/* ============================================================
   Caipora Landing Page — Dark Folk-Horror Redesign
   Native CSS. Zero frameworks. Fontes e assets do jogo.
   ============================================================ */

/* --------------------------------------------------------------
   Fontes
   -------------------------------------------------------------- */
@font-face {
  font-family: 'PressStart2P';
  src: url('../assets/fonts/PressStart2P.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------
   Variáveis
   -------------------------------------------------------------- */
:root {
  --bg-void: #050505;
  --bg-surface: #08080c;
  --bg-elevated: #0f0f14;
  --bg-card: #111118;
  --text-primary: #f0f0f5;
  --text-secondary: #9a9aa8;
  --text-muted: #4d4d5c;
  --accent-flame: #ff4500;
  --accent-amber: #ff6b00;
  --accent-blood: #8b0000;
  --accent-crystal: #00fa9a;
  --outline: #1a120a;
  --blood-line: rgba(139, 0, 0, 0.55);

  --font-display: 'PressStart2P', monospace;
  --font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;

  --nav-height: 72px;
  --max-width: 1200px;
  --section-gap: clamp(5rem, 10vw, 8rem);
}

/* --------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-secondary);
  background-color: var(--bg-void);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* clip (não hidden) recorta na horizontal SEM criar scroll container —
     hidden faria overflow-y computar p/ auto e quebraria position:sticky
     (ex.: a cena scroll-scrub do coração). */
  overflow-x: clip;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: rgba(255, 69, 0, 0.35);
  color: var(--text-primary);
}

/* --------------------------------------------------------------
   Overlays globais
   -------------------------------------------------------------- */
.grain,
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

.grain {
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  mix-blend-mode: overlay;
  animation: grainShift 0.5s steps(4) infinite;
}

@keyframes grainShift {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 2px); }
  50% { transform: translate(2px, -1px); }
  75% { transform: translate(-1px, -2px); }
}

.vignette {
  background: radial-gradient(ellipse at center, transparent 0%, transparent 45%, rgba(0,0,0,0.75) 100%);
}

.embers {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.ember {
  position: absolute;
  bottom: -10px;
  width: 3px;
  height: 3px;
  background: var(--accent-flame);
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 6px var(--accent-flame), 0 0 12px var(--accent-amber);
  animation: emberRise linear forwards;
}

@keyframes emberRise {
  0% {
    transform: translateY(0) translateX(0) scale(0.5);
    opacity: 0;
  }
  10% { opacity: 0.9; }
  90% { opacity: 0.6; }
  100% {
    transform: translateY(-110vh) translateX(var(--drift)) scale(0.2);
    opacity: 0;
  }
}

/* --------------------------------------------------------------
   Utilitários
   -------------------------------------------------------------- */
.section-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.section-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.5rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-flame);
  margin-bottom: 1rem;
}

/* --------------------------------------------------------------
   Botões
   -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-family: var(--font-display);
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background-color: var(--accent-flame);
  color: var(--bg-void);
  border-color: var(--accent-flame);
  box-shadow: 0 0 18px rgba(255, 69, 0, 0.25);
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.18) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.4s ease;
}

.btn-primary:hover {
  background-color: var(--accent-amber);
  border-color: var(--accent-amber);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(255, 107, 0, 0.4);
}

.btn-primary:hover::after {
  transform: translateX(100%);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
  border-color: var(--text-muted);
}

.btn-ghost:hover {
  border-color: var(--accent-flame);
  color: var(--text-primary);
  box-shadow: inset 0 0 18px rgba(255, 69, 0, 0.12);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 1.125rem 2.25rem;
  font-size: 0.75rem;
}

.btn-xl {
  padding: 1.375rem 2.75rem;
  font-size: 0.875rem;
}

/* --------------------------------------------------------------
   Nav
   -------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  background-color: rgba(5, 5, 5, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: rgba(139, 0, 0, 0.45);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-brand-icon {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 8px rgba(255, 69, 0, 0.35));
}

/* Header = barra de controles coerente: GitHub, idioma e JOGAR compartilham a
   MESMA altura (--nav-ctrl), cantos retos e tratamento de borda idêntico. Só o
   JOGAR é preenchido (ação primária); os demais são fantasmas. Espaçamento
   uniforme entre todos os itens. */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  --nav-ctrl: 40px;
}

.nav-link {
  display: none;
  font-family: var(--font-display);
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--accent-flame);
}

/* JOGAR no header — compacto, mesma altura dos demais controles.
   No mobile some (a hero já tem o CTA grande). */
.nav-links .btn {
  display: none;
  height: var(--nav-ctrl);
  padding: 0 1.25rem;
}

/* GitHub — botão-ícone quadrado, fantasma */
.nav-github {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--nav-ctrl);
  height: var(--nav-ctrl);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.nav-github:hover {
  color: var(--accent-flame);
  border-color: var(--accent-flame);
  background-color: rgba(255, 69, 0, 0.08);
}

.nav-github svg {
  width: 18px;
  height: 18px;
}

/* Idioma — dois botões de bandeira, mesmo padrão dos controles */
.lang-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--nav-ctrl);
  height: var(--nav-ctrl);
  padding: 0;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.lang-btn:hover {
  opacity: 0.9;
  border-color: rgba(255, 255, 255, 0.25);
}

.lang-btn--active {
  opacity: 1;
  border-color: var(--accent-flame);
  background-color: rgba(255, 69, 0, 0.08);
}

.lang-btn:focus-visible {
  outline: 2px solid var(--accent-flame);
  outline-offset: 2px;
}

.flag-img {
  display: block;
  width: 24px;
  height: 16px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* --------------------------------------------------------------
   Hero
   -------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-height) + 2rem) 1.5rem 4rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 69, 0, 0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(139, 0, 0, 0.12) 0%, transparent 40%),
    var(--bg-void);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.22) 0px,
    rgba(0,0,0,0.22) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: multiply;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-boss {
  position: absolute;
  opacity: 0.28;
  filter: blur(1px) brightness(0.85) contrast(1.1);
  transition: transform 0.1s linear;
  animation: bossFloat 6s ease-in-out infinite;
}

.hero-boss img {
  width: auto;
  height: auto;
  max-width: none;
  image-rendering: pixelated;
}

.hero-boss--mula    { bottom: -5%; right: -4%; animation-delay: 0s; }
.hero-boss--mula img    { width: clamp(180px, 30vw, 340px); }
.hero-boss--boitata { top: 10%; right: 5%; animation-delay: -1.2s; }
.hero-boss--boitata img { width: clamp(160px, 26vw, 300px); }
.hero-boss--curupira { top: 22%; left: 2%; animation-delay: -2.4s; }
.hero-boss--curupira img { width: clamp(120px, 20vw, 220px); }
.hero-boss--saci    { bottom: 12%; left: -2%; animation-delay: -3.6s; }
.hero-boss--saci img    { width: clamp(110px, 18vw, 190px); }
.hero-boss--jesuita { top: 5%; left: 18%; animation-delay: -4.8s; }
.hero-boss--jesuita img { width: clamp(130px, 22vw, 240px); }

@keyframes bossFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 820px;
  width: 100%;
}

.hero-mark {
  margin-bottom: 1.5rem;
  animation: markPulse 3s ease-in-out infinite;
}

.hero-mark img {
  width: clamp(56px, 10vw, 80px);
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 24px rgba(255, 69, 0, 0.45));
}

/* A Caipora protagonista como peça-herói (ela é o hype). Sprite real do jogo,
   ampliado em pixel-art, com clareira de chama e flutuar predatório. */
.hero-caipora {
  margin-bottom: 1.75rem;
  /* entrada + flutuar definidos no grupo de entrada do hero (mais abaixo). */
}

/* Idle vivo: tira de 7 quadros de 96px (5 do idle + 2 do piscar) espelhando a
   animação do jogo. O JS (main.js) avança background-position-x; sem JS (ou com
   reduced-motion) fica parado no 1º quadro — a mesma pose canônica de antes. */
.hero-caipora-sprite {
  width: clamp(132px, 26vw, 248px);
  aspect-ratio: 1 / 1;
  margin-inline: auto;
  image-rendering: pixelated;
  background-image: url('../assets/sprites/caipora_idle_strip.png');
  background-size: 700% 100%;
  background-position: 0% 0;
  background-repeat: no-repeat;
  filter:
    drop-shadow(0 0 2px rgba(0, 0, 0, 0.9))
    drop-shadow(0 0 38px rgba(255, 69, 0, 0.5))
    drop-shadow(0 14px 26px rgba(0, 0, 0, 0.7));
}

@keyframes caiporaFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes markPulse {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(255, 69, 0, 0.35)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 34px rgba(255, 107, 0, 0.55)); transform: scale(1.04); }
}

.hero-title {
  margin-bottom: 1.25rem;
  line-height: 1;
}

.hero-title-img {
  width: min(90vw, 560px);
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 30px rgba(255, 69, 0, 0.25));
}

.hero-title-fallback {
  display: none;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 8vw, 4rem);
  color: var(--text-primary);
  letter-spacing: 0.06em;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  color: var(--text-secondary);
  max-width: 42ch;
  margin-bottom: 2.5rem;
  line-height: 1.55;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* Hero entrance animation */
.hero-caipora,
.hero-title,
.hero-subtitle,
.hero-ctas {
  opacity: 0;
  transform: translateY(24px);
  animation: heroEnter 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-caipora { animation: heroEnter 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards, caiporaFloat 4.5s ease-in-out 1s infinite; }
.hero-title { animation-delay: 0.25s; }
.hero-subtitle { animation-delay: 0.45s; }
.hero-ctas { animation-delay: 0.65s; }

@keyframes heroEnter {
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------
   Manifesto
   -------------------------------------------------------------- */
.manifesto {
  position: relative;
  padding: var(--section-gap) 1.5rem;
  background-color: var(--bg-surface);
  overflow: hidden;
  border-top: 1px solid var(--blood-line);
  border-bottom: 1px solid var(--blood-line);
}

.manifesto::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(255, 69, 0, 0.04) 0%, transparent 55%);
  pointer-events: none;
}

.manifesto-inner {
  position: relative;
  max-width: 68ch;
  margin: 0 auto;
  text-align: center;
}

.manifesto-sprite {
  position: absolute;
  top: -4rem;
  right: -6rem;
  opacity: 0.06;
  pointer-events: none;
  transform: scale(1.6);
}

.manifesto-sprite img {
  image-rendering: pixelated;
  max-width: 420px;
}

.manifesto-title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 4vw, 1.5rem);
  line-height: 1.5;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.manifesto-body {
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  line-height: 1.75;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------
   Chefes
   -------------------------------------------------------------- */
.bosses {
  position: relative;
  padding: var(--section-gap) 1.5rem;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(139, 0, 0, 0.08) 0%, transparent 45%),
    radial-gradient(ellipse at 80% 80%, rgba(255, 69, 0, 0.05) 0%, transparent 45%),
    var(--bg-void);
}

.bosses-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.bosses-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.bosses-title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 4.5vw, 1.75rem);
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bosses-lead {
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  color: var(--text-secondary);
  max-width: 50ch;
  margin: 0 auto;
}

.boss-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.boss-card {
  position: relative;
}

.boss-card-frame {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(255, 69, 0, 0.18);
  padding: 1.5rem;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.boss-card-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-blood), transparent);
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.boss-card:hover .boss-card-frame {
  border-color: rgba(255, 69, 0, 0.55);
  box-shadow: 0 0 30px rgba(255, 69, 0, 0.12), inset 0 0 40px rgba(139, 0, 0, 0.08);
  transform: translateY(-4px);
}

.boss-card:hover .boss-card-frame::before {
  opacity: 1;
}

.boss-card-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 140%;
  height: 140%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(255, 69, 0, 0.12) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.boss-card:hover .boss-card-glow {
  opacity: 1;
}

.boss-card-sprite {
  position: relative;
  height: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.boss-card-sprite img {
  position: absolute;
  bottom: 0;
  image-rendering: pixelated;
  max-height: 100%;
  width: auto;
  transition: opacity 0.2s ease, transform 0.3s ease;
}

.boss-card-sprite .boss-windup {
  opacity: 0;
  transform: scale(1.05);
}

.boss-card:hover .boss-idle {
  opacity: 0;
  transform: scale(0.95);
}

.boss-card:hover .boss-windup {
  opacity: 1;
  transform: scale(1);
}

.boss-card-meta {
  text-align: center;
}

.boss-phase {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.45rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-crystal);
  margin-bottom: 0.75rem;
}

.boss-name {
  font-family: var(--font-display);
  font-size: clamp(0.8rem, 3vw, 1rem);
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.boss-epithet {
  font-size: 0.9rem;
  color: var(--accent-flame);
  font-style: italic;
  margin-bottom: 1rem;
}

.boss-desc {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-secondary);
  padding: 0 0.5rem;
  text-align: center;
}

/* --------------------------------------------------------------
   Invasores
   -------------------------------------------------------------- */
.invaders {
  padding: var(--section-gap) 1.5rem;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--blood-line);
}

.invaders-inner {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  align-items: center;
}

.invaders-visual {
  flex: 1;
  width: 100%;
  max-width: 420px;
  position: relative;
}

.invaders-visual::after {
  content: '';
  position: absolute;
  inset: -1rem;
  background: radial-gradient(ellipse at center, rgba(139, 0, 0, 0.12) 0%, transparent 70%);
  z-index: -1;
}

.invaders-visual img {
  width: 100%;
  image-rendering: pixelated;
  border: 1px solid rgba(255, 69, 0, 0.2);
}

.invaders-content {
  flex: 1;
  max-width: 55ch;
}

.invaders-title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 4vw, 1.5rem);
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.invaders-body {
  font-size: 1.0625rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.invaders-sprites {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.invaders-sprites img {
  image-rendering: pixelated;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255, 69, 0, 0.2);
  background: var(--bg-card);
}

/* --------------------------------------------------------------
   Mecânicas
   -------------------------------------------------------------- */
.mechanics {
  padding: var(--section-gap) 1.5rem;
  background-color: var(--bg-void);
  position: relative;
}

.mechanics::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 60% 50%, rgba(0, 250, 154, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

.mechanics-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  max-width: var(--max-width);
  margin: 0 auto;
  align-items: center;
}

.mechanics-visual {
  flex: 1;
  width: 100%;
  max-width: 520px;
  position: relative;
}

.mechanics-visual::after {
  content: '';
  position: absolute;
  inset: -1rem;
  background: radial-gradient(ellipse at center, rgba(255, 69, 0, 0.08) 0%, transparent 65%);
  z-index: -1;
}

.mechanics-visual img {
  width: 100%;
  image-rendering: pixelated;
  border: 1px solid rgba(255, 69, 0, 0.22);
}

/* O clipe da seção é retrato (9:16) — moldura de "telefone" centralizada. */
.mechanics-visual .clip-frame {
  width: 100%;
  max-width: 300px;
  margin-inline: auto;
}

.mechanics-content {
  flex: 1;
  max-width: 55ch;
}

.mechanics-title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 4vw, 1.5rem);
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.35;
  text-transform: uppercase;
}

.mechanics-body {
  font-size: 1.0625rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.mechanics-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.mechanics-list li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.97rem;
  color: var(--text-secondary);
}

.mechanics-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 8px;
  height: 8px;
  background-color: var(--accent-blood);
  transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(139, 0, 0, 0.6);
}

/* --------------------------------------------------------------
   Clímax — os dois instantes finais, em destaque
   -------------------------------------------------------------- */
.climax {
  padding: var(--section-gap) 1.5rem;
  background-color: var(--bg-void);
  border-top: 1px solid var(--blood-line);
  position: relative;
}

.climax::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(139, 0, 0, 0.12) 0%, transparent 55%);
  pointer-events: none;
}

.climax-inner {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
}

.climax-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.climax-title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 4vw, 1.6rem);
  color: var(--text-primary);
  text-transform: uppercase;
  line-height: 1.35;
  margin-bottom: 1rem;
}

.climax-lead {
  max-width: 56ch;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 1.0625rem;
}

.moment {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 4rem;
}

.moment:last-child {
  margin-bottom: 0;
}

.moment-visual {
  position: relative;
}

.moment-visual::after {
  content: '';
  position: absolute;
  inset: -1rem;
  background: radial-gradient(ellipse at center, rgba(255, 69, 0, 0.10) 0%, transparent 65%);
  z-index: -1;
}

/* O clipe do golpe final é retrato (9:16) — moldura de "telefone" centralizada. */
.moment-visual--portrait .clip-frame {
  width: 100%;
  max-width: 280px;
  margin-inline: auto;
}

/* O still da escolha é paisagem (cena cinematográfica). */
.clip-frame--still {
  margin: 0;
}

.clip-frame--still img {
  display: block;
  width: 100%;
}

.moment-kicker {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.5rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-flame);
  margin-bottom: 0.85rem;
}

.moment-title {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 3.4vw, 1.35rem);
  color: var(--text-primary);
  text-transform: uppercase;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.moment-body {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

@media (min-width: 760px) {
  .moment {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
  /* Still de paisagem ganha mais largura que o texto. */
  .moment--reverse {
    grid-template-columns: 1.3fr 1fr;
  }
  .moment--reverse .moment-visual {
    order: 2;
  }
}

/* --------------------------------------------------------------
   Galeria
   -------------------------------------------------------------- */
.gallery {
  padding: var(--section-gap) 1.5rem;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--blood-line);
}

.gallery-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.gallery-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.gallery-title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 4vw, 1.5rem);
  color: var(--text-primary);
  line-height: 1.35;
  text-transform: uppercase;
}

.bento {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.bento-cell {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(255, 69, 0, 0.12);
  overflow: hidden;
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.bento-cell:hover {
  transform: scale(1.015);
  border-color: rgba(255, 69, 0, 0.35);
  box-shadow: 0 0 24px rgba(255, 69, 0, 0.08);
}

.bento-cell::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.45) 100%);
  pointer-events: none;
}

.bento-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.35s ease, transform 0.35s ease;
}

.bento-cell:hover img {
  filter: brightness(1.1) contrast(1.05);
  transform: scale(1.03);
}

.bento-cell-sprite {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(ellipse at center, rgba(13, 17, 23, 0.7) 0%, var(--bg-card) 70%);
}

.bento-cell-sprite img {
  object-fit: contain;
  max-width: 90%;
  max-height: 90%;
  image-rendering: pixelated;
}

.bento-cell-screenshot {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-void);
}

.bento-cell-screenshot img {
  object-fit: contain;
  width: 100%;
  height: 100%;
}

.bento-cell-large  { aspect-ratio: 16 / 10; }
.bento-cell-wide   { aspect-ratio: 2 / 1; }
.bento-cell:not(.bento-cell-large):not(.bento-cell-wide) { aspect-ratio: 1 / 1; }

/* Stagger delays */
.bento-cell:nth-child(1) { transition-delay: 0s; }
.bento-cell:nth-child(2) { transition-delay: 0.06s; }
.bento-cell:nth-child(3) { transition-delay: 0.12s; }
.bento-cell:nth-child(4) { transition-delay: 0.18s; }
.bento-cell:nth-child(5) { transition-delay: 0.24s; }

/* --------------------------------------------------------------
   CTA Final
   -------------------------------------------------------------- */
.final-cta {
  position: relative;
  padding: var(--section-gap) 1.5rem;
  background:
    radial-gradient(ellipse at center, rgba(255, 69, 0, 0.10) 0%, transparent 60%),
    var(--bg-void);
  text-align: center;
  overflow: hidden;
  border-top: 1px solid var(--blood-line);
}

.final-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.25) 0px,
    rgba(0,0,0,0.25) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.3;
  pointer-events: none;
}

.final-cta-inner {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}

.final-cta-title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 5vw, 1.75rem);
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.35;
  text-transform: uppercase;
}

.final-cta-body {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.final-cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* --------------------------------------------------------------
   Footer
   -------------------------------------------------------------- */
.footer {
  padding: 3rem 1.5rem;
  background-color: var(--bg-void);
  border-top: 1px solid var(--blood-line);
  position: relative;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-tagline {
  font-family: var(--font-display);
  font-size: 0.55rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-flame);
}

/* --------------------------------------------------------------
   Media Queries
   -------------------------------------------------------------- */
@media (min-width: 640px) {
  .nav-link { display: inline-block; }
  .nav-links .btn { display: inline-flex; }

  .boss-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .boss-card--wide {
    grid-column: span 2;
  }

  .boss-card--wide .boss-card-frame {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 1.5rem;
    align-items: center;
  }

  .boss-card--wide .boss-card-sprite {
    height: 200px;
    margin-bottom: 0;
  }

  .boss-card--wide .boss-card-meta,
  .boss-card--wide .boss-desc {
    text-align: left;
  }

  .bento {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: 1.25rem;
  }

  .bento-cell-large { grid-column: span 2; grid-row: span 1; }
  .bento-cell-wide  { grid-column: span 2; }
}

@media (min-width: 900px) {
  .boss-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .boss-card--wide {
    grid-column: span 3;
  }

  .boss-card--wide .boss-card-frame {
    grid-template-columns: 220px 1fr;
  }

  .mechanics-inner,
  .invaders-inner {
    flex-direction: row;
    gap: 4rem;
  }

  .mechanics-visual { max-width: 48%; }
  .invaders-visual { max-width: 45%; }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

@media (min-width: 1024px) {
  .bento {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
  }

  .bento-cell-large {
    grid-column: span 2;
    grid-row: span 2;
    aspect-ratio: auto;
  }

  .bento-cell-wide {
    grid-column: span 2;
    grid-row: span 1;
    aspect-ratio: auto;
  }

  .bento-cell:not(.bento-cell-large):not(.bento-cell-wide) {
    aspect-ratio: auto;
  }
}

/* --------------------------------------------------------------
   Clips — sprite-strip player (gameplay REAL capturado do jogo)
   A tira tem N células lado a lado; a animação rola background-position
   com steps(N, jump-none) p/ alinhar exatamente na borda de cada célula
   (jump-end "rasga" entre quadros). image-rendering: pixelated mantém o
   pixel-art nítido ao ampliar. clips.json -> --frames / --clip-src via JS.
   -------------------------------------------------------------- */
.clip-frame {
  position: relative;
  overflow: hidden;
  background: var(--bg-void);
  border: 1px solid rgba(255, 69, 0, 0.22);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.6),
    0 24px 70px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(255, 69, 0, 0.06);
}

/* Scanlines + clareira de chama, igual ao hero, p/ moldura "tela do jogo". */
.clip-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.18) 0px,
    rgba(0, 0, 0, 0.18) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.4;
  mix-blend-mode: multiply;
}

.clip {
  display: block;
  width: 100%;
  aspect-ratio: var(--cell-w, 480) / var(--cell-h, 270);
  background-image: var(--clip-src, none);
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: calc(var(--frames, 30) * 100%) 100%;
  image-rendering: pixelated;
  animation: clipPlay calc(var(--frames, 30) / 12 * 1s)
    steps(var(--frames, 30), jump-none) infinite;
}

@keyframes clipPlay {
  from { background-position-x: 0%; }
  to   { background-position-x: 100%; }
}

/* --------------------------------------------------------------
   Cena scroll-scrub: clipe GRANDE, fixo na viewport, avançado pela
   ROLAGEM. A seção é alta (~250vh); o .scrollscene-sticky fixa por 1
   viewport e os ~150vh restantes (~1.5 tela) são a "trilha" de scrub.
   O quadro é setado pelo JS via background-position-x (ver main.js,
   [data-scrub]) — rolar p/ baixo avança 0→100%, p/ cima reverte.
   .clip--scrub desliga a animação CSS (controle é do scroll).
   Aspecto fixo 270×480 (finisher é retrato): a moldura-pai não herda
   --cell-w/-h, que o JS seta no .clip filho.
   -------------------------------------------------------------- */
.scrollscene {
  position: relative;
  /* A faixa de scrub = altura - 100vh (sticky). 400vh => 300vh de scrub, o
     DOBRO do 150vh anterior: o golpe final passa em câmera lenta mais longa. */
  height: 400vh;
  background: var(--bg-void);
}

.scrollscene-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  overflow: hidden;
}

.scrollscene-frame {
  height: min(100svh, calc(100vw * (480 / 270)));
  aspect-ratio: 270 / 480;
  max-width: 100vw;
}

.scrollscene-frame .clip {
  height: 100%;
  width: 100%;
  aspect-ratio: auto;
}

.clip--scrub { animation: none; }

.scrollscene-caption {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0 1rem;
}

/* Movimento reduzido: sem pin/scrub — colapsa a trilha alta e vira um clipe
   contido. A animação fica parada no 1º quadro (== poster) pela regra global
   `.clip { animation: none !important }` lá embaixo, mantendo a convenção do site. */
@media (prefers-reduced-motion: reduce) {
  .scrollscene { height: auto; padding: 2.5rem 0; }
  .scrollscene-sticky { position: static; height: auto; }
  .scrollscene-frame { height: auto; aspect-ratio: auto; width: min(78vw, 320px); }
  .scrollscene-frame .clip {
    height: auto;
    width: 100%;
    aspect-ratio: var(--cell-w, 270) / var(--cell-h, 480);
  }
}

.clip-caption {
  margin-top: 0.85rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

/* Galeria: showcase de clipes (1 -> 3 colunas). Clipes são retrato (9:16): cada
   card vira um "telefone" de largura limitada e centralizado na sua coluna. */
.clips-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.clip-card {
  margin: 0;
  width: 100%;
  max-width: 280px;
  margin-inline: auto;
}

.gallery-stills {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.gallery-stills img {
  width: 100%;
  border: 1px solid rgba(255, 69, 0, 0.12);
  background: var(--bg-void);
}

.gallery-still-sprite {
  image-rendering: pixelated;
  object-fit: contain;
  padding: 1rem;
  background: radial-gradient(ellipse at center, rgba(13, 17, 23, 0.7) 0%, var(--bg-card) 70%);
}

@media (min-width: 640px) {
  .clips-grid { grid-template-columns: repeat(3, 1fr); }
  .gallery-stills { grid-template-columns: repeat(3, 1fr); }
}

/* Hero: a tela do jogo (retrato 9:16, como no celular) abaixo dos CTAs. Largura
   de "telefone" centralizada — a altura segue o aspect-ratio do clipe (clips.json). */
.hero-clip {
  position: relative;
  z-index: 2;
  width: min(78vw, 300px);
  margin: 2.75rem auto 0;
  opacity: 0;
  transform: translateY(24px);
  animation: heroEnter 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.85s forwards;
}

/* --------------------------------------------------------------
   Acessibilidade — "roguelike de navegador, sem instalar"
   -------------------------------------------------------------- */
.access {
  position: relative;
  padding: var(--section-gap) 1.5rem;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 69, 0, 0.06) 0%, transparent 55%),
    var(--bg-void);
  border-top: 1px solid var(--blood-line);
  text-align: center;
}

.access-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.access-title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 4vw, 1.5rem);
  color: var(--text-primary);
  line-height: 1.4;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.access-lead {
  font-size: 1.0625rem;
  max-width: 50ch;
  margin: 0 auto 2.75rem;
  line-height: 1.7;
}

.access-badges {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.access-badge {
  padding: 1.5rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid rgba(255, 69, 0, 0.14);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.access-badge:hover {
  border-color: rgba(255, 69, 0, 0.35);
  transform: translateY(-3px);
}

.access-badge-icon {
  line-height: 1;
  margin-bottom: 0.9rem;
  color: var(--accent-flame);
}

.access-badge-icon svg {
  width: 34px;
  height: 34px;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 0 10px rgba(255, 69, 0, 0.35));
}

.access-badge-title {
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-flame);
  margin-bottom: 0.6rem;
}

.access-badge-body {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

@media (min-width: 640px) {
  .access-badges { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  /* Mecânicas: clip ocupa a coluna visual no layout de 2 colunas. */
  .mechanics-visual .clip-frame { width: 100%; }
}

/* --------------------------------------------------------------
   Reduced Motion
   -------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html { scroll-behavior: auto; }
  .section-reveal { opacity: 1; transform: none; }

  /* Clip parado mostra o 1º quadro (== poster). hero-clip visível sem entrada. */
  .clip { animation: none !important; background-position-x: 0% !important; }
  .hero-clip { opacity: 1 !important; transform: none !important; }
}
