/* ==========================================================================
   Invitación · Dayana & Wilmer
   Sistema visual: papel marfil en relieve, marco en arco, encaje floral.
   Paleta (vinculante): Chocolate #4B2E1F · Café #7A4E3A · Moca #A6856F · Beige #D8C6B3 · Marfil #F5EDE1
   Los tokens de color y tipografía viven en tokens.css (compartidos con el panel).
   ========================================================================== */

:root {

  /* Escala tipográfica fluida (móvil → escritorio) */
  --t-xs: 0.78rem;
  --t-sm: 0.95rem;
  --t-md: 1.125rem;
  --t-lg: clamp(1.25rem, 1.1rem + 0.6vw, 1.45rem);
  --t-xl: clamp(1.9rem, 1.4rem + 2.4vw, 2.6rem);
  --t-2xl: clamp(3.2rem, 2.2rem + 6vw, 5.4rem);

  /* Espaciado (base 4) */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem;
  --s-5: 1.5rem; --s-6: 2rem; --s-7: 3rem; --s-8: 4rem;


  --frame-top: 10px;
  --frame-side: 10px;
  --arch-safe-top: 26%;
  --pill-zone: 92px;

}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper) var(--texture);
  color: var(--ink);
  font-family: var(--f-text);
  font-size: var(--t-md);
  line-height: 1.55;
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}
.no-js body { overflow: auto; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
p, h1, h2, h3, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--beige); color: var(--chocolate); }
input, textarea { caret-color: var(--cafe); }
:focus-visible { outline: 2px solid var(--cafe); outline-offset: 4px; border-radius: 4px; }

.icon { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.script { font-family: var(--f-script); font-weight: 400; color: var(--cafe); }
.visually-hidden {
  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: 8px; z-index: 100; transform: translate(-50%, -150%);
  background: var(--chocolate); color: var(--marfil); padding: 10px 18px; border-radius: var(--radius-pill);
  text-decoration: none; transition: transform .3s var(--ease-out);
}
.skip-link:focus { transform: translate(-50%, 0); }

/* ---------- Ornamentos ---------- */
.ornament { width: 9.5rem; height: auto; margin-inline: auto; fill: none; stroke: var(--moca); stroke-width: 1; }
.ornament path:nth-child(2) { fill: var(--paper-raised); stroke: var(--cafe); }
.ornament circle { fill: var(--moca); stroke: none; }

/* ==========================================================================
   Puertas de bienvenida
   ========================================================================== */
.gate {
  position: fixed; inset: 0; z-index: 60;
  perspective: 1800px;
  display: grid; place-items: center;
  overflow: hidden;
}
.no-js .gate { display: none; }
.gate__door {
  position: absolute; top: 0; bottom: 0; width: 50.5%;
  background: var(--paper) var(--texture);
  overflow: hidden;
  backface-visibility: hidden;
  transition: transform 1.6s var(--ease-in-out), box-shadow 1.6s var(--ease-in-out);
  will-change: transform;
}
.gate__door--left {
  left: 0; transform-origin: left center;
  box-shadow: inset -1px 0 0 var(--line), inset -12px 0 18px -14px rgba(75, 46, 31, .45);
}
.gate__door--right {
  right: 0; transform-origin: right center;
  box-shadow: inset 1px 0 0 #fff, inset 12px 0 18px -14px rgba(75, 46, 31, .35);
}
/* Encaje: las dos puertas muestran el mismo ramillete en espejo */
.gate__lace { position: absolute; width: min(118%, 560px); height: auto; pointer-events: none; }
.gate__lace--a { top: -4%; left: -10%; }
.gate__lace--b { bottom: -5%; left: -12%; transform: scaleY(-1); width: min(96%, 460px); }
.gate__door--right .gate__lace--a { left: auto; right: -10%; transform: scaleX(-1); }
.gate__door--right .gate__lace--b { left: auto; right: -12%; transform: scale(-1, -1); }

.gate__content {
  position: relative; z-index: 2;
  display: grid; justify-items: center; align-content: center;
  gap: var(--s-4);
  width: min(100%, 26rem);
  min-height: 100%;
  padding: calc(env(safe-area-inset-top) + var(--s-6)) var(--s-5) calc(env(safe-area-inset-bottom) + var(--s-6));
  text-align: center;
  transition: opacity .7s var(--ease-out), transform .9s var(--ease-out), filter .7s var(--ease-out);
}
.gate__names {
  display: flex; flex-direction: column; align-items: center;
  font-family: var(--f-display); font-size: clamp(2.3rem, 1.8rem + 3vw, 3.2rem); line-height: .95;
  color: var(--chocolate);
}
.gate__names .script { font-size: .62em; line-height: 1; padding-right: .18em; margin-block: -.1em 0; }
.gate__seal {
  border: 0; padding: 0; background: none; border-radius: 50%;
  width: clamp(132px, 38vw, 176px); aspect-ratio: 1;
  margin-block: var(--s-2);
  transition: transform .5s var(--ease-out), filter .5s var(--ease-out);
  animation: seal-breathe 3.6s var(--ease-in-out) infinite;
}
.gate__seal img { width: 100%; height: 100%; }
.gate__seal:hover { transform: scale(1.04) rotate(-2deg); }
.gate__seal:active { transform: scale(.97); }
.gate__date {
  font-family: var(--f-text); font-weight: 500; font-size: var(--t-sm);
  text-transform: uppercase; letter-spacing: .3em; color: var(--cafe);
}
.gate__phrase { font-style: italic; font-size: var(--t-lg); line-height: 1.4; color: var(--chocolate); max-width: 20ch; text-wrap: balance; }
.gate__cta { margin-top: var(--s-4); }

@keyframes seal-breathe {
  0%, 100% { filter: drop-shadow(0 6px 10px rgba(75, 46, 31, .18)); }
  50% { filter: drop-shadow(0 10px 18px rgba(75, 46, 31, .3)); }
}

/* Apertura */
.gate.is-opening .gate__content { opacity: 0; transform: scale(.96) translateY(-8px); filter: blur(6px); }
.gate.is-opening .gate__door--left { transform: rotateY(-104deg); box-shadow: inset -1px 0 0 var(--line), 30px 0 60px rgba(75, 46, 31, .25); }
.gate.is-opening .gate__door--right { transform: rotateY(104deg); box-shadow: inset 1px 0 0 #fff, -30px 0 60px rgba(75, 46, 31, .25); }
.gate.is-opening { pointer-events: none; }
.gate.is-gone { display: none; }

/* ==========================================================================
   Escenario y marco en arco
   ========================================================================== */
.stage { position: fixed; inset: 0; }
.stage__flora { display: none; }

.frame {
  position: absolute;
  top: calc(var(--frame-top) + env(safe-area-inset-top));
  bottom: calc(var(--frame-top) + env(safe-area-inset-bottom));
  left: calc(var(--frame-side) + env(safe-area-inset-left));
  right: calc(var(--frame-side) + env(safe-area-inset-right));
}
.frame__arch { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.arch-fill { fill: var(--paper-raised); }
.arch-line { fill: none; stroke: var(--line); stroke-width: 1.25; }
.arch-line.arch-inner { stroke-width: .9; }
.arch-light { fill: none; stroke: #fff; stroke-width: 1.4; opacity: .9; transform: translate(1px, 1.2px); }

.frame__flora { position: absolute; height: auto; pointer-events: none; z-index: 3; }
.frame__flora--tl { top: -3%; left: -8%; width: clamp(180px, 56%, 360px); }
.frame__flora--br { bottom: -4%; right: -9%; width: clamp(150px, 46%, 300px); transform: rotate(180deg); }

/* El contenido vive recortado dentro del arco (clip-path calculado en JS) */
.scroller {
  position: absolute; inset: 0; z-index: 2;
  overflow-y: auto; overflow-x: hidden;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  clip-path: inset(12% 4% 2% 4% round 50% 50% 0 0 / 14% 14% 0 0);
  outline: none;
}
.scroller::-webkit-scrollbar { display: none; }
.scroller.is-typing { scroll-snap-type: none; }
.no-js .scroller { position: static; overflow: visible; clip-path: none; }

.panel {
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  align-items: center;
  padding: calc(var(--arch-safe-top) + var(--s-2)) var(--s-6) var(--pill-zone);
}
.panel__inner {
  width: 100%; max-width: 28rem; margin-inline: auto;
  display: flex; flex-direction: column; align-items: center;
  gap: var(--s-4);
  text-align: center;
}

/* ---------- Revelado por sección (momento de movimiento único: disolución con desenfoque) ---------- */
.js .reveal {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(14px);
  transition:
    opacity .5s ease-out,
    filter .5s ease-out,
    transform .5s ease-out;
}
.js:not(.gate-closed) .panel.is-in .reveal {
  opacity: 1; filter: blur(0); transform: none;
  transition:
    opacity 1.1s var(--ease-out) calc(var(--i, 0) * 110ms + 120ms),
    filter 1.1s var(--ease-out) calc(var(--i, 0) * 110ms + 120ms),
    transform 1.2s var(--ease-out) calc(var(--i, 0) * 110ms + 120ms);
}

/* ---------- Tipografía de secciones ---------- */
.cover-names {
  display: flex; flex-direction: column; align-items: center;
  font-family: var(--f-display); font-weight: 400;
  font-size: var(--t-2xl); line-height: .98; letter-spacing: -.01em;
  color: var(--chocolate);
}
.js .cover-names.reveal { opacity: 1; filter: none; transform: none; }
.js .cover-names__name, .js .cover-names__and {
  opacity: 0; filter: blur(12px); transform: translateY(18px) scale(1.02);
  transition: opacity 1.4s var(--ease-out), filter 1.4s var(--ease-out), transform 1.6s var(--ease-out);
  transition-delay: calc(var(--i) * 260ms + 200ms);
}
.js:not(.gate-closed) .panel.is-in .cover-names__name, .js:not(.gate-closed) .panel.is-in .cover-names__and { opacity: 1; filter: blur(0); transform: none; }
.cover-names__and { font-size: .62em; line-height: 1; margin-block: -.12em .02em; padding-right: .18em; }
.cover-date {
  font-weight: 500; font-size: var(--t-sm); letter-spacing: .32em; text-transform: uppercase; color: var(--cafe);
  font-variant-numeric: lining-nums;
}
.cover-place { font-style: italic; color: var(--ink-soft); }

.title { font-family: var(--f-display); font-weight: 400; font-size: var(--t-xl); line-height: 1.08; color: var(--chocolate); text-wrap: balance; }
.small-caps {
  font-family: var(--f-text); font-weight: 500; font-size: var(--t-xs);
  letter-spacing: .28em; text-transform: uppercase; color: var(--cafe);
}
.lead { font-style: italic; font-size: var(--t-lg); line-height: 1.35; color: var(--ink-soft); max-width: 22ch; text-wrap: balance; }
.body-text { max-width: 32ch; color: var(--ink); text-wrap: pretty; }
.body-text--small { font-size: var(--t-sm); color: var(--ink-soft); }
.formal-names {
  display: flex; flex-direction: column; gap: .1em;
  font-family: var(--f-display); font-weight: 400; font-size: clamp(1.45rem, 1.2rem + 1.2vw, 1.85rem); line-height: 1.15;
  color: var(--chocolate); text-wrap: balance;
}
.formal-names .script { font-size: 1.15em; line-height: 1; }

.parents {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--s-4);
  width: 100%; margin-top: var(--s-3);
  font-size: var(--t-sm); line-height: 1.4;
}
.parents__col { display: grid; gap: var(--s-1); align-content: start; }
.parents__col h3 { margin-bottom: var(--s-2); font-size: .7rem; letter-spacing: .22em; }
.parents__rule { width: 1px; background: var(--line); }

/* Historia */
.years { display: flex; flex-direction: column; align-items: center; gap: var(--s-1); }
.years__num {
  font-family: var(--f-display); font-size: clamp(4.6rem, 3.6rem + 5vw, 6rem); line-height: .9; color: var(--chocolate);
  font-variant-numeric: lining-nums tabular-nums;
}
.years__label { font-weight: 500; font-size: var(--t-xs); letter-spacing: .28em; text-transform: uppercase; color: var(--cafe); }
.quote { max-width: 30ch; }
.quote p { font-style: italic; font-size: var(--t-lg); line-height: 1.4; color: var(--ink-soft); text-wrap: balance; }
.quote p::before { content: "“"; } .quote p::after { content: "”"; }

.photos { display: flex; justify-content: center; gap: var(--s-3); width: 100%; margin-top: var(--s-2); }
.photos li { flex: 1 1 0; max-width: 8.5rem; }
.photos--1 li { max-width: 13rem; }
.photos--3 li:nth-child(2) { transform: translateY(-10px); }
.photo {
  display: block; width: 100%; padding: 5px; border: 1px solid var(--line); background: var(--paper);
  border-radius: 999px 999px 10px 10px; overflow: hidden;
  box-shadow: 0 10px 22px -16px rgba(75, 46, 31, .55);
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out);
}
.photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 999px 999px 7px 7px; filter: sepia(.18); transition: filter .5s var(--ease-out); }
.photo:hover { transform: translateY(-4px); box-shadow: 0 16px 28px -16px rgba(75, 46, 31, .6); }
.photo:hover img { filter: sepia(0); }
.photo-caption { font-style: italic; font-size: var(--t-sm); color: var(--ink-soft); margin-top: calc(var(--s-2) * -1); }

/* Fecha */
.date-plaque { position: relative; width: min(190px, 52vw); aspect-ratio: 220 / 280; display: grid; place-items: center; }
.date-plaque__frame { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.date-plaque__frame .pl-line { fill: none; stroke: var(--line); stroke-width: 1.4; }
.date-plaque__frame .pl-thin { stroke-width: .9; }
.date-plaque__frame .pl-light { fill: var(--paper); stroke: #fff; stroke-width: 2; transform: translate(1.2px, 1.6px); }
.date-plaque__text { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--s-2); }
.date-plaque__day { font-family: var(--f-display); font-size: clamp(3.8rem, 3rem + 4vw, 4.8rem); line-height: .9; color: var(--chocolate); font-variant-numeric: lining-nums; }
.date-plaque__month { font-weight: 500; font-size: var(--t-sm); letter-spacing: .34em; text-transform: uppercase; color: var(--cafe); margin-right: -.34em; }
.date-plaque__dot { width: 8px; fill: var(--moca); }
.date-plaque__year { font-family: var(--f-display); font-size: var(--t-lg); letter-spacing: .2em; color: var(--chocolate); margin-right: -.2em; }

.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-3); }
.pill, .venue-plate {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: .35rem 1.3rem;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: var(--paper-raised);
  box-shadow: inset 0 0 0 3px var(--paper-raised), inset 0 0 0 4px var(--line-soft), 0 6px 14px -10px rgba(75, 46, 31, .45);
  font-family: var(--f-display); font-size: 1.05rem; color: var(--chocolate);
}

/* Cuenta regresiva */
.countdown { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); width: 100%; }
.countdown__days { display: flex; align-items: center; gap: var(--s-4); width: 100%; justify-content: center; }
.countdown__rule { flex: 0 1 4.5rem; height: 1px; background: var(--line); position: relative; }
.countdown__rule::after { content: ""; position: absolute; top: -2.5px; width: 6px; height: 6px; background: var(--moca); transform: rotate(45deg); }
.countdown__rule:first-child::after { right: -3px; } .countdown__rule:last-child::after { left: -3px; }
.countdown__big {
  font-family: var(--f-display); font-size: clamp(4.4rem, 3.4rem + 5vw, 5.8rem); line-height: .95; color: var(--chocolate);
  font-variant-numeric: lining-nums tabular-nums; min-width: 2ch;
}
.countdown__label { font-weight: 500; font-size: var(--t-xs); letter-spacing: .32em; text-transform: uppercase; color: var(--cafe); margin-right: -.32em; }
.countdown__row { display: flex; align-items: flex-start; justify-content: center; gap: var(--s-3); margin-top: var(--s-3); }
.countdown__row div { display: grid; justify-items: center; min-width: 4.2rem; }
.countdown__row span[data-unit] { font-family: var(--f-display); font-size: 2rem; line-height: 1; color: var(--chocolate); font-variant-numeric: lining-nums tabular-nums; }
.countdown__row small { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--cafe); margin-top: var(--s-1); }
.countdown__sep { font-family: var(--f-display); font-size: 1.6rem; color: var(--moca); line-height: 1.1; }
.countdown__done { font-family: var(--f-display); font-size: var(--t-xl); color: var(--chocolate); }
.quote-line { font-style: italic; font-size: var(--t-lg); line-height: 1.4; color: var(--ink-soft); max-width: 26ch; text-wrap: balance; margin-top: var(--s-3); }

/* Lugares */
.map {
  position: relative; width: min(250px, 66vw); height: clamp(150px, 25svh, 250px);
  padding: 5px; border: 1px solid var(--line); background: var(--paper-raised);
  border-radius: 999px 999px 14px 14px / 46% 46% 14px 14px;
  box-shadow: 0 14px 26px -18px rgba(75, 46, 31, .55);
}
.map iframe, .map__veil {
  position: absolute; inset: 5px; width: calc(100% - 10px); height: calc(100% - 10px); border: 0;
  border-radius: 999px 999px 10px 10px / 46% 46% 10px 10px;
}
.map iframe { filter: sepia(.5) saturate(.55) contrast(.95) brightness(1.03); background: var(--paper-sunk); }
.map__veil { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6), inset 0 0 24px rgba(122, 78, 58, .18); }
.venue-plate { font-size: 1.2rem; line-height: 1.2; padding: .55rem 1.5rem; text-wrap: balance; max-width: 100%; }
.venue-meta { display: grid; gap: 0; font-size: var(--t-sm); color: var(--ink-soft); }
.venue-meta span:first-child { color: var(--ink); }
.note { font-style: italic; font-size: var(--t-sm); color: var(--ink-soft); max-width: 30ch; }

/* Itinerario: programa alternado a ambos lados de un eje central que se dibuja al llegar */
.panel#itinerario .panel__inner { gap: var(--s-3); }
.timeline {
  --node: 38px;
  position: relative; display: grid; gap: clamp(.55rem, 2.4svh, 1.5rem);
  width: 100%; max-width: 23rem; margin-top: var(--s-2);
}
.timeline::before {
  content: ""; position: absolute; left: 50%; top: calc(var(--node) / 2); bottom: calc(var(--node) / 2);
  width: 1px; margin-left: -.5px;
  background: linear-gradient(to bottom, transparent, var(--line) 6%, var(--line) 94%, transparent);
  transform-origin: top; transform: scaleY(1);
}
.js .timeline::before { transform: scaleY(0); transition: transform .4s ease-out; }
.js:not(.gate-closed) .panel.is-in .timeline::before { transform: scaleY(1); transition: transform 1.8s var(--ease-out) .25s; }
.timeline__item {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) var(--node) minmax(0, 1fr);
  align-items: center; column-gap: var(--s-3);
}
.timeline__time { grid-column: 1; grid-row: 1; justify-self: end; text-align: right; display: grid; justify-items: end; line-height: 1; }
.timeline__what { grid-column: 3; grid-row: 1; display: grid; gap: 2px; text-align: left; min-width: 0; }
.timeline__item.is-flip .timeline__time { grid-column: 3; justify-self: start; text-align: left; justify-items: start; }
.timeline__item.is-flip .timeline__what { grid-column: 1; text-align: right; justify-items: end; }
.timeline__mark { grid-column: 2; grid-row: 1; }

.timeline__num { font-family: var(--f-display); font-size: clamp(1.45rem, 1.2rem + 1vw, 1.75rem); color: var(--chocolate); font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.01em; }
.timeline__mer { margin-top: 3px; font-weight: 500; font-size: .68rem; letter-spacing: .24em; text-transform: uppercase; color: var(--cafe); }
.timeline__item.is-flip .timeline__mer { margin-left: .05em; }
.timeline__item:not(.is-flip) .timeline__mer { margin-right: -.24em; }
.timeline__title { font-family: var(--f-display); font-size: 1.08rem; line-height: 1.15; color: var(--chocolate); text-wrap: balance; }
.timeline__place { font-style: italic; font-size: .84rem; line-height: 1.25; color: var(--ink-soft); text-wrap: balance; }

.timeline__mark {
  position: relative; z-index: 1; width: var(--node); height: var(--node); display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%; background: var(--paper-raised); color: var(--cafe);
  box-shadow: inset 0 0 0 3px var(--paper-raised), inset 0 0 0 4px var(--line-soft), 0 6px 12px -8px rgba(75, 46, 31, .45);
}
.timeline__mark .icon { width: 17px; height: 17px; stroke-width: 1.4; }
/* Los dos momentos sagrados de la noche (ceremonia) y el cierre se marcan en chocolate */
.timeline__item:first-child .timeline__mark, .timeline__item:last-child .timeline__mark {
  background: var(--chocolate); color: var(--marfil); border-color: var(--chocolate);
  box-shadow: inset 0 0 0 3px var(--chocolate), inset 0 0 0 4px var(--cafe), 0 8px 14px -8px rgba(75, 46, 31, .6);
}
.js .timeline__mark { transform: scale(.4) rotate(-20deg); }
.js:not(.gate-closed) .panel.is-in .timeline__mark { transform: none; transition: transform .9s var(--ease-out) calc(var(--i, 0) * 110ms + 260ms); }

@media (min-width: 768px) {
  .timeline { --node: 42px; max-width: 25rem; }
  .timeline__title { font-size: 1.18rem; }
}
@media (max-height: 700px) {
  .timeline { --node: 32px; gap: .45rem; }
  .timeline__num { font-size: 1.3rem; }
  .timeline__mark .icon { width: 15px; height: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .js .timeline::before, .js .timeline__mark { transform: none !important; }
}

/* Vestimenta */
.dress-word { font-family: var(--f-display); font-size: clamp(3.6rem, 2.8rem + 5vw, 5rem); line-height: 1; color: var(--chocolate); }
.dress-art { display: flex; gap: var(--s-6); justify-content: center; }
.dress-art svg { width: 54px; height: auto; fill: none; stroke: var(--cafe); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.dress-art .thin { stroke-width: .8; stroke: var(--moca); }
.dress-art .fill { fill: var(--cafe); }

/* Regalo */
.envelope { width: 112px; height: auto; fill: var(--paper-raised); stroke: var(--cafe); stroke-width: 1.3; stroke-linejoin: round; filter: drop-shadow(0 10px 14px rgba(75, 46, 31, .15)); }
.envelope .thin { stroke: var(--moca); stroke-width: .9; fill: none; }
.envelope .seal { fill: var(--cafe); stroke: none; }
.envelope .seal-mark { stroke: var(--marfil); stroke-width: 1.2; fill: none; }

/* Despedida */
.closing-script { font-family: var(--f-script); font-size: clamp(3.6rem, 3rem + 4vw, 4.8rem); line-height: 1.1; color: var(--cafe); }
.closing-names { font-family: var(--f-display); font-size: var(--t-xl); color: var(--chocolate); }
.closing-names .script { font-size: .7em; }

/* ==========================================================================
   Botones
   ========================================================================== */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 52px; padding: 0 1.75rem;
  border: 1px solid transparent; border-radius: var(--radius-pill);
  font-family: var(--f-text); font-weight: 500; font-size: 1.05rem; letter-spacing: .05em;
  text-decoration: none;
  transition: background-color .35s var(--ease-out), color .35s var(--ease-out), box-shadow .35s var(--ease-out), transform .2s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.975); }
.btn--primary {
  background: var(--chocolate); color: var(--marfil);
  box-shadow: 0 0 0 3px var(--paper-raised), 0 0 0 4px var(--line), 0 12px 22px -14px rgba(75, 46, 31, .8);
}
.btn--primary:hover { background: var(--cafe); }
.btn--primary .icon { transition: transform .35s var(--ease-out); }
.btn--primary:hover .icon { transform: translateX(3px); }
.btn--outline {
  background: var(--paper-raised); color: var(--chocolate); border-color: var(--cafe);
  box-shadow: 0 0 0 3px var(--paper-raised), 0 0 0 4px var(--line-soft);
}
.btn--outline:hover { background: var(--chocolate); color: var(--marfil); border-color: var(--chocolate); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn__spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.btn.is-loading .btn__spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.link-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: 44px; padding: 0 .5rem; border: 0; background: none;
  color: var(--cafe); font-size: var(--t-sm); font-weight: 500; letter-spacing: .04em;
  text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: .35em; text-decoration-thickness: 1px;
  transition: color .3s var(--ease-out), text-decoration-color .3s var(--ease-out);
}
.link-btn:hover { color: var(--chocolate); text-decoration-color: var(--cafe); }

/* Píldora de avance (como en la referencia) */
.step-pill {
  position: absolute; z-index: 4; left: 50%; bottom: max(16px, calc(env(safe-area-inset-bottom) * .5 + 12px));
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: .45rem;
  min-height: 44px; padding: 0 1.2rem 0 1.35rem;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: var(--paper-raised);
  box-shadow: inset 0 0 0 3px var(--paper-raised), inset 0 0 0 4px var(--line-soft), 0 8px 18px -12px rgba(75, 46, 31, .5);
  color: var(--cafe); font-size: var(--t-sm); font-weight: 500; letter-spacing: .08em;
  transition: opacity .4s var(--ease-out), transform .4s var(--ease-out), color .3s;
}
.step-pill:hover { color: var(--chocolate); }
.step-pill .icon { transition: transform .4s var(--ease-out); animation: nudge 2.4s var(--ease-in-out) infinite; }
.step-pill.is-last .icon { transform: rotate(180deg); animation: none; }
.step-pill.is-hidden { opacity: 0; pointer-events: none; transform: translate(-50%, 10px); }
@keyframes nudge { 0%, 100% { translate: 0 0; } 50% { translate: 0 3px; } }

/* ==========================================================================
   Formulario RSVP
   ========================================================================== */
.panel--rsvp { align-items: start; padding-top: calc(var(--arch-safe-top) + var(--s-6)); }
.panel--rsvp .panel__inner { gap: var(--s-3); }
.rsvp { width: 100%; display: grid; gap: var(--s-4); text-align: left; margin-top: var(--s-2); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field { display: grid; gap: var(--s-1); }
.field__label { font-weight: 500; font-size: var(--t-sm); color: var(--chocolate); letter-spacing: .01em; padding: 0; }
.field__optional { font-weight: 400; font-style: italic; color: var(--ink-soft); font-size: .88em; margin-left: .25em; }
.field__input {
  width: 100%; min-height: 50px; padding: .65rem 1rem;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--paper-raised);
  font-size: 1.0625rem; line-height: 1.3; color: var(--chocolate);
  transition: border-color .25s, box-shadow .25s, background-color .25s;
  font-variant-numeric: lining-nums;
}
.field__input::placeholder { color: color-mix(in oklab, var(--cafe) 70%, var(--marfil)); }
.field__input:hover { border-color: var(--moca); }
.field__input:focus { outline: none; border-color: var(--cafe); box-shadow: 0 0 0 3px color-mix(in oklab, var(--beige) 75%, transparent); background: #fff; }
.field__input--area { min-height: 76px; resize: vertical; }
.field__hint { font-size: .82rem; line-height: 1.35; color: var(--ink-soft); }
.field__error { font-size: .86rem; font-weight: 500; color: var(--chocolate); line-height: 1.3; }
.field__error:not(:empty)::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: .45em; background: var(--cafe); transform: rotate(45deg) translateY(-2px); }
.field__error:empty { display: none; }
.is-invalid .field__input, .field__input[aria-invalid="true"] { border-color: var(--cafe); border-width: 2px; padding: calc(.65rem - 1px) calc(1rem - 1px); background: color-mix(in oklab, var(--beige) 22%, #fff); }

.choice { border: 0; margin: 0; padding: 0; display: grid; gap: var(--s-2); min-width: 0; }
.choice__options { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.choice__opt { position: relative; }
.choice__opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice__opt span {
  display: grid; place-items: center; min-height: 54px; padding: .4rem .6rem;
  border: 1px solid var(--line); border-radius: 14px; background: var(--paper-raised);
  font-size: 1rem; font-weight: 500; text-align: center; line-height: 1.2; color: var(--chocolate);
  transition: background-color .3s var(--ease-out), color .3s var(--ease-out), border-color .3s, box-shadow .3s;
}
.choice__opt:hover span { border-color: var(--moca); }
.choice__opt input:checked + span { background: var(--chocolate); color: var(--marfil); border-color: var(--chocolate); box-shadow: 0 10px 18px -12px rgba(75, 46, 31, .8); }
.choice__opt input:focus-visible + span { outline: 2px solid var(--cafe); outline-offset: 3px; }
.choice.is-invalid .choice__opt span { border-color: var(--cafe); }

.companions { display: grid; gap: var(--s-2); }
.companions__list { display: grid; gap: var(--s-2); }
.companion-row { display: flex; gap: var(--s-2); align-items: center; }
.companion-row .field__input { flex: 1; }
.companion-row__remove {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%; background: var(--paper-raised); color: var(--cafe);
}
.companion-row__remove:hover { color: var(--chocolate); border-color: var(--cafe); }

.rsvp-done { display: grid; justify-items: center; gap: var(--s-3); padding-top: var(--s-2); outline: none; }
.rsvp-done__mark { width: 56px; fill: none; stroke: var(--cafe); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.rsvp-done__mark path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 1s var(--ease-out) .2s forwards; }
.rsvp-done__title { font-family: var(--f-display); font-size: var(--t-lg); color: var(--chocolate); }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ==========================================================================
   Reproductor de música
   ========================================================================== */
.music {
  position: fixed; z-index: 20;
  /* Móvil: esquina superior derecha del marco, fuera del arco y lejos de la píldora «Desliza» */
  top: calc(var(--frame-top) + env(safe-area-inset-top) + 12px);
  right: calc(var(--frame-side) + env(safe-area-inset-right) + 12px);
  display: flex; align-items: center; gap: 6px;
}
.music__toggle, .music__vol-btn {
  position: relative; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--paper-raised); color: var(--cafe);
  transition: transform .3s var(--ease-out), background-color .4s var(--ease-out), color .4s, opacity .3s;
  -webkit-tap-highlight-color: transparent;
}
.music__toggle {
  width: 48px; height: 48px;
  box-shadow: inset 0 0 0 3px var(--paper-raised), inset 0 0 0 4px var(--line-soft), 0 10px 22px -12px rgba(75, 46, 31, .6);
}
.music__vol-btn { width: 44px; height: 44px; box-shadow: 0 8px 18px -12px rgba(75, 46, 31, .5); }
.music__vol-btn .icon { width: 19px; height: 19px; }
.music[data-volume="low"] .music__wave2, .music[data-volume="mute"] .music__wave2, .music[data-volume="mute"] .music__wave1 { opacity: 0; }
.music__vol-btn path { transition: opacity .25s; }
.music.is-open .music__vol-btn { background: var(--chocolate); color: var(--marfil); border-color: var(--chocolate); }
.music__toggle:active, .music__vol-btn:active { transform: scale(.94); }
@media (hover: hover) { .music__toggle:hover, .music__vol-btn:hover { transform: scale(1.05); } }
.music[data-state="playing"] .music__toggle { background: var(--chocolate); color: var(--marfil); box-shadow: inset 0 0 0 3px var(--chocolate), inset 0 0 0 4px var(--cafe), 0 10px 22px -12px rgba(75, 46, 31, .7); }
.music__note { width: 20px; height: 20px; transition: opacity .3s, transform .4s var(--ease-out); }
.music__bars { position: absolute; display: flex; align-items: flex-end; gap: 3px; height: 16px; opacity: 0; transform: scale(.6); transition: opacity .3s, transform .4s var(--ease-out); }
.music__bars i { width: 3px; height: 100%; background: currentColor; border-radius: 2px; transform-origin: bottom; animation: bars 1.1s var(--ease-in-out) infinite; animation-play-state: paused; }
.music__bars i:nth-child(2) { animation-delay: -.4s; } .music__bars i:nth-child(3) { animation-delay: -.75s; } .music__bars i:nth-child(4) { animation-delay: -.2s; }
.music[data-state="playing"] .music__note { opacity: 0; transform: scale(.6); }
.music[data-state="playing"] .music__bars { opacity: 1; transform: none; }
.music[data-state="playing"] .music__bars i { animation-play-state: running; }
@keyframes bars { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

/* Panel de volumen (se despliega hacia abajo en móvil) */
.music__panel {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: min(272px, calc(100vw - 2 * var(--frame-side) - 24px));
  display: grid; gap: var(--s-3);
  padding: var(--s-4) var(--s-4) var(--s-3);
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--paper-raised);
  box-shadow: inset 0 0 0 4px var(--paper-raised), inset 0 0 0 5px var(--line-soft), 0 18px 36px -18px rgba(75, 46, 31, .55);
  transform-origin: top right;
  animation: panel-in .35s var(--ease-out);
}
@keyframes panel-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.music__title { display: grid; font-family: var(--f-display); font-size: 1.05rem; line-height: 1.15; color: var(--chocolate); }
.music__title span { font-family: var(--f-text); font-style: italic; font-size: .85rem; color: var(--ink-soft); }
.music__volume { display: grid; grid-template-columns: 44px minmax(0, 1fr) 3.2rem; align-items: center; gap: var(--s-2); }
.music__mute { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--cafe); }
.music__mute:hover { color: var(--chocolate); background: color-mix(in oklab, var(--beige) 40%, transparent); }
.music__pct { font-size: .9rem; color: var(--ink-soft); text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.music__range { display: block; }
/* Deslizador táctil: zona de agarre de 44 px, riel fino y botón de 24 px */
.music__range input {
  --fill: 55%;
  -webkit-appearance: none; appearance: none; display: block;
  width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer; touch-action: none;
}
.music__range input::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background: linear-gradient(to right, var(--cafe) var(--fill), var(--beige) var(--fill));
}
.music__range input::-moz-range-track { height: 4px; border-radius: 4px; background: var(--beige); }
.music__range input::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--cafe); }
.music__range input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 24px; height: 24px; margin-top: -10px; border-radius: 50%;
  background: var(--chocolate); border: 3px solid var(--paper-raised); box-shadow: 0 0 0 1px var(--cafe), 0 4px 10px -4px rgba(75, 46, 31, .6);
}
.music__range input::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--chocolate); border: 3px solid var(--paper-raised); box-shadow: 0 0 0 1px var(--cafe);
}
.music__range input:focus-visible { outline: none; }
.music__range input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 1px var(--cafe), 0 0 0 4px var(--beige); }

/* ==========================================================================
   Visor de fotos
   ========================================================================== */
.lightbox {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: var(--s-5);
  border: 0; background: transparent; color: var(--marfil);
}
.lightbox[open] { display: grid; grid-template-rows: 1fr auto; gap: var(--s-4); place-items: center; animation: fade-in .4s var(--ease-out); }
.lightbox::backdrop { background: color-mix(in oklab, var(--chocolate) 92%, transparent); backdrop-filter: blur(4px); }
.lightbox__figure { display: grid; gap: var(--s-3); justify-items: center; min-height: 0; }
.lightbox__figure img { max-width: min(92vw, 900px); max-height: 74svh; width: auto; height: auto; border-radius: 6px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); }
.lightbox__figure figcaption { font-style: italic; color: var(--beige); text-align: center; max-width: 40ch; }
.lightbox__controls { display: flex; gap: var(--s-4); }
.lightbox__btn { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid color-mix(in oklab, var(--beige) 50%, transparent); border-radius: 50%; background: transparent; color: var(--marfil); }
.lightbox__btn:hover { background: color-mix(in oklab, var(--marfil) 12%, transparent); }
@keyframes fade-in { from { opacity: 0; } }

/* Navegación lateral (escritorio) */
.side-nav { display: none; }

/* ==========================================================================
   SweetAlert2 en la identidad de la invitación
   ========================================================================== */
.swal2-popup.wedding-swal {
  background: var(--paper-raised) var(--texture); color: var(--chocolate);
  border: 1px solid var(--line); border-radius: 22px; font-family: var(--f-text);
  box-shadow: inset 0 0 0 5px var(--paper-raised), inset 0 0 0 6px var(--line-soft), 0 30px 60px -24px rgba(75, 46, 31, .5);
  padding: 2rem 1.5rem 1.75rem;
}
.wedding-swal .swal2-title { font-family: var(--f-display); font-weight: 400; color: var(--chocolate); font-size: 1.7rem; }
.wedding-swal .swal2-html-container { color: var(--ink-soft); font-size: 1.05rem; line-height: 1.5; }
.wedding-swal .swal2-icon { border-color: var(--line) !important; color: var(--cafe) !important; }
.wedding-swal .swal2-icon.swal2-success [class^="swal2-success-line"] { background-color: var(--cafe) !important; }
.wedding-swal .swal2-icon.swal2-success .swal2-success-ring { border-color: color-mix(in oklab, var(--cafe) 35%, transparent) !important; }
.wedding-swal .swal2-icon.swal2-success [class^="swal2-success-circular-line"], .wedding-swal .swal2-icon.swal2-success .swal2-success-fix { background: transparent !important; }
.wedding-swal .swal2-confirm { background: var(--chocolate) !important; color: var(--marfil) !important; border-radius: 999px !important; min-height: 48px; padding: 0 1.8rem !important; font-family: var(--f-text); font-weight: 500; letter-spacing: .05em; box-shadow: none !important; }
.wedding-swal .swal2-confirm:focus-visible { outline: 2px solid var(--cafe) !important; outline-offset: 4px; }
.swal2-container.swal2-backdrop-show { background: color-mix(in oklab, var(--chocolate) 45%, transparent) !important; }

/* ==========================================================================
   Tablet 768–1023
   ========================================================================== */
@media (min-width: 768px) {
  :root { --frame-top: 24px; --t-md: 1.1875rem; }
  body { background-color: var(--paper-sunk); }
  .stage__flora { display: block; position: fixed; height: auto; pointer-events: none; opacity: .95; }
  .stage__flora--tl { top: -60px; right: -70px; width: min(40vw, 560px); transform: scaleX(-1); }
  .stage__flora--br { bottom: -70px; right: -70px; width: min(34vw, 480px); transform: rotate(180deg); }
  .frame {
    left: 50%; right: auto; width: min(620px, calc(100vw - 96px)); transform: translateX(-50%);
    background: var(--paper) var(--texture); border-radius: 8px;
    box-shadow: 0 1px 0 #fff inset, 0 40px 80px -40px rgba(75, 46, 31, .55), 0 12px 24px -16px rgba(75, 46, 31, .3);
  }
  .frame__flora--tl { width: 300px; top: -3%; left: -7%; }
  .frame__flora--br { width: 210px; bottom: -5%; right: -12%; }
  .panel { padding-inline: var(--s-8); }
  .gate__lace { width: min(70%, 620px); }
}

/* ==========================================================================
   Escritorio ≥1024
   ========================================================================== */
@media (min-width: 1024px) {
  .frame { width: min(580px, calc(100vw - 520px)); min-width: 500px; }
  .side-nav {
    display: grid; gap: var(--s-5); position: fixed; z-index: 5;
    left: clamp(32px, 6vw, 96px); top: 50%; transform: translateY(-50%);
    padding: var(--s-5) var(--s-5) var(--s-5) 0;
  }
  .side-nav__mark { font-family: var(--f-display); font-size: 1.6rem; color: var(--chocolate); line-height: 1; }
  .side-nav__mark .script { font-size: .8em; }
  .side-nav ol { display: grid; gap: 2px; border-left: 1px solid var(--line); }
  .side-nav a {
    position: relative; display: block; padding: .38rem 0 .38rem 1.1rem;
    color: var(--ink-soft); font-size: .98rem; text-decoration: none;
    transition: color .3s var(--ease-out), transform .3s var(--ease-out);
  }
  .side-nav a::before {
    content: ""; position: absolute; left: -4px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px;
    background: var(--chocolate); transform: rotate(45deg) scale(0); transition: transform .35s var(--ease-out);
  }
  .side-nav a:hover { color: var(--chocolate); transform: translateX(2px); }
  .side-nav a[aria-current="true"] { color: var(--chocolate); }
  .side-nav a[aria-current="true"]::before { transform: rotate(45deg) scale(1); }
  .music { top: auto; right: clamp(24px, 4vw, 64px); bottom: 32px; }
  .music__panel { top: auto; bottom: calc(100% + 10px); transform-origin: bottom right; }
}
@media (min-width: 1024px) and (max-width: 1199px) {
  .side-nav { display: none; }
  .frame { width: min(600px, calc(100vw - 160px)); }
}
@media (min-width: 1440px) {
  .stage__flora--tl { width: 600px; }
  .stage__flora--br { width: 520px; }
}

/* Teléfonos bajos (p. ej. 360×640): compactar sin perder jerarquía */
@media (max-height: 700px) {
  :root { --pill-zone: 80px; }
  .panel__inner { gap: var(--s-3); }
  .date-plaque { width: min(160px, 46vw); }
  .map { height: clamp(130px, 22svh, 200px); }
  .years__num { font-size: 4rem; }
}

/* ==========================================================================
   Movimiento reducido
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .js .reveal, .js .cover-names__name, .js .cover-names__and { filter: none !important; transform: none !important; transition: opacity .3s linear !important; transition-delay: 0s !important; }
  .gate__door { transition: opacity .4s linear; }
  .gate.is-opening .gate__door--left, .gate.is-opening .gate__door--right { transform: none; opacity: 0; }
  .gate__seal { animation: none; }
  .scroller { scroll-snap-type: y proximity; }
}
