/* ==========================================================================
   Valeria & Mateo — invitación digital (demo de oddfox.app)
   Móvil primero. Sin dependencias. Paleta y tipografías en :root.
   ========================================================================== */

/* ---------- Tipografías (Google Fonts, servidas desde el propio dominio) --- */
@font-face { font-family: 'Pinyon Script'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/pinyon-script-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/cormorant-garamond-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 400; font-display: swap;
  src: url('../fonts/cormorant-garamond-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 500; font-display: swap;
  src: url('../fonts/cormorant-garamond-latin-500-italic.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/manrope-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/manrope-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/manrope-latin-600-normal.woff2') format('woff2'); }

/* ---------- Tokens ---------------------------------------------------------- */
:root {
  --ivory: #F6F1E8;
  --ivory-2: #EFE7DA;
  --ivory-3: #E7DDCC;
  --paper: #FCF9F3;
  --sage: #9CAF9A;
  --sage-dark: #4F6352;
  --sage-deep: #3F5143;
  --gold: #B89B5E;            /* solo decorativo (líneas, bordes) */
  --gold-text: #7D6330;       /* dorado con contraste AA sobre marfil */
  --gold-large: #8E713A;      /* dorado para texto grande (≥ 3:1) */
  --ink: #2E2A26;
  --muted: #6B6158;
  --line: #DCD1BF;
  --danger: #9A3B2E;

  --font-script: 'Pinyon Script', 'Snell Roundhand', cursive;
  --font-serif: 'Cormorant Garamond', 'Cormorant', Garamond, 'Times New Roman', serif;
  --font-sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --gutter: 20px;
  --pad-l: max(var(--gutter), var(--safe-l));
  --pad-r: max(var(--gutter), var(--safe-r));

  --ease: cubic-bezier(.22, .61, .36, 1);
  --shadow-soft: 0 1px 2px rgba(46, 42, 38, .06), 0 12px 32px -14px rgba(46, 42, 38, .28);

  /* Textura de papel marfil (foto real, convertida en baldosa sin costuras por
     scripts/optimize_images.py). Se multiplica sobre el color de cada superficie. */
  --paper-tex: url('../img/papel-marfil.webp');
  --paper-size: 512px;

  color-scheme: light;
}
@media (min-width: 768px) { :root { --gutter: 40px; } }

/* ---------- Base ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  min-height: 100svh;
  background-color: var(--ivory);
  background-image: var(--paper-tex); background-size: var(--paper-size); background-blend-mode: multiply;
  color: var(--ink);
  font: 400 1rem/1.7 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
body.is-locked { overflow: hidden; }
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--sage-dark); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 400; line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
::selection { background: rgba(156, 175, 154, .45); }

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

.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; left: 50%; top: calc(8px + var(--safe-t)); z-index: 100;
  transform: translate(-50%, -160%); background: var(--ink); color: var(--ivory);
  padding: .6em 1.1em; border-radius: 999px; font-size: .85rem; text-decoration: none;
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); color: var(--ivory); }

/* ---------- Elementos comunes ---------------------------------------------- */
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding-left: var(--pad-l); padding-right: var(--pad-r); }
.wrap--narrow { max-width: 640px; }

.section { padding: clamp(88px, 16vw, 152px) 0; position: relative; }
.section__head { text-align: center; margin-bottom: clamp(40px, 8vw, 64px); }
.eyebrow {
  font: 600 .72rem/1.4 var(--font-sans); letter-spacing: .26em; text-transform: uppercase;
  color: var(--gold-text); margin-bottom: 14px;
}
.section__title { font-size: clamp(2.35rem, 9vw, 3.4rem); letter-spacing: -.01em; }
.section__lead { font: italic 400 clamp(1.2rem, 4.6vw, 1.45rem)/1.45 var(--font-serif); color: var(--muted); margin-top: 14px; }

.ornament {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  color: var(--gold); margin: 22px auto 0; width: min(220px, 60%);
}
.ornament::before, .ornament::after { content: ''; flex: 1; height: 1px; background: currentColor; opacity: .7; }
.ornament span { width: 7px; height: 7px; transform: rotate(45deg); border: 1px solid currentColor; }

/* Botones: una sola acción principal (Confirmar asistencia); el resto es secundario. */
.btn {
  --h: 52px;
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: var(--h); padding: 0 1.6em; border-radius: 999px;
  font: 600 .82rem/1 var(--font-sans); letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; border: 1px solid transparent; background: none;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--primary {
  background: var(--sage-dark); color: var(--ivory);
  box-shadow: 0 10px 24px -12px rgba(63, 81, 67, .8);
}
.btn--primary:hover { background: var(--sage-deep); color: var(--ivory); box-shadow: 0 14px 28px -12px rgba(63, 81, 67, .9); }
.btn--outline { border-color: var(--line); color: var(--ink); background: rgba(252, 249, 243, .7); }
.btn--outline:hover { border-color: var(--sage-dark); color: var(--sage-deep); background: var(--paper); }
.btn--ghost { color: var(--sage-dark); padding: 0 .4em; min-height: 44px; letter-spacing: .12em; }
.btn--ghost:hover { color: var(--ink); }
.btn--small { --h: 40px; padding: 0 1.1em; font-size: .72rem; }
.btn--block { width: 100%; }

/* ---------- Imágenes con LQIP --------------------------------------------- */
.ph { position: relative; overflow: hidden; background: var(--ivory-3); }
.ph > .lqip, .ph > picture, .ph > picture > img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.ph > .lqip { filter: blur(14px); transform: scale(1.12); }
.ph > picture { z-index: 1; }
.js .ph > picture > img { opacity: 0; transition: opacity .7s var(--ease); }
.js .ph > picture > img.is-loaded { opacity: 1; }

.decor { pointer-events: none; user-select: none; }
.hero picture, .env__card picture { display: contents; }
.js .decor-fade { opacity: 0; transition: opacity 1s var(--ease); }
.js .decor-fade.is-loaded { opacity: 1; }

/* ==========================================================================
   1. EL SOBRE
   ========================================================================== */
.intro {
  position: fixed; inset: 0; z-index: 60;
  height: 100vh; height: 100svh;
  display: grid; place-items: center;
  padding: calc(64px + var(--safe-t)) var(--pad-r) calc(24px + var(--safe-b)) var(--pad-l);
  overflow: hidden;
}
.intro__bg {
  position: absolute; inset: 0;
  background-color: var(--ivory-2);
  background-image:
    radial-gradient(120% 80% at 50% 38%, rgba(252, 249, 243, .95) 0%, rgba(252, 249, 243, 0) 62%),
    var(--paper-tex);
  background-size: 100% 100%, var(--paper-size);
  background-blend-mode: normal, multiply;
}
.intro__inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: clamp(26px, 5svh, 44px); width: 100%; }
.intro__to { text-align: center; }
.intro__to-label {
  display: block; font: 600 .7rem/1.4 var(--font-sans); letter-spacing: .28em; text-transform: uppercase; color: var(--gold-text);
}
.intro__to-name { display: block; margin-top: 6px; font: italic 400 1.4rem/1.3 var(--font-serif); color: var(--ink); }

.envelope {
  --w: min(86vw, 460px, calc((100svh - 300px) * 1.42));
  position: relative; width: var(--w); aspect-ratio: 1.42 / 1;
}
.envelope::after { /* sombra de contacto */
  content: ''; position: absolute; left: 6%; right: 6%; bottom: -7%; height: 14%; z-index: -1;
  background: radial-gradient(closest-side, rgba(46, 42, 38, .28), transparent);
  filter: blur(6px);
}
.env__back, .env__pocket, .env__flap, .env__card { position: absolute; }
.env__back {
  inset: 0; border-radius: 6px; z-index: 0;
  background-color: #E5DAC7;
  box-shadow: 0 2px 4px rgba(46, 42, 38, .12), 0 26px 50px -26px rgba(46, 42, 38, .55);
}
/* Interior del sobre (forro) visible al abrir */
.env__back::after {
  content: ''; position: absolute; inset: 4% 4% 40%; border-radius: 3px;
  background:
    repeating-linear-gradient(135deg, rgba(184, 155, 94, .28) 0 1px, transparent 1px 11px),
    linear-gradient(var(--sage), #8DA28B);
}
.env__card {
  left: 6%; right: 6%; top: 5%; height: 90%; z-index: 2;
  border-radius: 3px; overflow: hidden;
  background-color: var(--paper);
  box-shadow: 0 1px 3px rgba(46, 42, 38, .14);
  display: grid; place-content: center; text-align: center;
  transform-origin: 50% 50%;
}
/* Textura del sobre en una capa aparte: así no cuenta como imagen para el LCP. */
.env__back::before, .env__card::before, .env__side--l::before, .env__side--r::before,
.env__bottom::before, .env__flap-shape::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background-image: var(--paper-tex); background-size: calc(var(--paper-size) * .7);
  mix-blend-mode: multiply;
}
/* Al crecer, la textura de la tarjeta se escalaría 3×: se desvanece y queda la de la página. */
.env__card::before { transition: opacity .3s ease-out; }
.env__card.is-growing::before { opacity: 0; }
.env__card-flor { position: absolute; width: 46%; }
.env__card-flor--tl { top: -10%; left: -12%; }
.env__card-flor--br { bottom: -10%; right: -12%; transform: rotate(180deg); }
.env__card-names { font: 400 calc(var(--w) * .118)/1 var(--font-script); color: var(--ink); }
.env__card-names span { font: italic 400 .62em/1 var(--font-serif); color: var(--gold-large); }
.env__card-date { margin-top: .7em; font: 500 calc(var(--w) * .03)/1 var(--font-sans); letter-spacing: .32em; color: var(--muted); }

.env__pocket { inset: 0; z-index: 3; pointer-events: none; }
.env__pocket > span { position: absolute; inset: 0; }
.env__side--l { clip-path: polygon(0 0, 50% 57%, 0 100%); background-color: #F0E7D8; border-radius: 6px; }
.env__side--r { clip-path: polygon(100% 0, 50% 57%, 100% 100%); background-color: #ECE2D1; border-radius: 6px; }
.env__bottom-wrap { position: absolute; inset: 0; filter: drop-shadow(0 -2px 2.5px rgba(46, 42, 38, .13)); }
.env__bottom {
  position: absolute; inset: 0; border-radius: 6px;
  clip-path: polygon(0 100%, 0 99%, 50% 46%, 100% 99%, 100% 100%);
  background-color: #F4ECDF; background-image: linear-gradient(to top, rgba(255, 255, 255, .25), transparent 60%);
}

.env__flap {
  left: 0; right: 0; top: 0; height: 62%; z-index: 4;
  transform-origin: 50% 0;
  transform: perspective(1400px) rotateX(0deg);
  filter: drop-shadow(0 3px 3px rgba(46, 42, 38, .2));
}
.env__flap-shape {
  position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 52% 98%, 50% 100%, 48% 98%);
  background-color: #EFE5D4; background-image: linear-gradient(to bottom, rgba(255, 255, 255, .3), transparent 70%);
  border-radius: 6px 6px 0 0;
}
.env__flap.is-open .env__flap-shape {
  background-color: var(--sage);
  background-image: repeating-linear-gradient(135deg, rgba(184, 155, 94, .32) 0 1px, transparent 1px 11px), linear-gradient(#8FA48D, var(--sage));
}
.env__flap.is-open { filter: none; z-index: 1; }

.seal {
  position: absolute; left: 50%; top: 61%; z-index: 5;
  width: 26%; aspect-ratio: 1; margin: -13% 0 0 -13%;
  border: 0; padding: 0; background: none; border-radius: 50%;
  filter: drop-shadow(0 5px 6px rgba(28, 38, 30, .38));
  -webkit-tap-highlight-color: transparent;
}
.seal__half { position: absolute; inset: 0; will-change: transform; }
.seal__half img { width: 100%; height: 100%; object-fit: contain; }
.seal__half--l { clip-path: polygon(0 0, 53% 0, 47% 15%, 55% 31%, 46% 48%, 54% 64%, 47% 81%, 52% 100%, 0 100%); }
.seal__half--r { clip-path: polygon(53% 0, 100% 0, 100% 100%, 52% 100%, 47% 81%, 54% 64%, 46% 48%, 55% 31%, 47% 15%); }
.seal::after { /* halo que invita a tocar */
  content: ''; position: absolute; inset: -14%; border-radius: 50%;
  border: 1px solid rgba(184, 155, 94, .7); opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .intro:not(.is-opening) .seal::after { animation: halo 2.6s var(--ease) 1.2s infinite; }
  .intro:not(.is-opening) .seal { animation: breathe 2.6s ease-in-out 1.2s infinite; }
}
@keyframes halo { 0% { opacity: 0; transform: scale(.85); } 30% { opacity: .9; } 100% { opacity: 0; transform: scale(1.25); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }

.intro__actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.intro__open {
  border: 1px solid var(--gold); background: rgba(252, 249, 243, .6); color: var(--ink);
  min-height: 48px; padding: 0 1.8em; border-radius: 999px;
  font: 600 .78rem/1 var(--font-sans); letter-spacing: .2em; text-transform: uppercase;
  transition: background-color .25s var(--ease), border-color .25s var(--ease);
}
.intro__open:hover { background: var(--paper); border-color: var(--gold-text); }
.intro__hint { font: italic 400 1rem/1.3 var(--font-serif); color: var(--muted); }

/* Mientras la intro está visible, la página no se muestra */
.has-intro .page { opacity: 0; }
.page { transition: none; }

/* ==========================================================================
   3. LA TARJETA (hero)
   ========================================================================== */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: calc(84px + var(--safe-t)) var(--pad-r) calc(56px + var(--safe-b)) var(--pad-l);
  background-color: var(--paper); background-image: var(--paper-tex); background-size: var(--paper-size); background-blend-mode: multiply;
}
.hero::after { /* marco fino tipo tarjeta */
  content: ''; position: absolute; inset: max(12px, var(--safe-t)) max(12px, var(--safe-r)) 12px max(12px, var(--safe-l));
  border: 1px solid rgba(184, 155, 94, .45); pointer-events: none; z-index: -1;
}
.hero__flor { position: absolute; width: min(66vw, 460px); z-index: -1; }
.hero__flor--tl { top: -3%; left: -14%; }
.hero__flor--br { bottom: -3%; right: -14%; transform: rotate(180deg); }
@media (min-width: 900px) {
  .hero__flor { width: min(40vw, 560px); }
  .hero__flor--tl { left: -6%; top: -6%; }
  .hero__flor--br { right: -6%; bottom: -6%; }
}
.hero__eyebrow { font: 600 .74rem/1.4 var(--font-sans); letter-spacing: .34em; text-transform: uppercase; color: var(--gold-text); }
.hero__names {
  margin: .22em 0 .12em; font: 400 clamp(4.2rem, 21vw, 9rem)/.86 var(--font-script); color: var(--ink);
  display: flex; flex-direction: column; align-items: center;
}
.hero__names .amp { font: italic 400 .4em/1.5 var(--font-serif); color: var(--gold-large); }
.hero__names:focus { outline: none; }
@media (min-width: 720px) {
  .hero__names { flex-direction: row; gap: .18em; align-items: baseline; }
  .hero__names .amp { font-size: .42em; }
}
.hero__date { font: italic 400 clamp(1.3rem, 5vw, 1.65rem)/1.3 var(--font-serif); color: var(--ink); }
.hero__greeting {
  max-width: 30ch; margin: 26px auto 0; font: 400 clamp(1.18rem, 4.6vw, 1.4rem)/1.45 var(--font-serif); color: var(--ink);
}
.hero__seats {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 14px;
  font: 500 .8rem/1.4 var(--font-sans); letter-spacing: .06em; color: var(--sage-deep);
  padding: 8px 16px; border-radius: 999px; background: rgba(156, 175, 154, .18);
}
.hero__seats::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--sage-dark); }

.countdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 34px auto 0; width: min(100%, 380px); }
.countdown__cell { position: relative; padding: 4px 2px; }
.countdown__cell + .countdown__cell::before {
  content: ''; position: absolute; left: 0; top: 18%; bottom: 18%; width: 1px; background: rgba(184, 155, 94, .55);
}
.countdown__num { display: block; font: 400 clamp(2.1rem, 9vw, 2.8rem)/1 var(--font-serif); font-variant-numeric: tabular-nums lining-nums; }
.countdown__lbl { display: block; margin-top: 6px; font: 600 .62rem/1 var(--font-sans); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.countdown__done { margin-top: 30px; font: italic 400 1.5rem/1.3 var(--font-serif); color: var(--sage-deep); }

.hero__cta { margin-top: 36px; }
.hero__scroll {
  position: absolute; left: 50%; bottom: calc(22px + var(--safe-b)); transform: translateX(-50%);
  width: 1px; height: 44px; background: linear-gradient(var(--gold), transparent); opacity: .8;
}
@media (prefers-reduced-motion: no-preference) {
  .hero__scroll { animation: drip 2.4s var(--ease) infinite; transform-origin: top; }
}
@keyframes drip { 0% { transform: translateX(-50%) scaleY(0); } 50% { transform: translateX(-50%) scaleY(1); } 100% { transform: translateX(-50%) scaleY(1); opacity: 0; } }
@media (max-height: 700px) { .hero__scroll { display: none; } }

/* ==========================================================================
   4. NUESTRA HISTORIA
   ========================================================================== */
.story { padding: clamp(88px, 16vw, 140px) 0 clamp(64px, 12vw, 120px); overflow: hidden; }
.story__head { text-align: center; padding: 0 var(--pad-r) 0 var(--pad-l); }
.story__track {
  list-style: none; margin: 0; padding: 48px var(--pad-r) 12px var(--pad-l);
  display: flex; flex-direction: column; align-items: center; gap: 60px;
}
.polaroid {
  --pw: min(74vw, 330px);
  position: relative; width: var(--pw); margin: 0;
  padding: 12px 12px 20px; background: #FFFDF9;
  box-shadow: 0 1px 1px rgba(46, 42, 38, .08), 0 22px 40px -22px rgba(46, 42, 38, .5);
  transform: rotate(var(--r, 0deg));
}
.story__track > li:nth-child(1) .polaroid { --r: -3deg; }
.story__track > li:nth-child(2) .polaroid { --r: 2.4deg; }
.story__track > li:nth-child(3) .polaroid { --r: -1.8deg; }
.story__track > li:nth-child(4) .polaroid { --r: 3deg; }
.polaroid::before { /* cinta */
  content: ''; position: absolute; z-index: 2; top: -13px; left: 50%; width: 92px; height: 26px;
  transform: translateX(-50%) rotate(-4deg);
  background: linear-gradient(rgba(255, 255, 255, .25), rgba(255, 255, 255, 0)), rgba(156, 175, 154, .55);
  box-shadow: 0 1px 2px rgba(46, 42, 38, .1);
}
.story__track > li:nth-child(even) .polaroid::before { transform: translateX(-50%) rotate(5deg); background-color: rgba(184, 155, 94, .38); }
.polaroid .ph { aspect-ratio: 4 / 5; }
.polaroid figcaption { padding: 16px 6px 2px; text-align: center; }
.polaroid__date { display: block; font: 600 .68rem/1.4 var(--font-sans); letter-spacing: .24em; text-transform: uppercase; color: var(--gold-text); }
.polaroid__text { display: block; margin-top: 4px; font: italic 400 1.35rem/1.25 var(--font-serif); color: var(--ink); }
.polaroid--final .polaroid__text { font: 400 2.1rem/1.1 var(--font-script); }

.story__progress { display: none; }

/* Modo álbum horizontal (lo activa JS si hay GSAP y no se pidió reducir movimiento) */
.hs .story { height: 100vh; height: 100svh; padding: calc(28px + var(--safe-t)) 0 calc(20px + var(--safe-b)); display: flex; flex-direction: column; justify-content: center; }
.hs .story__head .section__lead { display: none; }
.hs .story__track {
  flex-direction: row; align-items: center; width: max-content; gap: clamp(44px, 12vw, 140px);
  padding: 40px calc(50vw - var(--pw-cur) / 2) 24px;
  --pw-cur: min(70vw, 330px, calc((100svh - 300px) * .74));
}
.hs .polaroid { --pw: min(70vw, 330px, calc((100svh - 300px) * .74)); }
.hs .story__progress {
  display: block; position: relative; width: min(160px, 40vw); height: 1px; margin: 4px auto 0; background: var(--line);
}
.hs .story__progress span { position: absolute; inset: 0; background: var(--gold); transform-origin: left; transform: scaleX(0); }

/* ==========================================================================
   5. EL GRAN DÍA
   ========================================================================== */
.day { background-color: var(--ivory-2); background-image: var(--paper-tex); background-size: var(--paper-size); background-blend-mode: multiply; }
.timeline { list-style: none; margin: 0 auto; padding: 0 0 0 30px; position: relative; max-width: 920px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 12px; bottom: 40px; width: 1px; background: linear-gradient(var(--gold), rgba(184, 155, 94, .15)); }
.tl-item { position: relative; padding-bottom: 64px; }
.tl-item::before {
  content: ''; position: absolute; left: -30px; top: 12px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--ivory); border: 1px solid var(--gold); box-shadow: 0 0 0 4px var(--ivory-2);
}
.tl-time { font: 400 2.5rem/1 var(--font-serif); color: var(--ink); }
.tl-time small { font: 600 .72rem/1 var(--font-sans); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-text); margin-left: 6px; }
.tl-photo { margin-top: 18px; aspect-ratio: 4 / 5; max-width: 420px; border-radius: 2px; box-shadow: var(--shadow-soft); }
.tl-body { margin-top: 20px; }
.tl-title { font-size: 2rem; }
.tl-place { margin-top: 6px; font: 600 .78rem/1.5 var(--font-sans); letter-spacing: .08em; color: var(--sage-deep); }
.tl-desc { margin-top: 10px; color: var(--muted); max-width: 42ch; }
@media (min-width: 860px) {
  .timeline { padding-left: 0; }
  .timeline::before { left: 170px; }
  .tl-item { display: grid; grid-template-columns: 140px 1fr 1fr; column-gap: 60px; align-items: start; }
  .tl-item::before { left: 163px; }
  .tl-time { text-align: right; padding-top: 4px; }
  .tl-time small { display: block; margin: 8px 0 0; }
  .tl-photo { margin-top: 0; }
  .tl-body { margin-top: 0; padding-top: 4px; }
}

.place {
  margin: 8px auto 0; max-width: 560px; text-align: center;
  padding: 36px 24px 30px; border-radius: 4px;
  background-color: var(--paper); background-image: var(--paper-tex); background-size: var(--paper-size); background-blend-mode: multiply;
  box-shadow: var(--shadow-soft);
}
.place__title { font-size: 1.9rem; }
.place__addr { margin-top: 8px; color: var(--muted); }
.place__label { margin-top: 24px; font: 600 .7rem/1.4 var(--font-sans); letter-spacing: .24em; text-transform: uppercase; color: var(--gold-text); }
.place__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.place__btns .btn { padding: 0 .8em; }
.place__cal { margin-top: 14px; }

/* ==========================================================================
   6. CÓDIGO DE VESTIMENTA
   ========================================================================== */
.dress { text-align: center; }
.dress__code { margin-top: 22px; font: 400 clamp(3rem, 14vw, 4.4rem)/1 var(--font-serif); font-style: italic; color: var(--ink); }
.dress__label { margin-top: 36px; }
.palette { list-style: none; padding: 0; margin: 20px auto 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 18px 8px; max-width: 520px; }
.palette li { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 60px; font-size: .7rem; line-height: 1.3; color: var(--muted); text-align: center; }
@media (min-width: 480px) { .palette { gap: 18px 16px; } .palette li { width: 72px; } }
.swatch {
  width: 50px; height: 50px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), 0 0 0 1px rgba(46, 42, 38, .08), 0 8px 16px -8px rgba(46, 42, 38, .45);
}
.swatch--salvia { background: #9CAF9A; }
.swatch--terracota { background: #CF9C82; }
.swatch--azul { background: #A7B9C9; }
.swatch--champana { background: #E6D5B0; }
.swatch--oliva { background: #7C8456; }
.dress__note {
  display: inline-block; margin-top: 38px; padding: 14px 22px; max-width: 34ch;
  font: italic 400 1.2rem/1.4 var(--font-serif); color: var(--ink);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}

/* ==========================================================================
   7. REGALOS
   ========================================================================== */
.gifts { text-align: center; background-color: var(--ivory-2); background-image: var(--paper-tex); background-size: var(--paper-size); background-blend-mode: multiply; }
.gifts__text { color: var(--muted); max-width: 40ch; margin: 18px auto 0; }
.gifts__list { margin-top: 26px; }
.bank {
  position: relative; text-align: left; max-width: 420px; margin: 34px auto 0;
  padding: 28px 24px 22px; border-radius: 6px;
  background-color: var(--paper); background-image: var(--paper-tex); background-size: var(--paper-size); background-blend-mode: multiply;
  box-shadow: var(--shadow-soft);
}
.bank::before { content: ''; position: absolute; inset: 7px; border: 1px solid rgba(184, 155, 94, .4); border-radius: 3px; pointer-events: none; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font: 600 .64rem/1.3 var(--font-sans); letter-spacing: .16em; text-transform: uppercase;
  color: var(--danger); background: rgba(154, 59, 46, .08); border: 1px solid rgba(154, 59, 46, .35);
}
.bank__title { margin-top: 14px; font-size: 1.6rem; }
.bank dl { margin: 14px 0 0; display: grid; gap: 10px; }
.bank dl > div { display: grid; gap: 2px; }
.bank dt { font: 600 .66rem/1.3 var(--font-sans); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.bank dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 500; word-break: break-word; }
.bank__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.bank__foot p { font-size: .78rem; color: var(--muted); flex: 1 1 160px; }

dialog.sheet {
  width: min(100% - 24px, 460px); max-height: min(86svh, 680px); padding: 0; border: 0; border-radius: 10px;
  background-color: var(--paper); background-image: var(--paper-tex); background-size: var(--paper-size); background-blend-mode: multiply; color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(46, 42, 38, .55);
}
dialog.sheet::backdrop { background: rgba(46, 42, 38, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet__inner { padding: 30px 24px 24px; }
.sheet__title { font-size: 1.9rem; padding-right: 40px; }
.sheet__close {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: transparent; display: grid; place-items: center; color: var(--ink);
}
.sheet__close:hover { background: var(--ivory-2); }
.gift-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 2px; }
.gift-list li { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.gift-list strong { font: 500 1.15rem/1.3 var(--font-serif); }
.gift-list span { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.sheet__note { margin-top: 16px; font-size: .82rem; color: var(--muted); }

/* ==========================================================================
   8. RSVP
   ========================================================================== */
.rsvp__card {
  position: relative; max-width: 600px; margin: 0 auto;
  padding: clamp(28px, 7vw, 48px) clamp(20px, 6vw, 48px);
  border-radius: 6px; background-color: var(--paper); background-image: var(--paper-tex); background-size: var(--paper-size); background-blend-mode: multiply;
  box-shadow: 0 1px 2px rgba(46, 42, 38, .06), 0 30px 60px -30px rgba(46, 42, 38, .45);
}
.rsvp__card::before { content: ''; position: absolute; inset: 8px; border: 1px solid rgba(184, 155, 94, .35); border-radius: 3px; pointer-events: none; }
.rsvp__for { text-align: center; font: italic 400 1.25rem/1.4 var(--font-serif); }
.rsvp__for strong { font-weight: 500; }
.rsvp__seats { display: block; margin-top: 2px; font: 600 .72rem/1.4 var(--font-sans); font-style: normal; letter-spacing: .16em; text-transform: uppercase; color: var(--sage-deep); }

.form { display: grid; gap: 26px; margin-top: 28px; }
.form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.form legend, .field > label {
  display: block; padding: 0; margin-bottom: 10px;
  font: 600 .8rem/1.4 var(--font-sans); letter-spacing: .04em; color: var(--ink);
}
.opt { font-weight: 400; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; min-width: 46px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--line); background: #FFFDF9;
  font-weight: 500; font-size: .9rem; transition: all .2s var(--ease);
}
.chip input:checked + span { background: var(--sage-dark); border-color: var(--sage-dark); color: var(--ivory); }
.chip input:focus-visible + span { outline: 2px solid var(--sage-dark); outline-offset: 3px; }
.chip input:hover + span { border-color: var(--sage-dark); }

.field { display: grid; }
.input, .select, .textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid #CFC3AE; background: #FFFDF9; font-size: 1rem; /* 16px evita el zoom en iOS */
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.textarea { min-height: 112px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%234F6352' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--sage-dark); box-shadow: 0 0 0 3px rgba(79, 99, 82, .18); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--danger); }
.field__error { margin-top: 6px; font-size: .8rem; color: var(--danger); }
.hint { margin-top: 6px; font-size: .8rem; color: var(--muted); }

.person {
  padding: 20px 16px 18px !important; border-radius: 10px !important;
  background: rgba(239, 231, 218, .55); display: grid; gap: 14px;
}
.person legend {
  float: left; width: 100%; margin: 0;
  font: italic 500 1.3rem/1.2 var(--font-serif) !important; letter-spacing: 0 !important;
}
.person legend + * { clear: both; }
.people { display: grid; gap: 14px; }

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

.form-error { padding: 12px 14px; border-radius: 8px; background: rgba(154, 59, 46, .08); color: var(--danger); font-size: .88rem; }
.fineprint { text-align: center; font-size: .78rem; color: var(--muted); }

.rsvp-nocode, .rsvp-invite { text-align: center; }
.rsvp-invite .btn { margin-top: 22px; }
.rsvp-cta__status {
  display: inline-block; margin-top: 16px; padding: 8px 16px; border-radius: 999px;
  background: rgba(156, 175, 154, .18); color: var(--sage-deep); font-size: .88rem;
}
.rsvp-retry { display: flex; margin: 18px auto 0; }
.rsvp-loading { text-align: center; font: italic 400 1.2rem/1.4 var(--font-serif); color: var(--muted); }
.rsvp-nocode p + p { margin-top: 10px; color: var(--muted); }
.demo-pick { margin-top: 22px; padding-top: 20px; border-top: 1px dashed var(--line); }
.demo-pick__title { font-size: .86rem; color: var(--muted); }
.demo-pick__title span:first-child {
  display: inline-block; margin-right: 6px; padding: 2px 8px; border-radius: 999px; background: var(--ivory-2);
  font-weight: 600; font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-text);
}
.demo-pick__list { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.demo-pick__list a {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-height: 48px; padding: 6px 16px;
  border: 1px solid var(--line); border-radius: 12px; background: rgba(252, 249, 243, .7);
  font-size: .85rem; font-weight: 600; line-height: 1.25; color: var(--sage-deep); text-decoration: none;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.demo-pick__list a:hover { border-color: var(--sage); background: var(--paper); }
.demo-pick__list small { font-weight: 400; font-size: .7rem; color: var(--muted); }

.rsvp-done { text-align: center; }
.rsvp-done:focus { outline: none; }
.rsvp-done__seal { width: 84px; margin: 0 auto 14px; filter: drop-shadow(0 6px 8px rgba(28, 38, 30, .3)); }
.rsvp-done__title { font: 400 clamp(2.4rem, 10vw, 3.2rem)/1.05 var(--font-script); }
.rsvp-done__msg { margin: 14px auto 0; max-width: 34ch; font: 400 1.25rem/1.45 var(--font-serif); }
.rsvp-done__list { list-style: none; padding: 0; margin: 22px auto 0; max-width: 360px; text-align: left; border-top: 1px solid var(--line); }
.rsvp-done__list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.rsvp-done__list li span:last-child { color: var(--muted); text-align: right; }
.rsvp-done__edit { margin-top: 18px; }

/* ==========================================================================
   Footer y avisos
   ========================================================================== */
.footer {
  background: var(--sage-deep); color: var(--ivory); text-align: center;
  padding: 72px var(--pad-r) calc(40px + var(--safe-b)) var(--pad-l);
}
.footer a { color: var(--ivory); }
.footer a:hover { color: #fff; }
.footer__names { font: 400 clamp(2.6rem, 12vw, 3.6rem)/1 var(--font-script); }
.footer__date { margin-top: 10px; font: 500 .78rem/1 var(--font-sans); letter-spacing: .4em; opacity: .9; }
.footer__nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 18px; margin-top: 36px; font-size: .82rem; }
.footer__nav a { display: inline-block; padding: 8px 0; }
.wa {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 26px; min-height: 40px; padding: 0 16px;
  border: 1px solid rgba(246, 241, 232, .45); border-radius: 999px; font-size: .8rem; text-decoration: none;
}
.wa:hover { border-color: var(--ivory); background: rgba(246, 241, 232, .08); }
.wa svg { width: 16px; height: 16px; }
.footer__demo { margin-top: 22px; font-size: .75rem; opacity: .88; }


.cookie {
  position: fixed; z-index: 64; left: max(12px, var(--safe-l)); right: max(12px, var(--safe-r));
  bottom: calc(14px + var(--safe-b)); max-width: 400px;
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 14px;
  background: rgba(46, 42, 38, .94); color: var(--ivory); font-size: .78rem; line-height: 1.45;
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .5);
}
.cookie a { color: var(--ivory); }
.cookie button {
  flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 0;
  background: var(--ivory); color: var(--ink); font-weight: 600; font-size: .75rem;
}

.toast {
  position: fixed; z-index: 80; left: 50%; bottom: calc(76px + var(--safe-b));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--ivory); font-size: .85rem;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Aparición suave al hacer scroll */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
  .js .reveal.is-in { opacity: 1; transform: none; }
}
/* Con «Reducir movimiento»: solo un fundido, sin desplazamiento. */
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 0; transition: opacity .8s ease; }
  .js .reveal.is-in { opacity: 1; }
}

/* ---------- Página /confirmar --------------------------------------------- */
.cf-head { position: relative; text-align: center; padding: calc(28px + var(--safe-t)) var(--pad-r) 0 var(--pad-l); }
.cf-back {
  position: absolute; left: var(--pad-l); top: calc(22px + var(--safe-t));
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px;
  font-size: .82rem; color: var(--sage-deep); text-decoration: none;
}
.cf-back:hover { text-decoration: underline; }
.cf-back svg { width: 16px; height: 16px; }
.cf-names { margin-top: 44px; font: 400 clamp(2.6rem, 11vw, 4rem)/1.05 var(--font-script); color: var(--ink); }
.cf-names span { color: var(--gold-text); font-size: .8em; }
.cf-date { margin-top: 8px; font: 600 .7rem/1.4 var(--font-sans); letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.cf .section { padding-top: clamp(40px, 9vw, 72px); }
.rsvp-done__back { display: block; margin-top: 10px; font-size: .85rem; }
button.rsvp-done__back, button.cf-back { border: 0; background: none; font-family: inherit; cursor: pointer; }
button.rsvp-done__back { margin: 10px auto 0; padding: 8px 4px; color: var(--sage-deep); text-decoration: underline; text-underline-offset: 3px; }

/* Formulario dentro de la invitación: vista a pantalla completa (diálogo) */
.rsvp-sheet {
  width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0;
  overflow-y: auto; overscroll-behavior: contain;
  background-color: var(--ivory); background-image: var(--paper-tex); background-size: var(--paper-size); background-blend-mode: multiply;
  color: var(--ink);
}
.rsvp-sheet::backdrop { background: rgba(46, 42, 38, .4); }
.rsvp-sheet .section { padding-top: clamp(32px, 7vw, 56px); padding-bottom: calc(56px + var(--safe-b)); }
@media (prefers-reduced-motion: no-preference) {
  .rsvp-sheet[open] { animation: hoja-sube .45s var(--ease); }
}
@media (prefers-reduced-motion: reduce) {
  .rsvp-sheet[open] { animation: hoja-funde .3s ease; }
}
@keyframes hoja-sube { from { opacity: 0; transform: translateY(28px); } }
@keyframes hoja-funde { from { opacity: 0; } }
/* Agradecimiento centrado también dentro del diálogo */
.is-done .rsvp-sheet .section__head { display: none; }
.is-done .rsvp-sheet .rsvp { display: flex; align-items: center; min-height: calc(100% - 200px); padding-top: 24px; }
.is-done .rsvp-sheet .rsvp > .wrap { width: 100%; }
@media (min-width: 700px) { .cf-names { margin-top: 24px; } }
.rsvp-done__estado {
  display: inline-block; margin-top: 16px; padding: 7px 14px; border-radius: 999px;
  background: rgba(156, 175, 154, .18); color: var(--sage-deep); font-size: .84rem;
}
.rsvp-done__estado.is-pending { background: rgba(184, 155, 94, .14); color: var(--gold-text); }
@media (prefers-reduced-motion: no-preference) {
  .rsvp-done__estado.is-pending { animation: latido 1.4s ease-in-out infinite; }
}
@keyframes latido { 50% { opacity: .55; } }

/* Ya respondió: el agradecimiento queda solo y centrado en la pantalla */
.cf.is-done .rsvp .section__head { display: none; }
.cf.is-done .rsvp {
  display: flex; align-items: center;
  min-height: calc(100vh - 200px); min-height: calc(100svh - 200px - var(--safe-t));
  padding: 24px 0 calc(40px + var(--safe-b));
}
.cf.is-done .rsvp > .wrap { width: 100%; }
@media (max-height: 760px), (max-width: 380px) {
  .cf.is-done .cf-names { margin-top: 40px; font-size: clamp(2.2rem, 10vw, 3rem); }
  .cf.is-done .rsvp__card { padding-top: 24px; padding-bottom: 24px; }
  .rsvp-done__seal { width: 64px; margin-bottom: 8px; }
  .rsvp-done__title { font-size: clamp(2rem, 9vw, 2.6rem); }
  .rsvp-done__msg { font-size: 1.1rem; margin-top: 10px; }
  .rsvp-done__list { margin-top: 14px; }
  .rsvp-done__list li { padding: 8px 2px; }
}

/* ---------- Páginas de texto (legal, 404) -------------------------------- */
.doc { padding: calc(56px + var(--safe-t)) 0 80px; }
.doc__back { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; }
.doc h1 { margin-top: 28px; font-size: clamp(2.4rem, 9vw, 3.2rem); }
.doc h2 { margin-top: 48px; font-size: 1.9rem; scroll-margin-top: 24px; }
.doc h3 { margin-top: 24px; font: 600 .95rem/1.4 var(--font-sans); }
.doc p, .doc li { color: #3d3833; }
.doc p { margin-top: 12px; }
.doc ul { padding-left: 1.2em; margin: 12px 0 0; }
.doc li + li { margin-top: 6px; }
.doc .note { margin-top: 18px; padding: 14px 16px; border-left: 2px solid var(--gold); background: rgba(239, 231, 218, .6); font-size: .9rem; }
.doc table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: .88rem; }
.doc th, .doc td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc code { font-size: .85em; background: var(--ivory-2); padding: .1em .35em; border-radius: 4px; word-break: break-word; }

.lost { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 40px var(--pad-r) 40px var(--pad-l); }
.lost__seal { width: 110px; margin: 0 auto 22px; filter: drop-shadow(0 8px 10px rgba(28, 38, 30, .3)); transform: rotate(-12deg); }
.lost__code { font: 600 .74rem/1 var(--font-sans); letter-spacing: .34em; color: var(--gold-text); }
.lost h1 { margin-top: 14px; font-size: clamp(2.2rem, 9vw, 3rem); }
.lost p { margin: 14px auto 28px; max-width: 34ch; color: var(--muted); }
