:root {
  --cream: #f2efe3;
  --paper: #faf7ee;
  --blue: #2f5ea8;
  --sky: #e6ecf4;
  --coral: #d96f4f;
  --terracotta: #c9603f;
  --mist: #d5e0ef;
  --peach: #fbe3d6;

  --f-script: 'Homemade Apple', cursive;
  --f-hand: 'Gochi Hand', cursive;
  --f-sans: 'Jost', sans-serif;
  --f-serif: 'Lora', serif;
}

html, body {
  margin: 0;
  overflow-x: clip;
  background: var(--cream);
  color: var(--blue);
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
a { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; }
a:hover { color: var(--coral); }
input, button { font: inherit; color: inherit; }
::selection { background: var(--sky); color: var(--blue); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shared type ---------- */
.eyebrow {
  font-family: var(--f-sans);
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.h-script {
  margin: 0;
  margin-inline: auto;
  width: fit-content;
  max-width: 100%;
  font-family: var(--f-script);
  font-weight: 400;
  font-size: clamp(30px, 8vw, 50px);
  line-height: 1.4;
}
/* Hand-writing reveal: a soft-edged mask slides from left to right (driven by --write, 100% → 0%). */
.is-writing-title, .cd-num.is-writing {
  -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
  mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
  -webkit-mask-size: 260% 100%;
  mask-size: 260% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: var(--write, 100%) 0;
  mask-position: var(--write, 100%) 0;
}
.body-text {
  margin: 0;
  font-family: var(--f-serif);
  font-size: 17px;
  line-height: 1.7;
  text-wrap: pretty;
}
.pill {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1.5px solid var(--blue);
  border-radius: 30px;
  padding: 0 28px;
  font-family: var(--f-sans);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
@media (hover: hover) { .pill:hover { background: var(--blue); color: var(--cream); } }

/* ---------- illustrations ---------- */
.ilus { position: relative; width: 100%; height: 100%; }
.ilus img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
}
/* Illustrations drawn stroke by stroke (draw.js): hidden until swapped for the inline SVG. */
.js .ilus img[data-draw]:not(.draw-ready) { opacity: 0; }
.ilus .draw-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* ---------- easter eggs in the drawings (tap targets: [data-egg], see main.js) ---------- */
.egg-hit { cursor: pointer; -webkit-tap-highlight-color: transparent; }
/* The eraser: a mask stroke goes back and forth over the part and rubs it out (tap again to bring it back). */
.draw-svg .goma { stroke-dasharray: 1 2; stroke-dashoffset: 1.1; transition: stroke-dashoffset 1.4s ease-in-out; }
/* 03 · the truck's front wheel: the eraser rubs out the wheel, then the two girls are drawn in, stroke by stroke, where
   it was; the truck lines right behind them hide as they appear. Tap again to undo. */
.draw-svg.egg-rueda .goma { stroke-dashoffset: 0; }
.nenas path, .nenas circle { stroke-dasharray: 1 2; stroke-dashoffset: 1.01; transition: stroke-dashoffset .25s ease; }
.draw-svg.egg-rueda .nenas path, .draw-svg.egg-rueda .nenas circle { stroke-dashoffset: 0; transition: stroke-dashoffset .5s ease calc(1.2s + var(--i, 0) * .028s); }
.draw-svg .tapa { opacity: 0; transition: opacity .3s ease; }
.draw-svg.egg-rueda .tapa { opacity: 1; transition: opacity .8s ease 1.25s; }
/* 01: the flowers in the vases sway when tapped, swinging from the vase's mouth and settling */
.draw-svg .flores { transform-box: view-box; }
.draw-svg .flores-izq { transform-origin: 8400px 3940px; }
.draw-svg .flores-der { transform-origin: 22500px 3920px; }
.draw-svg.egg-florero-izq .flores-izq, .draw-svg.egg-florero-der .flores-der { animation: mecer 1.8s ease-out; }
@keyframes mecer { 0% { transform: rotate(0); } 15% { transform: rotate(-6deg); } 35% { transform: rotate(4.5deg); } 55% { transform: rotate(-3deg); } 75% { transform: rotate(1.5deg); } 100% { transform: rotate(0); } }
/* 04: a girl peeks in through the window (drawn in; the hill behind her hides as she appears) */
.draw-svg .espia { opacity: 1; }
.espia path { stroke-dasharray: 1 2; stroke-dashoffset: 1.01; transition: stroke-dashoffset .25s ease; }
.draw-svg.egg-ventana .espia path { stroke-dashoffset: 0; transition: stroke-dashoffset .45s ease calc(var(--i, 0) * .05s); }
.draw-svg.egg-ventana .tapa-espia { opacity: 1; transition: opacity .6s ease .1s; }
/* 05 · the sun sets: the circle goes down behind the horizon and its rays go down with it (both clipped at the horizon) */
.draw-svg .sol, .draw-svg .rayos { transform-box: view-box; transition: transform 2.6s cubic-bezier(.45, 0, .55, 1); }
.draw-svg.egg-sol .sol, .draw-svg.egg-sol .rayos { transform: translateY(760px); }
/* 05 · the ring: its sparkle lines twinkle out from the stone, one after the other */
.draw-svg .destello { transform-box: view-box; transform-origin: 4830px 7260px; }
.draw-svg.egg-anillo .destello { animation: destello 1.3s ease-in-out both; }
.draw-svg.egg-anillo .destello-2 { animation-delay: .08s; }
.draw-svg.egg-anillo .destello-3 { animation-delay: .16s; }
.draw-svg.egg-anillo .destello-4 { animation-delay: .24s; }
.draw-svg.egg-anillo .destello-5 { animation-delay: .32s; }
@keyframes destello {
  0%, 100% { transform: scale(1); opacity: 1; }
  20% { transform: scale(1.75); opacity: .35; }
  40% { transform: scale(.85); opacity: 1; }
  62% { transform: scale(1.5); opacity: .5; }
  82% { transform: scale(.95); opacity: 1; }
}
/* 07 · the toast: both arms swing back a little from the elbow, then in until the glasses clink, with a small
   bounce; the sparkles flash out from where the glasses meet */
.draw-svg .brazo, .draw-svg .chispas { transform-box: view-box; }
.draw-svg .brazo-izq { transform-origin: 1267px 6267px; }
.draw-svg .brazo-der { transform-origin: 10733px 6600px; }
.draw-svg .chispas { transform-origin: 5933px 2400px; }
.draw-svg.egg-brindis .brazo-izq { animation: brindis-izq 1.1s ease-in-out both; }
.draw-svg.egg-brindis .brazo-der { animation: brindis-der 1.1s ease-in-out both; }
.draw-svg.egg-brindis .chispas { animation: chispas 1.1s ease-out both; }
@keyframes brindis-izq { 0%, 100% { transform: rotate(0); } 32% { transform: rotate(-5deg); } 55% { transform: rotate(1.4deg); } 68% { transform: rotate(-.7deg); } 82% { transform: rotate(.4deg); } }
@keyframes brindis-der { 0%, 100% { transform: rotate(0); } 32% { transform: rotate(5deg); } 55% { transform: rotate(-1.4deg); } 68% { transform: rotate(.7deg); } 82% { transform: rotate(-.4deg); } }
@keyframes chispas { 0%, 45% { transform: scale(1); opacity: 1; } 52% { transform: scale(.8); opacity: .3; } 66% { transform: scale(1.25); opacity: 1; } 82% { transform: scale(.95); opacity: .7; } 100% { transform: scale(1); opacity: 1; } }
/* 06 · the theatre's front door swings open and the dark inside gets hatched in */
.draw-svg .hoja { transform-box: view-box; transition: transform 1s cubic-bezier(.3, .7, .3, 1) .2s; }
.draw-svg .hoja-izq { transform-origin: 5374px 0; }
.draw-svg .hoja-der { transform-origin: 6709px 0; }
.draw-svg.egg-puerta .hoja { transform: scaleX(.14); transition-delay: 0s; }
.adentro path { fill: none; stroke: var(--blue); stroke-width: 20; stroke-linecap: round; stroke-dasharray: 1 2; stroke-dashoffset: 1.01; transition: stroke-dashoffset .35s ease; }
.draw-svg.egg-puerta .adentro path { stroke-dashoffset: 0; transition-delay: calc(.7s + var(--i, 0) * .05s); }
.adentro path:nth-child(2) { --i: 1; } .adentro path:nth-child(3) { --i: 2; } .adentro path:nth-child(4) { --i: 3; } .adentro path:nth-child(5) { --i: 4; }
.adentro path:nth-child(6) { --i: 5; } .adentro path:nth-child(7) { --i: 6; } .adentro path:nth-child(8) { --i: 7; } .adentro path:nth-child(9) { --i: 8; }
.adentro path:nth-child(10) { --i: 9; } .adentro path:nth-child(11) { --i: 10; } .adentro path:nth-child(12) { --i: 11; } .adentro path:nth-child(13) { --i: 12; } .adentro path:nth-child(14) { --i: 13; }
/* 04 · the cards: the diamond on the face-up card is rubbed out and a tiny sword drawn in its place
   (coming back, the sword goes first and then the diamond returns) */
.draw-svg .goma-rombo { transition: stroke-dashoffset .8s ease-in-out .35s; }
.draw-svg.egg-cartas .goma-rombo { stroke-dashoffset: 0; transition-delay: 0s; }
.espadita path { fill: none; stroke: var(--blue); stroke-width: 33; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 2; stroke-dashoffset: 1.01; transition: stroke-dashoffset .3s ease; }
.draw-svg.egg-cartas .espadita path { stroke-dashoffset: 0; transition: stroke-dashoffset .45s ease .85s; }
.draw-svg.egg-cartas .espadita path:nth-child(2) { transition-delay: 1.2s; }
.draw-svg.egg-cartas .espadita path:nth-child(3) { transition-delay: 1.4s; }
.draw-svg.egg-cartas .espadita path:nth-child(4) { transition-delay: 1.55s; }
@media (prefers-reduced-motion: reduce) { .draw-svg .goma, .draw-svg .sol, .draw-svg .rayos, .draw-svg .hoja, .adentro path, .espadita path, .nenas path, .nenas circle, .espia path, .tapa { transition-duration: .01s !important; transition-delay: 0s !important; } .draw-svg.egg-anillo .destello, .draw-svg.egg-brindis .brazo, .draw-svg.egg-brindis .chispas, .draw-svg .flores { animation: none; } }
/* Empty slot: dashed frame + caption until the designer's drawing arrives. */
.ilus--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  text-align: center;
  font: 500 13px/1.3 system-ui, -apple-system, sans-serif;
  letter-spacing: .01em;
}
.ilus--empty::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px dashed currentColor;
  opacity: .35;
  pointer-events: none;
}
.ilus--empty svg { opacity: .45; }
.ilus--empty span { max-width: 90%; opacity: .75; }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(242, 239, 227, .94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(47, 94, 168, .15);
}
.nav__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.nav__mark {
  flex: none;
  white-space: nowrap;
  font-family: var(--f-script);
  font-size: 18px;
  line-height: 1.6;
  text-decoration: none;
}
.nav__links {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  font-family: var(--f-sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
  scrollbar-width: none;
}
.nav__links::-webkit-scrollbar { display: none; }
.nav__links a { text-decoration: none; padding: 8px 0; }
.nav__links .nav__rsvp { padding: 8px 14px; border: 1.5px solid var(--blue); border-radius: 30px; }
/* Touch devices: a nearly solid background instead of the backdrop blur, which is costly to repaint while scrolling. */
@media (pointer: coarse) { .nav { background: rgba(242, 239, 227, .98); backdrop-filter: none; -webkit-backdrop-filter: none; } }
/* Narrow phones: tighter menu so the logo stays on one line and RSVP isn't cut. */
@media (max-width: 400px) {
  .nav__inner { padding: 10px 14px; gap: 10px; }
  .nav__mark { font-size: 16px; }
  .nav__links { gap: 12px; font-size: 11px; letter-spacing: .08em; }
  .nav__links .nav__rsvp { padding: 7px 11px; }
}
@media (max-width: 340px) { .nav__links { gap: 9px; letter-spacing: .04em; } }

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 0 0;
}
.hero__to, .intro-screen__to { font-family: var(--f-hand); font-size: 22px; line-height: 1.2; padding: 0 20px 6px; text-align: center; }
/* on the letter itself, under the date: read as it slides out of the envelope */
.intro-screen__to { font-size: clamp(17px, 4.8vw, 21px); padding: 0 8px 2px; margin-top: clamp(12px, 4vw, 22px); transform: rotate(-2deg); }
.hero__kicker {
  font-family: var(--f-sans);
  font-size: 12px;
  letter-spacing: .24em;
  text-transform: uppercase;
  padding: 0 20px;
}
.hero__stage {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: clamp(400px, 64vh, 700px);
}
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
  cursor: pointer;
}
.hero__replay {
  position: absolute;
  right: 14px;
  bottom: 6px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--blue);
  background: var(--cream);
  color: var(--blue);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.hero__replay:hover { background: var(--blue); color: var(--cream); }
.hero__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 20px;
}
.hero__date { font-family: var(--f-hand); font-size: clamp(26px, 6vw, 34px); }
.hero__place { font-family: var(--f-sans); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }
/* "tocá las flores": right under the names (not near the table's vases), once the names are written */
.hero__hint {
  display: flex; align-items: flex-end; justify-content: center; gap: 4px;
  font-family: var(--f-hand); font-size: 15px; line-height: 1;
  margin: -6px 0 14px; opacity: 0; transform: translateY(4px);
  transition: opacity .8s ease, transform .8s ease;
}
.hero__hint svg { width: 22px; height: 25px; flex: none; }
html[data-hero-typed] .hero__hint { opacity: 1; transform: none; }
.hero__mesa {
  position: relative;
  width: 100%;
  max-width: 1400px;
  aspect-ratio: 4 / 3;  /* phones: taller frame, the table is cropped at the sides */
  margin-top: 28px;
}
@media (min-width: 720px) {
  .hero__mesa { aspect-ratio: 21 / 9; }
}

/* ---------- countdown ---------- */
.countdown { padding: 40px 20px 8px; display: flex; justify-content: center; }
.countdown__inner { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.countdown__title { font-family: var(--f-hand); font-size: 34px; line-height: 1.15; text-wrap: balance; }
.countdown__units { display: flex; justify-content: center; gap: 12px; }
.countdown__unit { width: 92px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cd-num { display: inline-block; }
.cd-num.is-pending { opacity: 0; }
.cd-num.is-writing { animation: cd-write .9s ease-in-out both; }
.cd-num.is-late { animation-delay: .45s; }
@keyframes cd-write { from { --write: 100%; -webkit-mask-position: 100% 0; mask-position: 100% 0; } to { --write: 0%; -webkit-mask-position: 0 0; mask-position: 0 0; } }
.cd-num.is-old { position: absolute; left: 0; right: 0; top: 0; text-align: center; animation: cd-old 1s ease forwards; }
@keyframes cd-old { 0%, 55% { opacity: 1; } 100% { opacity: 0; } }
.cd-scribble { position: absolute; left: -10%; top: 18%; width: 120%; height: 64%; overflow: visible; }
.cd-scribble path { fill: none; stroke: var(--blue); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1 2; stroke-dashoffset: 1; animation: cd-scribble .4s ease-out forwards; }
@keyframes cd-scribble { to { stroke-dashoffset: 0; } }
#cd-units { cursor: pointer; -webkit-tap-highlight-color: transparent; }
/* seconds easter egg: everything rewrites in a hurry */
.cd-fast .cd-num.is-writing { animation-duration: .35s; }
.cd-fast .cd-num.is-late { animation-delay: .12s; }
.cd-fast .cd-num.is-old { animation-duration: .45s; }
.cd-fast .cd-scribble path { animation-duration: .15s; }
.countdown__v { position: relative; font-family: var(--f-hand); font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown__l { font-family: var(--f-sans); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
.countdown__note { font-family: var(--f-serif); font-size: 17px; line-height: 1.6; max-width: 340px; text-wrap: pretty; }

/* ---------- intro ---------- */
.intro {
  max-width: 560px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.intro__ramo { width: 190px; aspect-ratio: 3 / 4; cursor: pointer; touch-action: manipulation; }
@media (max-width: 719px) { .intro__ramo { width: 150px; } }
.intro { position: relative; }
/* Little line-drawn roses tossed by a tap on the bouquet (main.js). */
.burst { position: absolute; inset: -160px 0 -60px; pointer-events: none; overflow: hidden; z-index: 2; }
.burst svg {
  position: absolute;
  overflow: visible;
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- story ---------- */
.story { max-width: 1000px; margin: 0 auto; padding: 56px 24px 72px; }
/* Hilo (pilot, hilo.js): one line across the page linking the story drawings (and the theatre). */
.hilo { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 0; }
.hilo__line { fill: none; stroke: var(--blue); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.story .h-script { margin-bottom: 40px; text-align: center; }
.story__list { display: flex; flex-direction: column; gap: 56px; }
.story__item { display: flex; flex-wrap: wrap; gap: 20px 56px; align-items: center; }
.story__item--rev { flex-direction: row-reverse; }
.story__art { flex: 1 1 300px; aspect-ratio: 1 / 1; max-width: 440px; margin: 0 auto; }
.story__text { flex: 1 1 280px; display: flex; flex-direction: column; gap: 10px; text-align: center; }
.story__year { color: var(--terracotta); }
.story__title { margin: 0; font-family: var(--f-hand); font-weight: 400; font-size: clamp(28px, 7vw, 40px); line-height: 1.1; }

/* ---------- the day ---------- */
.day { background: var(--sky); padding: 72px 20px; }
.day__inner { max-width: 520px; margin: 0 auto; }
.day .h-script { margin-bottom: 6px; text-align: center; }
.day__date { text-align: center; margin-bottom: 36px; }
.timeline { position: relative; display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.timeline::before {
  content: "";
  position: absolute;
  left: 39px;
  top: 40px;
  bottom: 40px;
  width: 1.5px;
  background: var(--blue);
  transform: scaleY(var(--line, 1));
  transform-origin: top;
}
.timeline__row {
  position: relative;
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 10px 0;
}
.timeline__halo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--sky);
  display: flex;
  align-items: center;
  justify-content: center;
}
.timeline__icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--cream);
  border: 1.5px solid var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
}
.timeline__text { display: flex; flex-direction: column; gap: 2px; }
.timeline__time { font-family: var(--f-sans); font-weight: 500; font-size: 14px; letter-spacing: .14em; }
.timeline__title { font-family: var(--f-hand); font-size: 30px; line-height: 1.05; }

/* ---------- venue ---------- */
.venue {
  max-width: 1000px;
  margin: 0 auto;
  padding: 72px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 28px 56px;
  align-items: center;
}
.venue__art { flex: 1 1 300px; aspect-ratio: 4 / 3; max-width: 480px; margin: 0 auto; }
.venue__text { flex: 1 1 280px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.venue .h-script { font-size: clamp(30px, 8vw, 46px); }
.venue__name { font-family: var(--f-hand); font-size: 28px; line-height: 1.1; }
.venue .pill { margin-top: 6px; }
/* Hand-drawn "¡puntualidad!" note circling the reception time (animated in anim.js). */
.venue__note { padding-bottom: 44px; }
.punctual-anchor { position: relative; white-space: nowrap; }
.punctual {
  position: absolute;
  left: -60px;
  top: -10px;
  overflow: visible;
  pointer-events: none;
}
.punctual__draw { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.punctual__label { font-family: var(--f-hand); font-size: 21px; fill: var(--blue); }

/* ---------- RSVP ---------- */
.rsvp { padding: 40px 14px 72px; display: flex; justify-content: center; scroll-margin-top: 60px; }
.rsvp__card {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: var(--paper);
  border: 1.5px solid var(--blue);
  padding: 52px 22px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  box-shadow: 0 18px 40px rgba(47, 94, 168, .10);
}
.rsvp__corner {
  position: absolute;
  top: 8px;
  width: 44px;
  height: 44px;
  border: 1.5px dashed rgba(47, 94, 168, .45);
}
.rsvp__corner--l { left: 8px; }
.rsvp__corner--r { right: 8px; }
.rsvp .h-script { font-size: clamp(30px, 8vw, 44px); }
.rsvp__deadline { letter-spacing: .18em; }
.rsvp__form { width: 100%; display: flex; flex-direction: column; gap: 20px; text-align: left; margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-family: var(--f-sans); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }
.field input {
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--blue);
  border-radius: 0;
  padding: 8px 2px;
  outline: none;
  width: 100%;
  color: var(--blue);
  font-family: var(--f-serif);
  font-size: 17px;
}
.field input::placeholder { color: rgba(47, 94, 168, .5); }
.field input.field__pin { font-family: var(--f-hand); font-size: 28px; letter-spacing: .3em; width: 7.5em; }
.field input.is-wrong { border-bottom-color: var(--terracotta); }
.field__help { font-family: var(--f-serif); font-size: 14px; opacity: .7; }
.field input.field__name { font-family: var(--f-hand); font-size: 26px; }
.rsvp__choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rsvp__opt {
  min-height: 52px;
  border: 1.5px solid var(--blue);
  border-radius: 40px;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-family: var(--f-hand);
  font-size: 22px;
}
.rsvp__opt[aria-pressed="true"] { background: var(--blue); color: var(--paper); }
.rsvp__extra { display: flex; flex-direction: column; gap: 18px; }
.rsvp__submit {
  width: 100%;
  min-height: 54px;
  margin-top: 6px;
  background: var(--blue);
  color: var(--paper);
  border: 0;
  border-radius: 40px;
  font-family: var(--f-sans);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .2em;
  text-transform: uppercase;
  cursor: pointer;
}
.rsvp__submit:disabled { opacity: .4; cursor: default; }
.rsvp__submit.is-waiting { opacity: .45; }
.rsvp__note { margin: 0; font-family: var(--f-hand); font-size: 18px; text-align: center; animation: nota .4s ease; }
@keyframes nota { from { opacity: 0; transform: translateY(-4px); } }
.rsvp__decline { align-self: center; opacity: .75; }
.rsvp__error { margin: 0; font-family: var(--f-serif); font-size: 15px; color: var(--terracotta); text-align: center; }
.rsvp__q { font-family: var(--f-hand); font-size: 26px; text-align: center; }
.rsvp__members { display: flex; flex-direction: column; }
.check {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 6px 2px;
  border-bottom: 1.5px dashed rgba(47, 94, 168, .3);
  cursor: pointer;
}
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box {
  flex: none;
  position: relative;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--blue);
  border-radius: 7px 5px 8px 6px;
  transition: background .15s;
}
.check__box::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 2px;
  width: 8px;
  height: 15px;
  border: solid var(--paper);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(40deg) scale(0);
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1);
}
.check input:checked + .check__box { background: var(--blue); }
.check input:checked + .check__box::after { transform: rotate(40deg) scale(1); }
.check input:focus-visible + .check__box { outline: 2px solid var(--coral); outline-offset: 2px; }
.check__name { font-family: var(--f-hand); font-size: 24px; line-height: 1.2; }
.rsvp__punctual { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 6px 0 4px; }
.rsvp__punctual-title { font-family: var(--f-hand); font-size: 30px; line-height: 1.1; transform: rotate(-2deg); }
.rsvp__punctual-line { width: 220px; height: 14px; overflow: visible; }
.rsvp__punctual-line path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 1 2;
  stroke-dashoffset: 1.01;
}
.rsvp__punctual.is-drawn .rsvp__punctual-line path { stroke-dashoffset: 0; transition: stroke-dashoffset .9s ease .5s; }
.rsvp__punctual-text { font-family: var(--f-serif); font-size: 16px; }
.rsvp__done { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.rsvp__stamp {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 2.5px solid var(--blue);
  box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5.5px var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-script);
  font-size: 24px;
  transform: rotate(-10deg);
}
.rsvp__stamp--no { border-style: dashed; opacity: .75; }
.rsvp__done-title { font-family: var(--f-hand); font-size: 30px; line-height: 1.15; }
.rsvp__done .body-text { line-height: 1.6; max-width: 400px; }
.rsvp__reset {
  min-height: 44px;
  background: transparent;
  border: 0;
  padding: 0 8px;
  font-family: var(--f-sans);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- gifts ---------- */
.gifts {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 24px 72px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.gifts .h-script { font-size: clamp(28px, 7vw, 40px); }
/* Bank details: a plain list, one detail per line, with a quiet "copiar". */
.bank { width: 100%; max-width: 420px; display: flex; flex-direction: column; }
.bank:not([hidden]) { animation: bank-in .5s ease both; }
@keyframes bank-in { from { opacity: 0; transform: translateY(-8px); } }
.bank__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "label copy" "value copy";
  align-items: center;
  column-gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid rgba(47, 94, 168, .2);
  text-align: left;
}
.bank__row:first-child { border-top: 1px solid rgba(47, 94, 168, .2); }
.bank__label { grid-area: label; font-family: var(--f-sans); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; opacity: .75; }
.bank__value { grid-area: value; font-family: var(--f-serif); font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.bank__cbu { font-variant-numeric: tabular-nums; letter-spacing: .03em; font-size: 16px; }
.bank__copy {
  grid-area: copy;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  font-family: var(--f-sans);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 4px;
  color: var(--blue);
  cursor: pointer;
}
.bank__copy.is-done { text-decoration: none; opacity: .7; }
@media (prefers-reduced-motion: reduce) { .bank:not([hidden]) { animation: none; } }

/* ---------- footer ---------- */
.footer {
  padding: 24px 20px calc(96px + env(safe-area-inset-bottom));
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.footer__art { width: 100%; max-width: 340px; aspect-ratio: 3 / 2; }
.footer__names { width: fit-content; max-width: 100%; font-family: var(--f-script); font-size: 30px; line-height: 1.5; }
.footer__meta { font-family: var(--f-sans); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; }

/* ---------- sticky RSVP ---------- */
.fab {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 28px;
  background: var(--blue);
  color: var(--paper);
  border-radius: 40px;
  box-shadow: 0 10px 24px rgba(47, 94, 168, .3);
  font-family: var(--f-sans);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.fab:hover { color: var(--paper); }

/* ---------- envelope intro ---------- */
.intro-screen { display: none; }
.intro-on { overflow: hidden; }
.intro-on .intro-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 24px 24px calc(24px + env(safe-area-inset-bottom));
  background: var(--cream);
  cursor: pointer;
  outline: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  transition: opacity .7s ease, visibility 0s linear .7s;
  /* Failsafe: never trap the page if the script doesn't run. */
  animation: intro-failsafe 0s linear 15s forwards;
}
@keyframes intro-failsafe { to { opacity: 0; visibility: hidden; pointer-events: none; } }

.env {
  position: relative;
  width: min(84vw, 440px);
  aspect-ratio: 10 / 7;
  margin-top: 12vh;
  perspective: 1200px;
  transition: transform .8s cubic-bezier(.5, 0, .2, 1);
}
.env__back {
  position: absolute;
  inset: 0;
  background: #ece5d2;
  border: 1.5px solid var(--blue);
  border-radius: 4px;
  z-index: 1;
}
.env__letter {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 5%;
  height: 90%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 7%;
  background: var(--paper);
  border: 1.5px solid var(--blue);
  text-align: center;
  transition: transform .9s cubic-bezier(.3, 0, .2, 1);
}
.env__kicker { font-family: var(--f-sans); font-size: 10px; letter-spacing: .24em; text-transform: uppercase; }
.env__names { font-family: var(--f-script); font-size: clamp(20px, 6.4vw, 30px); line-height: 1.6; }
.env__date { font-family: var(--f-hand); font-size: clamp(16px, 4.6vw, 20px); }
.env__front, .env__flap { position: absolute; left: 0; width: 100%; overflow: visible; }
.env__front { top: 0; height: 100%; z-index: 3; }
.env__front path, .env__flap path {
  fill: var(--paper);
  stroke: var(--blue);
  stroke-width: 1.5px;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.env__flap {
  top: 0;
  height: 80%;
  z-index: 4;
  transform-origin: 50% 0;
  transition: transform .7s cubic-bezier(.4, 0, .2, 1) .2s, z-index 0s linear .55s;
}
.env__seal {
  position: absolute;
  left: 50%;
  top: 77%;
  z-index: 5;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--paper);
  box-shadow: inset 0 0 0 4px var(--blue), inset 0 0 0 5.5px rgba(250, 247, 238, .55), 0 4px 10px rgba(47, 94, 168, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-script);
  font-size: 15px;
  line-height: 1;
  padding-top: 4px;
  transform: rotate(-8deg);
  transition: transform .35s ease, opacity .35s ease;
}
.intro-screen__hint { position: relative; width: 100%; height: 24px; font-family: var(--f-hand); font-size: 20px; text-align: center; }
.intro-screen__hint span { display: block; transition: opacity .4s ease; }
.intro-screen__tap { position: absolute; inset: 0; white-space: nowrap; opacity: 0; }
.intro-screen.is-ready .intro-screen__loading { opacity: 0; }
.intro-screen.is-ready .intro-screen__tap { opacity: 1; animation: intro-breathe 1.8s ease-in-out infinite; }
.intro-screen.is-ready .env__seal { animation: seal-pulse 1.8s ease-in-out infinite; }
@keyframes intro-breathe { 50% { opacity: .45; } }
@keyframes seal-pulse { 50% { transform: rotate(-8deg) scale(1.08); } }

/* Opening sequence (intro.js adds these in turn). */
.intro-screen.is-open .intro-screen__hint { opacity: 0; transition: opacity .3s ease; }
.intro-screen.is-open .env__seal { animation: none; opacity: 0; transform: rotate(20deg) scale(.3); }
.intro-screen.is-open .env__flap { transform: rotateX(180deg); z-index: 1; }
.intro-screen.is-out .env { transform: translateY(18%); }
.intro-screen.is-out .env__letter { transform: translateY(-62%); }
.intro-screen.is-gone { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-screen.is-gone .env__letter { transform: translateY(-62%) scale(1.08); }
