/* ==========================================================
   Savita & Droan · RSVP
   Palette drawn from the Save the Date: ivory, deep rose-wine,
   blush, lavender wisteria and candle gold.
   ========================================================== */

:root {
  --ivory: #FBF7F1;
  --ivory-2: #F2EBE1;
  --paper: #FFFDF9;
  --wine: #6B1626;
  --wine-2: #4C0E1A;
  --rose: #A8303F;
  --blush: #EBC7C3;
  --lavender: #B7A5CF;
  --gold: #B08A3E;
  --gold-soft: #E3CC97;
  --gold-text: #87662A;
  --ink: #3A2620;
  --muted: #74605A;
  --line: rgba(58, 38, 32, 0.12);

  --serif: "Playfair Display", "Times New Roman", Georgia, serif;
  --script: "Pinyon Script", "Snell Roundhand", cursive;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(.22, .8, .24, 1);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(58, 38, 32, .05), 0 18px 40px -18px rgba(76, 14, 26, .28);

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 24px;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
a, button, label, input, select { -webkit-tap-highlight-color: transparent; }

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

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

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  padding: 10px 16px; border-radius: 999px;
  background: var(--wine); color: var(--ivory);
  text-decoration: none; font-size: .875rem; letter-spacing: .08em;
  transform: translateY(-160%);
  transition: transform .25s var(--ease);
}
.skip-link:focus-visible { transform: none; }

/* ---------- shared type ---------- */
.title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 6.4vw, 4.2rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
  color: var(--ink);
}
.script {
  font-family: var(--script);
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  color: var(--gold);
  line-height: 1;
  margin: 0 0 .35em;
}
.script--lg { font-size: clamp(2.6rem, 7vw, 3.6rem); }
.eyebrow {
  margin: 0;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow--light { color: rgba(255, 248, 238, .86); }

.ornament { width: 160px; height: 14px; display: block; margin: 0 auto; fill: none; stroke: var(--gold); stroke-width: 1; }
.ornament path:last-child { fill: var(--gold); stroke: none; }

/* ---------- pills / buttons ---------- */
.pill {
  display: inline-flex; align-items: center; gap: .65em;
  min-height: 44px;
  padding: .7em 1.35em .7em .8em;
  border-radius: 999px;
  font-size: .78rem; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.pill__icon { width: 22px; height: 22px; flex: none; }
.pill__icon circle { fill: currentColor; opacity: .18; }
.pill__icon path { fill: currentColor; }
.pill--sm { min-height: 40px; padding-block: .55em; font-size: .7rem; }

.pill--glass {
  color: #FFF9F0;
  background: rgba(255, 250, 240, .10);
  border-color: rgba(255, 245, 228, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.pill--glass:hover { background: rgba(255, 250, 240, .22); border-color: var(--gold-soft); }

.pill--solid { color: var(--ivory); background: var(--wine); }
.pill--solid:hover { background: var(--wine-2); }
.pill--solid .pill__icon circle { opacity: .25; }
.pill--solid[aria-busy="true"] { cursor: progress; opacity: .85; }

.link-btn {
  background: none; border: 0; padding: .6em .2em;
  min-height: 44px;
  font-size: .78rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); cursor: pointer;
  touch-action: manipulation;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px;
  transition: color .25s, text-decoration-color .25s;
}
.link-btn:hover { color: var(--wine); text-decoration-color: currentColor; }

/* ---------- nav ---------- */
.nav {
  position: absolute; inset: 0 0 auto; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 16px max(20px, env(safe-area-inset-left));
  color: #FFF9F0;
}
.nav__mark {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--serif); font-size: 1.35rem; text-decoration: none; letter-spacing: .04em;
}
.nav__mark i { width: 1px; height: 1.1em; background: var(--gold-soft); }
.nav__links { display: none; gap: 2.2rem; }
.nav__links a {
  font-size: .72rem; font-weight: 400; letter-spacing: .22em; text-transform: uppercase;
  text-decoration: none; opacity: .88;
  padding: .6em 0;
  transition: opacity .25s;
}
.nav__links a:hover { opacity: 1; }
@media (min-width: 760px) {
  .nav { padding-inline: clamp(24px, 5vw, 72px); padding-top: 22px; }
  .nav__links { display: flex; }
}

/* ==========================================================
   HERO
   ========================================================== */
.hero {
  position: relative;
  height: 100vh; height: 100svh;
  min-height: 560px;
  overflow: hidden;
  display: grid; place-items: center;
  color: #FFF9F0;
  background: #1e1012;
  isolation: isolate;
}
.hero__media { position: absolute; inset: -6% 0 0; z-index: -2; will-change: transform; }
.hero__media img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 42%;
  transform: scale(1.12);
  transition: transform 2.6s var(--ease);
}
.is-loaded .hero__media img { transform: scale(1); }
.hero__veil {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(70% 55% at 50% 52%, rgba(28, 10, 14, .42), rgba(28, 10, 14, 0) 70%),
    linear-gradient(180deg, rgba(28, 10, 14, .45) 0%, rgba(28, 10, 14, .08) 30%, rgba(28, 10, 14, .18) 62%, rgba(28, 10, 14, .62) 100%);
}

.lights { position: absolute; inset: 0 0 auto; width: 100%; height: 26vh; min-height: 150px; z-index: -1; pointer-events: none; }
.lights path { fill: none; stroke: rgba(255, 236, 200, .32); stroke-width: 1; }
.lights .bulb { animation: twinkle 3.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

/* shooting stars: one canvas behind each section's content (js/sky.js) */
.sky-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero .sky-layer { z-index: -1; }
@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: .38; }
}

.hero__content {
  text-align: center;
  padding: 0 20px;
  margin-top: 4vh;
  will-change: transform, opacity;
}
.hero__script {
  font-family: var(--script);
  color: var(--gold-soft);
  font-size: clamp(1.6rem, 4.6vw, 2.6rem);
  margin: 0 0 .1em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}
.hero__names {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  line-height: .95;
  letter-spacing: -0.015em;
  font-size: clamp(3.6rem, 19vw, 9.6rem);
  text-shadow: 0 4px 40px rgba(20, 6, 8, .35);
  display: flex; flex-direction: column; align-items: center;
}
.hero__names .amp {
  font-style: italic;
  color: var(--gold-soft);
  font-size: .5em;
  line-height: 1.2;
  margin: .02em 0 .04em;
}
@media (min-width: 760px) {
  .hero__names { flex-direction: row; gap: .22em; align-items: baseline; font-size: clamp(4rem, 10.4vw, 10rem); }
  .hero__names .amp { margin: 0; font-size: .6em; }
}
.hero__names .ch { display: inline-block; }

.hero__meta {
  margin: 1.4rem 0 1.8rem;
  font-size: clamp(.72rem, 2.6vw, .86rem);
  font-weight: 400;
  letter-spacing: .26em; text-transform: uppercase;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .4em 1em;
  font-variant-numeric: lining-nums;
}
.hero__meta .dot { width: 4px; height: 4px; transform: rotate(45deg); background: var(--gold-soft); }
@media (max-width: 559px) {
  .hero__meta { flex-direction: column; gap: .55em; }
  .hero__meta .dot { display: none; }
}

.hero__cue {
  position: absolute; bottom: max(22px, env(safe-area-inset-bottom)); left: 50%;
  translate: -50% 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: .64rem; letter-spacing: .3em; text-transform: uppercase; text-decoration: none;
  opacity: .85;
  padding: 6px 12px;
}
.hero__cue i { width: 1px; height: 38px; background: linear-gradient(var(--gold-soft), transparent); position: relative; overflow: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .hero__cue i::after {
    content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%;
    background: #fff; animation: drip 2.2s var(--ease) infinite;
  }
}
@keyframes drip { to { top: 110%; } }

/* entrance */
@media (prefers-reduced-motion: no-preference) {
  .js .intro { opacity: 0; transform: translateY(14px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
  .js .hero__script.intro { transition-delay: .25s; }
  .js .hero__meta.intro { transition-delay: 1.15s; }
  .js .hero__content .pill.intro { transition-delay: 1.3s; }
  .js .hero__cue.intro { transition-delay: 1.6s; }
  .is-loaded .intro { opacity: 1 !important; transform: none !important; }
  .hero__cue.intro { transform: none; }

  .js .hero__names .ch { opacity: 0; transform: translateY(.35em); filter: blur(6px); transition: opacity 1s var(--ease), transform 1.1s var(--ease), filter 1s var(--ease); }
  .is-loaded .hero__names .ch { opacity: 1; transform: none; filter: none; }
}

/* ==========================================================
   SAVE THE DATE
   Page 1: a long scroll track. Its stage stays on screen while
   the photo wheel turns, and the scratch card comes round as
   the wheel's last item (js/wheel.js).
   Page 2: the tiles. The card is pinned to the screen while
   page 2 slides up, so it lands in the empty slot between them.
   ========================================================== */
.std {
  position: relative;
  /* card size, shared by the pinned card and the slot it lands in */
  --cardW: min(62vw, 300px, calc((100svh - 330px) / 1.4));
  --cardH: calc(var(--cardW) * 1.4);
  --tileH: 118px;
  --gap: 10px;
}
@media (min-width: 900px) {
  .std {
    --cardH: min(58svh, 470px, calc((100vw - 140px) / 2.4));
    --cardW: calc(var(--cardH) * 900 / 1260);
    --col: calc(var(--cardH) * .42);
    --gap: 14px;
  }
}

.std__p1 { position: relative; height: 100vh; height: 100svh; }
.has-wheel .std__p1 {
  --unit: 30svh;
  height: calc(100vh + var(--units, 0) * 30vh);
  height: calc(100svh + var(--units, 0) * var(--unit));
}
@media (min-width: 900px) { .has-wheel .std__p1 { --unit: 34svh; } }
.std__stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(48% 42% at 50% 50%, rgba(235, 199, 195, .34), rgba(235, 199, 195, 0) 72%),
    var(--ivory);
}
.std__p2 {
  position: relative;
  height: 100vh; height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: var(--ivory-2);
  display: grid; place-items: center;
  box-shadow: 0 -30px 60px -40px rgba(76, 14, 26, .25);
}
.std__p2 .sky-layer { z-index: -1; }

.std__head {
  position: absolute; left: 0; right: 0; z-index: 2;
  bottom: calc(50% + var(--cardH) / 2 + clamp(14px, 3svh, 28px));
  text-align: center;
  padding: 0 16px;
}
.std__hint {
  margin: .7rem 0 0;
  font-size: .78rem; letter-spacing: .24em; text-transform: uppercase; color: var(--muted);
}

/* the pinned card */
.std__cardlayer { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.std__cardpin {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  display: grid; place-items: center;
}
.scratch-wrap { pointer-events: auto; width: var(--cardW); height: var(--cardH); }

/* shooting stars */
.stars { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* the photo wheel */
.wheel, .wheel__label, .wheel__count, .wheel__index { display: none; }
.has-wheel .wheel { display: block; }
.has-wheel .wheel__label { display: grid; }
.has-wheel .wheel__count, .has-wheel .wheel__index { display: flex; }
.has-wheel .std__head, .has-wheel .scratch-wrap { opacity: 0; }

.wheel { position: absolute; inset: 0; z-index: 1; }
.wheel__ring {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0;
  transform-style: preserve-3d;
  will-change: transform;
}
.wheel__card {
  position: absolute; left: 0; top: 0; margin: 0;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  will-change: transform, opacity;
}
.wheel__face {
  position: relative; display: block;
  width: 100%; height: 100%;
  border-radius: 16px; overflow: hidden;
  background: var(--blush);
  box-shadow: 0 26px 50px -26px rgba(76, 14, 26, .55), 0 0 0 1px rgba(176, 138, 62, .3);
}
.wheel__face img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
/* a thin gold inner frame, like the scratch card's */
.wheel__face::after {
  content: ""; position: absolute; inset: 7px;
  border: 1px solid rgba(255, 242, 214, .6); border-radius: 11px;
  pointer-events: none;
}

.wheel__label {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  width: calc(var(--ringR, 200px) * 1.32);
  justify-items: center; gap: .15em;
  text-align: center;
  pointer-events: none;
}
.wheel__script { font-family: var(--script); color: var(--gold); font-size: calc(var(--ringR, 200px) * .26); line-height: 1.05; }
.wheel__names { font-family: var(--serif); color: var(--ink); font-size: calc(var(--ringR, 200px) * .1); letter-spacing: .02em; }
.wheel__cue {
  margin-top: .9rem;
  font-size: .66rem; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: var(--muted);
}

.wheel__count {
  position: absolute; z-index: 2; left: clamp(14px, 6vw, 96px); top: 50%;
  translate: 0 -50%;
  margin: 0;
  flex-direction: column; align-items: flex-start; gap: .35em;
  pointer-events: none;
}
.wheel__num { font-family: var(--serif); font-size: clamp(1.6rem, 4.6vw, 4rem); line-height: 1; color: var(--wine); font-variant-numeric: lining-nums tabular-nums; }
.wheel__of { font-size: .66rem; letter-spacing: .28em; color: var(--muted); font-variant-numeric: tabular-nums; }

.wheel__index {
  position: absolute; z-index: 2; right: clamp(6px, 4vw, 64px); top: 50%;
  translate: 0 -50%;
  margin: 0; padding: 0; list-style: none;
  flex-direction: column;
}
.wheel__dot {
  position: relative; display: block;
  width: 24px; height: 24px; padding: 0;
  border: 0; background: none; cursor: pointer;
}
.wheel__dot::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 6px; height: 6px; margin: -3px;
  background: rgba(176, 138, 62, .4);
  transform: rotate(45deg);
  transition: background-color .35s var(--ease), transform .35s var(--ease);
}
.wheel__dot:hover::before { background: var(--gold); }
.wheel__dot.is-active::before { background: var(--wine); transform: rotate(45deg) scale(1.6); }
@media (max-width: 699px) {
  .wheel__dot { width: 18px; height: 18px; }
  .wheel__dot::before { width: 5px; height: 5px; margin: -2.5px; }
}
@media (hover: hover) and (pointer: fine) {
  .has-wheel .std__stage { cursor: grab; }
  .has-wheel .std__stage.is-dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }
}

/* page 2 grid: phone = 3 tiles, card, 3 tiles */
.bento {
  display: grid;
  width: min(calc(100vw - 32px), 420px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: var(--tileH) var(--cardH) var(--tileH);
  grid-template-areas:
    "t1 t2 t3"
    "slot slot slot"
    "t4 t5 t6";
  gap: var(--gap);
}
.t1 { grid-area: t1; } .t2 { grid-area: t2; } .t3 { grid-area: t3; }
.t4 { grid-area: t4; } .t5 { grid-area: t5; } .t6 { grid-area: t6; }
.bento__slot { grid-area: slot; justify-self: center; width: var(--cardW); height: var(--cardH); }

.tile {
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px solid rgba(176, 138, 62, .16);
  box-shadow: 0 1px 2px rgba(58, 38, 32, .04);
  padding: 22px 12px 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  min-height: 150px;
}
.tile__icon { width: 34px; height: 34px; fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; margin-bottom: 10px; }
.tile__big { margin: 0; font-family: var(--serif); font-size: 2rem; line-height: 1.1; color: var(--ink); font-variant-numeric: lining-nums; }
.tile__small { margin: .35rem 0 0; font-size: .82rem; color: var(--muted); line-height: 1.35; max-width: 14ch; }

@media (max-width: 899px) {
  .tile { min-height: 0; padding: 10px 6px; }
  .tile__icon { width: 24px; height: 24px; margin-bottom: 4px; }
  .tile__big { font-size: 1.45rem; }
  .tile__small { font-size: .7rem; margin-top: .15rem; }
}

/* scratch card */
.scratch {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: var(--wine);
  box-shadow: 0 30px 60px -28px rgba(76, 14, 26, .55), 0 2px 6px rgba(76, 14, 26, .12);
  touch-action: none;
  user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.scratch__reveal { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scratch__canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Ccircle cx='22' cy='22' r='19' fill='rgba(255,248,236,.18)' stroke='%23F2DFAF' stroke-width='1.5'/%3E%3Ccircle cx='22' cy='22' r='2' fill='%23F2DFAF'/%3E%3C/svg%3E") 22 22, crosshair;
  transition: opacity .9s var(--ease);
}
.scratch[data-state="revealed"] { touch-action: auto; }
.scratch[data-state="revealed"] .scratch__canvas { opacity: 0; pointer-events: none; }
.scratch__btn {
  position: absolute; left: 50%; bottom: 16px; translate: -50% 0;
  padding: .7em 1.2em; border-radius: 999px; border: 1px solid var(--gold-soft);
  background: rgba(76, 14, 26, .9); color: var(--gold-soft);
  font-size: .7rem; letter-spacing: .2em; text-transform: uppercase;
  cursor: pointer;
  opacity: 0; pointer-events: none;
}
.scratch__btn:focus-visible { opacity: 1; pointer-events: auto; }
.scratch[data-state="revealed"] .scratch__btn { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .scratch[data-state="revealed"] { animation: settle 1s var(--ease); }
}
@keyframes settle {
  0% { transform: scale(1); }
  40% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

@media (min-width: 900px) {
  .bento {
    width: auto;
    grid-template-columns: var(--col) var(--col) var(--cardW) var(--col) var(--col);
    grid-template-rows: repeat(2, calc((var(--cardH) - var(--gap)) / 2));
    grid-template-areas:
      "t1 t2 slot t4 t6"
      "t3 t2 slot t5 t6";
  }
  .tile { min-height: 0; padding: 14px 10px; }
  .tile__icon { width: calc(var(--cardH) * .085); height: calc(var(--cardH) * .085); }
  .tile__big { font-size: calc(var(--cardH) * .085); }
  .tile__small { font-size: max(.78rem, calc(var(--cardH) * .033)); }
}

/* tiles start hidden; scroll drops them into place (JS) */
@media (prefers-reduced-motion: no-preference) {
  .js .bento .tile { opacity: 0; will-change: transform, opacity; }
}

/* ==========================================================
   RSVP
   ========================================================== */
/* a dark, clear night sky (js/sky.js) with the hero's fairy lights along the top (js/main.js) */
.rsvp {
  --gh: clamp(84px, 9vw, 130px);       /* room for the lights along the top */
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--gh) 22px clamp(46px, 6svh, 64px);
  overflow: hidden;
  isolation: isolate;
  color: #FFF8EE;
  background:
    radial-gradient(130% 55% at 50% 118%, rgba(40, 34, 48, .6), rgba(40, 34, 48, 0) 62%),
    linear-gradient(180deg, #020309 0%, #03050C 38%, #060914 72%, #0A0D1B 100%);
}
@media (min-width: 820px) {
  .rsvp { padding: calc(var(--gh) * .92) 48px clamp(44px, 5svh, 60px); }
}
.rsvp__night, .rsvp__sky { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.rsvp__night { z-index: -3; }
.rsvp__sky { z-index: -2; }
.lights--rsvp { z-index: -1; }
.rsvp__head { text-align: center; max-width: 720px; margin: 0 auto clamp(16px, 3svh, 36px); }
.rsvp__head .script { font-size: clamp(1.5rem, 3.4vw, 2rem); margin-bottom: .2em; color: var(--gold-soft); }
.rsvp__head .title { font-size: clamp(2.2rem, 5.6vw, 3.3rem); color: #FFF8EE; text-shadow: 0 2px 30px rgba(255, 214, 150, .18); }
.title--lines .line { display: block; overflow: hidden; padding-bottom: .06em; }
.title--lines .line > span { display: inline-block; }
.rsvp__lede { margin: .6rem auto 0; color: rgba(255, 244, 230, .74); font-size: .9rem; max-width: 46ch; }
@media (min-width: 820px) {
  .rsvp__head .title--lines .line { display: inline-block; vertical-align: top; }
  .rsvp__lede { max-width: none; }
  .br-sm { display: none; }
}

.card {
  width: 100%; max-width: 1000px; margin: 0 auto;
  color: var(--ink);
  background: var(--paper);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(227, 204, 151, .28), 0 30px 80px -30px rgba(0, 0, 0, .7), 0 0 90px -20px rgba(255, 214, 150, .16);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.card__media { position: relative; margin: 0; aspect-ratio: 16 / 9; }
.card__media .eyebrow { letter-spacing: .12em; font-size: .64rem; }
.card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 40%; }
.card__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20, 8, 10, .05) 15%, rgba(20, 8, 10, .62) 50%, rgba(20, 8, 10, .9));
}
.card__media figcaption { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 14px 18px; color: #FFF8EE; }
.card__title { font-family: var(--serif); font-size: clamp(1.5rem, 4.6vw, 2.2rem); line-height: 1.08; margin: .35rem 0 .4rem; text-wrap: balance; }
.card__copy { margin: 0; font-size: .86rem; line-height: 1.5; opacity: .92; max-width: 40ch; }

@media (min-width: 820px) {
  .card { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); min-height: clamp(420px, 56svh, 540px); }
  .card__media { aspect-ratio: auto; }
  .card__media img { object-position: 78% 40%; }
  .card__media .eyebrow { letter-spacing: .2em; font-size: .7rem; }
  .card__media figcaption { padding: 28px 30px; }
}

/* form */
.form { padding: 20px 18px 22px; display: flex; flex-direction: column; min-width: 0; }
@media (min-width: 820px) { .form { padding: 28px 38px 28px; } }
.form__top { display: flex; justify-content: space-between; align-items: center; }
.form__count { font-size: .72rem; letter-spacing: .18em; color: var(--muted); font-variant-numeric: tabular-nums; }
.form__bar { height: 1px; background: var(--line); margin: 10px 0 clamp(18px, 2.6svh, 26px); position: relative; }
.form__bar i { position: absolute; left: 0; top: -.5px; height: 2px; width: 50%; background: var(--wine); transition: width .6s var(--ease); }
.form[data-at="2"] .form__bar i, .form[data-at="3"] .form__bar i { width: 100%; }

.step { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; flex: 1; }
.step[hidden] { display: none; }
.step__q {
  padding: 0;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.9rem, 5.2vw, 2.5rem);
  line-height: 1.08; margin: 0 0 .6rem; text-wrap: balance;
  color: var(--ink);
}
.step__sub { margin: 0 0 1.1rem; color: var(--muted); font-size: .9rem; max-width: 44ch; }
.step[data-step="2"] .step__q { font-size: clamp(1.45rem, 3.4vw, 1.9rem); margin-bottom: .35rem; }
@media (prefers-reduced-motion: no-preference) {
  .step.is-entering, .done.is-entering { animation: stepIn .6s var(--ease) both; }
}
@keyframes stepIn {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: none; }
}

.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice { position: relative; display: block; cursor: pointer; touch-action: manipulation; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice__face {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 96px; padding: 14px 10px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--ivory);
  font-size: .7rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; text-align: center;
  color: var(--muted);
  transition: background-color .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease), transform .35s var(--ease);
}
.choice__face svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.choice:hover .choice__face { border-color: rgba(107, 22, 38, .4); color: var(--wine); }
.choice input:focus-visible + .choice__face { outline: 2px solid var(--gold); outline-offset: 3px; }
.choice input:checked + .choice__face { background: var(--wine); border-color: var(--wine); color: var(--gold-soft); }
.choice input:checked + .choice__face span { color: #FFF4E6; }

.step__actions { margin-top: auto; padding-top: 14px; display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.step__actions--split { justify-content: space-between; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.field label { font-size: .72rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.field .opt { text-transform: none; letter-spacing: 0; font-weight: 300; }
.field input, .field select, .field textarea {
  width: 100%;
  font-size: 1rem; /* 16px keeps iOS from zooming */
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ivory);
  transition: border-color .25s, box-shadow .25s, background-color .25s;
}
.field textarea { resize: vertical; min-height: 88px; }
.field select {
  appearance: none; -webkit-appearance: none;
  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='%2374605A' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 36px;
}
.field input::placeholder, .field textarea::placeholder { color: #A8968F; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: none; border-color: var(--gold); background: #fff;
  box-shadow: 0 0 0 3px rgba(176, 138, 62, .2);
}
.field [aria-invalid="true"] { border-color: var(--rose); }
.field-row { display: grid; gap: 0 14px; }
@media (min-width: 520px) { .field-row { grid-template-columns: 1fr 1fr; } }

.field__error, .form__error { margin: 0; font-size: .82rem; color: var(--rose); min-height: 0; }
.field__error:empty, .form__error:empty { display: none; }
#attending-error { margin-top: 10px; }

.when-yes[hidden] { display: none; }

.done { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; padding: 20px 0; }
.done[hidden] { display: none; }
.done:focus, .step:focus { outline: none; }
.done__title { font-family: var(--serif); font-size: clamp(1.6rem, 4.4vw, 2.1rem); line-height: 1.15; margin: 0 0 .6rem; text-wrap: balance; max-width: 22ch; overflow-wrap: anywhere; }
.done .ornament { margin: 6px auto 10px; }

/* once the RSVP is confirmed, a quiet nudge down to the final details */
.done__cue {
  margin-top: clamp(16px, 3svh, 28px);
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 6px 12px;
  font-size: .62rem; letter-spacing: .3em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  color: var(--muted);
  transition: color .3s;
}
.done__cue i { width: 1px; height: 30px; background: linear-gradient(var(--gold), transparent); position: relative; overflow: hidden; }
.done__cue:hover { color: var(--wine); }
.done__cue:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .done__cue { animation: cueIn 1s var(--ease) .9s both; }
  .done__cue i::after {
    content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%;
    background: var(--wine); animation: drip 2.2s var(--ease) infinite;
  }
}
@keyframes cueIn { from { opacity: 0; transform: translateY(-6px); } }

/* scroll reveals */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
  .js .reveal.is-in { opacity: 1; transform: none; }
  .js .card.reveal { transition-delay: .15s; }
  .js .title--lines .line > span { transform: translateY(105%); transition: transform 1.1s var(--ease); }
  .js .title--lines .line:nth-child(2) > span { transition-delay: .12s; }
  .js .title--lines.is-in .line > span { transform: none; }
}

/* ==========================================================
   FINALE: a heart of the photo grows until it fills the screen,
   then the details fade in
   ========================================================== */
.finale { position: relative; background: var(--ivory); }
.finale__stage {
  position: relative;
  height: 100vh; height: 100svh;
  overflow: hidden;
}
.finale__photo { position: absolute; inset: 0; will-change: clip-path; }
.finale__photo img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: 48% 55%;
  transform-origin: 50% 50%;
  will-change: transform;
}
.finale__veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 50% 50%, rgba(30, 8, 14, .55), rgba(30, 8, 14, .35) 80%),
    rgba(30, 8, 14, .2);
}

.finale__names {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  gap: calc(min(max(150px, 34vw), 400px) + clamp(20px, 4vw, 56px));
  pointer-events: none;
}
.finale__name {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 5.2vw, 3.4rem);
  color: var(--ink);
  will-change: transform, opacity;
}
@media (max-width: 600px) {
  .finale__names { gap: calc(min(max(150px, 34vw), 400px) + 14px); }
  .finale__name { font-size: 1.45rem; }
}

.finale__details {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, 86vw);
  text-align: center;
  color: #FFF8EE;
  text-shadow: 0 2px 22px rgba(20, 4, 8, .55);
}
.finale__script { color: var(--gold-soft); margin-bottom: .1em; font-size: clamp(2rem, 5vw, 2.8rem); }
.finale__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  line-height: 1.05; margin: 0;
}
.ornament--light { stroke: var(--gold-soft); margin: clamp(14px, 2.6svh, 24px) auto; }
.ornament--light path:last-child { fill: var(--gold-soft); }
.facts { margin: 0; display: grid; gap: clamp(12px, 2.2svh, 20px); }
.facts div { display: grid; gap: 2px; }
.facts dt {
  font-size: .7rem; font-weight: 500; letter-spacing: .32em; text-transform: uppercase;
  color: var(--gold-soft);
}
.facts dd {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 3.4vw, 1.8rem);
  font-variant-numeric: lining-nums;
}

/* Scroll-driven version (motion allowed): a tall track with a sticky stage */
@media (prefers-reduced-motion: no-preference) {
  .js .finale__track { height: 300vh; }
  .js .finale__stage { position: sticky; top: 0; }
  .js .finale__veil { opacity: 0; }
  /* the details fade in one after another once the heart is nearly full (js adds .is-shown) */
  .js .finale__script, .js .finale__title, .js .ornament--light, .js .facts > div {
    opacity: 0; transform: translateY(16px); filter: blur(5px);
    transition: opacity .9s var(--ease), transform 1s var(--ease), filter .9s var(--ease);
  }
  .js .finale__details.is-shown .finale__script,
  .js .finale__details.is-shown .finale__title,
  .js .finale__details.is-shown .ornament--light,
  .js .finale__details.is-shown .facts > div { opacity: 1; transform: none; filter: none; }
  .finale__details.is-shown .finale__title { transition-delay: .1s; }
  .finale__details.is-shown .ornament--light { transition-delay: .2s; }
  .finale__details.is-shown .facts > div:nth-child(1) { transition-delay: .3s; }
  .finale__details.is-shown .facts > div:nth-child(2) { transition-delay: .4s; }
  .finale__details.is-shown .facts > div:nth-child(3) { transition-delay: .5s; }
}
/* Without motion: the full photo with the details, names hidden */
@media (prefers-reduced-motion: reduce) {
  .finale__names { display: none; }
}

/* ---------- petals (burst after the reveal) ---------- */
.petals { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

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