/* ============================================================
   Abdulrahman & Rayan — "Garden Blush & Sage"
   English garden editorial: bright ivory paper, blush roses,
   sage leaves, thin gold hairlines.
   ============================================================ */

:root {
  --ivory: #faf6ef;
  --paper: #fffdf8;
  --blush: #e8b4b8;
  --blush-deep: #c9848c;
  --blush-ink: #a05860;
  --sage: #8a9a5b;
  --sage-deep: #5f6f3e;
  --gold: #c9a227;
  --gold-soft: #e0c878;
  --ink: #3e3a36;
  --ink-soft: #7a7166;

  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-script: 'Pinyon Script', cursive;
  --font-ui: 'Jost', 'Segoe UI', sans-serif;
  --font-arabic: 'Amiri', serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 700ms;

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { height: 100%; }

body {
  height: 100dvh;
  overflow: hidden;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ---------- snap-page scroll container ---------- */

.pages {
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
}

.page {
  position: relative;
  min-height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 3rem);
  overflow: hidden;
}

/* paper pages get warm grain + faint corner blooms */
.page--paper {
  background:
    radial-gradient(38rem 30rem at -8% -10%, rgba(232, 180, 184, 0.22), transparent 60%),
    radial-gradient(34rem 28rem at 108% 112%, rgba(138, 154, 91, 0.16), transparent 60%),
    var(--grain),
    linear-gradient(180deg, var(--paper), var(--ivory));
}

/* ---------- entrance reveals (per page, JS toggles .is-active) ---------- */

.rise {
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.page.is-active .rise { opacity: 1; transform: none; }
.page.is-active .rise:nth-child(2) { transition-delay: 120ms; }
.page.is-active .rise:nth-child(3) { transition-delay: 240ms; }
.page.is-active .rise:nth-child(4) { transition-delay: 360ms; }
.page.is-active .rise:nth-child(5) { transition-delay: 480ms; }
.page.is-active .rise:nth-child(6) { transition-delay: 600ms; }

/* ---------- shared type ---------- */

.eyebrow {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--sage-deep);
  text-indent: 0.42em; /* balances tracking */
}

.script-title {
  font-family: var(--font-script);
  font-weight: 400;
  color: var(--blush-ink);
  line-height: 1.15;
}

.display-title {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.08;
}

/* gold hairline + leaf divider */
.divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: min(20rem, 62vw);
  margin: 0.4rem auto;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 45%, var(--gold) 55%, transparent);
}
.divider svg { width: 1.4rem; height: 1.4rem; flex: none; }

/* ============================================================
   0. LOCKER / TAP-TO-OPEN SCREEN (intro overlay)
   ============================================================ */

.gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: hidden;
  cursor: pointer;
}
.gate.is-hidden { display: none; }

.gate__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
}
.gate__tap {
  position: absolute;
  inset: 0;
  z-index: 5;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  background: linear-gradient(to bottom, rgba(20, 15, 12, 0.12) 0%, transparent 38%, transparent 66%, rgba(20, 15, 12, 0.5) 100%);
}
.gate__hint {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-ui);
  font-size: 0.65rem;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
  color: rgba(250, 246, 239, 0.92);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  opacity: 0;
  animation: gate-hint-fade 1s ease 1.2s forwards;
  white-space: nowrap;
  pointer-events: none;
  z-index: 6;
}
@keyframes gate-hint-fade { to { opacity: 1; } }

@keyframes gate-slide-right {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(105%); opacity: 0; }
}
.gate.is-open {
  animation: gate-slide-right 0.65s cubic-bezier(0.4, 0, 1, 0.6) forwards;
  pointer-events: none;
}

/* ---------- drifting petals (gate + hero) ---------- */

.petals {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 5;
}
.petal {
  position: absolute;
  top: -6%;
  width: 0.85rem;
  height: 0.7rem;
  border-radius: 80% 10% 80% 10%;
  background: linear-gradient(135deg, #f3cdd0, var(--blush) 55%, #d99aa1);
  opacity: 0;
  animation: petal-fall linear infinite;
}
.petal:nth-child(3n) {
  background: linear-gradient(135deg, #cdd8ae, #a9b97e 60%, var(--sage));
  border-radius: 10% 80% 10% 80%;
}
@keyframes petal-fall {
  0% { transform: translate3d(0, -4rem, 0) rotate(0deg); opacity: 0; }
  8% { opacity: 0.85; }
  85% { opacity: 0.85; }
  100% { transform: translate3d(var(--sway, 4rem), 108dvh, 0) rotate(var(--spin, 320deg)); opacity: 0; }
}

/* ============================================================
   1. HERO / INVITATION
   ============================================================ */

.hero { text-align: center; justify-content: flex-start; padding-top: clamp(2.4rem, 9dvh, 4.5rem); }

.hero__bg,
.hero__bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero__bg img {
  object-fit: cover;
  object-position: 50% 28%;
  /* lightly softened + gently darkened photo only — no CSS tint layer over it */
  filter: blur(0.8px) saturate(1.08) brightness(0.72) contrast(1.05);
  transform: scale(1.01); /* hide softened edge fringing */
}
/* faint grain only — not a colour veil, the photo itself carries the tone */
.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grain);
}

.hero__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.7rem, 1.6dvh, 1.15rem);
  max-width: 46rem;
}
/* tight, small-radius shadow so letters stay legible on the photo
   without the shadows merging into a solid block behind the text */
.hero__content > * { text-shadow: 0 1px 3px rgba(20, 15, 12, 0.55), 0 2px 12px rgba(20, 15, 12, 0.4); }

.hero__verse {
  font-family: var(--font-arabic);
  direction: rtl;
  lang: ar;
  font-size: clamp(1.02rem, 2.6vw, 1.5rem);
  line-height: 2.05;
  color: var(--paper);
  max-width: 38rem;
}
.hero__verse-ref {
  display: block;
  font-size: 0.85em;
  color: var(--gold-soft);
  margin-top: 0.15rem;
}

.hero__families {
  font-family: var(--font-display);
  font-size: clamp(0.92rem, 2.4vw, 1.12rem);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  text-indent: 0.26em;
  color: rgba(255, 253, 248, 0.92);
}
.hero__fathers {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.55em;
  letter-spacing: 0.08em;
  text-transform: none;
  text-indent: 0;
  margin-top: clamp(1.6rem, 4.5vw, 2.2rem);
  color: var(--gold-soft);
}
.hero__families em {
  display: block;
  font-style: normal;
  font-size: 0.78em;
  letter-spacing: 0.3em;
  margin-top: clamp(1.6rem, 4.5vw, 2.2rem);
  color: #cfe0ab;
}

/* names sit over the busiest part of the photo, so they get a firmer
   outline-style shadow (several tight offsets) instead of the soft
   glow used elsewhere — keeps them crisp against dress/suit detail */
.hero__name,
.hero__amp {
  text-shadow:
    -1px -1px 3px rgba(15, 11, 9, 0.85),
    1px -1px 3px rgba(15, 11, 9, 0.85),
    -1px 1px 3px rgba(15, 11, 9, 0.85),
    1px 1px 3px rgba(15, 11, 9, 0.85),
    0 3px 14px rgba(15, 11, 9, 0.65);
}

.hero__name {
  font-size: clamp(3.1rem, 11vw, 5.8rem);
  color: #fbe9ea;
}
/* the h1 wrapping the names is display:contents, so push the whole
   names cluster down by spacing above its first child instead */
.hero__name:first-of-type { margin-top: clamp(2.4rem, 8dvh, 4.5rem); }
.hero__amp {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.3rem, 4vw, 2rem);
  color: var(--gold-soft);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.hero__amp::before,
.hero__amp::after {
  content: '';
  width: clamp(2.5rem, 9vw, 4.5rem);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft));
}
.hero__amp::after { background: linear-gradient(270deg, transparent, var(--gold-soft)); }

/* personalized greeting from invite link */
.hero__guest {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 2.8vw, 1.2rem);
  color: #f6d7da;
}
.hero__guest[hidden] { display: none; }

/* ---------- countdown ring dials ---------- */

.count {
  display: flex;
  gap: clamp(0.7rem, 3vw, 1.6rem);
  margin-top: 0.3rem;
}
.count__dial {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}
.count__ring { width: clamp(3.6rem, 13vw, 4.9rem); height: auto; }
.count__ring .ring-track { fill: none; stroke: rgba(62, 58, 54, 0.12); stroke-width: 2.5; }
.count__ring .ring-fill {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2.5;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 900ms var(--ease-out);
}
.count__ring text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  fill: var(--ink);
  text-anchor: middle;
  dominant-baseline: central;
}
.count__label {
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-indent: 0.3em;
  color: var(--ink-soft);
}

/* scroll cue */
.scroll-cue {
  position: absolute;
  bottom: max(1.1rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  color: rgba(255, 253, 248, 0.85);
  font-size: 0.6rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  text-indent: 0.34em;
  text-shadow: 0 1px 3px rgba(20, 15, 12, 0.55);
}
.scroll-cue::after {
  content: '';
  width: 1px;
  height: 2.2rem;
  background: linear-gradient(180deg, var(--gold-soft), transparent);
  animation: cue-drop 1.8s var(--ease-out) infinite;
}
@keyframes cue-drop {
  0% { transform: scaleY(0); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: top; }
  56% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ============================================================
   2. WEDDING DETAILS — program timeline + venue
   ============================================================ */

/* shared photo-backdrop treatment — same as the hero: lightly softened
   + darkened photo only, no CSS tint layer. Reused by every section
   that sits a headline/eyebrow directly over a photo (programme, the
   date, rsvp, gift, closing) — only the crop (object-position) differs. */
.programme__bg,
.datepage__bg,
.rsvp__bg,
.gift__bg,
.closing__bg,
.programme__bg img,
.datepage__bg img,
.rsvp__bg img,
.gift__bg img,
.closing__bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.programme__bg img,
.datepage__bg img,
.rsvp__bg img,
.gift__bg img,
.closing__bg img {
  object-fit: cover;
  filter: blur(0.8px) saturate(1.08) brightness(0.72) contrast(1.05);
  transform: scale(1.01);
}
.programme__bg img { object-position: 32% 30%; }
.datepage__bg img { object-position: 50% 30%; }
.rsvp__bg img { object-position: 50% 25%; }
.gift__bg img { object-position: 50% 30%; filter: saturate(1.08) brightness(0.72) contrast(1.05); }
.closing__bg img { object-position: 50% 30%; }
.programme__bg::after,
.datepage__bg::after,
.rsvp__bg::after,
.gift__bg::after,
.closing__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grain);
}
.programme__content,
.datepage__content,
.rsvp__content,
.gift__content,
.closing__content { position: relative; z-index: 2; }

/* text sits on a darkened photo here, not the ivory paper base —
   switch to the hero's cream/gold palette + tight shadow for legibility */
.programme .eyebrow { color: rgba(255, 253, 248, 0.92); text-shadow: 0 1px 3px rgba(20, 15, 12, 0.55); }
.programme .details__title {
  color: #fbe9ea;
  text-shadow:
    -1px -1px 3px rgba(15, 11, 9, 0.85),
    1px -1px 3px rgba(15, 11, 9, 0.85),
    -1px 1px 3px rgba(15, 11, 9, 0.85),
    1px 1px 3px rgba(15, 11, 9, 0.85),
    0 3px 14px rgba(15, 11, 9, 0.65);
}
.programme .program__time { color: #f6d7da; text-shadow: 0 1px 3px rgba(20, 15, 12, 0.55); }
.programme .program__name { color: var(--paper); text-shadow: 0 1px 3px rgba(20, 15, 12, 0.55), 0 2px 12px rgba(20, 15, 12, 0.4); }

/* only the elements sitting directly on the photo need the lighter
   palette — the venue card keeps its own opaque light background */
.datepage .details__head .eyebrow { color: rgba(255, 253, 248, 0.92); text-shadow: 0 1px 3px rgba(20, 15, 12, 0.55); }
.datepage .date-display { color: var(--paper); text-shadow: 0 1px 3px rgba(20, 15, 12, 0.55), 0 2px 12px rgba(20, 15, 12, 0.4); }
.datepage .count__ring .ring-track { stroke: rgba(255, 253, 248, 0.28); }
.datepage .count__ring .ring-fill { stroke: var(--gold-soft); }
.datepage .count__ring text { fill: var(--paper); }
.datepage .count__ring { filter: drop-shadow(0 1px 4px rgba(20, 15, 12, 0.5)); }
.datepage .count__label { color: rgba(255, 253, 248, 0.85); text-shadow: 0 1px 3px rgba(20, 15, 12, 0.55); }

/* the rsvp card and success state keep their own opaque light
   background, but the header above them sits directly on the photo */
.rsvp .rsvp__head .eyebrow { color: rgba(255, 253, 248, 0.92); text-shadow: 0 1px 3px rgba(20, 15, 12, 0.55); }
.rsvp .rsvp__title {
  color: #fbe9ea;
  text-shadow:
    -1px -1px 3px rgba(15, 11, 9, 0.85),
    1px -1px 3px rgba(15, 11, 9, 0.85),
    -1px 1px 3px rgba(15, 11, 9, 0.85),
    1px 1px 3px rgba(15, 11, 9, 0.85),
    0 3px 14px rgba(15, 11, 9, 0.65);
}
.rsvp .rsvp__deadline { color: rgba(255, 253, 248, 0.85); text-shadow: 0 1px 3px rgba(20, 15, 12, 0.55); }
.rsvp .rsvp__success h3 { color: #fbe9ea; text-shadow: 0 1px 3px rgba(20, 15, 12, 0.55); }
.rsvp .rsvp__success p { color: rgba(255, 253, 248, 0.9); text-shadow: 0 1px 3px rgba(20, 15, 12, 0.55); }

/* everything in the gift section sits directly on the photo —
   no card, just text with the hero's cream/gold palette + shadow */
.gift .details__head .eyebrow { color: rgba(255, 253, 248, 0.92); text-shadow: 0 1px 3px rgba(20, 15, 12, 0.55); }
.gift .details__title {
  color: #fbe9ea;
  text-shadow:
    -1px -1px 3px rgba(15, 11, 9, 0.85),
    1px -1px 3px rgba(15, 11, 9, 0.85),
    -1px 1px 3px rgba(15, 11, 9, 0.85),
    1px 1px 3px rgba(15, 11, 9, 0.85),
    0 3px 14px rgba(15, 11, 9, 0.65);
}
.gift .gift__note { color: rgba(255, 253, 248, 0.9); text-shadow: 0 1px 3px rgba(20, 15, 12, 0.55); }

/* strip the venue card's glass panel — just a text overlay here */
.gift .venue {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
}
.gift .venue::before { display: none; }
.gift .venue .eyebrow { color: rgba(255, 253, 248, 0.92); text-shadow: 0 1px 3px rgba(20, 15, 12, 0.55); }
.gift .gift__number { color: var(--paper); text-shadow: 0 1px 3px rgba(20, 15, 12, 0.55), 0 2px 12px rgba(20, 15, 12, 0.4); }

/* closing has no card at all — everything sits on the photo */
.closing .closing__monogram { color: #fbe9ea; text-shadow: 0 1px 3px rgba(20, 15, 12, 0.55), 0 2px 12px rgba(20, 15, 12, 0.4); }
.closing .closing__names { color: rgba(255, 253, 248, 0.9); text-shadow: 0 1px 3px rgba(20, 15, 12, 0.55); }
.closing .closing__hashtag { color: #cfe0ab; text-shadow: 0 1px 3px rgba(20, 15, 12, 0.55); }
.closing .closing__love { color: var(--gold-soft); text-shadow: 0 1px 3px rgba(20, 15, 12, 0.55); }

.details__head { text-align: center; margin-bottom: clamp(1.2rem, 3dvh, 2.2rem); }
.details__title { font-size: clamp(2.2rem, 7vw, 3.4rem); }

.date-display {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-indent: 0.28em;
  color: var(--ink);
  margin-top: 0.3rem;
}

.program {
  position: relative;
  list-style: none;
  width: min(26rem, 100%);
  padding-left: 3.4rem;
  display: flex;
  flex-direction: column;
  gap: clamp(0.85rem, 2.2dvh, 1.5rem);
}
/* the gold thread */
.program::before {
  content: '';
  position: absolute;
  left: 1.19rem;
  top: 1.2rem;
  bottom: 1.2rem;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--gold) 12%, var(--gold) 88%, transparent);
}

.program__item { position: relative; }
.program__icon {
  position: absolute;
  left: -3.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--gold-soft);
  box-shadow: 0 0.2rem 0.7rem rgba(201, 162, 39, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}
.program__icon svg { width: 1.25rem; height: 1.25rem; stroke: var(--sage-deep); fill: none; stroke-width: 1.4; }

.program__time {
  font-size: 0.66rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--blush-ink);
}
.program__name {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 4vw, 1.6rem);
  font-weight: 600;
}

/* gift section — reuses the venue card look for its account panel */
.gift { justify-content: flex-start; padding-top: clamp(3rem, 14dvh, 6rem); }
/* heading + note stay near the top; the whish card fills the rest
   of the page and centers itself in that remaining vertical space */
.gift .venue {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: clamp(2.5rem, 8dvh, 4.5rem);
}
.gift__note {
  max-width: 28rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 0.2rem 0 0.4rem;
}
.gift__number {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 6vw, 2.5rem);
  letter-spacing: 0.14em;
  color: var(--sage-deep);
  margin: 0.2rem 0 1rem;
}

/* venue card */
.venue {
  margin-top: clamp(1.4rem, 3.5dvh, 2.4rem);
  width: min(26rem, 100%);
  text-align: center;
  padding: clamp(1.1rem, 3vw, 1.6rem) 1.4rem;
  background: rgba(255, 253, 248, 0.85);
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 0.4rem;
  box-shadow: 0 1rem 2.4rem -1.4rem rgba(62, 58, 54, 0.35);
  position: relative;
}
/* double gold frame */
.venue::before {
  content: '';
  position: absolute;
  inset: 0.4rem;
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: 0.25rem;
  pointer-events: none;
}
.venue__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 5vw, 1.9rem);
  color: var(--sage-deep);
}
.venue__note { color: var(--ink-soft); font-size: 0.86rem; letter-spacing: 0.12em; margin-top: 0.2rem; }

.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.95rem;
  padding: 0.72rem 1.7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold) 0%, #b18d1e 100%);
  color: var(--paper);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-indent: 0.28em;
  text-decoration: none;
  box-shadow: 0 0.6rem 1.4rem -0.5rem rgba(177, 141, 30, 0.6);
  transition: transform 250ms var(--ease-out), box-shadow 250ms var(--ease-out);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 0.9rem 1.7rem -0.5rem rgba(177, 141, 30, 0.7); }
.btn-gold:active { transform: translateY(0); }
.btn-gold svg { width: 1rem; height: 1rem; fill: currentColor; }

/* ============================================================
   3. STORY CHAPTERS — Ken Burns photo pages
   ============================================================ */

.chapter { justify-content: flex-end; text-align: center; }

.chapter__bg { position: absolute; inset: 0; background: #241f1c; }
.chapter__bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 800ms ease;
  will-change: transform, opacity;
}
.chapter__bg img.is-shown { opacity: 1; }
.page.is-active .chapter__bg img.is-shown { animation: kenburns 5s ease-out forwards; }
@keyframes kenburns {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.1) translate3d(0, -1.2%, 0); }
}
/* legibility veil, romantic not gloomy */
.chapter__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(36, 26, 24, 0.18) 0%,
    rgba(36, 26, 24, 0) 34%,
    rgba(36, 26, 24, 0.24) 62%,
    rgba(30, 22, 20, 0.78) 100%);
}

.chapter__content {
  position: relative;
  z-index: 2;
  max-width: 34rem;
  padding-bottom: clamp(2.6rem, 7dvh, 4.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  color: #fdf8f1;
}
.chapter__kicker {
  font-size: 0.62rem;
  letter-spacing: 0.44em;
  text-transform: uppercase;
  text-indent: 0.44em;
  color: var(--gold-soft);
}
.chapter__title {
  font-family: var(--font-script);
  font-size: clamp(2.6rem, 9vw, 4rem);
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 2px 18px rgba(20, 12, 10, 0.45);
}
.chapter__text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.02rem, 3vw, 1.22rem);
  line-height: 1.65;
  color: rgba(253, 248, 241, 0.94);
  text-shadow: 0 1px 10px rgba(20, 12, 10, 0.5);
}

/* ============================================================
   4. RSVP
   ============================================================ */

.rsvp__head { text-align: center; margin-bottom: clamp(1rem, 2.5dvh, 1.8rem); }
.rsvp__title { font-size: clamp(2.4rem, 8vw, 3.4rem); }
.rsvp__deadline { color: var(--ink-soft); font-size: 0.8rem; letter-spacing: 0.18em; }

.rsvp__card[hidden] { display: none; }
.rsvp__card {
  width: min(28rem, 100%);
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: 0.5rem;
  box-shadow: 0 1.4rem 3rem -1.6rem rgba(62, 58, 54, 0.4);
  padding: clamp(1.2rem, 4vw, 1.8rem);
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}

.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label {
  font-size: 0.64rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--sage-deep);
}
.field input,
.field textarea {
  font-family: var(--font-display);
  font-size: 1.08rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(62, 58, 54, 0.25);
  padding: 0.45rem 0.1rem;
  border-radius: 0;
  transition: border-color 300ms;
}
.field input:focus,
.field textarea:focus { outline: none; border-bottom-color: var(--gold); }
.field textarea { resize: vertical; min-height: 3.2rem; }

.rsvp__submit { align-self: center; margin-top: 0.2rem; }
.rsvp__submit:disabled { opacity: 0.55; cursor: wait; transform: none; }

.rsvp__error {
  text-align: center;
  color: #a04747;
  font-size: 0.85rem;
  min-height: 1.2em;
}

/* success view */
.rsvp__success { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.8rem; padding: 1rem 0; }
.rsvp__success[hidden] { display: none; }
.check-ring { width: 5.4rem; height: 5.4rem; }
.check-ring circle {
  fill: none;
  stroke: var(--sage);
  stroke-width: 2;
  stroke-dasharray: 214;
  stroke-dashoffset: 214;
  animation: draw 900ms var(--ease-out) forwards;
}
.check-ring path {
  fill: none;
  stroke: var(--sage-deep);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 44;
  stroke-dashoffset: 44;
  animation: draw 500ms 600ms var(--ease-out) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.rsvp__success h3 { font-family: var(--font-script); font-size: 2.2rem; color: var(--blush-ink); font-weight: 400; }
.rsvp__success p { font-family: var(--font-display); font-style: italic; color: var(--ink-soft); max-width: 22rem; }

/* ============================================================
   5. CLOSING
   ============================================================ */

.closing { text-align: center; gap: clamp(0.9rem, 2.6dvh, 1.6rem); }
.closing__monogram {
  font-family: var(--font-script);
  font-size: clamp(4rem, 16vw, 6.5rem);
  color: var(--blush-ink);
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.closing__monogram span { display: inline-flex; padding: 0 0.18em; }
.closing__monogram span svg {
  width: 0.34em;
  height: 0.34em;
  fill: var(--gold);
  filter: drop-shadow(0 1px 3px rgba(20, 15, 12, 0.5));
}
.closing__names {
  font-family: var(--font-display);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-indent: 0.3em;
  font-size: clamp(0.8rem, 2.6vw, 1rem);
  color: var(--ink-soft);
}
.closing__hashtag {
  font-family: var(--font-ui);
  color: var(--sage-deep);
  letter-spacing: 0.14em;
  font-size: 0.9rem;
}
.closing__love {
  font-family: var(--font-script);
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  color: var(--gold);
}

/* ============================================================
   reduced motion & small screens
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .pages { scroll-behavior: auto; }
  .rise { transition: none; opacity: 1; transform: none; }
  .gate__hint { animation: none; opacity: 1; }
  .gate.is-open { animation: none; opacity: 0; }
  .page.is-active .chapter__bg img.is-shown { animation: none; }
  .scroll-cue::after,
  .petal { animation: none; display: none; }
  .check-ring circle, .check-ring path { animation-duration: 1ms; }
}

@media (max-width: 420px) {
  .program { padding-left: 3rem; }
  .program__icon { left: -3rem; width: 2.1rem; height: 2.1rem; }
  .program::before { left: 1.04rem; }
}
