:root {
  --terracota: #A9683A;
  --terracota-fundo: #8A4A24;
  --terracota-claro: #C58559;
  --off: #FBF8F3;
  --areia: #F1E8DC;
  --carvao: #2B2523;
  --texto: #3A322F;
  --suave: #8B7F77;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Montserrat", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { background: var(--off); color: var(--texto); font: 400 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- capa ---------- */
.cover { position: relative; height: 100svh; min-height: 520px; display: grid; place-items: end center; text-align: center; color: #fff; overflow: hidden; background: var(--terracota-fundo); }
.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity 1.4s var(--ease), transform 7s ease-out; }
.cover-img.ok { opacity: 1; transform: scale(1); }
.cover::before { content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(60, 28, 10, .5) 0%, rgba(60, 28, 10, 0) 28%, rgba(60, 28, 10, 0) 45%, rgba(48, 21, 6, .88) 100%); }
.cover-logo { position: absolute; z-index: 2; top: max(28px, env(safe-area-inset-top)); left: 50%; translate: -50% 0; width: clamp(110px, 16vw, 168px); }
.cover-body { position: relative; z-index: 2; padding: 0 clamp(24px, 6vw, 88px) clamp(64px, 11vh, 110px); max-width: 1100px; animation: subir 1.1s var(--ease) both .25s; }
.cover h1 { font: 500 clamp(34px, 7vw, 76px)/1.08 var(--serif); letter-spacing: .01em; text-wrap: balance; text-shadow: 0 2px 30px rgba(40, 18, 6, .35); }
.cover .sub { margin-top: 18px; font-size: 12px; letter-spacing: .32em; text-transform: uppercase; opacity: .92; }
.cover .btn { margin-top: 38px; }
.cover-cue { position: absolute; z-index: 2; bottom: 22px; left: 50%; translate: -50% 0; width: 1px; height: 46px; background: linear-gradient(#fff, transparent); animation: cue 2.2s ease-in-out infinite; }
@keyframes subir { from { opacity: 0; transform: translateY(24px); } }
@keyframes cue { 50% { transform: translateY(8px); opacity: .4; } }

.btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 30px; border-radius: 999px; background: var(--terracota); color: #fff; font-weight: 500; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; text-decoration: none; transition: background .25s, transform .25s var(--ease), box-shadow .25s; box-shadow: 0 8px 24px -10px rgba(138, 74, 36, .8); }
.btn:hover { background: var(--terracota-fundo); transform: translateY(-2px); }
.btn.ghost { background: transparent; color: var(--texto); box-shadow: inset 0 0 0 1px #d9cdbf; }
.btn.ghost:hover { background: var(--areia); }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- topo ---------- */
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px clamp(16px, 3vw, 40px); background: rgba(251, 248, 243, .82); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); border-bottom: 1px solid rgba(169, 104, 58, .14); }
.bar-id { display: flex; align-items: center; gap: 18px; min-width: 0; }
.bar-id img { height: 30px; width: auto; flex: none; }
.bar-id div { min-width: 0; padding-left: 18px; border-left: 1px solid #dfd2c4; }
.bar-title { font: 500 17px/1.2 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-sub { font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .btn { padding: 11px 20px; font-size: 11px; flex: none; }

/* ---------- grade justificada ---------- */
.grid { display: flex; flex-wrap: wrap; gap: 6px; padding: clamp(12px, 2.5vw, 36px); max-width: 1900px; margin: 0 auto; }
.grid::after { content: ""; flex-grow: 999999; }
.tile { position: relative; overflow: hidden; border-radius: 4px; background: var(--areia); cursor: zoom-in; padding: 0; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.04); transition: opacity .7s var(--ease), transform 1.2s var(--ease); }
.tile img.ok { opacity: 1; transform: none; }
.tile:hover img.ok { transform: scale(1.045); }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(60, 28, 10, .28)); opacity: 0; transition: opacity .3s; }
.tile:hover::after { opacity: 1; }
.tile:focus-visible { outline: 3px solid var(--terracota); outline-offset: 2px; }

.foot { padding: 70px 24px 56px; text-align: center; color: var(--suave); }
.foot img { height: 40px; width: auto; margin: 0 auto 18px; opacity: .9; }
.foot p { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; }
.top { position: fixed; right: 22px; bottom: 22px; z-index: 9; width: 46px; height: 46px; border-radius: 50%; background: var(--terracota); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 26px -10px rgba(138, 74, 36, .9); opacity: 0; pointer-events: none; transform: translateY(10px); transition: .3s var(--ease); }
.top.on { opacity: 1; pointer-events: auto; transform: none; }

/* ---------- estados ---------- */
.msg { min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 32px; text-align: center; }
.msg img { width: 150px; }
.msg h1 { font: 500 28px/1.2 var(--serif); }
.msg p { max-width: 420px; color: var(--suave); }
.loader { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--areia); border-top-color: var(--terracota); animation: gira .9s linear infinite; }
@keyframes gira { to { rotate: 360deg; } }

/* ---------- lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 50; background: rgba(24, 17, 14, .96); backdrop-filter: blur(10px); color: #fff; touch-action: pan-y; animation: surge .3s var(--ease); }
@keyframes surge { from { opacity: 0; } }
.lb-top { position: absolute; z-index: 3; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: max(14px, env(safe-area-inset-top)) 18px 14px; background: linear-gradient(rgba(0, 0, 0, .45), transparent); }
.lb-count { font-size: 12px; letter-spacing: .2em; opacity: .85; }
.lb-actions { display: flex; gap: 4px; }
.icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; transition: background .2s; }
.icon:hover { background: rgba(255, 255, 255, .14); }
.icon svg, .nav svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon.on { background: var(--terracota); }
.nav { position: absolute; z-index: 3; top: 50%; translate: 0 -50%; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); transition: background .2s; }
.nav:hover { background: var(--terracota); }
.nav.prev { left: 18px; } .nav.next { right: 18px; }
.lb-stage { position: absolute; inset: 64px 0 18px; display: grid; place-items: center; grid-template: minmax(0, 1fr) / minmax(0, 1fr); padding: 0 clamp(8px, 7vw, 100px); }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 3px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); transition: opacity .35s, filter .35s; }
.lb-stage img.soft { filter: blur(10px); opacity: .85; }
.lb-bar { position: absolute; z-index: 3; left: 0; bottom: 0; height: 3px; width: 0; background: var(--terracota-claro); }
.lb-bar.run { width: 100%; transition: width var(--t, 4s) linear; }
@media (max-width: 700px) { .nav { display: none; } .lb-stage { padding: 0; } .bar-id img { height: 24px; } .bar-id div { padding-left: 12px; } }

/* ---------- download ---------- */
dialog { margin: auto; border: 0; border-radius: 20px; padding: 32px; width: min(92vw, 420px); background: var(--off); color: var(--texto); box-shadow: 0 40px 100px -30px rgba(40, 18, 6, .6); }
dialog::backdrop { background: rgba(40, 24, 16, .55); backdrop-filter: blur(4px); }
dialog h2 { font: 500 24px/1.2 var(--serif); margin-bottom: 10px; }
dialog p { color: var(--suave); font-size: 14px; }
dialog menu { display: flex; gap: 10px; justify-content: flex-end; padding: 0; margin-top: 26px; }
.dl-progress { height: 4px; border-radius: 4px; background: var(--areia); margin-top: 20px; overflow: hidden; }
.dl-progress i { display: block; height: 100%; width: 0; background: var(--terracota); transition: width .3s; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }
