/* =========================================================================
   Linna & Daniel — Wedding RSVP
   Choreography modelled on springs.estate (chained sticky pins, bottom-up
   clip-path reveals, deliberate scroll pacing). Brand pulled from the
   printed red invitation card (red, gold, 囍, dragons).
   ========================================================================= */

:root {
  /* Brand (printed card) */
  --red:        #A8132A;
  --red-deep:   #6B0A18;
  --red-shadow: #4A0510;
  --gold:       #D4AF37;
  --gold-light: #E8C76C;
  --gold-deep:  #9C7B1E;
  --cream:      #F5E8D1;          /* springs stage colour */
  --cream-deep: #EAD7B0;
  --paper:      #FBF6EC;
  --ink:        #1A1208;
  --ink-soft:   #4A3826;
  --teal:       #162D24;          /* springs accent for body text */

  --serif: "Cormorant Garamond", "Noto Serif SC", Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --cn:    "Noto Serif SC", "Cormorant Garamond", serif;

  /* Springs uses scroll-driven mappings; for transitions a slow ease-out */
  --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-card: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--cream);
}

body {
  font-family: var(--sans);
  color: var(--teal);
  line-height: 1.55;
  font-weight: 400;
  overflow-x: hidden;
  background: var(--cream);
  min-height: 100vh;
}

img { display: block; max-width: 100%; }

/* ----- Path gating ------------------------------------------------------ */
body[data-path="accept"]  .decline-only { display: none; }
body[data-path="decline"] .accept-only  { display: none; }
body:not([data-path="accept"]):not([data-path="decline"]) .decline-only,
body:not([data-path="accept"]):not([data-path="decline"]) .accept-only {
  display: none;
}
body:not([data-step="confirm"]) #confirm { display: none; }

/* =========================================================================
   FIXED MONOGRAM — top-left, 囍 + tryzub + L · D
   ========================================================================= */
.monogram {
  position: fixed;
  top: 22px; left: 28px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--gold-deep);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s var(--ease-soft), color 0.4s var(--ease-soft);
}
.crest__xi {
  font-family: var(--cn);
  font-size: 22px;
  line-height: 1;
}
.crest__sep { color: var(--gold-deep); opacity: 0.5; font-size: 14px; line-height: 1; }
.crest__tryzub { display: inline-block; width: 22px; height: 22px; }
.crest__tryzub object { width: 100%; height: 100%; pointer-events: none; }
.monogram__name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.4em;
  margin-left: 6px;
  color: var(--teal);
}
body[data-step]:not([data-step="card"]) .monogram { opacity: 0.85; }

/* When we're in a red-card section, the monogram inverts to gold */
body[data-step="decline"] .monogram,
body[data-step="confirm"] .monogram { color: var(--gold-light); }
body[data-step="decline"] .monogram__name,
body[data-step="confirm"] .monogram__name { color: var(--cream); }

/* =========================================================================
   1. THE CARD — sticky-pinned hero (springs.estate `.sticky--full-height`).
   Cream stage, red invitation card centered like a real piece of stationery
   on a table. Card scales down + lifts as you scroll past it (driven by
   --card-progress JS variable: 0 = at rest, 1 = fully scrolled past).
   ========================================================================= */
.card-section {
  position: relative;
  height: 220vh;                  /* tall outer = sticky inner holds longer */
  width: 100%;
  background: var(--cream);
}

.card {                            /* the sticky stage (full viewport) */
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 70% 55% at 50% 50%, rgba(168,19,42,0.06), transparent 55%),
    var(--cream);
  isolation: isolate;
  overflow: hidden;
  perspective: 1400px;
}

/* The invitation paper itself.
   Width sized so the card always fits both axes of the viewport — width is
   the smaller of: 640px max, 56vw, and (84vh × 5/7) which keeps height ≤ 84vh. */
.card-paper {
  position: relative;
  width: min(640px, 56vw, calc(84vh * 5 / 7));
  aspect-ratio: 5 / 7;
  background:
    radial-gradient(ellipse 130% 80% at 0% 0%, rgba(232,199,108,0.10), transparent 55%),
    repeating-linear-gradient(135deg,
      rgba(0,0,0,0.025) 0px, rgba(0,0,0,0.025) 1px,
      transparent 1px, transparent 4px),
    var(--red);
  border-radius: 4px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 -2px 0 rgba(0,0,0,0.18) inset,
    0 30px 60px -20px rgba(0,0,0,0.35),
    0 60px 120px -40px rgba(168,19,42,0.30);

  transition: transform 0.05s linear, opacity 0.05s linear;

  /* slow idle float */
  animation: cardFloat 12s var(--ease-soft) infinite alternate;
}

/* Zoom-in/fly-through transform applies ONLY to the hero card-paper.
   Without this scoping, --card-progress would also fade out the decline
   and confirm cards (since they share the .card-paper class). */
#card .card-paper {
  --p: var(--card-progress, 0);
  transform-origin: 50% 50%;
  transform:
    scale(calc(1 + (var(--p) * 2.4)))
    translateY(calc(var(--p) * -2vh));
  opacity: calc(1 - (var(--p) * 0.95));
}
@keyframes cardFloat {
  from { box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 -2px 0 rgba(0,0,0,0.18) inset, 0 30px 60px -20px rgba(0,0,0,0.35), 0 60px 120px -40px rgba(168,19,42,0.30); }
  to   { box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 -2px 0 rgba(0,0,0,0.18) inset, 0 36px 72px -22px rgba(0,0,0,0.40), 0 70px 140px -40px rgba(168,19,42,0.36); }
}

/* Entrance animation. Defaults to fully visible — animation is an
   enhancement, never a gate. If JS or IntersectionObserver fails the card
   is still rendered. */
.card-paper {
  /* The .in-view class triggers a subtle scale-up from 0.97 → 1 + opacity
     fade-in. No clip-path here — the card's edges and shadows are part of
     the visual identity, clipping them mid-reveal looked like a render bug. */
  transition: transform 0.05s linear, opacity 0.05s linear;
}

/* Gold double-line border, inset 16px */
.card-paper::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(232,199,108,0.55);
  outline: 1px solid rgba(232,199,108,0.18);
  outline-offset: 5px;
  border-radius: 2px;
  pointer-events: none;
}

/* Card layout: 囍 top-left, dragons in TR/BL slots, text middle, deadline BR */
.card-paper__inner {
  position: relative;
  width: 100%; height: 100%;
  padding: 9% 8%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: var(--cream);
}

.card-xi {
  font-family: var(--cn);
  font-weight: 600;
  font-size: clamp(26px, 3.4vw, 40px);
  color: var(--gold-light);
  width: clamp(46px, 6.4vw, 72px);
  height: clamp(46px, 6.4vw, 72px);
  border: 1.5px solid var(--gold-light);
  border-radius: 50%;
  display: grid;
  place-items: center;
  line-height: 1;
  text-shadow: 0 0 6px rgba(212,175,55,0.4);
  align-self: start;
  justify-self: start;
}

/* Dragon (龍) + Phoenix (鳳) corner ornaments — the traditional Chinese
   wedding pairing, set as large brush-script characters in gold rather
   than amateur line-art. Ma Shan Zheng is a calligraphic Chinese font from
   Google Fonts (loaded in <head>) — falls back to Noto Serif SC. */
.card-dragon {
  position: absolute;
  width: clamp(64px, 14cqw, 130px);
  height: clamp(64px, 14cqw, 130px);
  display: grid;
  place-items: center;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  font-weight: 400;
  font-size: clamp(46px, 11cqw, 100px);
  line-height: 1;
  color: var(--gold-light);
  text-shadow:
    0 0 12px rgba(232,199,108,0.35),
    0 2px 8px rgba(107,10,24,0.4);
  pointer-events: none;
  user-select: none;
  /* Subtle gold-leaf gradient on the character itself */
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.card-paper { container-type: inline-size; }
.card-dragon--tr { top: clamp(8px, 2.5cqw, 20px); right: clamp(8px, 2.5cqw, 20px); }
.card-dragon--bl { bottom: clamp(8px, 2.5cqw, 20px); left: clamp(8px, 2.5cqw, 20px); }

.card-text {
  align-self: center;
  text-align: left;
}
.card-text--center { text-align: center; }

.card-intro {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(13px, 1.3vw, 17px);
  letter-spacing: 0.05em;
  color: var(--gold-light);
  margin-bottom: clamp(18px, 2.6vw, 28px);
}
.card-names {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 4.2vw, 52px);
  line-height: 1.0;
  letter-spacing: -0.005em;
  color: var(--gold-light);
  margin-bottom: clamp(14px, 2vw, 22px);
}
.card-names--small { font-size: clamp(22px, 3vw, 34px); }
.card-name { display: block; }
.card-name + .card-name { margin-top: 4px; }
.card-names .amp {
  font-style: italic;
  font-weight: 300;
  color: var(--gold);
}
.card-verb {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(13px, 1.3vw, 17px);
  color: var(--cream);
  margin-bottom: clamp(20px, 2.8vw, 28px);
}
.card-details { margin-bottom: clamp(18px, 2.6vw, 28px); text-align: right; }
.card-date {
  font-family: var(--serif);
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 400;
  color: var(--gold-light);
  margin-bottom: 2px;
}
.card-time, .card-venue {
  font-family: var(--serif);
  font-size: clamp(13px, 1.4vw, 17px);
  color: var(--cream);
  line-height: 1.4;
  opacity: 0.92;
}
.card-time { font-style: italic; opacity: 0.85; margin-bottom: 4px; }
.card-reception {
  font-family: var(--serif);
  font-size: clamp(13px, 1.3vw, 16px);
  color: var(--gold-light);
  font-style: italic;
  text-align: right;
  align-self: end;
}
.card-deadline {
  position: absolute;
  bottom: 6%; right: 8%;
  text-align: right;
  font-family: var(--sans);
  color: var(--gold-light);
  line-height: 1.3;
}
.card-deadline-line {
  display: block;
  font-size: clamp(9px, 0.8vw, 11px);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.85;
}
.card-deadline-date {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(13px, 1.4vw, 16px);
  margin-top: 3px;
  color: var(--cream);
}

/* Smaller card (decline + confirm) */
.card-section--small { height: 100vh; }
.card-section--small .card-paper {
  width: clamp(300px, 44vw, 520px);
  /* no card-deadline on small variant */
}
.card-section--small .card-deadline { display: none; }

.card-redirect {
  margin-top: 18px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--gold-light);
  text-align: center;
}

/* Scroll cue */
.scroll-cue {
  position: absolute;
  bottom: 4vh;
  left: 50%;
  transform: translateX(-50%);
  background: transparent;
  border: 1px solid var(--gold-deep);
  color: var(--gold-deep);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  padding: 11px 22px 9px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
  transition: background 0.4s var(--ease-soft), color 0.4s var(--ease-soft);
  animation: cueBob 2.6s var(--ease-soft) infinite;
}
.scroll-cue:hover { background: var(--gold-deep); color: var(--cream); }
.scroll-cue svg { width: 12px; height: 12px; }
@keyframes cueBob {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.85; }
  50%      { transform: translateX(-50%) translateY(6px); opacity: 1; }
}

/* =========================================================================
   1.NEW HERO — the red invitation card, dominantly large on a cream stage.
   Landscape orientation so the "囍 left · text center · CTA bottom-right"
   layout fits naturally and the card takes most of the viewport.
   Phoenix top-left, dragon top-right. Card scales up + fades on scroll
   (--card-progress) like the original zoom-in choreography.
   ========================================================================= */

/* Big landscape hero card — overrides the portrait .card-paper sizing for
   the hero only. Decline + confirm cards keep the small-portrait variant. */
#card .card-paper {
  /* Landscape ratio (5:4) so the horizontal layout fits + card dominates */
  width: min(94vw, calc(88vh * 5 / 4));
  aspect-ratio: 5 / 4;
  background:
    radial-gradient(ellipse 130% 80% at 0% 0%, rgba(232,199,108,0.10), transparent 55%),
    repeating-linear-gradient(135deg,
      rgba(0,0,0,0.025) 0px, rgba(0,0,0,0.025) 1px,
      transparent 1px, transparent 4px),
    var(--red);
  border-radius: 4px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 -2px 0 rgba(0,0,0,0.18) inset,
    0 30px 60px -20px rgba(0,0,0,0.40),
    0 60px 120px -40px rgba(168,19,42,0.35);
  position: relative;
  isolation: isolate;
  container-type: inline-size;

  /* Zoom-in / fly-through on scroll */
  --p: var(--card-progress, 0);
  transform-origin: 50% 50%;
  transform:
    scale(calc(1 + (var(--p) * 1.6)))
    translateY(calc(var(--p) * -2vh));
  opacity: calc(1 - (var(--p) * 0.95));
  transition: transform 0.05s linear, opacity 0.05s linear;
}

/* Gold double-line frame inside the card */
#card .card-paper__frame {
  position: absolute;
  inset: clamp(12px, 1.6cqw, 22px);
  border: 1px solid rgba(232,199,108,0.55);
  outline: 1px solid rgba(232,199,108,0.18);
  outline-offset: 5px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 2;
}

/* Phoenix (top-left) + Dragon (top-right) corner slots — empty by default.
   When real artwork is dropped at /assets/invite/phoenix.png and dragon.png,
   the CSS below picks them up automatically as background images. */
.card-corner {
  position: absolute;
  top: clamp(20px, 3cqw, 36px);
  z-index: 4;
  width: clamp(80px, 14cqw, 180px);
  height: clamp(80px, 14cqw, 180px);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}
.card-corner--tl {
  left: clamp(20px, 3cqw, 36px);
  background-image: url('/assets/invite/phoenix.png');
}
.card-corner--tr {
  right: clamp(20px, 3cqw, 36px);
  background-image: url('/assets/invite/dragon.png');
}
/* Hide the slot if its background image fails to load — keeps the card
   uncluttered until the real artwork is provided. */
.card-corner { background-color: transparent; }

/* Inner layout grid for the hero card */
#card .card-paper__inner {
  position: relative;
  z-index: 3;
  width: 100%; height: 100%;
  padding: clamp(40px, 6cqw, 80px) clamp(32px, 5cqw, 72px);
  display: grid;
  grid-template-columns: 0.95fr 1fr;
  grid-template-rows: 1fr auto;
  gap: clamp(20px, 3cqw, 40px);
  align-items: center;
}

/* Background 囍 — the dominant decorative element on the left.
   Darker red than the card background. */
.card-bg-xi {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
  font-family: "Noto Serif SC", "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: clamp(120px, 28cqw, 380px);
  color: var(--red-deep);
  line-height: 0.85;
  text-align: center;
  align-self: center;
  justify-self: center;
  user-select: none;
  pointer-events: none;
  text-shadow: 0 4px 18px rgba(74,5,16,0.4);
  filter: drop-shadow(0 2px 28px rgba(74,5,16,0.5));
}

/* Center text block, left-aligned */
.card-content {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  text-align: left;
  color: var(--cream);
  align-self: center;
  max-width: 540px;
}
.card-intro {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(13px, 1.4cqw, 18px);
  letter-spacing: 0.04em;
  color: var(--gold-light);
  margin-bottom: clamp(16px, 2cqw, 24px);
}
.card-names {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 5.6cqw, 78px);
  line-height: 1.0;
  letter-spacing: -0.005em;
  color: var(--gold-light);
  margin-bottom: clamp(14px, 2cqw, 24px);
}
.card-names .amp { font-style: italic; font-weight: 300; color: var(--gold); }
.card-verb {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(13px, 1.4cqw, 18px);
  color: var(--cream);
  margin-bottom: clamp(20px, 2.6cqw, 32px);
  opacity: 0.95;
}
.card-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-date {
  font-family: var(--serif);
  font-size: clamp(20px, 2.6cqw, 36px);
  color: var(--gold-light);
  margin-bottom: 4px;
}
.card-time, .card-venue {
  font-family: var(--serif);
  font-size: clamp(13px, 1.5cqw, 20px);
  color: var(--cream);
  line-height: 1.4;
  opacity: 0.92;
}
.card-time { font-style: italic; opacity: 0.85; }

/* Bottom-right CTA */
.card-cta {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  text-align: right;
  align-self: end;
  justify-self: end;
}
.card-cta__line {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(12px, 1.2cqw, 16px);
  color: var(--gold-light);
  margin-bottom: 14px;
  line-height: 1.4;
}
.card-cta__line span {
  color: var(--cream);
  font-style: normal;
  font-weight: 500;
  display: inline-block;
  margin-top: 2px;
}
/* Outline-pill CTA — lighter than a filled gold button, matches the
   .scroll-cue style from the archive that the user preferred. */
.cta-pill {
  background: transparent;
  border: 1px solid var(--gold-light);
  color: var(--gold-light);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  padding: 11px 22px 9px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: background 0.4s var(--ease-soft), color 0.4s var(--ease-soft), transform 0.3s var(--ease-soft);
  animation: ctaPillBob 2.6s var(--ease-soft) infinite;
}
@keyframes ctaPillBob {
  0%, 100% { transform: translateY(0);   opacity: 0.9; }
  50%      { transform: translateY(4px); opacity: 1; }
}
.cta-pill:hover { background: var(--gold-light); color: var(--red-deep); animation-play-state: paused; }
.cta-pill svg   { width: 12px; height: 12px; }

/* Mobile / narrow: stack the layout vertically + portrait card */
@media (max-width: 900px) {
  #card .card-paper {
    /* Switch to portrait so it fits a tall narrow viewport */
    width: min(94vw, calc(88vh * 5 / 7));
    aspect-ratio: 5 / 7;
  }
  #card .card-paper__inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    padding: clamp(40px, 5cqw, 64px);
    align-items: start;
    gap: 24px;
  }
  .card-bg-xi {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    font-size: clamp(100px, 30cqw, 200px);
    align-self: start;
  }
  .card-content {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    max-width: 100%;
    align-self: start;
  }
  .card-cta {
    grid-column: 1 / 2;
    grid-row: 3 / 3;
    text-align: left;
    align-self: end;
    justify-self: start;
  }
}

/* =========================================================================
   1.5 ENGAGEMENT — sticky-pinned bridge between red hero and cream gallery.
   Single full-bleed engagement photo with slow ken-burns and a subtle
   gradient veil so the transition red → cream feels intentional.
   ========================================================================= */
.engagement {
  position: relative;
  width: 100%;
  height: 160vh;          /* tall outer = sticky inner holds for ~half a screen */
  background: var(--cream);
}
.engagement__pin {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}
.engagement__photo {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
}
.engagement__photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  /* slow ken-burns — 30s loop */
  animation: engagementPan 30s var(--ease-soft) infinite alternate;
}

/* Scroll-driven zoom-in / fly-through on the engagement photo, matching
   the hero card's zoom-into-next-section behavior. As --engagement-progress
   goes 0 → 1, the photo scales up and fades, revealing the gallery beyond. */
.engagement__photo {
  --p: var(--engagement-progress, 0);
  transform-origin: 50% 50%;
  transform: scale(calc(1 + (var(--p) * 1.4)));
  opacity: calc(1 - (var(--p) * 0.95));
  transition: transform 0.05s linear, opacity 0.05s linear;
  will-change: transform, opacity;
}
@keyframes engagementPan {
  from { transform: scale(1.05) translate(0, 0); }
  to   { transform: scale(1.12) translate(-1.5%, -1%); }
}
.engagement__veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg,
      rgba(168,19,42,0.28) 0%,            /* red wash at top, joining hero */
      rgba(168,19,42,0.10) 35%,
      rgba(245,232,209,0.0) 60%,
      rgba(245,232,209,0.55) 100%);       /* cream wash at bottom, joining gallery */
  pointer-events: none;
}

/* =========================================================================
   2. FLIP-GALLERY — sleek 3x3 photo grid that flips card-style on scroll
   to reveal the RSVP question. Sticky-pinned so the flip plays out as the
   user scrolls; staggered per-card delay gives a "deck of cards being
   turned over" feel; the question fades in over the flipped grid.
   ========================================================================= */

.flip-section {
  position: relative;
  width: 100%;
  height: 160vh;                /* short — once you enter, animation auto-plays */
  background: var(--cream);
}
.flip-section__pin {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  gap: clamp(20px, 3vh, 36px);
  padding: clamp(40px, 6vh, 72px) clamp(28px, 5vw, 80px);
  overflow: hidden;
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(168,19,42,0.04), transparent 60%),
    var(--cream);
  /* Cross-fade to red+peony when the question is revealed */
  transition: background 0.9s var(--ease-soft);
}

/* When the form is revealed, the whole pin background transitions to a deep
   red wash overlaid with a tiled gold peony pattern. The peony SVG is
   tinted gold via background-image + currentColor (the SVG uses currentColor
   for its strokes — but when used as a background-image we use a fixed
   golden color via CSS variables baked into the SVG's data URL).
   We use the file-based SVG and tint via filter when needed. */
.flip-section.is-revealed .flip-section__pin {
  background:
    /* peony tile pattern, gold on red */
    url('/assets/motifs/peony-gold.svg'),
    /* slight vignette */
    radial-gradient(ellipse 80% 60% at 50% 50%, rgba(107,10,24,0.0), rgba(107,10,24,0.45) 100%),
    var(--red);
  background-repeat: repeat;
  background-size: 280px 280px, auto, auto;
}

.flip-section__intro {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 3vw, 38px);
  line-height: 1.4;
  text-align: center;
  color: var(--teal);
  max-width: 780px;
  letter-spacing: -0.005em;
}
.flip-section__intro em {
  font-style: italic;
  color: var(--red);
  font-weight: 400;
}

/* ----- The 3x3 photo grid ---------------------------------------------- */
.flip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: clamp(10px, 1.4vw, 18px);
  width: min(720px, 78vw);
  height: min(720px, 70vh);
  perspective: 2000px;
  position: relative;
  z-index: 1;

  /* As the flips happen, the whole grid drifts back slightly so the
     question can sit comfortably above */
  transition: transform 1s var(--ease-soft), opacity 1s var(--ease-soft);
}
.flip-grid {
  /* Photos never need to intercept clicks — the question card on top of
     them is the only interactive element after they flip. */
  pointer-events: none;
}
.flip-section.is-revealed .flip-grid {
  transform: scale(0.92) translateY(-2vh);
  opacity: 0.40;          /* fades back further so peony bg shows through */
}
/* Intro text fades out when the form is revealed (cream→red bg = unreadable) */
.flip-section.is-revealed .flip-section__intro {
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.6s var(--ease-soft), transform 0.6s var(--ease-soft);
}
.flip-section__intro {
  transition: opacity 0.6s var(--ease-soft), transform 0.6s var(--ease-soft);
}

.flip {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1400px;
  transform: rotate(var(--rot, 0deg));
}

.flip__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 1.1s var(--ease-out);
  transition-delay: var(--d, 0s);
  border-radius: 4px;
  box-shadow:
    0 8px 18px -8px rgba(22,45,36,0.30),
    0 18px 40px -16px rgba(22,45,36,0.18);
}
.flip.is-flipped .flip__inner {
  transform: rotateY(180deg);
}

.flip__face {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.flip__face--front img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.flip__face--back {
  transform: rotateY(180deg);
  background:
    radial-gradient(ellipse 100% 80% at 0% 0%, rgba(255,255,255,0.6), transparent 60%),
    repeating-linear-gradient(135deg,
      rgba(0,0,0,0.015) 0px, rgba(0,0,0,0.015) 1px,
      transparent 1px, transparent 4px),
    var(--cream-deep);
  border: 1px solid rgba(212,175,55,0.45);
}
/* Decorative inner gold border on the back, like an envelope */
.flip__face--back::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(212,175,55,0.30);
  border-radius: 2px;
}
/* Tiny 囍 monogram on each card back */
.flip__face--back::before {
  content: "囍";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(20px, 2.4vw, 30px);
  color: var(--gold);
  opacity: 0.7;
}

.flip--center .flip__inner {
  /* center card slightly more shadow */
  box-shadow:
    0 12px 24px -10px rgba(22,45,36,0.35),
    0 24px 50px -18px rgba(22,45,36,0.22);
}

/* ----- The RSVP question, layered over the grid ----------------------- */
.flip-section__question {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(680px, 86vw);
  text-align: center;
  z-index: 5;
  padding: clamp(28px, 4vw, 48px) clamp(28px, 4vw, 56px);
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, rgba(255,255,255,0.7), transparent 60%),
    var(--paper);
  border: 1px solid rgba(212,175,55,0.5);
  border-radius: 6px;
  box-shadow:
    0 24px 50px -18px rgba(22,45,36,0.28),
    0 50px 100px -40px rgba(168,19,42,0.18);

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s var(--ease-out);
}
.flip-section.is-revealed .flip-section__question {
  opacity: 1;
  pointer-events: auto;
}
.flip-section__question .eyebrow { margin-bottom: 18px; }
.flip-section__question .paper__question {
  font-size: clamp(22px, 2.6vw, 32px);
  margin-bottom: 18px;
  color: var(--teal);
}
.flip-section__question .choice__hint {
  margin-top: 16px;
  text-align: center;
}

/* ----- Mobile fallback: smaller grid, simpler flip ---------------------- */
@media (max-width: 720px) {
  .flip-section { height: 140vh; }   /* short — trigger fires quickly on small screens */
  .flip-section__pin {
    padding: 56px 20px;
    gap: 18px;
  }
  .flip-grid {
    width: 92vw;
    height: 60vh;
    gap: 8px;
  }
  .flip-section__question {
    width: 92vw;
    padding: 24px 20px;
  }
}



/* =========================================================================
   3. PAPER SECTION — cream form / question card on the cream stage.
   Same physical-card aesthetic; thin gold border.
   ========================================================================= */
.paper-section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background: var(--cream);
  display: grid;
  place-items: center;
  padding: 12vh clamp(20px, 4vw, 60px);
}
.paper {
  position: relative;
  width: min(720px, 100%);
  background:
    radial-gradient(ellipse 100% 80% at 0% 0%, rgba(255,255,255,0.5), transparent 60%),
    repeating-linear-gradient(135deg,
      rgba(0,0,0,0.012) 0px, rgba(0,0,0,0.012) 1px,
      transparent 1px, transparent 4px),
    var(--paper);
  border-radius: 4px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 24px 50px -18px rgba(22,45,36,0.18),
    0 50px 100px -40px rgba(168,19,42,0.10);
  padding: clamp(48px, 6vw, 88px) clamp(36px, 5vw, 72px);
  /* Defaults visible — entrance handled via the inner .reveal */
}
.paper--form { padding-top: clamp(56px, 7vw, 96px); padding-bottom: clamp(56px, 7vw, 96px); }
.paper__border {
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(212,175,55,0.45);
  outline: 1px solid rgba(212,175,55,0.16);
  outline-offset: 5px;
  border-radius: 2px;
  pointer-events: none;
}
.paper__inner { position: relative; z-index: 1; }

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--gold-deep);
  margin-bottom: 22px;
}

.paper__heading,
.paper__question {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.15;
  color: var(--teal);
  margin-bottom: 32px;
}
.paper__heading { font-size: clamp(28px, 3.6vw, 44px); letter-spacing: -0.005em; }
.paper__question {
  font-size: clamp(24px, 3vw, 38px);
  text-align: center;
  line-height: 1.55;
  color: var(--teal);
}

/* Choice pills */
.choice-pill {
  font-family: var(--serif);
  font-size: inherit;
  font-style: italic;
  color: var(--red);
  background: transparent;
  border: 1.5px solid var(--gold);
  padding: 4px 22px 6px;
  border-radius: 999px;
  cursor: pointer;
  margin: 0 4px;
  transition:
    background 0.45s var(--ease-soft),
    color 0.45s var(--ease-soft),
    border-color 0.45s var(--ease-soft),
    transform 0.4s var(--ease-soft);
  vertical-align: baseline;
}
.choice-pill:hover { background: rgba(168,19,42,0.06); border-color: var(--red); transform: translateY(-2px); }
.choice-pill.is-selected { background: var(--red); color: var(--cream); border-color: var(--red); }
.choice__or { font-style: italic; color: var(--ink-soft); margin: 0 4px; font-size: 0.85em; }
.choice__hint {
  margin-top: 22px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  min-height: 1.2em;
  opacity: 0;
  text-align: center;
  transition: opacity 0.4s var(--ease-soft);
}
.choice__hint.is-visible { opacity: 1; }

/* ----- Form fields -------------------------------------------------- */
.field { margin-bottom: 22px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
.field label {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 8px;
  font-weight: 500;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--serif);
  font-size: 21px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(22,45,36,0.25);
  padding: 6px 0 10px;
  color: var(--teal);
  transition: border-color 0.3s var(--ease-soft);
  font-weight: 400;
}
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-bottom-color: var(--red); }
.field input::placeholder, .field textarea::placeholder { color: rgba(22,45,36,0.4); font-style: italic; }
.field textarea {
  resize: vertical;
  min-height: 80px;
  font-family: var(--sans);
  font-size: 15px;
  border: 1px solid rgba(22,45,36,0.2);
  padding: 12px 14px;
  border-radius: 4px;
  background: rgba(255,255,255,0.4);
  color: var(--teal);
}
.field textarea:focus { border-color: var(--red); }
.field select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gold-deep) 50%),
    linear-gradient(-45deg, transparent 50%, var(--gold-deep) 50%);
  background-position: calc(100% - 18px) center, calc(100% - 12px) center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px;
  cursor: pointer;
}

.guests-container { display: grid; gap: 16px; margin-bottom: 22px; }
.guests-container .field { margin-bottom: 0; }

.party-line {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--ink-soft);
  padding: 16px 20px;
  border-left: 2px solid var(--gold);
  background: rgba(212,175,55,0.10);
  border-radius: 0 4px 4px 0;
  margin: 12px 0 28px;
  line-height: 1.55;
}
.party-line strong { color: var(--teal); font-weight: 500; font-style: normal; }

.form-nav {
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  padding: 14px 28px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition:
    background 0.4s var(--ease-soft),
    color 0.4s var(--ease-soft),
    transform 0.3s var(--ease-soft),
    box-shadow 0.4s var(--ease-soft);
}
.btn-gold {
  background: var(--gold);
  color: var(--red-deep);
  border-color: var(--gold);
}
.btn-gold:hover { background: var(--gold-light); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(168,19,42,0.18); }
.btn-lg { padding: 18px 40px; font-size: 13px; }
.form-error { color: var(--red); font-size: 14px; margin-top: 16px; text-align: right; min-height: 20px; }

/* ----- Dinner cards ------------------------------------------------- */
.dinner-cards { display: grid; gap: 14px; margin-bottom: 28px; }
.dinner-card {
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(22,45,36,0.10);
  border-radius: 6px;
  padding: 18px 20px;
}
.dinner-card__name {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--teal);
  margin-bottom: 12px;
  font-weight: 500;
}
.dinner-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 600px) { .dinner-options { grid-template-columns: repeat(2, 1fr); } }
.dinner-options input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.dinner-options label {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 11px 6px;
  border: 1.5px solid rgba(22,45,36,0.18);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s var(--ease-soft);
  color: var(--ink-soft);
}
.dinner-options label:hover { border-color: var(--gold); color: var(--teal); }
.dinner-options input[type="radio"]:checked + label {
  background: var(--red);
  border-color: var(--red);
  color: var(--cream);
}

/* ----- Links / footer ----------------------------------------------- */
.link-gold {
  color: var(--gold-deep);
  text-decoration: none;
  font-family: var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
  border-bottom: 1px solid currentColor;
  padding-bottom: 4px;
  transition: color 0.3s var(--ease-soft), border-color 0.3s var(--ease-soft);
  background: none; border-left: none; border-right: none; border-top: none;
  cursor: pointer;
}
.link-gold:hover { color: var(--red); }
.link-gold--onred { color: var(--gold-light); }
.link-gold--onred:hover { color: var(--cream); }

.site-footer {
  text-align: center;
  padding: 36px 24px 40px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-deep);
  background: var(--cream);
  border-top: 1px solid rgba(212,175,55,0.25);
}

/* =========================================================================
   STAGGERED TEXT REVEAL — springs.estate `.data-reveal` pattern.
   Each .reveal child fades up sequentially.
   ========================================================================= */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 1.2s var(--ease-out),
    transform 1.3s var(--ease-out);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
.reveal > * {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1.1s var(--ease-out), transform 1.2s var(--ease-out);
}
.reveal.in-view > * { opacity: 1; transform: translateY(0); }
.reveal.in-view > *:nth-child(1) { transition-delay: 0.05s; }
.reveal.in-view > *:nth-child(2) { transition-delay: 0.20s; }
.reveal.in-view > *:nth-child(3) { transition-delay: 0.35s; }
.reveal.in-view > *:nth-child(4) { transition-delay: 0.50s; }
.reveal.in-view > *:nth-child(5) { transition-delay: 0.65s; }
.reveal.in-view > *:nth-child(6) { transition-delay: 0.80s; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html { scroll-behavior: auto; }
  .card-paper, .interlude__photo, .paper { clip-path: none !important; }
  .card { position: static; height: auto; min-height: 100vh; }
  .card-section, .interlude { height: auto; }
}
