/* =========================================================
   Cemitério Adobe — estilos
   ========================================================= */

:root {
  --sky: #0b0f17;
  --sky-mid: #121a27;
  --sky-low: #1a2231;
  --ground: #151c1b;
  --ground-deep: #0f1514;
  --ink: #0a0d12;
  --ivory: #ece7db;
  --ivory-dim: #b3aea2;
  --line: rgba(231, 226, 214, .18);
  --line-strong: rgba(231, 226, 214, .3);
  --gold: #d0b173;
  --gold-soft: rgba(208, 177, 115, .5);
  --gold-glow: rgba(242, 196, 107, .35);

  --stone: #bdb8ad;
  --stone-base: #a9a498;
  --stone-edge: #8d887e;
  --engrave: #2e2c28;
  --engrave-soft: #4a4740;

  --sage-ink: #2f3d2c;   --sage-bg: rgba(80, 110, 75, .2);
  --amber-ink: #4a3712;  --amber-bg: rgba(170, 125, 45, .22);
  --lav-ink: #34305a;    --lav-bg: rgba(90, 85, 140, .18);

  /* cores de estado sobre fundo escuro */
  --c-morto: #cfc9bb;
  --c-zumbi: #9fc293;
  --c-terminal: #ecbc66;
  --c-reencarnado: #b6afef;

  --paper: #efeadf;
  --paper-line: #d6cfbf;
  --paper-ink: #22211e;
  --paper-dim: #5b574e;
  --paper-accent: #6e5b37;

  --serif-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --serif-text: 'EB Garamond', Georgia, serif;
  --inscription: 'Cinzel', 'Trajan Pro', serif;

  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --ease-gate: cubic-bezier(.65, 0, .25, 1);

  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32  0 0 0 0 .26  0 0 0 0 .16  0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--sky); }

body {
  margin: 0;
  background: var(--sky);
  color: var(--ivory);
  font-family: var(--serif-text);
  font-size: 18px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* grão de filme sobre tudo */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background-image: var(--noise); opacity: .06; mix-blend-mode: overlay;
}

body.locked, .js body.intro-on { overflow: hidden; }

::selection { background: rgba(208, 177, 115, .35); color: #fff; }

html { scrollbar-color: #3a4150 var(--sky); scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--sky); }
::-webkit-scrollbar-thumb { background: #2d3441; border-radius: 10px; border: 2px solid var(--sky); }
::-webkit-scrollbar-thumb:hover { background: #454d5c; }

a { color: var(--gold); }

/* =========================================================
   INTRODUÇÃO — portões do cemitério
   ========================================================= */
.intro {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: #05070b;
  overflow: hidden;
  transition: background-color 1.4s ease .5s;
  /* se o script falhar, a introdução sai sozinha */
  animation: intro-failsafe .8s ease 9s forwards;
}
html:not(.js) .intro, .no-intro .intro { display: none; }
@keyframes intro-failsafe { to { opacity: 0; visibility: hidden; } }

.intro-glow {
  position: absolute; left: 50%; top: 38%; width: 140vmax; height: 140vmax;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 50% 50%, rgba(230, 224, 207, .22) 0, rgba(150, 170, 200, .10) 14%, rgba(20, 28, 42, .0) 42%);
  opacity: 0;
  animation: fade-in 2.2s ease .3s forwards;
}

.intro-gates { position: absolute; inset: 0; perspective: 1600px; perspective-origin: 50% 60%; }
.gate {
  position: absolute; top: 0; bottom: 0; width: 50%;
  color: #04060a;
  transition: transform 1.9s var(--ease-gate), opacity 1s ease .9s;
  will-change: transform;
}
.gate svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; filter: drop-shadow(0 0 1px rgba(170, 185, 210, .25)); opacity: 0; animation: gate-in 1.6s ease .5s forwards; }
.gate-l { left: 0; transform-origin: 0 50%; }
.gate-r { right: 0; transform-origin: 100% 50%; }
.gate-r svg { transform: scaleX(-1); }
@keyframes gate-in { from { opacity: 0; } to { opacity: 1; } }

.intro-mist { position: absolute; left: 0; right: 0; bottom: 0; height: 45%; pointer-events: none; transition: opacity 1.6s ease 1s; }
.intro-mist span {
  position: absolute; bottom: -18%; width: 90vw; height: 60%; border-radius: 50%;
  background: rgba(190, 205, 225, .10); filter: blur(40px);
  animation: mist 9s ease-in-out infinite alternate;
}
.intro-mist span:nth-child(1) { left: -30vw; }
.intro-mist span:nth-child(2) { left: 20vw; bottom: -26%; animation-duration: 11s; animation-direction: alternate-reverse; }
.intro-mist span:nth-child(3) { left: 50vw; animation-duration: 13s; }
@keyframes mist { from { transform: translateX(-8vw); } to { transform: translateX(8vw); } }

.intro-center {
  position: relative; z-index: 3; text-align: center; padding: 0 24px;
  transition: opacity .7s ease, transform 1.2s var(--ease-out), filter .7s ease;
}
.intro-center::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 760px; height: 520px; max-width: 150vw;
  transform: translate(-50%, -50%); z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(5, 7, 11, .88), rgba(5, 7, 11, 0));
}

.intro-candle { display: block; width: 30px; height: 80px; margin: 0 auto 26px; overflow: visible; }
.intro-candle .i-halo { transform-box: fill-box; transform-origin: 50% 50%; transform: scale(0); animation: halo-on 1.2s var(--ease-out) .3s forwards, halo-breathe 2.4s ease-in-out 1.5s infinite; }
.intro-candle .i-flame { transform-box: fill-box; transform-origin: 50% 100%; transform: scale(0); animation: ignite .7s var(--ease-out) .25s forwards, flicker 2.2s ease-in-out 1s infinite; }
@keyframes ignite { 0% { transform: scale(0, 0); } 60% { transform: scale(1.15, 1.25); } 100% { transform: scale(1, 1); } }
@keyframes halo-on { from { transform: scale(0); opacity: 0; } to { transform: scale(6); opacity: 1; } }
@keyframes halo-breathe { 0%, 100% { transform: scale(6); opacity: 1; } 50% { transform: scale(5.3); opacity: .75; } }

.intro-kicker, .intro-big, .intro-years { margin: 0; opacity: 0; }
.intro-kicker {
  font-family: var(--inscription); font-weight: 500; font-size: 13px; letter-spacing: .48em; text-transform: uppercase;
  color: var(--gold); padding-left: .48em;
  animation: blur-in 1.1s var(--ease-out) .75s forwards;
}
.intro-big {
  margin-top: 10px;
  font-family: var(--serif-display); font-weight: 300; font-size: clamp(46px, 8vw, 104px); line-height: 1;
  color: var(--ivory); text-shadow: 0 0 40px rgba(242, 196, 107, .18);
  animation: blur-in 1.3s var(--ease-out) 1.05s forwards;
}
.intro-big span { font-style: italic; color: #f3e6c6; }
.intro-years {
  margin-top: 20px;
  font-family: var(--inscription); font-size: 12px; letter-spacing: .4em; color: var(--ivory-dim);
  animation: blur-in 1.1s var(--ease-out) 1.45s forwards;
}
.intro-years span { color: var(--gold); font-size: 9px; vertical-align: 2px; margin: 0 .6em; }
@keyframes blur-in { from { opacity: 0; transform: translateY(14px); filter: blur(10px); letter-spacing: inherit; } to { opacity: 1; transform: none; filter: blur(0); } }

.intro-skip {
  position: absolute; right: 24px; bottom: 22px; z-index: 5;
  appearance: none; background: transparent; cursor: pointer;
  font-family: var(--inscription); font-weight: 500; font-size: 11px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--ivory-dim); border: 1px solid var(--line); border-radius: 999px;
  min-height: 44px; padding: 8px 18px;
  opacity: 0; animation: fade-in .6s ease 1s forwards;
  transition: color .2s, border-color .2s, opacity .4s;
}
.intro-skip:hover { color: var(--ivory); border-color: var(--gold-soft); }
.intro-skip:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }

/* abertura */
.intro.open { background-color: rgba(5, 7, 11, 0); pointer-events: none; }
.intro.open .gate-l { transform: rotateY(88deg); opacity: 0; }
.intro.open .gate-r { transform: rotateY(-88deg); opacity: 0; }
.intro.open .intro-center { opacity: 0; transform: translateY(-30px) scale(1.04); filter: blur(6px); }
.intro.open .intro-glow { animation: fade-out 1.4s ease forwards; }
.intro.open .intro-mist { opacity: 0; }
.intro.open .intro-skip { animation: fade-out .3s ease forwards; }

.intro.skip { transition-duration: .6s; transition-delay: 0s; }
.intro.skip .gate { transition-duration: .8s, .5s; transition-delay: 0s, .2s; }
.intro.skip .intro-mist { transition-delay: 0s; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }

/* =========================================================
   CÉU
   ========================================================= */
.sky {
  position: relative; padding: 104px 24px 260px; overflow: hidden;
  background:
    radial-gradient(90% 60% at 82% 12%, rgba(230, 224, 207, .07), transparent 60%),
    linear-gradient(180deg, var(--sky) 0%, var(--sky-mid) 58%, var(--sky-low) 100%);
}

.aurora {
  position: absolute; inset: -20% -10% auto; height: 80%; pointer-events: none;
  background:
    radial-gradient(40% 50% at 20% 40%, rgba(90, 110, 160, .10), transparent 70%),
    radial-gradient(30% 40% at 60% 20%, rgba(120, 100, 150, .07), transparent 70%);
  filter: blur(20px);
  animation: aurora 26s ease-in-out infinite alternate;
}
@keyframes aurora { from { transform: translateX(-3%) scale(1); } to { transform: translateX(4%) scale(1.08); } }

.stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.stars circle { fill: var(--ivory); opacity: .75; }
.twinkle { animation: twinkle 5s ease-in-out infinite; }
.twinkle.d2 { animation-delay: 1.6s; }
.twinkle.d3 { animation-delay: 3.1s; }
@keyframes twinkle { 0%, 100% { opacity: .85; } 50% { opacity: .15; } }

/* estrelas cadentes */
.shoot {
  position: absolute; top: 12%; left: 30%; z-index: 1;
  width: 160px; height: 1.5px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(236, 231, 219, 0), rgba(236, 231, 219, .95));
  transform: rotate(-24deg) translateX(0); opacity: 0;
  animation: shoot 13s linear 5s infinite;
}
.shoot::after { content: ""; position: absolute; right: -2px; top: -1.5px; width: 4px; height: 4px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px 2px rgba(255, 255, 255, .6); }
.shoot.s2 { top: 26%; left: 58%; width: 110px; animation-duration: 19s; animation-delay: 11s; }
@keyframes shoot {
  0% { opacity: 0; transform: rotate(-24deg) translateX(0); }
  1% { opacity: 1; }
  6% { opacity: 0; transform: rotate(-24deg) translateX(-420px); }
  100% { opacity: 0; transform: rotate(-24deg) translateX(-420px); }
}

.moon {
  position: absolute; top: 76px; right: 10%;
  width: 150px; height: 150px; border-radius: 50%;
  background:
    radial-gradient(circle at 34% 32%, #fbf7ec 0%, #ece6d5 38%, #d8d0bb 78%, #c7bea7 100%);
  box-shadow:
    inset -14px -12px 30px rgba(120, 110, 90, .28),
    0 0 50px 12px rgba(236, 228, 205, .14),
    0 0 160px 50px rgba(236, 228, 205, .06),
    0 0 320px 120px rgba(160, 175, 210, .05);
  animation: moon-glow 8s ease-in-out infinite alternate;
}
@keyframes moon-glow {
  from { filter: brightness(1); }
  to { filter: brightness(1.05); }
}
.crater { position: absolute; border-radius: 50%; background: rgba(120, 108, 85, .12); box-shadow: inset 2px 2px 3px rgba(90, 80, 60, .14), inset -1px -1px 2px rgba(255, 255, 255, .25); }
.c1 { width: 32px; height: 32px; top: 34px; left: 34px; }
.c2 { width: 18px; height: 18px; top: 88px; left: 86px; }
.c3 { width: 12px; height: 12px; top: 52px; left: 100px; }

.cloud {
  position: absolute; top: 132px; right: calc(10% - 60px);
  width: 280px; height: 34px; border-radius: 50%;
  background: rgba(15, 19, 27, .6); filter: blur(10px);
  animation: cloud 38s ease-in-out infinite alternate;
}
@keyframes cloud { from { transform: translateX(-140px); } to { transform: translateX(120px); } }

.hero { position: relative; z-index: 2; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.eyebrow {
  margin: 0 0 20px;
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--inscription); font-weight: 500; font-size: 13px;
  letter-spacing: .32em; text-transform: uppercase; color: var(--gold);
}
.eyebrow::before { content: ""; width: 34px; height: 1px; background: var(--gold-soft); }
.title {
  margin: 0;
  font-family: var(--serif-display); font-weight: 300;
  font-size: clamp(54px, 8.8vw, 132px); line-height: .98; letter-spacing: .005em;
  color: var(--ivory);
  text-shadow: 0 0 60px rgba(236, 228, 205, .12), 0 2px 0 rgba(0, 0, 0, .25);
}
.title .word { display: inline-block; white-space: nowrap; }
.title .ch { display: inline-block; }
.rule { display: block; width: 240px; height: 12px; margin: 28px 0 0; color: var(--gold-soft); }
.lede {
  max-width: 620px; margin: 24px 0 0;
  font-style: italic; font-size: 21px; line-height: 1.6; color: var(--ivory-dim);
}

.stats { display: flex; flex-wrap: wrap; margin: 44px 0 0; padding: 0; }
.stat { display: flex; flex-direction: column-reverse; padding: 0 28px; border-left: 1px solid var(--line); }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat dd { margin: 0; font-family: var(--serif-display); font-weight: 400; font-size: 44px; line-height: 1; color: var(--ivory); font-variant-numeric: lining-nums tabular-nums; }
.stat dt { margin-top: 8px; display: flex; align-items: center; gap: 7px; font-family: var(--inscription); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ivory-dim); }

.hills { position: absolute; left: 0; bottom: -2px; width: 100%; height: 260px; z-index: 1; }

/* ---------- revelação do topo depois da introdução ---------- */
.js body:not(.revealed) .hero > *,
.js body:not(.revealed) .moon,
.js body:not(.revealed) .stars { opacity: 0; }

.revealed .eyebrow { animation: fade-up 1s var(--ease-out) .05s both; }
.revealed .ch { animation: letter 1.1s var(--ease-out) both; animation-delay: calc(var(--i) * 42ms + .15s); }
.revealed .rule { animation: rule-draw 1.2s var(--ease-out) .8s both; }
.revealed .lede { animation: fade-up 1.1s var(--ease-out) .95s both; }
.revealed .stat { animation: fade-up .9s var(--ease-out) both; animation-delay: calc(1.15s + var(--i) * 90ms); }
.revealed .moon { animation: moon-rise 2.6s var(--ease-out) both, moon-glow 8s ease-in-out 2.6s infinite alternate; }
.revealed .stars { animation: fade-in 2.4s ease both; }

@keyframes fade-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes letter { from { opacity: 0; transform: translateY(.35em) rotate(4deg); filter: blur(10px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes rule-draw { from { clip-path: inset(0 50% 0 50%); opacity: 0; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
@keyframes moon-rise { from { opacity: 0; transform: translateY(70px) scale(.92); } to { opacity: 1; transform: none; } }

/* =========================================================
   QUADRA
   ========================================================= */
.yard {
  position: relative; isolation: isolate;
  background: linear-gradient(180deg, #161d1c 0, var(--ground) 30%, var(--ground-deep) 100%);
  padding: 16px 24px 190px;
  overflow: hidden; overflow: clip;
}

/* lanterna que segue o cursor */
.lantern {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, -600px), rgba(255, 214, 140, .30), rgba(255, 214, 140, .08) 40%, transparent 70%);
  mix-blend-mode: soft-light;
  opacity: 0; transition: opacity .6s ease;
}
.yard.lit .lantern { opacity: 1; }

/* vaga-lumes */
.fireflies { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.fireflies span {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: #f7dc9a; box-shadow: 0 0 6px 2px rgba(247, 220, 154, .55), 0 0 18px 4px rgba(247, 220, 154, .18);
  opacity: 0;
  animation: firefly var(--t, 12s) ease-in-out var(--dl, 0s) infinite;
}
@keyframes firefly {
  0% { opacity: 0; transform: translate(0, 0); }
  15% { opacity: .9; }
  35% { opacity: .25; }
  50% { opacity: .85; transform: translate(var(--x, 40px), var(--y, -30px)); }
  70% { opacity: .2; }
  85% { opacity: .7; }
  100% { opacity: 0; transform: translate(0, 0); }
}

.yard-head { position: relative; z-index: 5; max-width: 1240px; margin: 0 auto 28px; display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.yard-head h2 { margin: 0; font-family: var(--serif-display); font-weight: 400; font-size: 44px; color: var(--ivory); }
.yard-sub { margin: 0; font-family: var(--inscription); font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
.yard-sub span { font-variant-numeric: lining-nums; }

.controls-sentinel { height: 0; }
.controls {
  position: relative; z-index: 6;
  max-width: 1240px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; justify-content: space-between;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  appearance: none; font-family: var(--inscription); font-weight: 500; font-size: 12px;
  letter-spacing: .14em; text-transform: uppercase;
  min-height: 44px; padding: 8px 14px 8px 16px;
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, .02); color: var(--ivory); cursor: pointer;
  transition: border-color .25s, background-color .25s, color .25s, box-shadow .25s, transform .25s var(--ease-out);
}
.chip:hover { border-color: var(--gold-soft); background: rgba(208, 177, 115, .06); transform: translateY(-1px); }
.chip:active { transform: translateY(0); }
.chip:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }
.chip[aria-pressed="true"] {
  background: linear-gradient(180deg, #dcc088, #c29f5f); border-color: #d6b97d; color: #17140e;
  box-shadow: 0 6px 22px -8px rgba(208, 177, 115, .7), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.chip .n { font-family: var(--serif-text); font-size: 15px; letter-spacing: 0; opacity: .75; }
.chip[aria-pressed="true"] .dot { box-shadow: 0 0 0 2px rgba(23, 20, 14, .35); }

.dot { display: inline-block; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; }
.dot-morto { background: var(--c-morto); }
.dot-zumbi { background: var(--c-zumbi); }
.dot-terminal { background: var(--c-terminal); box-shadow: 0 0 8px rgba(236, 188, 102, .7); }
.dot-reencarnado { background: var(--c-reencarnado); }

.search { position: relative; display: flex; flex-direction: column; gap: 8px; width: 300px; max-width: 100%; }
.search label { font-family: var(--inscription); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ivory-dim); }
.search input {
  font-family: var(--serif-text); font-size: 18px; min-height: 46px; padding: 10px 16px 10px 42px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, .035) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='5' fill='none' stroke='%23b3aea2' stroke-width='1.3'/%3E%3Cpath d='M11 11 L14.5 14.5' stroke='%23b3aea2' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 17px 50%;
  color: var(--ivory); outline: none;
  transition: border-color .25s, box-shadow .25s, background-color .25s;
}
.search input::placeholder { color: #857f74; font-style: italic; }
.search input:focus { border-color: var(--gold); background-color: rgba(255, 255, 255, .06); box-shadow: 0 0 0 4px rgba(208, 177, 115, .12); }

.legend {
  position: relative; z-index: 5;
  max-width: 1240px; margin: 26px auto 0; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px 28px;
  font-size: 16px; line-height: 1.5; color: var(--ivory-dim);
}
.legend li { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: baseline; }
.legend .dot { align-self: center; }
.legend b { font-family: var(--inscription); font-weight: 500; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ivory); }
.legend span { grid-column: 2; font-style: italic; }

.grid {
  position: relative; z-index: 2;
  max-width: 1240px; margin: 96px auto 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 78px 36px;
}

/* =========================================================
   LÁPIDE
   ========================================================= */
.tomb {
  appearance: none; background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer; width: 100%; text-decoration: none;
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  text-align: center;
}
.js .tomb:not(.in) { opacity: 0; }
.tomb.in { animation: rise 1s var(--ease-out) both; animation-delay: var(--d, 0ms); }
@keyframes rise {
  from { opacity: 0; transform: translateY(34px); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

/* sombra no chão */
.tomb::before {
  content: ""; position: absolute; left: 50%; bottom: -14px; z-index: 0;
  width: 120%; max-width: 250px; height: 30px; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent);
}
/* brilho de vela ao passar */
.tomb::after {
  content: ""; position: absolute; left: 50%; top: 38%; z-index: 0;
  width: 150%; aspect-ratio: 1; transform: translate(-50%, -50%) scale(.8);
  border-radius: 50%; background: radial-gradient(closest-side, rgba(242, 196, 107, .16), transparent);
  opacity: 0; transition: opacity .6s ease, transform .8s var(--ease-out);
  pointer-events: none;
}
.tomb:hover::after, .tomb:focus-visible::after { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.stone {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: 100%; max-width: 206px; min-height: 262px; padding: 34px 16px 20px;
  background-color: var(--stone);
  background-image:
    linear-gradient(155deg, rgba(255, 255, 255, .20) 0%, rgba(255, 255, 255, 0) 38%, rgba(0, 0, 0, 0) 62%, rgba(0, 0, 0, .14) 100%),
    radial-gradient(120% 26% at 50% 104%, rgba(64, 88, 56, .34), transparent 70%),
    radial-gradient(rgba(0, 0, 0, .05) 1px, transparent 1.3px),
    radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.3px);
  background-size: 100% 100%, 100% 100%, 7px 7px, 11px 11px;
  background-position: 0 0, 0 0, 0 0, 3px 5px;
  border: 1px solid var(--stone-edge);
  border-radius: 100px 100px 4px 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .4),
    inset -10px 0 14px -6px rgba(0, 0, 0, .12),
    inset 6px 0 10px -6px rgba(255, 255, 255, .25),
    0 22px 34px -18px rgba(0, 0, 0, .8);
  transition: transform .6s var(--ease-out), box-shadow .6s ease, filter .6s ease;
}
.inset { position: absolute; inset: 7px; border: 1px solid rgba(46, 44, 40, .16); border-radius: inherit; pointer-events: none; }

.shape-1 .stone { border-radius: 22px 22px 4px 4px; }
.shape-2 .stone { border-radius: 50% 50% 4px 4px / 22% 22% 4px 4px; min-height: 278px; }
.shape-3 .stone { border-radius: 6px 6px 4px 4px; margin-top: 34px; }
.shape-3 .stone::before {
  content: ""; position: absolute; left: 50%; top: -13px;
  width: 64px; height: 14px; margin-left: -32px;
  background: var(--stone-base); border: 1px solid var(--stone-edge); border-bottom: 0; border-radius: 3px 3px 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
}
.shape-3 .stone::after {
  content: ""; position: absolute; left: 50%; top: -34px;
  width: 22px; height: 22px; margin-left: -11px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d6d1c6, var(--stone) 60%, #a39e93); border: 1px solid var(--stone-edge);
}

.tilt-0 .stone { transform: rotate(-.8deg); }
.tilt-1 .stone { transform: rotate(.6deg); }
.tilt-2 .stone { transform: rotate(0deg); }
.tilt-3 .stone { transform: rotate(1deg); }
.tilt-4 .stone { transform: rotate(-.4deg); }
.tomb:hover .stone,
.tomb:focus-visible .stone {
  transform: translateY(-8px) rotate(0deg);
  filter: brightness(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .4),
    inset -10px 0 14px -6px rgba(0, 0, 0, .12),
    inset 6px 0 10px -6px rgba(255, 255, 255, .25),
    0 34px 44px -20px rgba(0, 0, 0, .85),
    0 0 0 1px rgba(208, 177, 115, .55),
    0 0 36px -6px rgba(242, 196, 107, .25);
}
.tomb:focus-visible { outline: none; }
.tomb:focus-visible .stone { outline: 1px solid var(--gold); outline-offset: 6px; }

.orn { width: 56px; height: 8px; color: #6c675d; flex-shrink: 0; }

.icon {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 54px; height: 54px; border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 1px 0 rgba(255, 255, 255, .45), 0 3px 8px rgba(0, 0, 0, .25);
  font-family: 'Helvetica Neue', Arial, system-ui, sans-serif; font-weight: 600; font-size: 24px; letter-spacing: -.01em; line-height: 1;
  transition: transform .6s var(--ease-out);
}
.icon.sm { font-size: 17px; }
.tomb:hover .icon { transform: scale(1.06); }
/* ícones de quem já partiu ficam um pouco desbotados */
.st-morto .stone .icon { filter: saturate(.72) contrast(.96); transition: transform .6s var(--ease-out), filter .6s ease; }
.st-morto:hover .stone .icon { filter: none; }

.pre { margin-top: 4px; font-family: var(--inscription); font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: var(--engrave-soft); }
.name {
  font-family: var(--inscription); font-weight: 600; font-size: 18px; line-height: 1.15;
  letter-spacing: .05em; text-transform: uppercase; color: var(--engrave);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .45), 0 -1px 0 rgba(0, 0, 0, .08);
}
.years {
  font-family: var(--serif-display); font-weight: 500; font-size: 18px; letter-spacing: .06em;
  color: var(--engrave); text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
  font-variant-numeric: lining-nums;
}

.tag {
  display: inline-block; padding: 3px 10px;
  border: 1px solid rgba(46, 44, 40, .3); border-radius: 999px;
  font-family: var(--inscription); font-size: 10px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap;
  color: var(--engrave); background: rgba(255, 255, 255, .12);
}
.stone .tag { margin-top: auto; }
.tag-zumbi { color: var(--sage-ink); background: var(--sage-bg); border-color: rgba(47, 61, 44, .35); }
.tag-terminal { color: var(--amber-ink); background: var(--amber-bg); border-color: rgba(74, 55, 18, .35); }
.tag-reencarnado { color: var(--lav-ink); background: var(--lav-bg); border-color: rgba(52, 48, 90, .35); }

.crack { position: absolute; top: 108px; right: 16px; width: 18px; height: 36px; }

.plinth {
  position: relative; z-index: 2; display: block;
  width: 114%; max-width: 234px; height: 16px; margin-top: -1px;
  background: linear-gradient(180deg, #b4afa3, var(--stone-base) 50%, #969185);
  border: 1px solid #7f7a70; border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 14px 22px -10px rgba(0, 0, 0, .7);
}
.blades { position: absolute; bottom: -3px; width: 26px; height: 14px; }
.blades.l { left: -14px; }
.blades.r { right: -14px; transform: scaleX(-1); }

.ivy { position: absolute; z-index: 2; left: -8px; bottom: 16px; width: 40px; height: 150px; pointer-events: none; }
.candle { position: absolute; z-index: 3; left: 4%; bottom: 16px; width: 18px; height: 44px; overflow: visible; }
.flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 2.2s ease-in-out infinite; }
.halo { animation: halo 2.2s ease-in-out infinite; }
@keyframes flicker { 0%, 100% { transform: scale(1, 1); } 30% { transform: scale(.94, 1.05); } 60% { transform: scale(1.03, .96); } }
@keyframes halo { 0%, 100% { opacity: .22; } 50% { opacity: .12; } }
.st-terminal::before { background: radial-gradient(closest-side, rgba(242, 196, 107, .16), rgba(0, 0, 0, .45) 60%, transparent); }
.sprout { position: absolute; z-index: 3; right: 3%; bottom: 16px; width: 28px; height: 38px; transform-origin: 50% 100%; animation: sway 5s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.flower { position: absolute; z-index: 3; right: 6%; bottom: 14px; width: 60px; height: 16px; }

.empty { max-width: 560px; margin: 24px auto 0; text-align: center; font-size: 19px; line-height: 1.6; color: var(--ivory-dim); position: relative; z-index: 2; font-style: italic; animation: fade-up .6s var(--ease-out) both; }
.empty b { display: block; margin-bottom: 4px; font-family: var(--serif-display); font-style: normal; font-weight: 400; font-size: 32px; color: var(--ivory); }

.fog { position: absolute; left: 0; right: 0; bottom: 0; height: 240px; pointer-events: none; overflow: hidden; z-index: 1; }
.fog span {
  position: absolute; bottom: -80px; width: 620px; height: 190px; border-radius: 50%;
  background: rgba(200, 210, 225, .07); filter: blur(24px);
  animation: fogdrift 30s ease-in-out infinite alternate;
}
.fog .f2 { left: 30%; animation-duration: 38s; bottom: -100px; }
.fog .f3 { left: 62%; animation-duration: 34s; }
@keyframes fogdrift { from { transform: translateX(-90px); } to { transform: translateX(90px); } }

/* =========================================================
   RODAPÉ
   ========================================================= */
.foot {
  position: relative;
  background: linear-gradient(180deg, #0b0e14, #07090d);
  color: var(--ivory); padding: 72px 24px 40px;
  border-top: 1px solid rgba(231, 226, 214, .08);
}
.foot::before {
  content: ""; position: absolute; left: 50%; top: -1px; width: min(560px, 80%); height: 1px; transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
}
.foot-in { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 40px; }
.foot h2 { margin: 0 0 12px; font-family: var(--serif-display); font-weight: 400; font-size: 36px; color: var(--ivory); }
.foot h3 { margin: 10px 0 12px; font-family: var(--inscription); font-weight: 500; font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
.foot p { margin: 0 0 12px; font-size: 17px; line-height: 1.65; }
.foot .fine { color: var(--ivory-dim); font-size: 16px; }
.foot-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.motion-toggle {
  appearance: none; font-family: var(--inscription); font-weight: 500; font-size: 11px;
  letter-spacing: .16em; text-transform: uppercase; text-decoration: none;
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 8px 18px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--ivory); cursor: pointer;
  transition: border-color .25s, color .25s, background-color .25s;
}
.motion-toggle:hover { border-color: var(--gold-soft); background: rgba(208, 177, 115, .06); }
.motion-toggle[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.motion-toggle:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }

.foot-sign {
  max-width: 1240px; margin: 56px auto 0; padding-top: 28px;
  border-top: 1px solid rgba(231, 226, 214, .06);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  font-family: var(--inscription); font-size: 11px; letter-spacing: .4em; text-transform: uppercase; color: #6f6b63;
}
.foot-sign .rule { margin: 0; width: 180px; color: rgba(208, 177, 115, .35); }

/* =========================================================
   OBITUÁRIO (modal)
   ========================================================= */
.cert-dialog {
  padding: 0; border: 0; background: transparent; color: inherit;
  width: calc(100% - 32px); max-width: 720px;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  overflow: visible;
}
.cert-dialog::backdrop {
  background: radial-gradient(ellipse at 50% 40%, rgba(12, 16, 24, .78), rgba(4, 5, 8, .94));
  backdrop-filter: blur(4px);
}
.cert-dialog[open] .cert { animation: appear .55s var(--ease-out); }
.cert-dialog[open]::backdrop { animation: fade-in .4s ease; }
@keyframes appear { from { transform: translateY(24px) scale(.97) rotate(-.4deg); opacity: 0; } to { transform: none; opacity: 1; } }

.cert {
  position: relative;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto;
  background-color: var(--paper);
  background-image: var(--paper-grain), radial-gradient(120% 90% at 50% 40%, rgba(255, 255, 255, .4), rgba(180, 160, 120, .12));
  background-attachment: local, local;
  color: var(--paper-ink);
  border: 1px solid #cfc8b8; border-radius: 4px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, .7), 0 0 0 1px rgba(0, 0, 0, .2), inset 0 0 0 10px transparent, inset 0 0 0 11px var(--paper-line);
  padding: 34px 44px 30px;
  scrollbar-color: #c9bfa9 transparent;
}
.cert::-webkit-scrollbar-track { background: transparent; }
.cert::-webkit-scrollbar-thumb { background: #cdc3ad; border-color: var(--paper); }

.cert.swap .cert-head, .cert.swap .facts, .cert.swap .sec, .cert.swap .epitaph { animation: swap .45s var(--ease-out) both; }
.cert.swap .facts { animation-delay: .04s; }
.cert.swap .sec { animation-delay: .08s; }
.cert.swap .epitaph { animation-delay: .12s; }
@keyframes swap { from { opacity: 0; transform: translateX(var(--dir, 12px)); } to { opacity: 1; transform: none; } }

.cert-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--paper-line); }
.cert-no { font-family: var(--inscription); font-size: 11px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: var(--paper-accent); }
.x {
  appearance: none; flex-shrink: 0; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #bdb4a1; border-radius: 50%;
  background: transparent; color: var(--paper-ink); cursor: pointer;
  transition: background-color .2s, transform .3s var(--ease-out);
}
.x:hover { background: rgba(0, 0, 0, .05); transform: rotate(90deg); }
.x:focus-visible, .navbtn:focus-visible { outline: 1px solid var(--paper-accent); outline-offset: 3px; }

.cert-head { display: flex; gap: 24px; align-items: center; margin: 26px 0 28px; }
.cert .icon.big { width: 88px; height: 88px; border-radius: 20px; font-size: 38px; box-shadow: 0 6px 18px rgba(0, 0, 0, .2), inset 0 0 0 1px rgba(255, 255, 255, .08); }
.cert .icon.big.sm { font-size: 28px; }
.cert .pre { margin: 0; color: var(--paper-dim); }
.cert h2 { margin: 2px 0 10px; font-family: var(--serif-display); font-weight: 500; font-size: 50px; line-height: 1.02; color: var(--paper-ink); }
.cert .tag { color: var(--paper-ink); background: transparent; border-color: #bdb4a1; }
.cert .tag-zumbi { color: var(--sage-ink); background: var(--sage-bg); border-color: rgba(47, 61, 44, .3); }
.cert .tag-terminal { color: var(--amber-ink); background: var(--amber-bg); border-color: rgba(74, 55, 18, .3); }
.cert .tag-reencarnado { color: var(--lav-ink); background: var(--lav-bg); border-color: rgba(52, 48, 90, .3); }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin: 0 0 28px; padding: 0; }
.fact { padding: 12px 0 14px; border-top: 1px solid var(--paper-line); }
.fact dt { font-family: var(--inscription); font-size: 10px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--paper-accent); }
.fact dd { margin: 5px 0 0; font-size: 18px; line-height: 1.4; color: var(--paper-ink); }

.sec { margin: 0 0 22px; }
.sec h3 { margin: 0 0 6px; font-family: var(--serif-display); font-weight: 600; font-size: 24px; color: #3a3226; }
.sec p { margin: 0; font-size: 18px; line-height: 1.65; color: #2b2925; }
.sec:first-of-type p::first-letter {
  float: left; margin: 5px 5px 0 -2px;
  font-family: var(--serif-display); font-weight: 500; font-size: 62px; line-height: .78; color: var(--paper-accent);
}

.epitaph {
  margin: 30px 0 26px; padding: 0;
  text-align: center; font-family: var(--serif-display); font-style: italic; font-weight: 400;
  font-size: 28px; line-height: 1.3; color: var(--paper-ink);
}
.epitaph .rule { margin: 0 auto 16px; color: #b5a583; }

.cert-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 18px; border-top: 1px solid var(--paper-line); }
.navbtn {
  appearance: none; font-family: var(--inscription); font-weight: 500; font-size: 11px;
  letter-spacing: .16em; text-transform: uppercase;
  min-height: 44px; padding: 8px 16px;
  border: 1px solid #bdb4a1; border-radius: 999px;
  background: transparent; color: var(--paper-ink); cursor: pointer;
  transition: background-color .2s, border-color .2s;
}
.navbtn:hover { background: rgba(110, 91, 55, .08); border-color: var(--paper-accent); }
.pos { font-style: italic; font-size: 16px; color: var(--paper-dim); text-align: center; }

/* =========================================================
   DESKTOP — barra de filtros fixa ao rolar
   ========================================================= */
@media (min-width: 960px) {
  .controls {
    position: sticky; top: 12px;
    width: calc(100% + 36px); max-width: 1276px;
    margin-left: max(-18px, calc((100% - 1276px) / 2));
    margin-right: max(-18px, calc((100% - 1276px) / 2));
    padding: 12px 18px;
    border: 1px solid transparent; border-radius: 18px;
    transition: background-color .35s ease, border-color .35s ease, box-shadow .35s ease;
  }
  .controls.stuck {
    background: rgba(17, 23, 23, .78);
    -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
    border-color: var(--line);
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8);
  }
  .controls.stuck .search label { display: none; }
}

/* =========================================================
   MOVIMENTO
   ========================================================= */
body.calm *, body.calm *::before, body.calm *::after { animation: none !important; transition: none !important; }
body.calm .fireflies, body.calm .shoot { display: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .intro, .fireflies, .shoot { display: none !important; }
}

/* =========================================================
   CELULAR
   ========================================================= */
@media (max-width: 640px) {
  body { font-size: 17px; }
  .sky { padding: 128px 16px 220px; }
  .hero { padding: 0; }
  .moon { top: 28px; right: 20px; width: 80px; height: 80px; }
  .c1 { width: 18px; height: 18px; top: 18px; left: 18px; }
  .c2 { width: 10px; height: 10px; top: 48px; left: 46px; }
  .c3 { display: none; }
  .cloud { top: 64px; right: -20px; width: 160px; }
  .eyebrow { font-size: 11px; letter-spacing: .26em; gap: 10px; }
  .eyebrow::before { width: 20px; }
  .lede { font-size: 18px; }
  .stats { gap: 18px 0; }
  .stat { padding: 0 16px; }
  .stat dd { font-size: 32px; }
  .stat dt { font-size: 10px; letter-spacing: .14em; }

  .intro-kicker { font-size: 11px; letter-spacing: .36em; }
  .intro-years { font-size: 11px; letter-spacing: .3em; }
  .intro-skip { right: 16px; bottom: 16px; }

  .yard { padding: 8px 16px 150px; }
  .yard-head h2 { font-size: 34px; }
  .search { width: 100%; }
  .chip { padding: 8px 12px 8px 14px; font-size: 11px; letter-spacing: .1em; gap: 8px; }
  .legend { font-size: 15px; grid-template-columns: minmax(0, 1fr); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 60px 18px; margin-top: 76px; }
  .stone { min-height: 232px; padding: 28px 8px 16px; gap: 6px; }
  .shape-2 .stone { min-height: 244px; }
  .icon { width: 46px; height: 46px; font-size: 20px; border-radius: 10px; }
  .icon.sm { font-size: 15px; }
  .name { font-size: 14px; letter-spacing: .03em; }
  .years { font-size: 15px; }
  .pre { font-size: 9px; letter-spacing: .16em; }
  .tag { font-size: 8.5px; padding: 3px 7px; letter-spacing: .1em; }
  .plinth { width: 108%; }
  .ivy { height: 120px; width: 32px; }

  .cert { padding: 22px 20px 22px; }
  .cert-head { gap: 16px; align-items: flex-start; }
  .cert .icon.big { width: 66px; height: 66px; font-size: 28px; border-radius: 16px; }
  .cert .icon.big.sm { font-size: 20px; }
  .cert h2 { font-size: 34px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .epitaph { font-size: 23px; }
  .navbtn { padding: 8px 12px; font-size: 10px; }
  .foot-sign { letter-spacing: .28em; }
}
