/* The Death Life · site oficial
   Folha noturna, tinta de luz (docs/ui-estilo.md): papel preto com fibra,
   tinta clara com contorno escuro e halo roxo, uma cor por função. */

/* Foice: tipografia própria do jogo, feita das letras do logo
   (tools/fonte/build.py gera os .woff2 a partir dos mesmos glifos do jogo). */
@font-face {
  font-family: "Foice Titulo";
  src: url("../fonts/Foice-Titulo.woff2") format("woff2");
  font-weight: 100 900; /* um peso só: nunca sintetizar negrito */
  font-display: swap;
}
@font-face {
  font-family: "Grenze";
  src: url("../fonts/Grenze.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* ui/palette.gd */
  --abismo: #07080d;
  --folha: #1e1826;
  --folha-alta: #2a2234;
  --folha-borda: #4a3d57;
  --tinta: #ede6f3;
  --tinta-dim: #b4a8c2;
  --tinta-apagada: #7d7090;
  --brilho: #b07cff;
  --brilho-pronto: #ff6b9e;
  --alma: #6ff0e0;
  --contorno: #120a18;
  --gotica: "Foice Titulo", "Grenze", Georgia, serif;
  --texto: "Grenze", Georgia, serif;
  /* UIKit: OPEN_TIME 0,32 s, deslize de 40 px */
  --abrir: 0.32s;
  --curva: cubic-bezier(0.22, 0.9, 0.3, 1);
  --halo: 0 0 0.35em rgba(176, 124, 255, 0.55), 0 0 1.2em rgba(176, 124, 255, 0.25);
  --tinta-contorno: -1px -1px 0 var(--contorno), 1px -1px 0 var(--contorno), -1px 1px 0 var(--contorno), 1px 1px 0 var(--contorno);
  --fibra: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.75  0 0 0 0 0.68  0 0 0 0 0.85  0 0 0 0.09 0'/></filter><rect width='100%' height='100%' filter='url(%23f)'/></svg>");
}

*, *::before, *::after { box-sizing: border-box; }
/* Seleção na tinta do jogo: lilás com a tinta clara, nunca o azul do sistema. */
::selection { background: rgba(176, 124, 255, 0.55); color: #fff; text-shadow: none; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background:
    radial-gradient(80% 60% at 15% 35%, rgba(70, 30, 120, 0.16), transparent 70%),
    radial-gradient(70% 50% at 90% 70%, rgba(40, 120, 130, 0.08), transparent 70%),
    var(--abismo);
  background-attachment: fixed;
  color: var(--tinta);
  font-family: var(--texto);
  font-size: clamp(1.05rem, 0.98rem + 0.3vw, 1.25rem);
  line-height: 1.55;
  overflow-x: hidden;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--tinta); }
p { margin: 0 0 1em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.defs { position: absolute; width: 0; height: 0; }
main, .rodape { position: relative; z-index: 1; }

.pular {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--folha); padding: 0.6rem 1rem; border: 1px solid var(--brilho);
}
.pular:focus { top: 1rem; }

/* Tinta: letra clara, contorno escuro e halo roxo (Paper.glow). */
h1, h2, h3 {
  font-family: var(--gotica);
  font-weight: 400;
  line-height: 1.1;
  margin: 0 0 0.5em;
  text-shadow: var(--tinta-contorno), var(--halo);
}

/* Partículas do site inteiro (js/efeitos.js). */
.particulas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* ------------------------------------------------------------ folha */
.folha {
  position: relative;
  background:
    var(--fibra),
    radial-gradient(120% 90% at 50% 0%, var(--folha-alta), var(--folha) 70%);
  border: 1px solid var(--folha-borda);
  border-radius: 3px;
  box-shadow:
    inset 0 1px 0 rgba(237, 230, 243, 0.12),   /* chanfro claro */
    inset 0 0 0 1px rgba(18, 10, 24, 0.8),
    inset 0 -18px 30px -20px rgba(0, 0, 0, 0.7),
    0 18px 40px -18px rgba(0, 0, 0, 0.9);
}
/* Borda gasta: um segundo contorno torto, deslocado pelo ruído. */
.folha::before {
  content: "";
  position: absolute; inset: 5px;
  border: 1px solid rgba(180, 168, 194, 0.16);
  border-radius: 2px;
  filter: url(#gasto);
  pointer-events: none;
  z-index: 1;
}

/* ------------------------------------------------------------ chama de foco
   Botões grandes: halo roxo atrás, tremulando em degraus. */
.chama { position: relative; isolation: isolate; }
.chama::after {
  content: "";
  position: absolute; inset: -10px -14px;
  z-index: -1;
  border-radius: 40%;
  background:
    radial-gradient(60% 70% at 50% 75%, rgba(255, 220, 255, 0.5), transparent 60%),
    radial-gradient(70% 90% at 50% 70%, rgba(176, 124, 255, 0.75), rgba(110, 50, 200, 0.25) 55%, transparent 72%);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.18s, transform 0.18s var(--curva);
  pointer-events: none;
}
.chama:hover::after, .chama:focus-visible::after {
  opacity: 1;
  transform: scale(1);
  animation: tremula 0.9s steps(6) infinite;
}
@keyframes tremula {
  0% { transform: scale(1, 1) translateY(0); opacity: 0.95; }
  25% { transform: scale(1.04, 1.1) translateY(-2px); opacity: 0.8; }
  50% { transform: scale(0.97, 1.03) translateY(-1px); opacity: 1; }
  75% { transform: scale(1.03, 1.12) translateY(-3px); opacity: 0.85; }
  100% { transform: scale(1, 1) translateY(0); opacity: 0.95; }
}
:focus-visible { outline: 2px solid var(--brilho); outline-offset: 4px; }
.chama:focus-visible, .foco:focus-visible { outline-color: transparent; }

/* Chama de alma do foco (ui/run_art/focus_ring.gdshader, estilo 0): tufos
   de fogo chapado nos quatro cantos, deitados nas bordas e apontando para o
   meio dos lados; turquesa nos de baixo. Acendem crescendo (arrive) e
   tremulam em degraus. Embaixo, uma brasa varre o sublinhado de tinta. */
.foco { position: relative; isolation: isolate; }
.foco::after {
  content: "";
  position: absolute; inset: -6px -10px;
  z-index: -1;
  background:
    url("../media/ui/chama-ce.svg") left top / 30px 18px no-repeat,
    url("../media/ui/chama-cd.svg") right top / 30px 18px no-repeat,
    url("../media/ui/chama-be.svg") left bottom / 30px 18px no-repeat,
    url("../media/ui/chama-bd.svg") right bottom / 30px 18px no-repeat;
  filter: drop-shadow(0 0 5px rgba(176, 124, 255, 0.65));
  opacity: 0;
  transform: scale(0.72);
  transition: opacity 0.16s, transform 0.22s var(--curva);
  pointer-events: none;
}
.foco::before {
  content: "";
  position: absolute; left: 0.6rem; right: 0.6rem; bottom: 0.18rem; height: 2px;
  background: linear-gradient(90deg, transparent, var(--brilho) 30%, #f3e6ff 88%, var(--brilho-pronto));
  box-shadow: 0 0 8px var(--brilho), 0 0 2px #fff;
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.34s var(--curva);
}
.foco:hover::after, .foco:focus-visible::after, .foco[aria-current="true"]::after {
  opacity: 1;
  transform: scale(1);
}
.foco:hover::after, .foco:focus-visible::after { animation: tufos 0.7s steps(4) infinite; }
.foco:hover::before, .foco:focus-visible::before, .foco[aria-current="true"]::before { transform: scaleX(1); }
@keyframes tufos {
  0%, 100% { background-size: 30px 18px, 30px 18px, 30px 18px, 30px 18px; }
  25% { background-size: 33px 20px, 28px 17px, 31px 18px, 33px 20px; }
  50% { background-size: 28px 17px, 32px 19px, 33px 20px, 29px 17px; }
  75% { background-size: 32px 19px, 30px 18px, 28px 16px, 31px 19px; }
}

/* Fita escura (Paper.tab). */
.fita {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem;
  padding: 0.35rem 2.1rem;
  background: url("../media/ui/fita.webp") center / 100% 100% no-repeat;
  color: var(--tinta-dim);
  font-family: var(--texto);
  font-weight: 680;
  text-decoration: none;
  letter-spacing: 0.02em;
  text-shadow: var(--tinta-contorno);
  position: relative; isolation: isolate;
  transition: color 0.2s, transform 0.28s var(--curva), filter 0.3s;
}
.fita:hover, .fita:focus-visible {
  color: var(--tinta);
  transform: translateY(-2px);
  filter: drop-shadow(0 0 5px rgba(176, 124, 255, 0.7)) drop-shadow(0 0 14px rgba(130, 70, 220, 0.4));
}

/* ------------------------------------------------------------ topo */
.topo {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem clamp(1rem, 3vw, 3rem);
  background: linear-gradient(rgba(7, 8, 13, 0.85), rgba(7, 8, 13, 0.4) 70%, transparent);
  transition: background 0.3s, box-shadow 0.3s;
}
.topo.rolou { background: rgba(9, 8, 15, 0.94); box-shadow: 0 1px 0 var(--folha-borda), 0 10px 30px -12px rgba(0, 0, 0, 0.9); }
.marca {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--gotica); font-size: 1.5rem; text-decoration: none;
  text-shadow: var(--tinta-contorno), var(--halo);
}
/* O capuz recortado do ícone (icone-capuz.webp): o brilho segue a silhueta, e a
   base e as laterais do manto se desfazem num oval (já no alfa da imagem). */
.marca img {
  width: 42px; height: 42px;
  filter: drop-shadow(0 0 5px rgba(176, 124, 255, 0.75)) drop-shadow(0 0 14px rgba(110, 50, 200, 0.45));
  transition: transform 0.4s var(--curva), filter 0.3s;
}
.marca:hover img { transform: rotate(-10deg) scale(1.08); filter: drop-shadow(0 0 6px rgba(200, 160, 255, 0.95)) drop-shadow(0 0 18px rgba(111, 240, 224, 0.35)); }
nav { display: flex; align-items: center; gap: 0.5rem; }
nav .foco {
  padding: 0.45rem 0.9rem 0.55rem;
  color: var(--tinta-dim);
  text-decoration: none;
  text-shadow: var(--tinta-contorno);
  transition: color 0.18s;
}
nav .foco:hover, nav .foco:focus-visible, nav .foco[aria-current="true"] { color: var(--tinta); }
nav .fita { margin-left: 0.6rem; }
.menu-botao { display: none; }

/* ------------------------------------------------------------ herói */
.heroi {
  position: relative;
  min-height: 100svh;
  display: grid; place-items: center;
  padding: 6rem 1.5rem 8rem;
  overflow: hidden;
  isolation: isolate;
}
/* O fundo do herói (vídeo, véu, céu e névoa) não termina numa linha: se desfaz
   numa borda de névoa irregular e mostra o mesmo fundo do resto do site. */
.heroi-cena {
  position: absolute; inset: 0; z-index: -1; isolation: isolate; pointer-events: none;
  -webkit-mask: linear-gradient(#000 calc(100% - 22rem), rgba(0, 0, 0, 0.5) calc(100% - 9rem), transparent);
  mask: linear-gradient(#000 calc(100% - 22rem), rgba(0, 0, 0, 0.5) calc(100% - 9rem), transparent);
}
.heroi-fundo { background: #07060c; }
.heroi-fundo { position: absolute; inset: -4%; z-index: -3; will-change: transform; }
.heroi-video {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(1.1) brightness(0.72) contrast(1.05);
}
/* Véu: vinheta roxa e escuro embaixo para o logo e a tinta lerem. */
.veu {
  position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(55% 45% at 50% 40%, rgba(20, 10, 40, 0.15), rgba(7, 6, 12, 0.55) 80%),
    linear-gradient(rgba(7, 6, 12, 0.55), transparent 22%, transparent 55%, rgba(7, 6, 12, 0.92) 92%),
    linear-gradient(90deg, rgba(40, 14, 80, 0.35), transparent 30%, transparent 70%, rgba(40, 14, 80, 0.35));
}
.ceu { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.ceu > * { will-change: transform; }
/* Redemoinho das Almas, no lugar da lua: halo e olho parados, só os braços
   giram, e giram o svg inteiro (transform no compositor, sem repintar). */
.redemoinho {
  position: absolute; top: 9%; right: 10%;
  width: clamp(76px, 9vw, 150px); aspect-ratio: 1;
  opacity: 0.9;
}
.redemoinho svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rd-bracos { opacity: 0.85; will-change: transform; animation: gira 46s linear infinite; }
@keyframes gira { to { transform: rotate(-360deg); } }
.picos { position: absolute; left: -3%; bottom: -2%; width: 106%; height: 30%; fill: #170b2b; opacity: 0.88; }
.picos.perto { height: 18%; fill: #0c0716; opacity: 1; }
/* Névoa espectral: duas camadas sem emenda, em velocidades diferentes. */
.nevoa {
  --passo: 1024px;
  position: absolute; left: -10%; right: -10%; bottom: 0; height: 38%;
  overflow: hidden;
  opacity: 0.4;
}
.nevoa::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: calc(-1 * var(--passo)); right: 0;
  background: url("../media/ui/nevoa.png") 0 100% / var(--passo) 100% repeat-x;
  will-change: transform;
  animation: deriva 70s linear infinite;
}
.nevoa.perto { --passo: 1400px; height: 24%; bottom: -4%; opacity: 0.55; }
.nevoa.perto::before { animation-name: deriva-perto; animation-duration: 42s; animation-direction: reverse; }
@keyframes deriva { to { transform: translate3d(1024px, 0, 0); } }
@keyframes deriva-perto { to { transform: translate3d(1400px, 0, 0); } }

.heroi-conteudo { position: relative; z-index: 2; text-align: center; max-width: 62rem; }
.logo { position: relative; margin: 0 auto; width: min(660px, 86vw); will-change: transform; }
.logo img {
  position: relative; width: 100%;
  filter: drop-shadow(0 0 10px rgba(176, 124, 255, 0.5)) drop-shadow(0 0 40px rgba(110, 50, 200, 0.35));
  animation: nasce 1.4s var(--curva) both;
}
/* O brilho que respira é um halo atrás do logo: anima só a opacidade. */
.logo::before {
  content: ""; position: absolute; inset: 8% 6%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(176, 124, 255, 0.4), rgba(111, 240, 224, 0.08) 70%, transparent);
  opacity: 0.5;
  will-change: opacity;
  animation: respira 4.5s ease-in-out infinite;
}
/* Brilho espectral do logo: o halo pulsa como o crânio dos painéis (UIKit.breathe). */
@keyframes respira {
  50% { opacity: 1; }
}
@keyframes nasce { from { opacity: 0; transform: translateY(18px) scale(0.94); } }
.chamada {
  font-family: var(--gotica);
  font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2.35rem);
  line-height: 1.2;
  color: var(--tinta);
  text-shadow: var(--tinta-contorno), var(--halo);
  margin: 0.4rem 0 1.8rem;
  animation: nasce 1.4s 0.25s var(--curva) both;
}
.acoes { display: flex; flex-wrap: wrap; gap: 1.2rem 1.6rem; justify-content: center; align-items: center; animation: nasce 1.4s 0.45s var(--curva) both; }
.selos {
  list-style: none; margin: 2rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1.6rem;
  color: var(--tinta-dim); font-size: 0.98rem; letter-spacing: 0.04em;
  text-shadow: var(--tinta-contorno);
  animation: nasce 1.4s 0.65s var(--curva) both;
}
.selos li { display: flex; align-items: center; gap: 0.6rem; }
.selos li::before {
  content: ""; width: 0.5rem; height: 0.5rem; transform: rotate(45deg);
  background: var(--alma); box-shadow: 0 0 8px var(--alma);
}

/* Botão principal: a placa do aviso (aviso.png) na proporção da arte
   (1000x236). O título fica na faixa de dentro (de 42% a 87% da altura, 11%
   das laterais), com a fonte medida pela largura da placa, para nunca vazar.
   A coroa octogonal guarda uma gema de alma; a legenda ciano vem embaixo. */
.botao-portal {
  display: inline-flex; flex-direction: column; align-items: center; gap: 0.35rem;
  width: clamp(16rem, 24vw, 23rem);
  container-type: inline-size;
  text-decoration: none;
  color: var(--tinta);
  transition: transform 0.28s var(--curva);
}
.botao-portal span {
  position: relative; isolation: isolate;
  display: grid; place-items: center;
  width: 100%; aspect-ratio: 1000 / 236;
  padding: 10.4% 11% 3.4%;
  background: url("../media/ui/placa.webp") center / 100% 100% no-repeat;
  font-family: var(--gotica);
  font-size: 7.2cqw;
  line-height: 1;
  white-space: nowrap;
  text-shadow: var(--tinta-contorno), var(--halo);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55));
  transition: filter 0.3s var(--curva);
}
/* Gema de alma na coroa: pulsa devagar e acende no hover. */
.botao-portal span::after {
  content: ""; position: absolute; z-index: 1;
  left: 50%; top: 21%; width: 4.2%; aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--alma);
  box-shadow: 0 0 6px var(--alma), 0 0 16px rgba(111, 240, 224, 0.6);
  will-change: opacity;
  animation: gema 3.2s ease-in-out infinite;
}
@keyframes gema { 50% { opacity: 0.5; } }
.botao-portal small {
  color: var(--alma); font-size: 0.85rem; line-height: 1.2; letter-spacing: 0.06em;
  text-shadow: var(--tinta-contorno);
  white-space: nowrap;
}
.botao-portal.grande { width: clamp(17rem, 34vw, 27rem); }

/* Hover dos botões: brilho roxo na silhueta da arte (drop-shadow, nada de
   caixa), uma subida curta e uma luz que segue o cursor, recortada pela
   própria arte para não vazar em retângulo. --lx/--ly vêm do js/efeitos.js. */
.botao-portal.chama::after, .fita.chama::after { display: none; }
.luz { --lx: 50%; --ly: 40%; }
.luz::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(circle at var(--lx) var(--ly), rgba(240, 220, 255, 0.5), rgba(176, 124, 255, 0.28) 22%, transparent 52%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.3s;
}
.botao-portal span.luz::before { z-index: 0; -webkit-mask: url("../media/ui/placa.webp") center / 100% 100%; mask: url("../media/ui/placa.webp") center / 100% 100%; }
.fita.luz::before { -webkit-mask: url("../media/ui/fita.webp") center / 100% 100%; mask: url("../media/ui/fita.webp") center / 100% 100%; }
.botao-portal:hover, .botao-portal:focus-visible { transform: translateY(-3px); }
.botao-portal:hover span, .botao-portal:focus-visible span {
  filter: drop-shadow(0 0 6px rgba(176, 124, 255, 0.75)) drop-shadow(0 0 20px rgba(130, 70, 220, 0.45)) drop-shadow(0 10px 14px rgba(0, 0, 0, 0.5));
}
.botao-portal:hover span::after, .botao-portal:focus-visible span::after { animation: none; opacity: 1; box-shadow: 0 0 8px var(--alma), 0 0 24px var(--alma); }
.botao-portal:active { transform: translateY(0) scale(0.98); }
.luz:hover::before, .luz:focus-visible::before, .botao-portal:hover .luz::before, .botao-portal:focus-visible .luz::before { opacity: 1; }

/* Ampulheta: a areia escorre e vira. */
.ampulheta {
  position: absolute; bottom: 1.6rem; left: 50%; z-index: 2;
  width: 34px; margin-left: -17px;
  animation: vira 6s var(--curva) infinite;
}
.ampulheta svg { width: 100%; overflow: visible; }
.ampulheta .moldura { fill: none; stroke: var(--tinta-dim); stroke-width: 2.2; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(176, 124, 255, 0.7)); }
.ampulheta .areia { fill: var(--alma); filter: drop-shadow(0 0 3px var(--alma)); }
.ampulheta .fio { stroke: var(--alma); stroke-width: 1.2; stroke-dasharray: 2 3; }
@keyframes vira { 0%, 86% { transform: rotate(0); } 96%, 100% { transform: rotate(180deg); } }

/* ------------------------------------------------------------ seções */
.secao, .trailer { position: relative; padding: clamp(4rem, 8vw, 7rem) clamp(1rem, 4vw, 3rem); max-width: 80rem; margin: 0 auto; }
/* O trailer sobe por cima do fim do herói. */
.trailer { padding-top: 0; margin-top: -5.5rem; z-index: 3; }
/* Faixa de névoa no começo de cada seção: as partes se emendam sem linha reta. */
.secao::before, .trailer::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: -20vw; right: -20vw; top: -7rem; height: 14rem;
  background: url("../media/ui/nevoa.png") 0 50% / 1100px 100% repeat-x;
  opacity: 0.16;
  -webkit-mask: linear-gradient(transparent, #000 35%, #000 65%, transparent), linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
  -webkit-mask-composite: source-in;
  mask: linear-gradient(transparent, #000 35%, #000 65%, transparent), linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
  mask-composite: intersect;
}
.secao:nth-of-type(even)::before { opacity: 0.12; background-position: 520px 50%; }
/* Logo abaixo do herói a névoa é mais densa: cobre a passagem do vídeo para a folha. */
.trailer::before { top: -13rem; height: 20rem; opacity: 0.3; }
/* Placa de título com o crânio (heading_noite.png). */
.titulo-placa {
  display: grid; place-items: center;
  width: min(30rem, 92%);
  min-height: 7.2rem;
  margin: 0 auto 1.6rem;
  padding: 2.4rem 2rem 1.2rem;
  background: url("../media/ui/titulo.webp") center / 100% 100% no-repeat;
  font-size: clamp(2.2rem, 1.6rem + 2vw, 3.3rem);
  text-align: center;
}
.intro { max-width: 46rem; margin: 0 auto 2rem; text-align: center; color: var(--tinta-dim); text-shadow: var(--tinta-contorno); }
.ornamento { margin: 0 auto 2.4rem; width: min(520px, 80%); opacity: 0.9; }
.lema { color: var(--brilho); font-style: italic; text-shadow: var(--tinta-contorno); }

.moldura-video { padding: clamp(0.5rem, 1.4vw, 1rem); max-width: 68rem; margin: 0 auto; box-shadow: inset 0 1px 0 rgba(237, 230, 243, 0.12), 0 0 0 1px var(--contorno), 0 30px 80px -20px rgba(0, 0, 0, 0.95), 0 0 120px -40px rgba(176, 124, 255, 0.55); }
.moldura-video video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 2px; position: relative; z-index: 2; }

/* Capítulos: tela de vídeo grande e o texto ao lado, alternando os lados. */
.capitulo {
  position: relative;
  display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(1.5rem, 4vw, 4.5rem);
  align-items: center;
  margin: 0 0 clamp(4rem, 9vw, 8rem);
}
.capitulo:nth-of-type(even) { grid-template-columns: 1fr 1.35fr; }
.capitulo:nth-of-type(even) .tela { order: 2; }
.tela { margin: 0; padding: clamp(0.4rem, 1vw, 0.7rem); }
.tela video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 2px; position: relative; z-index: 2; background: #0b0912; }
/* Luz espectral atrás da tela, que acende quando o capítulo entra. */
.tela::after {
  content: ""; position: absolute; inset: 8% -4% -10%; z-index: -1;
  background: radial-gradient(50% 50% at 50% 50%, rgba(176, 124, 255, 0.3), transparent 75%);
  opacity: 0; transition: opacity 1.2s;
}
.tela.visto::after { opacity: 1; }
.capitulo:nth-of-type(even) .tela::after { background: radial-gradient(50% 50% at 50% 50%, rgba(111, 240, 224, 0.2), transparent 70%); }
.capitulo-texto { position: relative; }
.numeral {
  font-family: var(--gotica);
  font-size: clamp(4rem, 3rem + 4vw, 7rem);
  line-height: 0.8;
  margin: 0 0 0.1em;
  color: rgba(176, 124, 255, 0.16);
  -webkit-text-stroke: 1px rgba(196, 150, 255, 0.7);
  text-shadow: 0 0 30px rgba(176, 124, 255, 0.35);
}
.capitulo h3 { font-size: clamp(2.2rem, 1.7rem + 1.8vw, 3.4rem); margin-bottom: 0.15em; }
.capitulo .lema { font-size: 1.15em; margin-bottom: 0.8em; }
.capitulo p:not(.numeral):not(.lema) { color: var(--tinta-dim); text-shadow: var(--tinta-contorno); }
.etapas { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: 0.6rem; }
.etapas li { position: relative; color: var(--tinta-dim); border-left: 1px solid var(--folha-borda); padding: 0.15rem 0 0.15rem 3rem; text-shadow: var(--tinta-contorno); }
.etapas li span { position: absolute; left: 0.8rem; top: 0.05rem; font-family: var(--gotica); color: var(--brilho); font-size: 1.3rem; line-height: 1.2; }
.etapas b { color: var(--tinta); font-weight: 650; }
/* A foice de fundo da forja, em parallax. */
.foice-deco {
  position: absolute; z-index: -1; right: -2%; top: -14%;
  width: clamp(10rem, 22vw, 20rem);
  fill: rgba(176, 124, 255, 0.07);
  filter: drop-shadow(0 0 30px rgba(176, 124, 255, 0.3));
  transform-origin: 50% 90%;
}

/* Galeria */
.galeria { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); grid-auto-flow: dense; gap: 1rem; }
.galeria li:nth-child(5n + 1) { grid-column: span 2; grid-row: span 2; }
.galeria button {
  display: block; width: 100%; height: 100%; padding: 0.45rem; cursor: zoom-in;
  font: inherit; color: inherit; text-align: left;
  transition: transform 0.22s var(--curva), box-shadow 0.22s;
}
.galeria img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; border-radius: 2px; transition: filter 0.3s; filter: saturate(0.85) brightness(0.85); position: relative; z-index: 2; }
.galeria button:hover img, .galeria button:focus-visible img { filter: none; }
.galeria button:hover, .galeria button:focus-visible { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--brilho), 0 0 26px -6px rgba(176, 124, 255, 0.7); }
.galeria span { display: block; padding: 0.45rem 0.3rem 0.1rem; font-size: 0.95rem; color: var(--tinta-dim); }

.visor {
  max-width: min(96vw, 1600px); width: auto; padding: 0.8rem;
  background: var(--folha); color: var(--tinta);
  border: 1px solid var(--folha-borda);
}
.visor[open] { animation: nasce 0.32s var(--curva); }
.visor::backdrop { background: rgba(4, 3, 8, 0.88); backdrop-filter: blur(3px); }
.visor img { max-height: 82vh; width: auto; margin: 0 auto; }
.visor .legenda { margin: 0.6rem 0 0; text-align: center; color: var(--tinta-dim); }
.visor .fechar {
  position: absolute; top: 0.3rem; right: 0.5rem;
  width: 2.6rem; height: 2.6rem;
  border: 0; background: none; color: var(--tinta); font-size: 2rem; cursor: pointer;
  text-shadow: var(--halo);
}

/* Chefes */
.chefes { display: grid; grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr)); gap: 1.6rem; }
.chefe { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1.2rem; padding: 0.75rem; align-items: center; transition: transform 0.22s var(--curva), box-shadow 0.22s; }
.chefe img { border-radius: 2px; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; box-shadow: 0 0 0 1px var(--contorno); position: relative; z-index: 2; }
.chefe h3 { font-size: 2.2rem; margin-bottom: 0.1em; }
.chefe .lema { margin-bottom: 0.5em; }
.chefe p:last-child { color: var(--tinta-dim); margin: 0; }
.chefe:hover { transform: translateY(-4px); box-shadow: inset 0 1px 0 rgba(237, 230, 243, 0.12), 0 0 0 1px var(--brilho), 0 0 34px -8px rgba(176, 124, 255, 0.6); }

/* Baixar e portal */
.baixar { display: grid; grid-template-columns: minmax(16rem, 1fr) 1.2fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: center; }
.baixar .titulo-placa, .baixar .intro { margin-left: 0; margin-right: 0; }
.baixar .intro { text-align: left; }
.portal { position: relative; aspect-ratio: 1; width: 100%; max-width: 34rem; margin: 0 auto; }
.portal::before {
  content: ""; position: absolute; inset: -12%;
  background: radial-gradient(closest-side, rgba(176, 124, 255, 0.3), transparent);
  will-change: transform, opacity;
  animation: pulsa 4.5s ease-in-out infinite;
}
@keyframes pulsa { 50% { opacity: 0.55; transform: scale(0.94); } }
.portal img { position: relative; z-index: 1; width: 100%; animation: flutua 7s ease-in-out infinite; }
.portal .vortice {
  position: absolute; inset: 9%; width: 82%; height: 82%;
  z-index: 2; border-radius: 50%;
  mix-blend-mode: screen;
  pointer-events: none;
  animation: flutua 7s ease-in-out infinite;
}
@keyframes flutua { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.requisitos { margin-top: 2rem; padding: 1.4rem 1.6rem 1.2rem; }
.requisitos h3 { font-size: 1.9rem; }
.requisitos dl { margin: 0; display: grid; gap: 0.55rem; }
.requisitos dl div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; border-bottom: 1px solid rgba(74, 61, 87, 0.6); padding-bottom: 0.45rem; }
.requisitos dt { color: var(--tinta-dim); }
.requisitos dd { margin: 0; }
.requisitos .nota { margin: 0.9rem 0 0; font-size: 0.95rem; color: var(--tinta-apagada); }

/* Rodapé */
.rodape { text-align: center; padding: 3rem 1rem 2.5rem; color: var(--tinta-dim); background: linear-gradient(transparent, #0d0a14); }
.rodape-icone { margin: 0 auto 0.4rem; filter: drop-shadow(0 0 8px rgba(176, 124, 255, 0.6)); }
.rodape-nome { font-family: var(--gotica); font-size: 2rem; color: var(--tinta); text-shadow: var(--tinta-contorno), var(--halo); margin: 0; }
.rodape .links { display: flex; gap: 1.4rem; justify-content: center; flex-wrap: wrap; }
.rodape .links a { color: var(--tinta-dim); }
.rodape .links a:hover { color: var(--tinta); }
.creditos { font-size: 0.85rem; color: var(--tinta-apagada); }

/* ------------------------------------------------------------ revelação
   A folha entra como o papel do menu (paper_departure.gdshader) ao
   contrário: a tinta aparece de cima para baixo por uma borda roída pelo
   fogo, sobe 40 px em OPEN_TIME e acende um instante. */
.js .revelar {
  -webkit-mask: url("../media/ui/queima.png") 0 100% / 100% 300% no-repeat;
  mask: url("../media/ui/queima.png") 0 100% / 100% 300% no-repeat;
  transform: translateY(40px);
  opacity: 0;
}
.js .revelar.visto {
  animation: queima 1.05s var(--curva) both;
}
.js .revelar.queimado { -webkit-mask: none; mask: none; animation: none; opacity: 1; transform: none; filter: none; }
@keyframes queima {
  0% { -webkit-mask-position: 0 100%; mask-position: 0 100%; transform: translateY(40px); opacity: 0; filter: brightness(2) saturate(1.4); }
  12% { opacity: 1; }
  35% { transform: none; }
  100% { -webkit-mask-position: 0 0; mask-position: 0 0; transform: none; opacity: 1; filter: none; }
}

/* ------------------------------------------------------------ celular */
@media (max-width: 1000px) {
  .capitulo, .capitulo:nth-of-type(even) { grid-template-columns: 1fr; gap: 1.2rem; }
  .capitulo:nth-of-type(even) .tela { order: 0; }
  .numeral { font-size: 3.6rem; }
}
@media (max-width: 860px) {
  .menu-botao {
    display: grid; gap: 5px; place-content: center;
    width: 2.8rem; height: 2.8rem;
    background: var(--folha); border: 1px solid var(--folha-borda); border-radius: 3px; cursor: pointer;
  }
  .menu-botao i { display: block; width: 1.3rem; height: 2px; background: var(--tinta); }
  nav {
    position: absolute; top: 100%; right: 0.8rem; left: 0.8rem;
    flex-direction: column; align-items: stretch; gap: 0.3rem;
    padding: 0.8rem;
    background: var(--fibra), var(--folha); border: 1px solid var(--folha-borda);
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: opacity 0.2s, transform 0.2s var(--curva), visibility 0.2s;
  }
  nav.aberto { transform: none; opacity: 1; visibility: visible; }
  nav .foco { padding: 0.75rem 1rem; }
  nav .fita { margin: 0.4rem 0 0; }
  .heroi { padding-bottom: 9rem; }
  .selos { font-size: 0.9rem; gap: 0.3rem 1rem; }
  .chefes { grid-template-columns: 1fr; }
  .chefe { grid-template-columns: 1fr; }
  .baixar { grid-template-columns: 1fr; }
  .portal { max-width: 20rem; }
  .baixar .titulo-placa { margin: 0 auto 1.6rem; }
  .baixar .intro { text-align: center; }
  .baixar-texto { display: grid; justify-items: center; }
  .requisitos { width: 100%; }
  .requisitos dl div { grid-template-columns: 1fr; gap: 0.1rem; }
  .botao-portal { width: min(19rem, 82vw); }
  .botao-portal.grande { width: min(21rem, 88vw); }
  .galeria { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .galeria li:nth-child(5n + 1) { grid-column: span 2; grid-row: auto; }
  .galeria span { display: none; }
  .foice-deco { top: -6%; opacity: 0.6; }
  .trailer { margin-top: -4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .revelar { -webkit-mask: none; mask: none; opacity: 1; transform: none; }
}
