/* GOD · Greatest of the Desert — thegod.mx */

:root {
  --noche: #15110E;
  --hueso: #EFEAE0;
  --brasa: #E0532B;
  --duna: #D9BE93;
  --ocaso: #3A1C2A;

  --brasa-rgb: 224, 83, 43;
  --duna-rgb: 217, 190, 147;
  --hueso-rgb: 239, 234, 224;
  --noche-rgb: 21, 17, 14;

  --f-titulo: "Grenze", Georgia, serif;
  --f-texto: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-dato: "Archivo", "Manrope", system-ui, sans-serif;

  --gutter: clamp(20px, 5vw, 48px);
  --w-letras: min(80vw, 600px, 56svh); /* ancho de las letras "god" */
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--noche);
  color: var(--hueso);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
html.reduce { scroll-behavior: auto; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--noche);
  font-family: var(--f-texto);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
html, body { overflow-x: clip; } /* iOS: evita que algo más ancho que la pantalla permita zoom/desplazamiento lateral */

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--duna);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  padding: 10px 14px; background: var(--hueso); color: var(--noche);
  font-weight: 700; text-decoration: none; border-radius: 6px;
}
.skip-link:focus { top: 12px; }

/* ───────────────────────── Escena fija ───────────────────────── */

.stage {
  position: fixed; top: 0; left: 0; right: 0; z-index: 0;
  height: 100vh;
  height: 100lvh; /* fija: no cambia cuando la barra de Safari aparece o se esconde al hacer scroll */
  overflow: hidden;
  pointer-events: none;
  background: var(--noche);
}

/* Cielo "Amanecer en el desierto" (fondo 3840×2160): Noche arriba → Brasa en el horizonte */
.sky-dawn {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    var(--noche) 2%,
    #3C1027 27%,
    #70292D 58%,
    #B8472A 80%,
    var(--brasa) 100%);
  will-change: transform, opacity;
}

/* Sol y dunas comparten la escala del diseño: su altura es la del escenario (16:9, centrado) */
.sky-art {
  position: absolute; bottom: 0; left: 50%;
  height: 100%; width: auto; aspect-ratio: 3840 / 2160;
  max-width: none;
  translate: -50% 0;
  overflow: visible;
  pointer-events: none;
}
.sky-sun { will-change: transform, opacity; }


/* Destello al confirmar el registro */
.flare {
  position: absolute; inset: 0;
  background: radial-gradient(70% 45% at 50% 100%, rgba(var(--brasa-rgb), .55), rgba(var(--brasa-rgb), 0) 70%);
  opacity: 0;
}
.stage.is-flaring .flare { animation: flare 2.2s var(--ease-out) both; }
@keyframes flare { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }

.embers, .chispas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.reduce .chispas { display: none; }

.dunes {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 45.3704%; /* 980 de 2160 unidades del diseño: de la cresta más alta al piso */
}
.dune {
  position: absolute; bottom: 0;
  left: -800px; width: calc(100% + 1600px); /* el JS ajusta el ancho exacto para que el patrón ruede sin huecos */
  height: 100%;
  max-width: none;
  overflow: hidden;
  will-change: transform;
}
/* Crestas: el filo de luz del diseño, en Duna (la opacidad de cada capa viene en el SVG) */
.dune path {
  stroke: var(--duna);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

/* Grano de película */
.grain {
  position: absolute; inset: -24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .937 0 0 0 0 .918 0 0 0 0 .878 0 0 0 1.6 -.72'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  opacity: .16; /* quieto: el grano en movimiento se veía como polvo temblando */
}

/* ───────────────────────── Contenido ───────────────────────── */

main, .pie { position: relative; z-index: 1; }

/* Hero: las letras aparecen justo al centro de la pantalla.
   Con JS (y sin movimiento reducido) la sección es más alta que la pantalla y .hero-pin se queda fija
   mientras deslizas: las letras suben y se alejan un poco, y la frase se enciende palabra por palabra (main.js → --p). */
.hero { position: relative; text-align: center; }
.hero-pin {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 72px var(--gutter) 22svh;
  overflow: hidden; /* el resplandor de "god" es más ancho que la pantalla en celular */
  overflow: clip;
}
html.js:not(.reduce) .hero { height: calc(100svh + 110svh); } /* 110svh de recorrido con la escena fija */
html.js:not(.reduce) .hero-pin {
  position: sticky; top: 0;
  height: 100svh; min-height: 0;
  padding: 0 var(--gutter);
  --p: 0; /* avance de la revelación, 0–1 (main.js) */
}

.brand {
  margin: 0;
  display: flex; flex-direction: column; align-items: center;
  font-weight: normal;
  position: relative;
  transform-origin: 50% 0;
}
/* Letras al centro exacto: el descriptor cuelga debajo sin empujarlas */
html.js:not(.reduce) .brand { will-change: transform; }
html.js:not(.reduce) .brand .descriptor {
  position: absolute; top: 100%; left: 50%;
  translate: calc(-50% + .25em) 0; /* .25em: mitad del espaciado final de la última letra */
  margin-right: 0;
}

.letras {
  position: relative;
  will-change: transform, filter; /* capa estable: no se re-crea al terminar la entrada */
  width: var(--w-letras);
  height: auto;
  aspect-ratio: 501 / 366;
}

/* ── Cobre forjado ──────────────────────────────────────────────
   Las letras de René (SVG original, sin redibujar) funcionan como máscara sobre una textura metálica real
   (la foto de lámina con grano, llevada a cobre con la paleta: herramientas/cobre.py).
   Capas: el cobre, el mismo metal al rojo (se enfría al entrar) y un reflejo de fragua que deriva y titila. */
.metal {
  display: block;
  overflow: hidden;
  /* Máscara = las letras de René prerasterizadas (herramientas: alfa del PNG original a 1200 px).
     El SVG de 263 KB como máscara se rasterizaba en vivo y daba un tirón al aparecer. */
  -webkit-mask: url("/assets/img/god-mascara.webp") center / 100% 100% no-repeat;
          mask: url("/assets/img/god-mascara.webp") center / 100% 100% no-repeat;
}
.metal > span { position: absolute; inset: 0; }
/* Cobre liso (del mismo tono que la textura): lo que se ve mientras la textura se decodifica */
.metal-base {
  background:
    linear-gradient(to bottom, rgba(21, 17, 14, 0) 55%, rgba(21, 17, 14, .38)),
    linear-gradient(112deg, #8F3A26 0%, #C9663C 38%, #E99A66 52%, #C9663C 66%, #A8452B 100%);
}
/* La textura real: aparece con un fundido solo cuando ya está decodificada (clase .cobre-listo, main.js).
   Así nunca se pinta a medias: sin cuadros vacíos ni destellos. */
.metal-tex {
  opacity: .001;
  transition: opacity 1.2s cubic-bezier(.4, 0, .2, 1);
  will-change: opacity;
}
/* 1) .cobre-carga: la textura ya está descargada y decodificada; se pinta todavía invisible (desde la caché)
   2) .cobre-listo: fundido */
.cobre-carga .metal-tex {
  background:
    linear-gradient(to bottom, rgba(21, 17, 14, 0) 55%, rgba(21, 17, 14, .38)),
    url("/assets/img/god-cobre.webp") center / cover no-repeat;
}
.cobre-listo .metal-tex { opacity: 1; }
/* Metal al rojo: sin filtros CSS (un filtro que aparece puede dibujar un cuadro negro en Safari) */
.metal-hot {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.15' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E"),
    radial-gradient(120% 95% at 50% 62%, #F08A55 0%, #E0532B 45%, #B8472A 80%, #70292D 100%);
  background-size: 180px 180px, 100% 100%;
  background-blend-mode: soft-light, normal;
  opacity: 0;
  will-change: opacity;
}
/* Reflejo de fragua: una luz cálida suave que recorre el metal sin rumbo fijo y titila como fuego.
   El contenedor (con la máscara radial) se mueve; la textura de adentro se mueve al revés para quedarse quieta. */
.metal > .metal-glint {
  inset: auto;
  left: 0; top: 0;
  width: 70%; height: 70%;
  -webkit-mask: radial-gradient(closest-side, #000 0%, rgba(0, 0, 0, .5) 45%, transparent 100%);
          mask: radial-gradient(closest-side, #000 0%, rgba(0, 0, 0, .5) 45%, transparent 100%);
  opacity: .001; /* casi invisible pero ya pintado: se prepara mientras las letras están a oscuras, sin tirón al aparecer */
  will-change: transform, opacity;
}
.metal-glint > span {
  position: absolute; left: 0; top: 0;
  width: calc(100% / .7); height: calc(100% / .7);
  will-change: transform;
}
.cobre-carga .metal-glint > span {
  /* la textura sobre sí misma en "screen": más luminosa, sin filtro CSS; conserva la sombra de volumen de abajo */
  background:
    linear-gradient(to bottom, rgba(21, 17, 14, 0) 50%, rgba(21, 17, 14, .45)),
    url("/assets/img/god-cobre.webp") center / cover no-repeat,
    url("/assets/img/god-cobre.webp") center / cover no-repeat;
  background-blend-mode: normal, screen, normal;
}
html:not(.reduce) .metal > .metal-glint {
  animation: glint-move 17s ease-in-out infinite, glint-flicker 4.3s ease-in-out infinite; /* desde el inicio: nada nuevo aparece después */
}
html:not(.reduce) .metal-glint > span { animation: glint-counter 17s ease-in-out infinite; }
.reduce .metal > .metal-glint { display: none; }
/* Recorrido por la zona media y alta de las letras (no baja a la cola de la "g", donde el cielo es más claro) */
@keyframes glint-move {
  0%   { transform: translate3d(-35%, 20%, 0); }
  20%  { transform: translate3d(15%, -25%, 0); }
  40%  { transform: translate3d(70%, 10%, 0); }
  60%  { transform: translate3d(85%, 32%, 0); }
  80%  { transform: translate3d(30%, 5%, 0); }
  100% { transform: translate3d(-35%, 20%, 0); }
}
@keyframes glint-counter { /* inverso de glint-move (× .7): la textura no se desplaza */
  0%   { transform: translate3d(24.5%, -14%, 0); }
  20%  { transform: translate3d(-10.5%, 17.5%, 0); }
  40%  { transform: translate3d(-49%, -7%, 0); }
  60%  { transform: translate3d(-59.5%, -22.4%, 0); }
  80%  { transform: translate3d(-21%, -3.5%, 0); }
  100% { transform: translate3d(24.5%, -14%, 0); }
}
@keyframes glint-flicker { /* más sutil: realza el grano sin lavar el cobre */
  0%   { opacity: .32; }
  13%  { opacity: .5; }
  27%  { opacity: .36; }
  41%  { opacity: .6; }
  55%  { opacity: .42; }
  70%  { opacity: .55; }
  84%  { opacity: .3; }
  100% { opacity: .32; }
}

/* Forja: al entrar el metal está al rojo y se enfría hasta el cobre */
.intro-play .letras.metal .metal-hot { animation: cool 2.1s linear .8s backwards; }
@keyframes cool { /* brasa que se enfría despacio: nunca a opacidad completa */
  0%   { opacity: .6; }
  30%  { opacity: .5; }
  60%  { opacity: .28; }
  80%  { opacity: .12; }
  100% { opacity: 0; }
}

/* La fragua: el fuego va detrás de las letras */
.forja {
  position: absolute;
  left: 50%; top: 0;
  width: var(--w-letras);
  aspect-ratio: 501 / 366;
  transform: translateX(-50%);
  pointer-events: none;
}
.forja-glow {
  position: absolute;
  left: -25%; top: -25%;
  width: 150%; height: 150%;
  max-width: none;
  opacity: .55;
}
/* Sombra en Noche ceñida a las letras: separa el metal del cielo naranja (imagen estática, sin costo al animar).
   Está desde el primer cuadro: en el cielo nocturno no se ve y aparece sola cuando amanece. */
.forja-sombra {
  position: absolute;
  left: 50%; top: 0;
  width: var(--w-letras);
  aspect-ratio: 501 / 366;
  transform: translateX(-50%) scale(1.5);
  pointer-events: none;
  height: auto;
  max-width: none;
  opacity: .9;
}
.forja-bloom {
  position: absolute; inset: -30% -20%;
  background: radial-gradient(closest-side, rgba(var(--brasa-rgb), .2), rgba(var(--brasa-rgb), .07) 55%, rgba(var(--brasa-rgb), 0));
}
html:not(.reduce) .forja-glow { animation: breathe 6s ease-in-out 3s infinite; }
@keyframes breathe { 0%, 100% { opacity: .55; } 50% { opacity: .38; } }

.descriptor {
  /* Mismo largo que las letras "god": el tamaño se calcula a partir del ancho de las letras */
  display: block;
  margin-top: calc(var(--w-letras) * .09);
  font-family: 'Montserrat', sans-serif; /* descriptor: Montserrat Bold 700, espaciado .5em (contraste con la gótica) */
  font-weight: 700;
  font-size: calc(var(--w-letras) * .0395);
  line-height: 1;
  letter-spacing: .5em;
  margin-right: -.5em; /* compensa el espaciado final para centrar */
  text-transform: uppercase;
  color: var(--duna);
  white-space: nowrap;
}

.frase {
  margin: calc(var(--w-letras) * .13) 0 0; /* aire entre el descriptor y la frase, proporcional a las letras */
  max-width: 22ch;
  font-family: var(--f-titulo);
  font-weight: 400;
  font-size: clamp(1.45rem, 5.4vw, 2.3rem);
  line-height: 1.12;
  color: var(--hueso);
  text-wrap: balance;
  text-shadow: 0 1px 18px rgba(var(--noche-rgb), .6);
}
.frase-l { display: block; }
/* Con la revelación: la frase espera debajo del descriptor (fuera del flujo, así las letras quedan al centro)
   y cada palabra se enciende como brasa y se enfría a Hueso. --i = orden de la palabra. */
html.js:not(.reduce) .frase {
  position: absolute; left: var(--gutter); right: var(--gutter);
  top: calc(50% + var(--w-letras) * .625); /* mitad de las letras + descriptor + aire */
  margin: 0 auto;
  will-change: transform;
}
html.js:not(.reduce) .frase .w {
  --on: clamp(0, (var(--p) - .16 - var(--i) * .045) * 8, 1);    /* aparece */
  --cool: clamp(0, (var(--p) - .24 - var(--i) * .045) * 4.5, 1); /* se enfría */
  display: inline-block;
  opacity: var(--on);
  transform: translate3d(0, calc((1 - var(--on)) * .5em), 0);
  color: var(--hueso);
  color: color-mix(in srgb, var(--hueso) calc(var(--cool) * 100%), #F08A55);
  text-shadow:
    0 0 calc(.1em + (1 - var(--cool)) * .5em) rgba(var(--brasa-rgb), calc((1 - var(--cool)) * .9)),
    0 1px 18px rgba(var(--noche-rgb), .6);
}

.scroll-hint {
  position: absolute; left: 50%; bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  opacity: calc(.85 - var(--p, 0) * 6); /* se va en cuanto empiezas a deslizar */
  display: grid; place-items: center;
  width: 48px; height: 56px;
  color: var(--duna);
}
html:not(.reduce) .scroll-hint svg { animation: nudge 2.4s ease-in-out 3.2s infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ───────────── Intro: el amanecer en el desierto (≤ 3 s) ───────────── */

.intro-play .sky-dawn  { animation: dawn 1.75s var(--ease-out) .15s backwards; }
.intro-play .sky-sun   { animation: sun 1.7s var(--ease-out) .35s backwards; }
.intro-play .forja     { animation: forge 1.9s cubic-bezier(.4, 0, .2, 1) .7s backwards; }
.intro-play .letras    { animation: emerge 2.2s linear .7s both; }
.intro-play .forja-sombra { animation: sombra-in 2.2s linear .7s both; } /* la sombra y los huecos oscuros llegan con las letras */
.intro-play .descriptor { animation: rise .7s var(--ease-out) 1.9s backwards; }
.intro-play .scroll-hint { animation: fade .5s ease 2.5s backwards; }
.intro-play .dunes     { animation: dunes-in 1.6s var(--ease-out) 0s backwards; }

@keyframes dawn   { from { opacity: 0; transform: translate3d(0, 24%, 0); } }
@keyframes sun    { from { opacity: 0; transform: translate3d(0, 12%, 0) scale(.8); } }
@keyframes forge { /* la fragua enciende pareja, sin parpadeo */
  0%   { opacity: 0; transform: translateX(-50%) scale(.88); }
  100% { opacity: 1; transform: translateX(-50%) scale(1); }
}
/* La luz sube pareja, como un amanecer: sin saltos (antes pasaba de 16 % a 96 % en 0.4 s) */
@keyframes emerge {
  0%   { filter: brightness(.075); transform: translate3d(0, 10px, 0); } /* sin escala: evita re-rasterizar al terminar */
  20%  { filter: brightness(.14);  transform: translate3d(0, 7px, 0); }
  40%  { filter: brightness(.3);   transform: translate3d(0, 4.5px, 0); }
  60%  { filter: brightness(.55);  transform: translate3d(0, 2.4px, 0); }
  80%  { filter: brightness(.82);  transform: translate3d(0, .8px, 0); }
  100% { filter: brightness(1);    transform: none; }
}
@keyframes sombra-in { /* de casi invisible (ya pintada: sin tirón) a su opacidad, al ritmo de la luz de las letras */
  0%   { opacity: .001; }
  40%  { opacity: .2; }
  100% { opacity: .9; }
}
@keyframes rise   { from { opacity: 0; transform: translate3d(0, 12px, 0); } }
@keyframes fade   { from { opacity: 0; } }
@keyframes dunes-in { from { filter: brightness(.4); } }

/* ───────────────────────── Invitación ───────────────────────── */

.invite {
  padding: clamp(80px, 16svh, 160px) var(--gutter) clamp(56px, 10svh, 110px);
  max-width: 1080px; margin: 0 auto;
  text-align: center;
}
.coords {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline;
  gap: .3em 1em;
  margin: 0 0 clamp(26px, 5svh, 40px);
  font-family: var(--f-dato); font-stretch: 125%; font-weight: 500;
  font-size: clamp(14px, 4vw, 18px); letter-spacing: .06em;
  color: var(--duna);
}
.coord { white-space: nowrap; }
.coord b { display: inline-flex; gap: .16em; margin-right: .1em; font-weight: inherit; }
/* Ranura de una cifra: la sede es sorpresa. Con JS, cada ranura lleva un rodillo de cifras que gira sin parar
   (main.js las desordena y les da su propia velocidad); los bordes se desvanecen para que el giro se vea suave. */
.coord i {
  position: relative;
  display: inline-block;
  width: .66em; height: 1.1em;
  vertical-align: -.24em;
  overflow: hidden;
  border-bottom: 1.5px solid rgba(var(--duna-rgb), .85);
  font-style: normal; line-height: 1.1; text-align: center;
  color: rgba(var(--duna-rgb), .78);
  font-variant-numeric: tabular-nums;
}
.coords.rodando i {
  -webkit-mask: linear-gradient(transparent 6%, #000 38%, #000 62%, transparent 94%), linear-gradient(#000, #000) bottom / 100% 2px no-repeat;
          mask: linear-gradient(transparent 6%, #000 38%, #000 62%, transparent 94%), linear-gradient(#000, #000) bottom / 100% 2px no-repeat;
}
.rodillo {
  position: absolute; left: 0; right: 0; top: 0;
  white-space: pre;
  animation: rodar 3s linear infinite;
  will-change: transform;
}
.coords.pausa .rodillo { animation-play-state: paused; }
@keyframes rodar { to { transform: translate3d(0, -90.909%, 0); } } /* 10 de 11 renglones: vuelve al inicio sin salto */
.coords-sep { color: var(--brasa); font-size: .8em; }
.invite-title {
  margin: 0 auto;
  max-width: 14ch;
  font-family: var(--f-titulo); font-weight: 600;
  font-size: clamp(2.5rem, 11vw, 5.2rem);
  line-height: .98;
  letter-spacing: -.005em;
  text-wrap: balance;
}
/* "En algún lugar del" en la misma gótica, más ligera y pequeña: el remate es "Gran Desierto de Chihuahua." */
.invite-pre {
  display: block;
  margin: 0 0 .28em;
  font-weight: 400;
  font-size: .5em;
  line-height: 1.1;
  color: var(--duna);
}
.soon {
  display: inline-block;
  margin: 26px 0 0;
  padding: 10px 18px 10px calc(18px + .38em);
  border-top: 1px solid rgba(var(--duna-rgb), .45);
  border-bottom: 1px solid rgba(var(--duna-rgb), .45);
  font-family: var(--f-dato); font-stretch: 125%; font-weight: 600;
  font-size: 13px; letter-spacing: .38em; text-transform: uppercase;
  color: var(--duna);
}
/* ───────────────────────── Introducción ───────────────────────── */

.intro {
  max-width: 760px; margin: 0 auto;
  padding: clamp(24px, 5svh, 56px) var(--gutter) clamp(72px, 12svh, 120px);
  text-align: center;
}
.intro-title {
  margin: 0 auto;
  max-width: 17ch;
  font-family: var(--f-titulo); font-weight: 600;
  font-size: clamp(2rem, 8.4vw, 3.4rem);
  line-height: 1.02;
  color: var(--hueso);
  text-wrap: balance;
}
.intro-text {
  margin: 22px auto 0;
  max-width: 28ch; /* ≈36 caracteres por línea en celular (1ch = ancho del "0", más ancho que la letra promedio) */
  font-family: var(--f-texto); font-weight: 400;
  font-size: 17px;
  line-height: 1.7;
  color: var(--hueso);
  text-wrap: pretty;
}
.intro-rule {
  display: block;
  width: 48px; height: 1px;
  margin: clamp(44px, 8svh, 72px) auto clamp(26px, 4svh, 36px);
  background: rgba(var(--duna-rgb), .6);
}
.intro-sub {
  margin: 0;
  font-family: var(--f-titulo); font-weight: 600;
  font-size: clamp(1.5rem, 5.6vw, 2.1rem);
  line-height: 1.1;
  color: var(--duna);
}
.intro-sub + .intro-text { margin-top: 16px; }

/* ───────────────────────── Registro ───────────────────────── */

.registro {
  padding: 0 var(--gutter) clamp(80px, 14svh, 140px);
  scroll-margin-top: 16px;
}
.panel {
  position: relative;
  max-width: 540px; margin: 0 auto;
  padding: clamp(28px, 6vw, 48px) clamp(22px, 6vw, 48px) clamp(28px, 5vw, 40px);
  background: linear-gradient(180deg, rgba(58, 28, 42, .55), rgba(var(--noche-rgb), .92) 38%), rgba(var(--noche-rgb), .9);
  border: 1px solid rgba(var(--duna-rgb), .2);
  border-radius: 4px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
}
.panel::before { /* filo de luz en el borde superior */
  content: ""; position: absolute; left: 12%; right: 12%; top: -1px; height: 1px;
  background: linear-gradient(90deg, rgba(var(--brasa-rgb), 0), var(--brasa), rgba(var(--brasa-rgb), 0));
}
.eyebrow {
  margin: 0 0 14px;
  font-family: var(--f-dato); font-stretch: 125%; font-weight: 600;
  font-size: 11.5px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--duna);
}
.panel-title {
  margin: 0;
  font-family: var(--f-titulo); font-weight: 600;
  font-size: clamp(2.2rem, 9vw, 3.1rem);
  line-height: 1;
}
.panel-sub {
  margin: 12px 0 30px;
  color: rgba(var(--hueso-rgb), .78);
  font-size: 16px;
}

.field { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.field label, .field legend {
  display: flex; align-items: baseline; gap: 10px;
  margin: 0 0 8px; padding: 0;
  font-size: 15px; font-weight: 600;
  color: var(--hueso);
}
.label-hint {
  font-family: var(--f-dato); font-stretch: 125%; font-weight: 500;
  font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--duna);
}
.field legend { display: block; line-height: 1.35; }

input[type="text"], input[type="tel"] {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  font: 500 17px/1 var(--f-texto);
  color: var(--hueso);
  background: rgba(var(--hueso-rgb), .04);
  border: 1px solid rgba(var(--duna-rgb), .32);
  border-radius: 3px;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
input::placeholder { color: rgba(var(--hueso-rgb), .34); }
input[type="text"]:hover, input[type="tel"]:hover { border-color: rgba(var(--duna-rgb), .55); }
input[type="text"]:focus, input[type="tel"]:focus {
  outline: none;
  border-color: var(--duna);
  background: rgba(var(--hueso-rgb), .07);
  box-shadow: 0 0 0 3px rgba(var(--duna-rgb), .18);
}
input[aria-invalid="true"] { border-color: var(--brasa) !important; }
input:-webkit-autofill {
  -webkit-text-fill-color: var(--hueso);
  -webkit-box-shadow: 0 0 0 100px #231a18 inset;
  caret-color: var(--hueso);
}

/* Celular: selector de lada (bandera + código; al tocarlo abre la lista nativa con los nombres) + número */
.input-tel {
  display: flex; align-items: stretch;
  height: 54px;
  background: rgba(var(--hueso-rgb), .04);
  border: 1px solid rgba(var(--duna-rgb), .32);
  border-radius: 3px;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.input-tel:hover { border-color: rgba(var(--duna-rgb), .55); }
.input-tel:focus-within {
  border-color: var(--duna);
  background: rgba(var(--hueso-rgb), .07);
  box-shadow: 0 0 0 3px rgba(var(--duna-rgb), .18);
}
.input-tel:has(input[aria-invalid="true"]) { border-color: var(--brasa); }
.input-tel input[type="tel"],
.input-tel input[type="tel"]:hover,
.input-tel input[type="tel"]:focus {
  flex: 1; min-width: 0; height: 100%;
  padding: 0 14px;
  border: 0; background: transparent; box-shadow: none;
}
.lada {
  position: relative; flex: 0 0 auto;
  display: flex; align-items: center; gap: 7px;
  padding: 0 12px 0 14px;
  border-right: 1px solid rgba(var(--duna-rgb), .22);
  font-family: var(--f-dato); font-stretch: 125%; font-weight: 500; font-size: 14px;
  color: var(--duna);
}
.lada-visible { display: flex; align-items: center; gap: 7px; pointer-events: none; }
.lada-flag { font-size: 18px; line-height: 1; font-stretch: normal; }
.lada::after { /* flecha */
  content: ""; width: 6px; height: 6px; margin: -3px 0 0 1px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); opacity: .8; pointer-events: none;
}
.lada select {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
  font-size: 16px; /* evita el zoom de iOS al tocarlo */
  border: 0;
}
.lada:has(select:focus-visible) { outline: 2px solid var(--duna); outline-offset: -3px; border-radius: 2px; }

.input-affix { position: relative; }
.input-affix .affix {
  position: absolute; left: 0; top: 0; bottom: 0; width: 58px;
  display: grid; place-items: center;
  font-family: var(--f-dato); font-stretch: 125%; font-weight: 500; font-size: 14px;
  color: var(--duna);
  border-right: 1px solid rgba(var(--duna-rgb), .22);
  pointer-events: none;
}
.input-affix input { padding-left: 72px; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field .choice { position: relative; display: block; cursor: pointer; margin: 0; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: grid; place-items: center;
  height: 54px;
  font-family: var(--f-dato); font-stretch: 125%; font-weight: 600; font-size: 14px;
  letter-spacing: .22em; text-transform: uppercase;
  padding-left: .22em;
  color: var(--hueso);
  border: 1px solid rgba(var(--duna-rgb), .32);
  border-radius: 3px;
  background: rgba(var(--hueso-rgb), .04);
  transition: border-color .2s, background-color .2s, color .2s;
}
.choice:hover span { border-color: rgba(var(--duna-rgb), .6); }
.choice input:checked + span {
  color: var(--noche);
  background: var(--duna);
  border-color: var(--duna);
}
.choice input:focus-visible + span { outline: 2px solid var(--duna); outline-offset: 3px; }
.field-choice[data-invalid="true"] .choice span { border-color: var(--brasa); }

.field-error {
  margin: 7px 0 0;
  min-height: 0;
  font-size: 14px; font-weight: 600;
  color: var(--brasa);
}
.field-error:empty { display: none; }

.hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px;
  padding: 0 26px;
  font: 700 16px/1 var(--f-texto);
  letter-spacing: .01em;
  text-decoration: none;
  border-radius: 3px;
  cursor: pointer;
  transition: transform .15s, box-shadow .25s, background-color .2s, border-color .2s, color .2s;
}
.btn-brasa {
  width: 100%;
  margin-top: 10px;
  color: var(--noche);
  background: var(--brasa);
  border: 0;
  box-shadow: 0 10px 34px -12px rgba(var(--brasa-rgb), .75);
  position: relative;
}
.btn-brasa:hover { box-shadow: 0 12px 44px -10px rgba(var(--brasa-rgb), .95); }
.btn-brasa:active { transform: translateY(1px); }
.btn-brasa[disabled] { cursor: progress; }
.btn-spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(var(--noche-rgb), .3);
  border-top-color: var(--noche);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.is-sending .btn-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-ghost {
  color: var(--hueso);
  background: transparent;
  border: 1px solid rgba(var(--duna-rgb), .5);
}
.btn-ghost:hover { border-color: var(--duna); background: rgba(var(--duna-rgb), .08); }

/* Redes: mismo botón para Instagram y Facebook — Duna, hover en Brasa */
.btn svg { flex-shrink: 0; } /* el ícono nunca se encoge */
.social {
  display: flex; justify-content: center; gap: 12px;
  width: 100%; max-width: 560px; margin-left: auto; margin-right: auto;
  container-type: inline-size;
}
.btn-social {
  flex: 1 1 0; min-width: 0; max-width: 176px;
  padding: 0 14px;
  color: var(--duna);
  background: transparent;
  border: 1px solid rgba(var(--duna-rgb), .55);
}
.btn-social:hover, .btn-social:focus-visible {
  color: var(--brasa);
  border-color: var(--brasa);
  background: rgba(var(--brasa-rgb), .07);
}
/* Si no caben los tres con texto (celular), quedan como íconos cuadrados iguales en una fila; el nombre sigue para lectores de pantalla */
@container (max-width: 440px) {
  .btn-social { flex: 0 0 56px; width: 56px; padding: 0; }
  .social-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  .btn-social svg { width: 22px; height: 22px; }
}

.form-status { margin-top: 14px; font-size: 15px; }
.form-status:empty { display: none; }
.form-status.is-error {
  padding: 14px 16px;
  border: 1px solid rgba(var(--brasa-rgb), .6);
  border-radius: 3px;
  background: rgba(var(--brasa-rgb), .08);
}
.form-status p { margin: 0 0 10px; }
.btn-retry {
  font: 700 14px/1 var(--f-texto);
  color: var(--hueso);
  background: none;
  border: 1px solid rgba(var(--hueso-rgb), .45);
  border-radius: 3px;
  padding: 10px 14px;
  cursor: pointer;
}
.btn-retry:hover { border-color: var(--hueso); }

.legal {
  margin: 18px 0 0;
  font-size: 13.5px;
  color: rgba(var(--hueso-rgb), .66);
  text-align: center;
}
.legal a { color: var(--duna); text-underline-offset: 3px; }

/* Éxito */
.panel-ok { text-align: center; padding: 8px 0 6px; }
.panel-ok[hidden] { display: none; }
.mini-forja {
  position: relative;
  width: 150px; margin: 0 auto 26px;
  aspect-ratio: 501 / 366;
}
.mini-glow {
  position: absolute; left: -25%; top: -25%; width: 150%; height: 150%; max-width: none;
  opacity: .85;
}
.mini-letras { position: relative; display: block; width: 100%; aspect-ratio: 501 / 366; }
.panel-ok.is-lit .mini-glow { animation: reignite 1.8s cubic-bezier(.3, .6, .3, 1) both; }
.panel-ok.is-lit .mini-letras { animation: emerge 1.1s var(--ease-out) .1s backwards; }
.panel-ok.is-lit .metal-hot { animation: cool 1.6s cubic-bezier(.3, .1, .3, 1) .15s backwards; }
@keyframes reignite {
  0% { opacity: 0; transform: scale(.7); }
  35% { opacity: 1; transform: scale(1.12); }
  50% { opacity: .6; }
  70% { opacity: 1; transform: scale(1.02); }
  100% { opacity: .85; transform: scale(1); }
}
.ok-title {
  margin: 0;
  font-family: var(--f-titulo); font-weight: 600;
  font-size: clamp(2.2rem, 9vw, 3rem);
  line-height: 1;
}
.ok-title:focus { outline: none; }
.ok-sub { margin: 10px 0 28px; font-size: 18px; color: rgba(var(--hueso-rgb), .8); }

/* Marcadores de datos pendientes (visibles a propósito) */
[data-pendiente] { position: relative; margin-bottom: 22px; }
[data-pendiente]::after {
  content: attr(data-pendiente);
  position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%);
  white-space: nowrap;
  font: 600 11px/1 var(--f-texto);
  color: var(--noche); background: var(--duna);
  padding: 4px 6px; border-radius: 2px;
}
.pendiente {
  color: var(--noche);
  background: var(--duna);
  padding: 0 .25em;
  border-radius: 2px;
  font-weight: 600;
}

/* ───────────────────────── Pie ───────────────────────── */

.pie {
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  padding: 56px var(--gutter) calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(var(--duna-rgb), .16);
  background: var(--noche);
  text-align: center;
}
.pie-contacto {
  margin: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.pie-contacto-label {
  font-family: var(--f-dato); font-stretch: 125%; font-weight: 500;
  font-size: 11px; letter-spacing: .3em; margin-right: -.3em; text-transform: uppercase;
  color: var(--duna);
}
.pie-contacto a {
  font-family: var(--f-titulo); font-weight: 400;
  font-size: clamp(1.35rem, 5vw, 1.6rem);
  color: var(--hueso);
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--duna-rgb), .45);
  padding-bottom: 2px;
  transition: border-color .2s, color .2s;
}
.pie-contacto a:hover { border-color: var(--brasa); }
.pie-links a {
  font-size: 14.5px;
  color: var(--duna);
  text-underline-offset: 3px;
}
.pie-firma {
  margin: 0;
  font-family: var(--f-dato); font-stretch: 125%; font-weight: 500;
  font-size: clamp(9.5px, 2.6vw, 11.5px); letter-spacing: .24em; text-transform: uppercase;
  white-space: nowrap;
  color: rgba(var(--duna-rgb), .8);
}

/* ───────────────────────── Página legal ───────────────────────── */

.legal-page .stage { position: absolute; height: 100vh; }
.page-404 .doc { min-height: calc(100svh - 150px); } /* página corta: el pie queda debajo del cielo, sobre Noche */
.legal-head {
  position: relative; z-index: 1;
  display: flex; justify-content: center;
  padding: 36px var(--gutter) 0;
}
.legal-head a { display: block; width: 110px; }
.doc {
  position: relative; z-index: 1;
  max-width: 680px; margin: 0 auto;
  padding: 40px var(--gutter) 90px;
}
.doc-card {
  padding: clamp(26px, 6vw, 52px);
  background: rgba(var(--noche-rgb), .93);
  border: 1px solid rgba(var(--duna-rgb), .18);
  border-radius: 4px;
}
.doc h1 {
  margin: 0 0 6px;
  font-family: var(--f-titulo); font-weight: 600;
  font-size: clamp(2.1rem, 8vw, 3rem); line-height: 1;
}
.doc .doc-sub {
  margin: 0 0 34px;
  font-family: var(--f-dato); font-stretch: 125%; font-weight: 500;
  font-size: 11.5px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--duna);
}
.doc h2 {
  margin: 34px 0 10px;
  font-family: var(--f-titulo); font-weight: 600;
  font-size: 1.55rem; line-height: 1.1;
  color: var(--hueso);
}
.doc h3 {
  margin: 18px 0 6px;
  font-size: 15px; font-weight: 700; color: var(--duna);
}
.doc p, .doc li { color: rgba(var(--hueso-rgb), .86); }
.doc a { color: var(--duna); text-underline-offset: 3px; }
.doc ul { padding-left: 1.2em; margin: 6px 0 0; }
.doc li { margin-bottom: 6px; }
.doc li::marker { color: var(--brasa); }
.doc .updated {
  margin-top: 40px; padding-top: 20px;
  border-top: 1px solid rgba(var(--duna-rgb), .2);
  font-size: 14px;
}
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 30px;
  font-weight: 600; color: var(--duna); text-underline-offset: 3px;
}

/* ───────────────────────── Responsive ───────────────────────── */

@media (min-width: 900px) {
  body { font-size: 18px; }
  .intro-text { font-size: 19px; max-width: 36ch; }
  .intro-title { max-width: 24ch; }
  .hero-pin { padding-bottom: 24vh; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .hero-pin { padding-top: 32px; padding-bottom: 32px; }
  .scroll-hint { display: none; }
}

/* Movimiento reducido: estado final, sin animaciones */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
  }
}
