/* =========================================================================
   Josué y Claudia · Invitación digital
   Sistema visual: tema oscuro único (paleta tomada de la foto de portada).
   Formas: botones en píldora, superficies 14px, papel 6px, imágenes en arco.
   Capas (z-index): contenido 1-6 · nav 40 · burst 70 · grano 80 · preloader 90
   ========================================================================= */

@font-face {
  font-family: "Cormorant";
  src: url("../assets/fonts/cormorant-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant";
  src: url("../assets/fonts/cormorant-latin-wght-italic.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("../assets/fonts/jost-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Fondos: sombras del bosque, pino nocturno y cielo profundo */
  --bg: #0a1613;
  --bg-2: #0e1f1a;
  --bg-3: #0b2023;
  --surface: #11261f;
  --surface-2: #163029;

  /* Texto */
  --text: #ece4cf;
  --text-2: #c4bda6;
  --muted: #979683;

  /* Acento único: dorado */
  --gold: #d6b46a;
  --gold-hi: #f2e0a6;
  --gold-lo: #a7823e;
  --gold-line: rgba(214, 180, 106, 0.26);
  --gold-soft: rgba(214, 180, 106, 0.1);
  --gold-foil: linear-gradient(100deg, #a07a36 0%, #d8b765 18%, #f6e7b6 30%, #d2ad5c 44%, #9c7633 58%, #e3c67f 76%, #b38b44 100%);

  /* Ilustración (papel, lacre, pétalos) */
  --paper: #77714f;
  --paper-hi: #8a845f;
  --paper-lo: #5d583d;
  --wax: #8f1d24;
  --petal: #b3262e;
  --teal: #1f8f9f;

  --font-serif: "Cormorant", "Cormorant Garamond", "Times New Roman", Times, serif;
  --font-sans: "Jost", "Futura", "Avenir Next", system-ui, sans-serif;

  --radius: 14px;
  --radius-paper: 6px;
  --gutter: clamp(16px, 4vw, 48px);
  --nav-h: 68px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 350;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

/* El overflow del body pasa a la ventana y Safari en iOS lo ignora para el zoom.
   Recortar en los contenedores evita que una animación más ancha que la pantalla
   (p. ej. la solapa del sobre girando en 3D) haga que iOS aleje la página. */
main,
.footer { overflow-x: clip; }

/* Grano fílmico fijo, igual que la textura de la foto */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0.055;
  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='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg, canvas, iframe { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
em { font-style: italic; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

html.lenis, html.lenis body { height: auto; }
/* Reserva el espacio de la barra de scroll: el ancho no cambia al pausar el scroll */
html { scrollbar-gutter: stable; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: hidden; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }

::selection { background: rgba(214, 180, 106, 0.35); color: var(--text); }

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

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg:not([fill]) { fill: currentColor; }
.icon { width: 1.15em; height: 1.15em; flex: none; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 95;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--bg);
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease-out);
}
.skip-link:focus-visible { transform: none; }

.container {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Tipografía ------------------------------------------------------------ */

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-2);
}

h2 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2.7rem, 5.6vw, 5.2rem);
  line-height: 1.06;
  letter-spacing: -0.012em;
  color: var(--text);
  text-wrap: balance;
}
h2 em {
  font-weight: 400;
  color: var(--gold);
  padding-right: 0.04em;
}

.line-mask { padding-bottom: 0.14em; margin-bottom: -0.14em; }

/* Botones (píldora) ------------------------------------------------------ */

.btn {
  --btn-pad-y: 0.95em;
  --btn-pad-x: 1.8em;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.25s var(--ease-out), color 0.35s var(--ease-out), border-color 0.35s, background-color 0.35s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-sm { font-size: 0.72rem; --btn-pad-y: 0.8em; --btn-pad-x: 1.35em; }
.btn-lg { font-size: 0.86rem; --btn-pad-y: 1.15em; --btn-pad-x: 2.4em; }
.btn-block { width: 100%; }

.btn-gold {
  background: var(--gold);
  color: #10180f;
  box-shadow: 0 10px 30px -12px rgba(214, 180, 106, 0.55), inset 0 1px 0 rgba(255, 246, 214, 0.55);
}
.btn-gold::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 249, 228, 0.65) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.9s var(--ease-out);
}
.btn-gold:hover::before { transform: translateX(120%); }

.btn-outline {
  background: rgba(10, 22, 19, 0.35);
  border-color: var(--gold-line);
  color: var(--gold-hi);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.btn-outline::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--gold);
  border-radius: inherit;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.45s var(--ease-out);
}
.btn-outline:hover { color: #10180f; border-color: var(--gold); }
.btn-outline:hover::before { transform: scaleY(1); }

.btn-ghost { background: transparent; color: var(--text-2); border-color: rgba(236, 228, 207, 0.14); }
.btn-ghost:hover { color: var(--text); border-color: rgba(236, 228, 207, 0.3); }

.btn[disabled] { cursor: progress; }
.btn.is-loading .btn-label { opacity: 0.55; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  left: 18%; right: 18%; bottom: 9px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #10180f, transparent);
  animation: loading-line 1.1s var(--ease-in-out) infinite;
}
@keyframes loading-line {
  from { transform: translateX(-60%) scaleX(0.3); }
  to { transform: translateX(60%) scaleX(0.3); }
}

.link-btn {
  background: none;
  border: 0;
  padding: 0.4em 0;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  text-decoration: underline;
  text-decoration-color: var(--gold-line);
  text-underline-offset: 6px;
  transition: color 0.3s, text-decoration-color 0.3s;
}
.link-btn:hover { color: var(--gold-hi); text-decoration-color: var(--gold); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(236, 228, 207, 0.16);
  background: transparent;
  transition: border-color 0.3s, background-color 0.3s;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { border-color: var(--gold); background: var(--gold-soft); }

/* Preloader ----------------------------------------------------------- */

.preloader { display: none; }
.motion .preloader {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(31, 143, 159, 0.12), transparent 60%),
    var(--bg);
  clip-path: inset(0 0 0 0);
}
.motion.is-loaded .preloader { pointer-events: none; }
.motion.is-loaded.preloader-done .preloader { display: none; }

.preloader-mark { position: relative; width: 132px; height: 132px; display: grid; place-items: center; }
.preloader-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.preloader-ring circle {
  fill: none;
  stroke: var(--gold);
  stroke-width: 0.8;
  stroke-dasharray: 358;
  stroke-dashoffset: 358;
  animation: ring-draw 1.6s var(--ease-in-out) forwards 0.15s;
}
@keyframes ring-draw { to { stroke-dashoffset: 0; } }
.preloader-mono {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 2.9rem;
  letter-spacing: 0.02em;
  color: var(--gold);
  opacity: 0;
  animation: fade-in 1s var(--ease-out) forwards 0.35s;
}
.preloader-mono em { font-size: 0.8em; padding: 0 0.04em; }
@keyframes fade-in { to { opacity: 1; } }

/* Navegación ----------------------------------------------------------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-inline: var(--gutter);
  padding-top: env(safe-area-inset-top);
  transition: background-color 0.5s var(--ease-out), border-color 0.5s, backdrop-filter 0.5s;
  border-bottom: 1px solid transparent;
}
.nav.is-solid {
  background: rgba(10, 22, 19, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: rgba(214, 180, 106, 0.12);
}
.nav-mono {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 400;
  line-height: 1;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.nav-mono em { font-size: 0.82em; padding: 0 0.04em; }
.nav-links {
  display: none;
  gap: clamp(20px, 3vw, 44px);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.nav-links a {
  position: relative;
  font-size: 0.74rem;
  font-weight: 450;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-2);
  text-decoration: none;
  padding: 6px 0;
  transition: color 0.3s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease-out);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.is-active::after { transform: scaleX(1); transform-origin: left; }
.nav-cta { transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out), color 0.35s, border-color 0.35s; }
.nav.cta-hidden .nav-cta { opacity: 0; transform: translateY(-8px); pointer-events: none; }

@media (min-width: 960px) {
  .nav-links { display: flex; }
}

/* PORTADA + HISTORIA ==================================================== */

.intro { position: relative; }

.stage { position: relative; }

.hero {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
}

.stage-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background-color: var(--bg);
  background-size: cover;
  background-position: 50% 50%;
}
/* La ventana del arco usa las mismas variables que el marco dorado y las fotos,
   y "100%" (el ancho/alto real del elemento), así nunca se desalinean. */
.motion .stage-media {
  --m: 0;
  clip-path: inset(
    calc(var(--arch-y, 0px) * var(--m))
    calc((100% - var(--arch-x, 0px) - var(--arch-w, 0px)) * var(--m))
    calc((100% - var(--arch-y, 0px) - var(--arch-h, 0px)) * var(--m))
    calc(var(--arch-x, 0px) * var(--m))
    round calc(var(--arch-w, 0px) * 0.5 * var(--m)) calc(var(--arch-w, 0px) * 0.5 * var(--m)) 0px 0px
  );
}
.stage-parallax { position: absolute; inset: 0; }
.stage-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% 50%;
  transform-origin: 0 0;
}
.stage-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 18, 16, 0.62) 0%, rgba(8, 18, 16, 0.18) 30%, rgba(8, 18, 16, 0) 46%),
    linear-gradient(0deg, rgba(8, 18, 16, 0.86) 0%, rgba(8, 18, 16, 0.38) 22%, rgba(8, 18, 16, 0) 42%),
    radial-gradient(ellipse 85% 75% at 50% 52%, transparent 55%, rgba(8, 18, 16, 0.5) 100%);
}

/* Fotos de la historia: viven dentro del arco (solo en la versión animada) */
.arch-photos { display: none; }
.motion .arch-photos {
  display: block;
  position: absolute;
  left: var(--arch-x, 0px);
  top: var(--arch-y, 0px);
  width: var(--arch-w, 0px);
  height: var(--arch-h, 0px);
}
.arch-photo {
  position: absolute;
  inset: 0;
  margin: 0;
  overflow: hidden;
  clip-path: inset(100% 0% 0% 0%);
}
.arch-photo img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% 50%;
  transform-origin: 50% 60%;
}

.hero-copy {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  text-align: center;
  padding: calc(var(--nav-h) + clamp(28px, 8vh, 96px)) var(--gutter) max(28px, calc(env(safe-area-inset-bottom) + 24px));
}

.hero-eyebrow { color: var(--text); text-shadow: 0 1px 12px rgba(8, 18, 16, 0.6); }

.logo {
  margin-top: clamp(10px, 2vh, 22px);
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(3.9rem, 10.4vw, 10.5rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  column-gap: 0.22em;
  filter: drop-shadow(0 2px 18px rgba(6, 16, 13, 0.55)) drop-shadow(0 1px 1px rgba(6, 16, 13, 0.5));
  align-self: start;
}
.logo-word, .logo-y, .logo .char {
  background-image: var(--gold-foil);
  background-size: 220% 100%;
  background-position: var(--sx, 30%) 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.logo-word { padding-bottom: 0.08em; }
.logo-y {
  font-style: italic;
  font-weight: 400;
  font-size: 0.62em;
  padding: 0 0.04em 0.12em;
}
.logo .char { padding-bottom: 0.1em; }
.logo .char-mask { padding: 0.08em 0.1em 0.3em; margin: -0.08em -0.1em -0.3em; }
.logo.is-split .logo-word,
.logo.is-split .logo-y { background: none; color: var(--gold); -webkit-text-fill-color: currentColor; }
.logo.is-split .char {
  background-size: var(--foil-w, 220%) 100%;
  background-position: calc(var(--sx, 0px) - var(--ox, 0px)) 50%;
}

.hero-foot {
  display: grid;
  justify-items: center;
  gap: 22px;
}
.hero-phrase {
  max-width: 38ch;
  margin-bottom: clamp(8px, 3vh, 32px);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.3rem, 2.1vw, 1.8rem);
  line-height: 1.4;
  color: var(--text);
  text-shadow: 0 1px 16px rgba(8, 18, 16, 0.9), 0 0 2px rgba(8, 18, 16, 0.6);
  text-wrap: balance;
}

@media (max-width: 640px) {
  .stage-scrim {
    background:
      linear-gradient(180deg, rgba(8, 18, 16, 0.72) 0%, rgba(8, 18, 16, 0.42) 32%, rgba(8, 18, 16, 0) 52%),
      linear-gradient(0deg, rgba(8, 18, 16, 0.9) 0%, rgba(8, 18, 16, 0.4) 22%, rgba(8, 18, 16, 0) 40%);
  }
  .logo { flex-direction: column; align-items: center; row-gap: 0; font-size: clamp(3.6rem, 18vw, 5.4rem); line-height: 0.95; }
  .logo-y { font-size: 0.5em; margin: -0.05em 0; }
  .hero-copy { padding-top: calc(var(--nav-h) + 6vh); }
}

/* Arco dorado que enmarca la foto en la historia */
.arch-frame { display: none; }

/* Historia: versión estática (sin animación) --------------------------- */

.story {
  position: relative;
  padding: clamp(96px, 14vh, 160px) var(--gutter);
  max-width: 1200px;
  margin-inline: auto;
}
.story-title { text-align: center; margin-bottom: clamp(48px, 8vh, 96px); }
.chapters {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(64px, 10vh, 120px);
}
.chapter {
  display: grid;
  gap: 20px;
  justify-items: center;
  text-align: center;
}
.chapter-media {
  margin: 0 0 12px;
  width: min(320px, 74vw);
  aspect-ratio: 0.72;
  border-radius: 999px 999px 0 0;
  overflow: hidden;
  outline: 1px solid var(--gold-line);
  outline-offset: 10px;
}
.chapter-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
.chapter-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  line-height: 1.1;
  color: var(--gold);
}
.chapter-text {
  max-width: 34ch;
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 1.55vw, 1.45rem);
  line-height: 1.55;
  color: var(--text-2);
}
.story-progress { display: none; }

@media (min-width: 900px) {
  .chapter { grid-template-columns: 1fr 1fr; text-align: left; justify-items: start; align-items: center; column-gap: 64px; }
  .chapter-media { grid-row: span 2; justify-self: end; }
  .chapter-title { align-self: end; }
  .chapter-text { align-self: start; }
}

/* Historia: versión cinematográfica (con animación) -------------------- */

.motion .stage {
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
}
.motion .hero { position: absolute; inset: 0; min-height: 0; }
.motion .hero-copy { min-height: 100%; height: 100%; }

.motion .arch-frame {
  display: block;
  position: absolute;
  z-index: 3;
  left: calc(var(--arch-x, 0px) - 12px);
  top: calc(var(--arch-y, 0px) - 12px);
  width: calc(var(--arch-w, 0px) + 24px);
  height: calc(var(--arch-h, 0px) + 24px);
  border: 1px solid var(--gold-line);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
.motion .arch-frame::after {
  content: "";
  position: absolute;
  left: -40px; right: -40px; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line) 20%, var(--gold-line) 80%, transparent);
}

.motion .story {
  position: absolute;
  inset: 0;
  z-index: 4;
  max-width: none;
  margin: 0;
  padding: 0;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
.motion .story-title {
  position: absolute;
  margin: 0;
  text-align: left;
  font-size: clamp(2.4rem, 4.2vw, 4.2rem);
}
.motion .chapters { position: absolute; display: grid; gap: 0; }
.motion .chapter {
  grid-area: 1 / 1;
  display: block;
  text-align: left;
  opacity: 0;
  visibility: hidden;
}
.motion .chapter-media { display: none; }
.motion .chapter-title { margin-bottom: 18px; font-size: clamp(2.1rem, 3.3vw, 3.1rem); }
.motion .chapter-text { max-width: 30ch; }

.motion .story-progress {
  position: absolute;
  display: flex;
  gap: 8px;
}
.story-progress span {
  position: relative;
  width: 38px;
  height: 1px;
  background: rgba(236, 228, 207, 0.18);
  overflow: hidden;
}
.story-progress span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.7s var(--ease-out);
}
.story-progress span.is-on::after { transform: scaleX(1); }

/* Posición del texto según el diseño calculado en JS */
.motion .stage[data-layout="split"] .story-title { left: 54vw; top: calc(var(--arch-y) + 4px); }
.motion .stage[data-layout="split"] .chapters { left: 54vw; top: calc(var(--arch-y) + var(--arch-h) * 0.3); width: min(36vw, 520px); }
.motion .stage[data-layout="split"] .story-progress { left: 54vw; bottom: calc(100% - var(--arch-y) - var(--arch-h) + 2px); }

.motion .stage[data-layout="stack"] .story-title {
  left: 50%;
  transform: translateX(-50%);
  top: calc(var(--arch-y) + var(--arch-h) + 50px);
  font-size: clamp(1rem, 4vw, 1.25rem);
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-2);
  white-space: nowrap;
}
.motion .stage[data-layout="stack"] .story-title em { color: var(--gold); font-style: normal; font-weight: 500; }
.motion .stage[data-layout="stack"] .chapters {
  left: var(--gutter);
  right: var(--gutter);
  top: calc(var(--arch-y) + var(--arch-h) + 94px);
}
.motion .stage[data-layout="stack"] .chapter { text-align: center; }
.motion .stage[data-layout="stack"] .chapter-title { font-size: clamp(1.9rem, 8vw, 2.4rem); margin-bottom: 10px; }
.motion .stage[data-layout="stack"] .chapter-text { margin-inline: auto; font-size: clamp(1.08rem, 4.4vw, 1.28rem); line-height: 1.5; }
.motion .stage[data-layout="stack"] .story-progress { left: 50%; transform: translateX(-50%); top: calc(var(--arch-y) + var(--arch-h) + 30px); }

@media (max-height: 700px) {
  .motion .stage[data-layout="stack"] .chapter-text { font-size: 1.02rem; line-height: 1.42; }
  .motion .stage[data-layout="stack"] .chapter-title { font-size: 1.7rem; }
}

/* VERSÍCULO ============================================================= */

.verse {
  position: relative;
  padding: clamp(120px, 22vh, 240px) var(--gutter);
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(31, 143, 159, 0.08), transparent 70%),
    var(--bg);
}
.verse blockquote { margin: 0; max-width: 980px; text-align: center; }
.verse-text {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2rem, 4.6vw, 4.1rem);
  line-height: 1.18;
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.verse-text em { color: var(--gold); font-weight: 400; }
.verse cite {
  display: inline-block;
  margin-top: 36px;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.74rem;
  font-weight: 450;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

/* FECHA Y LUGAR ========================================================= */

.details {
  position: relative;
  padding: clamp(96px, 16vh, 180px) 0;
  background:
    radial-gradient(ellipse 70% 60% at 85% 30%, rgba(31, 143, 159, 0.1), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-3) 55%, var(--bg) 100%);
}
.details-grid {
  display: grid;
  gap: clamp(56px, 8vw, 96px);
}
@media (min-width: 1024px) {
  .details-grid { grid-template-columns: 1.25fr 1fr; align-items: center; }
}

.details-title { font-size: clamp(2.5rem, 4.4vw, 4rem); }

.date-block {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
  margin-top: clamp(16px, 3vh, 28px);
}
.date-day {
  display: block;
  overflow: hidden;
  overflow: clip;
  padding-bottom: 0.04em;
}
.date-day-inner {
  display: block;
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(9rem, 22vw, 17rem);
  line-height: 0.8;
  letter-spacing: -0.04em;
  font-variant-numeric: lining-nums;
  background-image: var(--gold-foil);
  background-size: 200% 100%;
  background-position: 35% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  padding: 0.06em 0.02em 0.04em;
}
.date-meta {
  display: grid;
  gap: 2px;
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3.2vw, 2.7rem);
  font-weight: 400;
  line-height: 1.08;
  font-variant-numeric: lining-nums;
}
.date-meta > span { display: block; }
.date-weekday { font-style: italic; color: var(--gold); }

.date-time {
  margin-top: 26px;
  font-size: 0.82rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-2);
}
.date-time strong { color: var(--text); font-weight: 500; }

.countdown {
  margin-top: clamp(40px, 6vh, 64px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--gold-line);
  max-width: 640px;
}
.cd-unit {
  display: grid;
  gap: 6px;
  padding: 22px 0 0;
  position: relative;
}
.cd-unit + .cd-unit { padding-left: clamp(14px, 3vw, 28px); }
.cd-unit + .cd-unit::before {
  content: "";
  position: absolute;
  left: 0; top: 26px; bottom: 6px;
  width: 1px;
  background: var(--gold-line);
}
.cd-num {
  display: flex;
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--text);
}
.cd-digit {
  position: relative;
  display: inline-block;
  overflow: hidden;
  overflow: clip;
  height: 1.08em;
  padding-top: 0.04em;
}
.cd-digit > span { display: block; }
.cd-digit > span + span { position: absolute; left: 0; top: 0.04em; }
.cd-label {
  font-size: 0.68rem;
  font-weight: 450;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}
.countdown-done {
  margin-top: 40px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  color: var(--gold);
}

.venue {
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(22, 48, 41, 0.6), rgba(14, 31, 26, 0.6));
  border: 1px solid rgba(214, 180, 106, 0.16);
  padding: 14px;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.7);
}
.venue-map {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 200px 200px calc(var(--radius) - 6px) calc(var(--radius) - 6px);
  overflow: hidden;
  background: var(--bg-2);
  isolation: isolate;
}
.venue-map-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 50% 50%;
}
.venue-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 44px;
  height: 44px;
  margin: -40px 0 0 -22px;
  color: var(--gold-hi);
  pointer-events: none;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6));
}
.venue-pin svg { position: relative; width: 100%; height: 100%; }
.venue-pin-pulse {
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  background: rgba(242, 224, 166, 0.5);
  transform: scaleY(0.45);
}
.motion .venue-pin-pulse { animation: pin-pulse 2.4s var(--ease-out) infinite; }
@keyframes pin-pulse {
  0% { opacity: 0.9; transform: scale(0.6, 0.27); }
  100% { opacity: 0; transform: scale(3.4, 1.5); }
}
.venue-map-credit {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 1;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: rgba(236, 228, 207, 0.6);
  pointer-events: none;
}
.venue-map-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.venue-map-link:focus-visible { outline-offset: -4px; }
.venue-map::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(214, 180, 106, 0.18), inset 0 -60px 60px -40px rgba(10, 22, 19, 0.7);
  border-radius: inherit;
}
.venue-body { padding: 26px 12px 12px; }
.venue-name {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.7rem, 2.6vw, 2.2rem);
  line-height: 1.12;
}
.venue-address {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--text-2);
  font-size: 0.95rem;
}
.venue-address .icon { color: var(--gold); }
.venue-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

@media (max-width: 520px) {
  .countdown { grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 0; }
  .cd-unit { border-top: 1px solid var(--gold-line); padding-bottom: 18px; }
  .cd-unit + .cd-unit { padding-left: 0; }
  .cd-unit:nth-child(even) { padding-left: 20px; }
  .cd-unit + .cd-unit::before { display: none; }
  .cd-unit:nth-child(even)::before { display: block; content: ""; position: absolute; left: 0; top: 26px; bottom: 24px; width: 1px; background: var(--gold-line); }
  .venue-actions .btn { flex: 1 1 100%; }
}

/* ITINERARIO ============================================================ */

.itinerary {
  position: relative;
  padding: clamp(96px, 16vh, 180px) 0;
  background: var(--bg);
}
.section-head { text-align: center; margin-bottom: clamp(56px, 9vh, 96px); }
.section-head p {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.2rem, 1.8vw, 1.45rem);
  color: var(--text-2);
}

.timeline {
  --icon: 64px;
  position: relative;
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 860px;
  display: grid;
  gap: clamp(28px, 4.5vh, 44px);
}
.tl-line {
  position: absolute;
  top: calc(var(--icon) / 2);
  bottom: calc(var(--icon) / 2);
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: rgba(214, 180, 106, 0.16);
}
.tl-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 40%, var(--gold-lo));
  transform-origin: top;
  transform: scaleY(1);
}
.motion .tl-fill { transform: scaleY(0); }

.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr var(--icon) 1fr;
  align-items: center;
  column-gap: clamp(20px, 4vw, 48px);
}
.tl-time {
  justify-self: end;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.2rem, 4vw, 3.3rem);
  line-height: 1;
  font-variant-numeric: lining-nums;
  color: var(--gold);
}
.tl-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: var(--icon);
  height: var(--icon);
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: var(--bg);
  color: var(--gold);
  transition: background-color 0.6s var(--ease-out), color 0.6s var(--ease-out), border-color 0.6s, box-shadow 0.6s;
}
.tl-icon svg { width: 30px; height: 30px; }
.tl-item.is-on .tl-icon,
.no-motion-tl .tl-icon {
  background: radial-gradient(circle at 35% 30%, var(--gold-hi), var(--gold) 55%, var(--gold-lo));
  color: #10180f;
  border-color: var(--gold);
  box-shadow: 0 0 0 6px rgba(214, 180, 106, 0.08), 0 12px 30px -10px rgba(214, 180, 106, 0.6);
}
html:not(.motion) .tl-icon {
  background: radial-gradient(circle at 35% 30%, var(--gold-hi), var(--gold) 55%, var(--gold-lo));
  color: #10180f;
}
.tl-body h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.55rem, 2.3vw, 2rem);
  line-height: 1.15;
}
.tl-body p { margin-top: 4px; color: var(--muted); font-size: 0.98rem; }

@media (max-width: 720px) {
  .timeline { --icon: 54px; max-width: 520px; }
  .tl-line { left: calc(var(--icon) / 2); }
  .tl-item {
    grid-template-columns: var(--icon) 1fr;
    grid-template-areas: "icon time" "icon body";
    column-gap: 20px;
    row-gap: 2px;
  }
  .tl-icon { grid-area: icon; align-self: start; }
  .tl-icon svg { width: 26px; height: 26px; }
  .tl-time { grid-area: time; justify-self: start; font-size: 1.9rem; }
  .tl-body { grid-area: body; }
}

/* REGALOS =============================================================== */

.gifts {
  position: relative;
  padding: clamp(96px, 16vh, 180px) 0;
  background:
    radial-gradient(ellipse 55% 60% at 75% 55%, rgba(179, 38, 46, 0.1), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 50%, var(--bg) 100%);
  overflow: hidden;
}
.gifts-grid { display: grid; gap: 56px; align-items: center; }
@media (min-width: 960px) {
  .gifts-grid { grid-template-columns: 1fr 1.05fr; gap: 64px; }
}
.gifts-copy h2 { font-size: clamp(2.6rem, 4.8vw, 4.4rem); line-height: 1.1; }
.gifts-copy > p:not(.gifts-hint) {
  margin-top: 24px;
  max-width: 44ch;
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 1.6vw, 1.4rem);
  line-height: 1.55;
  color: var(--text-2);
}
.gifts-hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
.gifts-hint .icon { width: 22px; height: 22px; }

.gift-stage {
  position: relative;
  min-height: 580px;
  display: grid;
  place-items: center;
}

/* Caja */
.gift-box {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 210px;
  height: 210px;
  margin: -105px 0 0 -105px;
  padding: 0;
  border: 0;
  background: none;
  -webkit-tap-highlight-color: transparent;
  z-index: 3;
}
.gift-box:focus-visible { outline-offset: 14px; border-radius: 12px; }
.gift-body {
  position: absolute;
  left: 12px; right: 12px; bottom: 18px;
  height: 140px;
  border-radius: 4px 4px 8px 8px;
  background:
    linear-gradient(90deg, transparent calc(50% - 17px), #e2c47c calc(50% - 17px), #f3e2a8 50%, #c9a556 calc(50% + 17px), transparent calc(50% + 17px)),
    linear-gradient(90deg, #5e1117 0%, #8a1c24 22%, #a6262f 52%, #861b23 78%, #5c1016 100%);
  box-shadow: inset 0 -14px 24px -12px rgba(0, 0, 0, 0.5), inset 0 12px 16px -12px rgba(0, 0, 0, 0.55);
}
.gift-body::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 16px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}
.gift-stage[data-state="open"] .gift-body::before { opacity: 1; }

.gift-lid {
  position: absolute;
  left: 0; right: 0;
  bottom: 150px;
  height: 46px;
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent calc(50% - 19px), #e6c983 calc(50% - 19px), #f6e7b4 50%, #cda95a calc(50% + 19px), transparent calc(50% + 19px)),
    linear-gradient(90deg, #6a131a 0%, #97202a 25%, #b12b34 52%, #8f1e27 80%, #65121a 100%);
  box-shadow: 0 8px 14px -6px rgba(0, 0, 0, 0.55), inset 0 2px 0 rgba(255, 210, 200, 0.18);
  transform-origin: 50% 100%;
  z-index: 2;
}
.gift-bow {
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 0;
  height: 0;
}
.gift-bow i, .gift-bow b { position: absolute; display: block; }
.bow-l, .bow-r {
  bottom: -6px;
  width: 64px;
  height: 46px;
  border: 11px solid #dcbc70;
  border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%;
  box-shadow: inset 0 2px 4px rgba(255, 245, 210, 0.35), 0 2px 6px rgba(0, 0, 0, 0.35);
}
.bow-l { right: 2px; transform: rotate(-24deg); transform-origin: 100% 100%; border-color: #e3c47b #c9a556 #b58f45 #e9d08d; }
.bow-r { left: 2px; transform: rotate(24deg); transform-origin: 0 100%; border-color: #e3c47b #e9d08d #b58f45 #c9a556; }
.bow-tail-l, .bow-tail-r {
  top: -4px;
  width: 16px;
  height: 34px;
  background: linear-gradient(180deg, #e2c47c, #b8924a);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}
.bow-tail-l { right: 0; transform: rotate(28deg); transform-origin: 100% 0; }
.bow-tail-r { left: 0; transform: rotate(-28deg); transform-origin: 0 0; }
.bow-knot {
  left: -12px;
  bottom: -10px;
  width: 24px;
  height: 22px;
  border-radius: 8px;
  background: radial-gradient(circle at 40% 35%, #f8ecc0, #d6b46a 60%, #a8823d);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}
.gift-shadow {
  position: absolute;
  left: 10%; right: 10%;
  bottom: 0;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55), transparent 70%);
  z-index: -1;
}
.gift-glow {
  position: absolute;
  left: 50%;
  bottom: 120px;
  width: 260px;
  height: 260px;
  margin-left: -130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 224, 166, 0.45), rgba(214, 180, 106, 0.12) 40%, transparent 70%);
  opacity: 0;
  transform: scale(0.4);
  pointer-events: none;
  z-index: 0;
}

.motion .gift-stage[data-state="closed"] .gift-box { animation: gift-wiggle 4.2s var(--ease-in-out) infinite 1.5s; }
@keyframes gift-wiggle {
  0%, 72%, 100% { transform: rotate(0) translateY(0); }
  76% { transform: rotate(-4deg) translateY(-6px); }
  80% { transform: rotate(4deg) translateY(-8px); }
  84% { transform: rotate(-3deg) translateY(-4px); }
  88% { transform: rotate(2deg) translateY(0); }
  92% { transform: rotate(0) translateY(0); }
}
.gift-stage[data-state="closed"] .gift-box:hover .gift-lid { transform: translateY(-6px) rotate(-2deg); }
.gift-lid { transition: transform 0.4s var(--ease-out); }
.gift-stage[data-state="open"] .gift-lid { transition: none; }
.gift-stage[data-state="closed"] .gift-box:active { transform: scale(0.97); }

/* Tarjetas que salen de la caja */
.gift-cards {
  position: absolute;
  left: 0; right: 0; top: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  z-index: 2;
  visibility: hidden;
}
.gift-stage[data-state="open"] .gift-cards { visibility: visible; }

.gift-card {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 4px;
  padding: 22px 22px 18px;
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(214, 180, 106, 0.14), transparent 60%),
    linear-gradient(160deg, #173a31, #10261f 70%);
  border: 1px solid rgba(214, 180, 106, 0.3);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 240, 200, 0.08);
}
.gift-card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: calc(var(--radius) - 5px);
  border: 1px solid rgba(214, 180, 106, 0.12);
  pointer-events: none;
}
.gift-card-icon {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  margin-bottom: 10px;
}
.gift-card-icon svg { width: 22px; height: 22px; }
.gift-card h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.45rem;
  line-height: 1.15;
}
.gift-card-label {
  margin-top: 6px;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.gift-card-number {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.2;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--gold-hi);
  word-break: break-all;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: transparent;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-hi);
  transition: background-color 0.3s, color 0.3s, border-color 0.3s, transform 0.2s;
}
.copy-btn:hover { background: var(--gold); color: #10180f; border-color: var(--gold); }
.copy-btn:active { transform: scale(0.96); }
.copy-btn.is-copied { background: var(--gold); color: #10180f; border-color: var(--gold); }

.gift-reset {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 4;
}

/* Estado abierto sin animación (movimiento reducido) */
html:not(.motion) .gift-stage[data-state="open"] .gift-lid { opacity: 0; }
html:not(.motion) .gift-stage[data-state="open"] .gift-box { top: auto; bottom: 56px; margin-top: 0; }

@media (max-width: 640px) {
  .gift-stage { min-height: 640px; }
  .gift-cards { grid-template-columns: 1fr; gap: 12px; }
  .gift-card { padding: 18px 18px 16px; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; }
  .gift-card-icon { grid-row: span 2; margin: 0; }
  .gift-card h3 { font-size: 1.3rem; }
  .gift-card-label, .gift-card-number, .copy-btn { grid-column: 1 / -1; }
  .gift-card-number { font-size: 1.6rem; }
}

/* CONFIRMACIÓN · SOBRE =================================================== */

.rsvp {
  position: relative;
  padding: clamp(96px, 16vh, 180px) 0 clamp(80px, 12vh, 140px);
  background:
    radial-gradient(ellipse 70% 50% at 50% 70%, rgba(214, 180, 106, 0.07), transparent 70%),
    var(--bg);
}
.rsvp-inner { display: grid; justify-items: center; }
.rsvp-head { text-align: center; max-width: 640px; }
.rsvp-head h2 { margin-top: 18px; }
.rsvp-head > p:last-child {
  margin-top: 20px;
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 1.6vw, 1.4rem);
  line-height: 1.5;
  color: var(--text-2);
}

.env-stage {
  --env-w: min(560px, calc(100vw - 2 * var(--gutter)));
  --env-h: calc(var(--env-w) / 1.5);
  --rise: 0px;
  --drop: 0px;
  width: var(--env-w);
  margin-top: clamp(56px, 9vh, 96px);
  padding-top: var(--drop);
  display: grid;
  justify-items: center;
}
@media (max-width: 520px) {
  .env-stage { --env-h: calc(var(--env-w) / 1.3); }
}

.envelope {
  position: relative;
  width: var(--env-w);
  height: var(--env-h);
  perspective: 1600px;
}
.env-shadow {
  position: absolute;
  left: 4%; right: 4%;
  bottom: -26px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6), transparent 70%);
  filter: blur(4px);
}
.env-back {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-paper);
  background:
    repeating-linear-gradient(45deg, rgba(214, 180, 106, 0.15) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(-45deg, rgba(214, 180, 106, 0.15) 0 1px, transparent 1px 14px),
    radial-gradient(ellipse at 50% 0%, #1f3d31, #10241c 75%);
  box-shadow: 0 0 0 1px rgba(95, 70, 18, 0.5), 0 50px 80px -34px rgba(0, 0, 0, 0.85), 0 18px 30px -18px rgba(0, 0, 0, 0.6);
}

/* El slot recorta la tarjeta solo por debajo: puede salir hacia arriba */
.env-slot {
  position: absolute;
  left: 0; right: 0; top: 0;
  bottom: 4%;
  clip-path: inset(-400% -25% 0 -25%);
  z-index: 2;
}
.env-card {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 6%;
  transform: translateY(calc(-1 * var(--rise)));
}
.card-inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1s var(--ease-in-out);
}
.env-stage.is-flipped .card-inner { transform: perspective(1800px) rotateY(180deg); }
html:not(.motion) .card-inner { transition: none; }

.card-face {
  border-radius: var(--radius-paper);
  background:
    url("../assets/img/fibras.webp") 0 0 / 256px 256px,
    radial-gradient(ellipse 90% 45% at 50% 0%, rgba(214, 180, 106, 0.14), transparent 62%),
    linear-gradient(180deg, #14301f, #0f2119);
  background-blend-mode: soft-light, normal, normal;
  box-shadow: 0 0 0 1px rgba(214, 180, 106, 0.55), 0 30px 60px -28px rgba(0, 0, 0, 0.9);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.card-face::before,
.card-face::after {
  content: "";
  position: absolute;
  border-radius: 3px;
  pointer-events: none;
}
.card-face::before { inset: 9px; border: 1px solid rgba(214, 180, 106, 0.42); }
.card-face::after { inset: 13px; border: 1px solid rgba(214, 180, 106, 0.16); }
.card-front {
  position: relative;
  padding: clamp(28px, 5vw, 44px) clamp(22px, 5vw, 44px) calc(var(--env-h) * 0.3 + 28px);
}
.card-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  display: grid;
  align-content: start;
  justify-items: center;
  text-align: center;
  gap: 14px;
  padding: clamp(40px, 8vw, 64px) clamp(22px, 5vw, 44px);
}

.card-head { text-align: center; margin-bottom: 22px; }
.card-logo {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2rem, 6vw, 2.7rem);
  line-height: 1.1;
  background-image: var(--gold-foil);
  background-size: 200% 100%;
  background-position: 30% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  padding-bottom: 0.06em;
}
.card-logo em { font-weight: 400; font-size: 0.7em; }
.card-sub {
  margin-top: 6px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.08rem;
  color: var(--text-2);
}

.rsvp-form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field label, .field legend, .field-label {
  padding: 0;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-2);
}
.field legend { margin-bottom: 8px; }
.optional { text-transform: none; letter-spacing: 0.02em; color: var(--muted); font-weight: 400; }
.field input[type="text"],
.field input[type="password"],
.field textarea {
  width: 100%;
  padding: 10px 2px 10px;
  border: 0;
  border-bottom: 1px solid rgba(214, 180, 106, 0.4);
  border-radius: 0;
  background: transparent;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  line-height: 1.35;
  color: var(--text);
  transition: border-color 0.3s;
  resize: none;
}
.field input::placeholder, .field textarea::placeholder { color: #8c8b78; opacity: 1; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--gold); box-shadow: 0 1px 0 0 var(--gold); }
.field input[aria-invalid="true"] { border-bottom-color: #e58b84; }
.field-error { min-height: 0; font-size: 0.85rem; color: #f0a39b; }
.field-error:empty { display: none; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice label {
  position: relative;
  letter-spacing: 0;
  text-transform: none;
}
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: block;
  padding: 12px 10px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  text-align: center;
  font-size: 0.86rem;
  font-weight: 450;
  letter-spacing: 0.02em;
  color: var(--text-2);
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.choice input:checked + span { background: var(--gold); border-color: var(--gold); color: #10180f; }
.choice input:focus-visible + span { outline: 2px solid var(--gold-hi); outline-offset: 3px; }

.stepper { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--gold-line); border-radius: 999px; padding: 4px; width: max-content; }
.stepper button { width: 38px; height: 38px; border-radius: 999px; border: 0; background: var(--gold-soft); color: var(--gold-hi); font-size: 1.2rem; }
.stepper button:hover { background: var(--gold); color: #10180f; }
.stepper output { min-width: 40px; text-align: center; font-family: var(--font-serif); font-size: 1.4rem; }

/* Campo trampa para bots: oculto sin desplazarlo fuera de la pantalla */
.hp {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
}
.form-status { font-size: 0.9rem; color: #f0a39b; text-align: center; }
.form-status:empty { display: none; }

.thanks-icon {
  display: grid;
  place-items: center;
  width: 58px; height: 58px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, var(--gold-hi), var(--gold) 55%, var(--gold-lo));
  color: #3a0d10;
}
.thanks-icon svg { width: 28px; height: 28px; }
.thanks-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.1rem, 6vw, 2.9rem);
  line-height: 1.12;
  color: var(--gold);
  text-wrap: balance;
}
.thanks-text {
  max-width: 32ch;
  font-family: var(--font-serif);
  font-size: 1.22rem;
  line-height: 1.5;
  color: var(--text-2);
}
.thanks-actions { display: grid; justify-items: center; gap: 10px; margin-top: 12px; }

/* Papel dorado del sobre: todas las piezas comparten la misma hoja */
.env-stage { --paper-tex: url("../assets/img/papel-dorado.webp"); }
.paper {
  background-color: #c4a75b;
  background-image: var(--paper-light, linear-gradient(transparent, transparent)), var(--paper-tex);
  background-size: 100% 100%, var(--env-w) var(--env-h);
  background-position: 0 0, 0 0;
  background-repeat: no-repeat;
}

/* Bolsillo frontal del sobre */
.env-pocket { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.pocket-side-wrap {
  position: absolute;
  inset: 0;
  filter: drop-shadow(0 1px 2px rgba(40, 25, 0, 0.3));
}
.pocket { position: absolute; inset: 0; border-radius: var(--radius-paper); box-shadow: inset 0 0 0 1px rgba(95, 70, 18, 0.45); }
.pocket-l {
  clip-path: polygon(0 0, 52% 55%, 0 100%);
  --paper-light: linear-gradient(100deg, rgba(70, 48, 8, 0.2) 0%, rgba(70, 48, 8, 0.06) 45%, rgba(255, 244, 214, 0.05) 100%);
}
.pocket-r {
  clip-path: polygon(100% 0, 48% 55%, 100% 100%);
  --paper-light: linear-gradient(260deg, rgba(70, 48, 8, 0.24) 0%, rgba(70, 48, 8, 0.08) 45%, rgba(255, 244, 214, 0.03) 100%);
}
.pocket-b-wrap {
  position: absolute;
  inset: 0;
  filter: drop-shadow(0 -1px 0 rgba(255, 240, 200, 0.3)) drop-shadow(0 -5px 9px rgba(40, 25, 0, 0.3));
}
.pocket-b {
  clip-path: polygon(0 100%, 50% 47%, 100% 100%);
  --paper-light:
    linear-gradient(0deg, rgba(255, 244, 214, 0.12), rgba(255, 244, 214, 0) 55%),
    linear-gradient(90deg, rgba(70, 48, 8, 0.07), transparent 32% 68%, rgba(70, 48, 8, 0.09));
}

/* Solapa */
.env-flap {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 57%;
  z-index: 4;
  transform-origin: 50% 0;
  transform-style: preserve-3d;
}
.flap-face {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.flap-out { filter: drop-shadow(0 6px 8px rgba(40, 25, 0, 0.4)); }
.flap-in { transform: rotateX(180deg); }
.flap-shape {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-paper) var(--radius-paper) 0 0;
}
.flap-out .flap-shape {
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  box-shadow: inset 0 0 0 1px rgba(95, 70, 18, 0.45);
  --paper-light: linear-gradient(180deg, rgba(255, 246, 220, 0.18) 0%, rgba(255, 246, 220, 0) 48%, rgba(70, 48, 8, 0.1) 100%);
}
/* La cara interior se dibuja invertida porque gira 180° dos veces (cara + solapa) */
.flap-in .flap-shape {
  clip-path: polygon(0 100%, 100% 100%, 50% 0);
  border-radius: 0 0 var(--radius-paper) var(--radius-paper);
  background:
    repeating-linear-gradient(45deg, rgba(214, 180, 106, 0.15) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(-45deg, rgba(214, 180, 106, 0.15) 0 1px, transparent 1px 14px),
    linear-gradient(0deg, #1f3d31, #12281f);
}

/* Lacre */
.env-seal {
  --seal: calc(var(--env-w) * 0.27);
  position: absolute;
  left: 50%;
  top: calc(57% - var(--seal) * 0.64);
  z-index: 5;
  width: var(--seal);
  height: var(--seal);
  margin-left: calc(var(--seal) * -0.5);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  -webkit-tap-highlight-color: transparent;
}
.seal-whole,
.seal-half { position: absolute; inset: 0; display: block; }
.seal-whole { transition: transform 0.45s var(--ease-out); }
.env-seal:hover .seal-whole { transform: scale(1.04) rotate(-3deg); }
.env-seal:focus-visible { border-radius: 50%; outline-offset: 8px; }
.seal-svg { width: 100%; height: 100%; overflow: visible; }
.seal-half { visibility: hidden; opacity: 0; }
.seal-l { clip-path: polygon(-10% -10%, 51% -10%, 47% 12%, 53% 27%, 46% 42%, 52% 58%, 47% 73%, 54% 88%, 49% 110%, -10% 110%); }
.seal-r { clip-path: polygon(51% -10%, 110% -10%, 110% 110%, 49% 110%, 54% 88%, 47% 73%, 52% 58%, 46% 42%, 53% 27%, 47% 12%); }
@media (max-width: 520px) {
  .env-seal { --seal: calc(var(--env-w) * 0.32); }
}

.env-actions { display: grid; justify-items: center; gap: 14px; margin-top: 56px; }
.env-note { font-family: var(--font-serif); font-style: italic; font-size: 1.1rem; color: var(--text-2); }

/* Estado abierto sin animación */
.env-stage[data-state="open"] .env-flap { transform: rotateX(180deg); z-index: 1; }
.env-stage[data-state="open"] .env-seal { opacity: 0; visibility: hidden; }
.env-stage[data-state="open"] .env-actions { display: none; }

/* FOOTER ================================================================ */

.footer {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: clamp(80px, 14vh, 140px) var(--gutter) calc(40px + env(safe-area-inset-bottom));
  text-align: center;
  border-top: 1px solid rgba(214, 180, 106, 0.12);
  background:
    radial-gradient(ellipse 60% 80% at 50% 100%, rgba(31, 143, 159, 0.1), transparent 70%),
    var(--bg);
}
.footer-logo {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: 1.05;
  background-image: var(--gold-foil);
  background-size: 200% 100%;
  background-position: 30% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  padding-bottom: 0.08em;
}
.footer-logo em { font-weight: 400; font-size: 0.62em; }
.footer-thanks { margin-top: 18px; font-family: var(--font-serif); font-style: italic; font-size: 1.25rem; color: var(--text-2); }

/* Barra inferior: fecha · crédito · acceso novios */
.footer-bar {
  width: 100%;
  max-width: 1320px;
  margin-top: clamp(64px, 10vh, 104px);
  padding-top: 24px;
  border-top: 1px solid rgba(214, 180, 106, 0.14);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}
.footer-bar-date {
  justify-self: start;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  letter-spacing: 0.14em;
  font-variant-numeric: lining-nums;
  color: var(--text-2);
}
.credit {
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.credit a {
  color: var(--gold-hi);
  text-decoration: underline;
  text-decoration-color: var(--gold-line);
  text-underline-offset: 5px;
  transition: color 0.3s, text-decoration-color 0.3s;
}
.credit a:hover { color: var(--gold); text-decoration-color: var(--gold); }
.credit-love {
  position: relative;
  display: inline-block;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2em;
  color: var(--gold);
}
.credit-hearts {
  position: absolute;
  left: 50%;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.credit-heart {
  position: absolute;
  left: -8px;
  top: -10px;
  width: 16px;
  height: 16px;
  max-width: none;
  color: var(--gold);
  opacity: 0;
}

/* Acceso novios (en la barra inferior) */
.admin-link {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  background: transparent;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-2);
  transition: color 0.3s, background-color 0.3s, border-color 0.3s, transform 0.2s;
}
.admin-link .icon { width: 15px; height: 15px; color: var(--gold); transition: color 0.3s; }
.admin-link:hover { color: #10180f; background: var(--gold); border-color: var(--gold); }
.admin-link:hover .icon { color: #10180f; }
.admin-link:active { transform: scale(0.97); }

@media (max-width: 720px) {
  .footer-bar {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "credit credit"
      "date admin";
    row-gap: 22px;
  }
  .credit { grid-area: credit; }
  .footer-bar-date { grid-area: date; }
  .admin-link { grid-area: admin; }
}

/* PANEL DE LOS NOVIOS ================================================== */

.admin {
  width: min(980px, 100vw);
  max-width: 100vw;
  height: min(860px, 100dvh);
  max-height: 100dvh;
  margin: auto;
  padding: 0;
  border: 1px solid rgba(214, 180, 106, 0.2);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #0f221c, #0a1613 40%);
  color: var(--text);
  overflow: hidden;
}
.admin::backdrop { background: rgba(5, 12, 10, 0.78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.admin[open] { display: flex; animation: admin-in 0.5s var(--ease-out); }
@keyframes admin-in { from { opacity: 0; transform: translateY(24px) scale(0.98); } }
@media (max-width: 640px) {
  .admin { width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
}
.admin-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: clamp(20px, 4vw, 40px);
  gap: 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.admin-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.admin-mono { font-family: var(--font-serif); color: var(--gold); font-size: 1.5rem; line-height: 1; }
.admin-mono em { font-size: 0.82em; }
.admin-top h2 { font-size: clamp(2rem, 4vw, 2.8rem); margin-top: 6px; }
.admin-demo {
  padding: 14px 18px;
  border-radius: 10px;
  background: rgba(214, 180, 106, 0.08);
  border: 1px solid var(--gold-line);
  color: var(--text-2);
  font-size: 0.92rem;
}
.admin-login {
  align-self: center;
  width: min(380px, 100%);
  margin-block: auto;
  display: grid;
  justify-items: center;
  gap: 20px;
  text-align: center;
}
.admin-login .field { width: 100%; text-align: left; }
.admin-lock {
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  color: var(--gold);
}
.admin-lock svg { width: 28px; height: 28px; }
.admin-login-text { font-family: var(--font-serif); font-style: italic; font-size: 1.2rem; color: var(--text-2); }

.admin-dash { display: grid; gap: 22px; }
.admin-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  border-radius: 12px;
  background: rgba(22, 48, 41, 0.55);
  border: 1px solid rgba(214, 180, 106, 0.14);
}
.stat:first-child { background: linear-gradient(150deg, rgba(214, 180, 106, 0.22), rgba(22, 48, 41, 0.55)); border-color: var(--gold-line); }
.stat-num { font-family: var(--font-serif); font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.stat:first-child .stat-num { color: var(--gold-hi); }
.stat-label { font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-2); }

.admin-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.admin-tool-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.search {
  flex: 1 1 240px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(236, 228, 207, 0.16);
  color: var(--muted);
}
.search:focus-within { border-color: var(--gold); }
.search input { flex: 1; min-width: 0; padding: 12px 0; border: 0; background: none; outline: none; color: var(--text); }
.search input::placeholder { color: #8c8b78; }

.admin-error { padding: 12px 16px; border-radius: 10px; background: rgba(229, 120, 110, 0.1); border: 1px solid rgba(229, 120, 110, 0.35); color: #f2b2aa; }

.guest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.guest {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(17, 38, 31, 0.6);
  border: 1px solid rgba(236, 228, 207, 0.06);
}
.guest-name { font-family: var(--font-serif); font-size: 1.35rem; line-height: 1.2; }
.guest-meta { grid-column: 1; font-size: 0.82rem; color: var(--muted); }
.guest-msg { grid-column: 1 / -1; margin-top: 6px; font-family: var(--font-serif); font-style: italic; font-size: 1.08rem; color: var(--text-2); }
.guest-status {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.guest-status.si { background: var(--gold); color: #10180f; }
.guest-status.no { border: 1px solid rgba(236, 228, 207, 0.22); color: var(--text-2); }

.guest.skeleton { min-height: 74px; position: relative; overflow: hidden; }
.guest.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(214, 180, 106, 0.08) 50%, transparent 80%);
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.admin-empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.admin-empty-title { font-family: var(--font-serif); font-size: 1.7rem; color: var(--text); margin-bottom: 6px; }

@media (max-width: 560px) {
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .stat:first-child { grid-column: 1 / -1; }
}

/* Lluvia de pétalos de celebración */
.burst {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 70;
  pointer-events: none;
}

/* Elementos que se revelan con animación: estado inicial seguro */
.motion [data-reveal="fade"] { opacity: 0; }
.motion.no-gsap [data-reveal] { opacity: 1 !important; }

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