/* =============================================================
   WEDDING TEMPLATE — Sage & Cream
   Type: Cormorant Garamond (display) + Jost (UI/body)
   ============================================================= */

:root {
  /* ---- brand ---- */
  --sage-900: #2C352D;
  --sage-800: #3B473C;
  --sage-700: #4E5F50;
  --sage-600: #647A66;
  --sage-500: #7C8F7B;
  --sage-400: #9AAB98;
  --sage-300: #B7C4B4;
  --sage-200: #D5DED1;
  --sage-100: #E7EDE3;

  --cream-50: #FDFBF6;
  --cream-100: #F7F4EC;
  --cream-200: #F0EBDF;
  --cream-300: #E4DDCC;

  --gold-600: #8A6C3E;
  --gold-500: #A9884F;
  --gold-400: #C0A473;

  --ink: #23281F;
  --ink-soft: #5A6157;

  /* ---- semantic ---- */
  --bg: var(--cream-100);
  --surface: var(--cream-50);
  --surface-alt: #FFFFFF;
  --fg: var(--ink);
  --fg-muted: var(--ink-soft);
  --border: var(--cream-300);
  --border-strong: var(--sage-300);
  --primary: var(--sage-700);
  --on-primary: #FFFFFF;
  --accent: var(--gold-600);
  --danger: #A03A2B;
  --ring: var(--sage-600);

  /* ---- type ---- */
  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-ui: "Jost", "Helvetica Neue", Arial, sans-serif;

  /* ---- spacing (spacious scale) ---- */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 96px;

  --radius-sm: 4px;
  --radius: 10px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(35, 40, 31, .05), 0 2px 8px rgba(35, 40, 31, .04);
  --shadow-md: 0 4px 12px rgba(35, 40, 31, .07), 0 12px 32px rgba(35, 40, 31, .06);
  --shadow-lg: 0 10px 30px rgba(35, 40, 31, .10), 0 30px 70px rgba(35, 40, 31, .09);

  --dur: 240ms;
  --ease: cubic-bezier(.22, .61, .36, 1);

  /* ---- z-index scale ---- */
  --z-dock: 40;
  --z-topbar: 50;
  --z-lightbox: 100;
  --z-toast: 110;
  --z-cover: 200;
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; }
/* A `display` value in a class would otherwise beat the hidden attribute and
   leave the element on screen — invisible overlays eat clicks. Keep this first. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; height: 100%; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 400; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; }

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

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 300;
  padding: 10px 18px; border-radius: var(--radius-sm);
  background: var(--sage-800); color: #fff;
  font-size: .78rem; letter-spacing: .1em; text-decoration: none;
  transition: top var(--dur) var(--ease);
}
.skip:focus { top: 12px; }
#main:focus { outline: none; }

/* ============ SHARED ============ */
.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--space-3); }
.wrap--narrow { max-width: 760px; }

.section { padding-block: var(--space-6); position: relative; }
.section--muted { background: var(--cream-200); }
.section--accent { background: linear-gradient(170deg, var(--sage-100), var(--cream-200)); }

.section__head { text-align: center; margin-bottom: var(--space-5); }
.section__head--left { text-align: left; margin-bottom: var(--space-4); }
.section__title {
  font-size: clamp(2rem, 5vw, 2.9rem);
  letter-spacing: .01em;
  color: var(--sage-900);
}
.section__lede {
  margin-top: var(--space-2);
  max-width: 56ch;
  margin-inline: auto;
  color: var(--fg-muted);
  font-size: .95rem;
}
.section__head--left .section__lede { margin-inline: 0; }

.eyebrow {
  font-size: .7rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 400;
  margin-bottom: var(--space-2);
}
.eyebrow--light { color: var(--cream-200); }

.ico { width: 20px; height: 20px; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico--lg { width: 34px; height: 34px; margin-inline: auto; margin-bottom: var(--space-2); color: var(--sage-500); }

.ornament { color: var(--sage-400); margin: 0 auto var(--space-2); width: 120px; }
.ornament svg { width: 100%; height: auto; stroke-linecap: round; }
.ornament--lg { width: 180px; margin-block: var(--space-3); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 28px;
  font-size: .74rem; letter-spacing: .22em; text-transform: uppercase; font-weight: 400;
  border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}
.btn--gold { background: var(--gold-600); color: #fff; box-shadow: var(--shadow-md); }
.btn--gold:hover { background: var(--gold-500); box-shadow: var(--shadow-lg); }
.btn--gold:active { transform: scale(.98); }

.btn--solid { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-sm); }
.btn--solid:hover { background: var(--sage-600); box-shadow: var(--shadow-md); }
.btn--solid:active { transform: scale(.99); }

.btn--outline { background: transparent; border-color: var(--sage-500); color: var(--sage-700); }
.btn--outline:hover { background: var(--sage-500); color: #fff; }

.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* ============ COVER ============ */
.cover {
  position: fixed; inset: 0; z-index: var(--z-cover);
  display: grid; place-items: center;
  padding: var(--space-4) var(--space-3);
  padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
  background: var(--sage-900);
  overflow: hidden;
  transition: opacity 700ms var(--ease), visibility 700ms;
}
.cover__bg {
  position: absolute; inset: -10%;
  background:
    radial-gradient(60% 50% at 50% 20%, rgba(192,164,115,.28), transparent 70%),
    linear-gradient(160deg, #3B473C 0%, #2C352D 45%, #1E241F 100%);
  animation: drift 26s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: scale(1.08) translate3d(0, -2%, 0); } }

.cover__inner { position: relative; text-align: center; color: var(--cream-100); max-width: 480px; }
.cover .ornament { color: var(--gold-400); }
.cover__date { font-size: .72rem; letter-spacing: .34em; color: var(--gold-400); margin-bottom: var(--space-2); }
.cover__title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 11vw, 4.2rem);
  letter-spacing: .06em; text-transform: uppercase; line-height: 1.05;
  color: #fff;
}
.cover__sub {
  margin-top: var(--space-2);
  font-size: .68rem; letter-spacing: .24em; text-transform: uppercase; color: var(--sage-200);
}
.cover__card {
  margin-top: var(--space-4);
  padding: var(--space-3);
  border: 1px solid rgba(230, 220, 195, .22);
  border-radius: var(--radius);
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(6px);
}
.cover__to { font-size: .66rem; letter-spacing: .26em; text-transform: uppercase; color: var(--sage-300); }
.cover__guest {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 6vw, 2rem);
  color: #fff; margin-block: 6px var(--space-3);
}
.cover.is-open { opacity: 0; visibility: hidden; pointer-events: none; }

/* ============ TOPBAR ============ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-topbar);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-2);
  padding: 10px var(--space-3);
  padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(247, 244, 236, 0);
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease),
              transform 360ms var(--ease);
  transform: translateY(-110%);
}
.topbar.is-visible { transform: translateY(0); }
.topbar.is-solid {
  background: rgba(247, 244, 236, .92);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--border);
}
.topbar__mono {
  font-family: var(--font-display);
  font-size: 1.25rem; letter-spacing: .18em;
  color: var(--sage-800); text-decoration: none;
  padding: 6px 10px; min-height: 44px; display: inline-flex; align-items: center;
}
/* Over the dark hero the bar is transparent — flip the marks to light. */
.topbar:not(.is-solid) .topbar__mono { color: var(--cream-100); }
.topbar:not(.is-solid) .music { color: var(--cream-100); border-color: rgba(255,255,255,.4); }

.music {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: none; border: 1px solid var(--border-strong); border-radius: 999px;
  color: var(--sage-700); cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.music:hover { background: var(--sage-500); color: #fff; border-color: var(--sage-500); }
.music.is-playing .ico { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid; place-items: center;
  padding: var(--space-6) var(--space-3);
  overflow: hidden;
  isolation: isolate;
}
.hero__bg {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(80% 60% at 30% 25%, rgba(215,222,209,.55), transparent 65%),
    linear-gradient(155deg, #55684F 0%, #3E4C3D 50%, #2A3229 100%);
}
.hero__veil {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, rgba(30,36,31,.45), rgba(30,36,31,.15) 40%, rgba(30,36,31,.72));
}
.hero__inner { text-align: center; color: #fff; max-width: 800px; }
.hero__names {
  font-size: clamp(2.8rem, 12vw, 6rem);
  font-weight: 300; line-height: 1.05; letter-spacing: .01em;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.hero__names .amp {
  font-style: italic; font-size: .5em; color: var(--gold-400);
  line-height: 1;
}
.hero__verse {
  margin-top: var(--space-3);
  font-size: .82rem; letter-spacing: .12em; color: var(--cream-200);
  max-width: 42ch; margin-inline: auto;
}
.scroll-hint {
  display: inline-flex; flex-direction: column; align-items: center; gap: 10px;
  margin-top: var(--space-5);
  color: var(--cream-200); text-decoration: none;
  min-height: 44px; min-width: 44px; justify-content: center;
}
.scroll-hint span { width: 1px; height: 44px; background: linear-gradient(var(--gold-400), transparent); }
.scroll-hint .ico { animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(6px); } }

/* ============ PHOTO PLACEHOLDER ============ */
.ph {
  position: relative;
  width: 100%; height: 100%;
  background:
    linear-gradient(135deg, var(--sage-300) 0%, var(--cream-200) 55%, var(--sage-200) 100%);
  display: grid; place-items: center;
  color: var(--sage-500);
  overflow: hidden;
}
.ph::after {
  content: "";
  position: absolute; inset: 8px;
  border: 1px solid rgba(124,143,123,.28);
}
.ph svg { width: 30px; height: 30px; opacity: .55; }
.ph img { width: 100%; height: 100%; object-fit: cover; }

/* ============ COUPLE ============ */
.couple__grid {
  display: grid; gap: var(--space-4);
  align-items: center;
}
.person {
  display: grid; gap: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
}
.person__photo { aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; }
.person__body { text-align: center; }
.person__name { font-size: clamp(1.9rem, 6vw, 2.5rem); color: var(--sage-900); }
.person__role { font-size: .64rem; letter-spacing: .3em; text-transform: uppercase; color: var(--accent); margin-top: 4px; }
.person__full { margin-top: var(--space-2); font-size: .95rem; color: var(--fg); }
.person__parents { font-size: .82rem; color: var(--fg-muted); margin-top: 2px; }
.person__bio { margin-top: var(--space-2); font-size: .9rem; color: var(--fg-muted); max-width: 40ch; margin-inline: auto; }
.couple__amp {
  font-family: var(--font-display); font-style: italic;
  font-size: 3rem; color: var(--gold-500); text-align: center; line-height: 1;
}
.socials { display: flex; gap: var(--space-1); justify-content: center; margin-top: var(--space-3); }
.socials a {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid var(--border-strong); border-radius: 999px;
  color: var(--sage-700);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.socials a:hover { background: var(--sage-600); border-color: var(--sage-600); color: #fff; }

/* ============ COUNTDOWN ============ */
.countdown {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--space-1);
  max-width: 560px; margin: 0 auto var(--space-5);
}
.cd {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--space-2) 6px;
  text-align: center; box-shadow: var(--shadow-sm);
}
.cd__num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 7vw, 2.6rem); line-height: 1;
  color: var(--sage-800);
  font-variant-numeric: tabular-nums;
}
.cd__lbl {
  display: block; margin-top: 6px;
  font-size: .58rem; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-muted);
}
.countdown__msg {
  text-align: center; margin: calc(var(--space-5) * -1 + var(--space-2)) 0 var(--space-5);
  font-family: var(--font-display); font-size: 1.6rem; color: var(--sage-800);
}

/* ============ EVENTS ============ */
.events { display: grid; gap: var(--space-3); margin-bottom: var(--space-4); }
.event {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-4) var(--space-3);
  text-align: center; box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.event:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.event__name { font-size: 1.75rem; color: var(--sage-900); }
.event__rule { width: 40px; height: 1px; background: var(--gold-400); margin: var(--space-2) auto; }
.event__time { font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.event__date { font-size: .8rem; color: var(--fg-muted); margin-top: 4px; }
.event__venue { font-family: var(--font-display); font-size: 1.3rem; margin-top: var(--space-2); color: var(--sage-800); }
.event__addr { font-size: .86rem; color: var(--fg-muted); margin-top: 4px; }
.event__note { font-size: .78rem; color: var(--fg-muted); font-style: italic; margin-top: var(--space-2); }
.event__actions { display: flex; flex-wrap: wrap; gap: var(--space-1); justify-content: center; margin-top: var(--space-3); }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 18px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--sage-700); text-decoration: none; background: transparent; cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.chip:hover { background: var(--sage-600); color: #fff; border-color: var(--sage-600); }

/* ============ DRESS / STREAM ============ */
.dress, .stream {
  text-align: center; padding: var(--space-4) var(--space-3);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: rgba(255,255,255,.5);
}
.dress { margin-bottom: var(--space-3); }
.dress__title, .stream__label {
  font-family: var(--font-display); font-size: 1.5rem; color: var(--sage-900);
}
.dress__text, .stream__text {
  margin-top: 8px; font-size: .9rem; color: var(--fg-muted); max-width: 48ch; margin-inline: auto;
}
.dress__swatches { display: flex; gap: 10px; justify-content: center; margin-top: var(--space-3); }
.dress__swatches i {
  width: 30px; height: 30px; border-radius: 999px; display: block;
  border: 1px solid rgba(35,40,31,.12);
}
.stream .btn { margin-top: var(--space-3); }

/* ============ VIDEO ============ */
.video__frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); }
.video__frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ============ GALLERY ============ */
.gallery__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-1); }
.gtile {
  position: relative; display: grid; padding: 0; border: 0; cursor: pointer;
  border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 1 / 1; background: none;
  transition: box-shadow var(--dur) var(--ease);
}
.gtile:hover { box-shadow: var(--shadow-md); }
.gtile::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: rgba(44,53,45,0);
  transition: background-color var(--dur) var(--ease);
}
.gtile:hover::before, .gtile:focus-visible::before { background: rgba(44,53,45,.22); }

.quote {
  margin: var(--space-5) auto 0; max-width: 620px; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-4) var(--space-3);
  box-shadow: var(--shadow-sm);
}
.quote blockquote {
  margin: 0; font-family: var(--font-display); font-style: italic;
  font-size: clamp(1.15rem, 3.4vw, 1.5rem); color: var(--sage-900); line-height: 1.5;
}
.quote figcaption {
  margin-top: var(--space-2);
  font-size: .66rem; letter-spacing: .24em; text-transform: uppercase; color: var(--accent);
}

/* ============ TIMELINE ============ */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 11px;
  width: 1px; background: linear-gradient(var(--sage-300), var(--cream-300));
}
.tl { position: relative; padding-left: 44px; padding-bottom: var(--space-4); }
.tl:last-child { padding-bottom: 0; }
.tl__dot {
  position: absolute; left: 4px; top: 6px;
  width: 15px; height: 15px; border-radius: 999px;
  background: var(--cream-100); border: 1px solid var(--sage-500);
  display: grid; place-items: center;
}
.tl__dot::after { content: ""; width: 5px; height: 5px; border-radius: 999px; background: var(--gold-500); }
.tl__date { font-size: .66rem; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); }
.tl__card {
  margin-top: 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-3); box-shadow: var(--shadow-sm);
}
.tl__title { font-size: 1.5rem; color: var(--sage-900); }
.tl__text { margin-top: 8px; font-size: .92rem; color: var(--fg-muted); }

/* ============ FORM ============ */
.rsvp__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-3);
  box-shadow: var(--shadow-md);
}
.form { display: grid; gap: var(--space-3); }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field label, .field legend {
  font-size: .68rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--sage-800); padding: 0;
}
.req { color: var(--danger); }
.hint-inline { text-transform: none; letter-spacing: 0; color: var(--fg-muted); font-size: .74rem; }

.field input[type="text"], .field input[type="email"], .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 300; color: var(--fg);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%234E5F50' stroke-width='1.4'><path d='m4 6 4 4 4-4'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 40px; cursor: pointer;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--sage-600);
  box-shadow: 0 0 0 3px rgba(100,122,102,.18);
}
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea { border-color: var(--danger); }

.radios { display: grid; gap: 10px; grid-template-columns: 1fr; }
.radio {
  display: flex; align-items: center; gap: 12px;
  min-height: 48px; padding: 10px 16px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-alt); cursor: pointer;
  text-transform: none; letter-spacing: 0; font-size: .95rem; color: var(--fg);
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.radio:hover { border-color: var(--sage-500); }
.radio input { width: 20px; height: 20px; accent-color: var(--sage-600); cursor: pointer; }
.radio:has(input:checked) { border-color: var(--sage-600); background: var(--sage-100); }

.helper { font-size: .78rem; color: var(--fg-muted); }
.helper--center { text-align: center; }
.err { font-size: .78rem; color: var(--danger); min-height: 0; display: none; }
.field.is-invalid .err { display: flex; align-items: center; gap: 6px; }
.err::before { content: "!"; display: grid; place-items: center; width: 15px; height: 15px; border-radius: 999px; border: 1px solid currentColor; font-size: .62rem; flex: none; }

.form__status { text-align: center; font-size: .9rem; min-height: 0; }
.form__status.is-success { color: var(--sage-700); }
.form__status.is-error { color: var(--danger); }

.spinner { display: none; width: 16px; height: 16px; border-radius: 999px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.is-loading .spinner { display: block; }
.btn.is-loading .btn__label { opacity: .7; }

.rsvp__done { text-align: center; padding: var(--space-4) 0; }
.rsvp__done .ico--lg { color: var(--sage-600); }
.rsvp__done h3 { font-size: 1.9rem; color: var(--sage-900); }
.rsvp__done p { margin-top: var(--space-2); color: var(--fg-muted); font-size: .95rem; }

/* ============ GIFT ============ */
.gift__list { display: grid; gap: var(--space-2); }
.gift__item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-3);
  box-shadow: var(--shadow-sm);
}
.gift__label { font-size: .66rem; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); }
.gift__bank { font-family: var(--font-display); font-size: 1.4rem; color: var(--sage-900); margin-top: 4px; }
.gift__num {
  font-size: 1.05rem; letter-spacing: .06em; margin-top: 6px;
  font-variant-numeric: tabular-nums; color: var(--fg);
}
.gift__holder { font-size: .84rem; color: var(--fg-muted); }
.gift__item .chip { margin-top: var(--space-2); }

/* ============ CLOSING ============ */
.closing { text-align: center; }
.seal {
  width: 96px; height: 96px; margin: 0 auto var(--space-3);
  border: 1px solid var(--gold-400); border-radius: 999px;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 1.9rem; letter-spacing: .06em;
  color: var(--gold-600);
}
.closing__text { max-width: 52ch; margin-inline: auto; color: var(--fg-muted); font-size: .95rem; }
.closing__signoff { margin-top: var(--space-3); font-family: var(--font-display); font-style: italic; font-size: 1.3rem; color: var(--sage-800); }
.closing__names { display: grid; gap: var(--space-3); margin-top: var(--space-3); }
.closing__name { font-family: var(--font-display); font-size: 1.7rem; color: var(--sage-900); }
.closing__parents { font-size: .8rem; color: var(--fg-muted); }

.foot {
  text-align: center; padding: var(--space-4) var(--space-3);
  padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  background: var(--sage-900); color: var(--sage-200);
  font-size: .7rem; letter-spacing: .24em; text-transform: uppercase;
}
.foot__small { margin-top: 8px; letter-spacing: .1em; text-transform: none; color: var(--sage-400); font-size: .74rem; }

/* ============ DOCK ============ */
.dock {
  position: fixed; z-index: var(--z-dock);
  left: 50%; bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translate(-50%, 140%);
  display: flex; gap: 2px;
  padding: 6px; border-radius: 999px;
  background: rgba(253, 251, 246, .93);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transition: transform 420ms var(--ease);
  max-width: calc(100vw - 24px);
}
.dock.is-visible { transform: translate(-50%, 0); }
.dock a {
  display: grid; place-items: center; gap: 2px;
  min-width: 56px; min-height: 48px; padding: 4px 6px;
  border-radius: 999px; text-decoration: none;
  color: var(--fg-muted);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.dock a span { font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; }
.dock a:hover { color: var(--sage-800); background: var(--sage-100); }
.dock a.is-active { background: var(--sage-700); color: #fff; }

/* ============ LIGHTBOX ============ */
.lightbox {
  position: fixed; inset: 0; z-index: var(--z-lightbox);
  display: grid; place-items: center;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-2);
  background: rgba(28, 33, 27, .93);
  backdrop-filter: blur(8px);
  opacity: 0; transition: opacity 260ms var(--ease);
}
/* Not clickable until fully open, and not during the closing fade. */
.lightbox:not(.is-open) { pointer-events: none; }
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox__stage {
  grid-column: 2; grid-row: 1;
  width: 100%; max-width: 820px; height: 76svh;
  border-radius: var(--radius); overflow: hidden;
  display: grid; place-items: center;
}
.lightbox__stage .ph { width: 100%; height: 100%; }
.lightbox__stage img { max-height: 76svh; width: auto; object-fit: contain; }
.lightbox__stage .ph { border-radius: var(--radius); }
.lightbox__close, .lightbox__nav {
  z-index: 2; width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.28);
  background: rgba(0,0,0,.25); color: #fff; cursor: pointer;
  transition: background-color var(--dur) var(--ease);
}
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255,255,255,.18); }
.lightbox__close { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; }
.lightbox__nav { grid-row: 1; align-self: center; }
.lightbox__nav--prev { grid-column: 1; justify-self: start; }
.lightbox__nav--next { grid-column: 3; justify-self: end; }
.lightbox__caption {
  grid-column: 1 / -1; grid-row: 2;
  color: var(--cream-200); font-size: .84rem; text-align: center; max-width: 60ch;
}

/* ============ TOAST ============ */
.toast {
  position: fixed; z-index: var(--z-toast);
  left: 50%; bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  padding: 12px 22px; border-radius: 999px;
  background: var(--sage-900); color: var(--cream-100);
  font-size: .82rem; letter-spacing: .04em;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ============ REVEAL ============ */
body.js .reveal { opacity: 0; transform: translateY(20px); }
body.js .reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity 620ms var(--ease), transform 620ms var(--ease);
}

/* ============ RESPONSIVE ============ */
@media (min-width: 600px) {
  .radios { grid-template-columns: 1fr 1fr; }
  /* First photo anchors the grid as a 2×2 feature tile. */
  .gallery__grid { grid-template-columns: repeat(3, 1fr); }
  .gtile:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
  .closing__names { grid-template-columns: 1fr 1fr; gap: var(--space-4); }
  .dock a { min-width: 76px; }
  .dock a span { font-size: .62rem; }
}

@media (min-width: 900px) {
  :root { --space-6: 128px; }
  .wrap { padding-inline: var(--space-4); }
  .events { grid-template-columns: 1fr 1fr; }

  .couple__grid {
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-3);
  }
  .person { grid-template-columns: 1fr; }
  .person--alt { margin-top: var(--space-5); }
  .couple__amp { font-size: 4rem; }

  .timeline::before { left: 50%; transform: translateX(-.5px); }
  .tl { padding-left: 0; width: 50%; padding-right: var(--space-4); text-align: right; }
  .tl__dot { left: auto; right: -7px; }
  .tl:nth-child(even) {
    margin-left: 50%; padding-right: 0; padding-left: var(--space-4); text-align: left;
  }
  .tl:nth-child(even) .tl__dot { left: -8px; right: auto; }

  .rsvp__card { padding: var(--space-5); }
  .gift__list { grid-template-columns: 1fr 1fr; }
}

/* ============ MOTION / A11Y ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .dock, .topbar, .cover, .lightbox, .toast, .scroll-hint { display: none !important; }
  body { background: #fff; }
}
