/* ============================================================================
   VATSAL & NISHI — RING CEREMONY INVITATION
   Design tokens
   Palette: deep royal plum + antique gold + ivory, lifted from the arch &
   floral motif of the invitation artwork. One signature moment (the
   tap-to-reveal -> hero video -> name reveal sequence) carries the biggest
   animation budget; everything after it uses one restrained reveal pattern.
============================================================================ */

:root {
  /* Color */
  --plum-deep:  #22081c;
  --plum:       #3a1230;
  --plum-soft:  #4d1a40;
  --wine:       #7a2244;
  --gold:       #c8a25a;
  --gold-light: #f2ddaa;
  --gold-deep:  #9c7a34;
  --ivory:      #faf3e6;
  --ivory-dim:  #efe5cf;
  --ink:        #2a1420;
  --lilac:      #cdb2da;

  /* Type */
  --font-script:  'Great Vibes', cursive;
  --font-display: 'Cormorant SC', 'Cormorant Garamond', serif;
  --font-heading: 'Cinzel', serif;
  --font-body:    'Cormorant Garamond', Georgia, serif;

  /* Layout */
  --max-w: 560px;
  --section-pad-y: clamp(3.5rem, 10vw, 5.5rem);
  --section-pad-x: clamp(1.5rem, 6vw, 2.5rem);

  /* Motion */
  --ease-royal: cubic-bezier(.22, .68, 0, 1);
  --dur-slow: 900ms;
  --dur-med: 550ms;
}

/* ---------------------------------- Reset -------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

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

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

/* ---------------------------- Desktop gate -------------------------------- */
.desktop-block {
  position: fixed; inset: 0; z-index: 9999;
  display: none; align-items: center; justify-content: center;
  background: radial-gradient(120% 120% at 50% 0%, var(--plum-soft), var(--plum-deep));
  padding: 2rem;
}
.desktop-block.is-active { display: flex; }
.desktop-block__card {
  max-width: 420px; text-align: center; color: var(--ivory);
  border: 1px solid rgba(200,162,90,.5); border-radius: 4px;
  padding: 3rem 2.5rem; background: rgba(0,0,0,.15);
}
.desktop-block__monogram {
  font-family: var(--font-script); font-size: 2.6rem; color: var(--gold-light); margin-bottom: 1rem;
}
.desktop-block__text {
  font-family: var(--font-heading); font-size: .95rem; letter-spacing: .04em; line-height: 1.8;
}
.app.is-desktop-hidden { display: none; }

/* ------------------------------- App shell -------------------------------- */
.app { position: relative; }
.app.no-scroll { height: 100vh; overflow: hidden; }

.section { padding: var(--section-pad-y) var(--section-pad-x); max-width: var(--max-w); margin: 0 auto; position: relative; }
.section-eyebrow {
  display: block; text-align: center; font-family: var(--font-heading);
  font-size: .72rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--gold-deep); margin-bottom: .6rem;
}
.section-title {
  text-align: center; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.7rem, 6vw, 2.2rem); color: var(--plum); letter-spacing: .02em;
  margin-bottom: 1.6rem;
}

.ornament-divider {
  display: flex; align-items: center; justify-content: center; gap: .75rem;
  color: var(--gold); margin: 0 auto 2.2rem; max-width: 220px;
}
.ornament-divider span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, currentColor); }
.ornament-divider span:last-child { background: linear-gradient(270deg, transparent, currentColor); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .95rem 2rem; font-family: var(--font-heading); font-size: .8rem;
  letter-spacing: .14em; text-transform: uppercase; border-radius: 2px;
  transition: transform var(--dur-med) var(--ease-royal), box-shadow var(--dur-med) var(--ease-royal);
}
.btn--gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 60%, var(--gold-deep));
  color: var(--plum-deep); box-shadow: 0 6px 18px rgba(156,122,52,.35);
}
.btn--gold:active { transform: scale(.97); }
.btn--block { width: 100%; }

/* Scroll-reveal (single consistent technique used throughout, per design system) */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity var(--dur-slow) var(--ease-royal), transform var(--dur-slow) var(--ease-royal); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ============================================================================
   1. GATE — Tap to Reveal
============================================================================ */
.gate {
  position: fixed; inset: 0; z-index: 100;
  height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.6rem; text-align: center; padding: 2.5rem;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(200,162,90,.18), transparent 60%),
    radial-gradient(140% 100% at 50% 110%, rgba(200,162,90,.14), transparent 55%),
    linear-gradient(180deg, var(--plum-deep), var(--plum) 55%, var(--plum-deep));
  color: var(--ivory); overflow: hidden;
  transition: opacity var(--dur-slow) var(--ease-royal), visibility var(--dur-slow);
}
.gate.is-open { opacity: 0; visibility: hidden; pointer-events: none; }

.gate__ornament { position: absolute; left: 0; right: 0; height: 40vh; opacity: .5; pointer-events: none; }
.gate__ornament--top {
  top: 0;
  background: radial-gradient(60% 100% at 50% 0%, rgba(242,221,170,.25), transparent 70%);
}
.gate__ornament--bottom {
  bottom: 0;
  background: radial-gradient(60% 100% at 50% 100%, rgba(242,221,170,.18), transparent 70%);
}

.gate__eyebrow {
  font-family: var(--font-heading); font-size: .7rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold-light); opacity: .85;
}
.gate__guest-name {
  font-family: var(--font-script); font-size: clamp(2.2rem, 11vw, 3.2rem);
  color: var(--gold-light); min-height: 1.4em; line-height: 1.2;
  text-shadow: 0 0 24px rgba(242,221,170,.35);
}
.shimmer {
  display: inline-block; width: 8em; height: .7em; border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.18), rgba(255,255,255,.05));
  background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.tap-badge { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 148px; height: 148px; }
.tap-badge__ring {
  position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(242,221,170,.6);
  animation: tap-pulse 2.4s var(--ease-royal) infinite;
}
.tap-badge__ring::before, .tap-badge__ring::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(242,221,170,.35); }
.tap-badge__ring::before { animation: tap-pulse 2.4s var(--ease-royal) infinite .6s; }
.tap-badge__ring::after { animation: tap-pulse 2.4s var(--ease-royal) infinite 1.2s; }
@keyframes tap-pulse { from { transform: scale(.7); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }

.tap-badge__label {
  position: relative; z-index: 1; font-family: var(--font-heading); font-size: .78rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--plum-deep);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  text-align: center; box-shadow: 0 8px 26px rgba(0,0,0,.35);
}

.gate__footnote { font-family: var(--font-body); font-style: italic; font-size: .95rem; color: var(--lilac); }

/* ============================================================================
   2. HERO — video + floating name reveal
============================================================================ */
.hero {
  position: relative; min-height: 100svh; width: 100%; background: var(--plum-deep);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  overflow: hidden; color: var(--ivory);
}
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(34,8,28,.15) 0%, rgba(34,8,28,.1) 45%, rgba(34,8,28,.85) 100%);
}

.hero__names {
  position: relative; z-index: 1; display: flex; align-items: baseline; gap: .5rem;
  font-family: var(--font-display); font-weight: 600; color: var(--gold-light);
  font-size: clamp(2.4rem, 12vw, 3.4rem);
  opacity: 0; transform: translateY(18px) scale(.96); filter: blur(6px);
  transition: opacity 1.3s var(--ease-royal), transform 1.3s var(--ease-royal), filter 1.3s var(--ease-royal);
  text-shadow: 0 2px 30px rgba(0,0,0,.4);
}
.hero__names.is-shown { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
.hero__amp { font-family: var(--font-script); font-size: .8em; color: var(--ivory); }

.hero__line {
  position: relative; z-index: 1; margin-top: .6rem; font-style: italic; font-size: 1.05rem; color: var(--lilac);
  opacity: 0; transition: opacity 1.1s var(--ease-royal) .3s;
}
.hero__line.is-shown { opacity: 1; }

.scroll-cue {
  position: relative; z-index: 1; margin: 2.4rem 0 2.6rem; display: flex; flex-direction: column; align-items: center; gap: .4rem;
  color: var(--gold-light); font-family: var(--font-heading); font-size: .68rem; letter-spacing: .2em; text-transform: uppercase;
  opacity: 0; pointer-events: none; transition: opacity .8s var(--ease-royal);
  text-shadow: 0 0 12px rgba(242,221,170,.7);
}
.scroll-cue.is-shown { opacity: 1; pointer-events: auto; animation: cue-bob 2.2s ease-in-out infinite; }
@keyframes cue-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ============================================================================
   3. INVITATION CARD
============================================================================ */
.invitation { background: var(--ivory); }
.invite-card {
  border: 1px solid var(--gold); border-radius: 4px; padding: 2.6rem 1.8rem;
  text-align: center; position: relative;
  background: linear-gradient(180deg, #fffdf8, var(--ivory-dim));
  box-shadow: 0 18px 40px -20px rgba(58,18,48,.35);
}
.invite-card::before {
  content: ""; position: absolute; inset: 8px; border: 1px solid rgba(200,162,90,.5); border-radius: 2px; pointer-events: none;
}
.invite-card__guest { font-family: var(--font-script); font-size: 1.9rem; color: var(--wine); margin-bottom: .2rem; }
.invite-card__script { font-family: var(--font-script); font-size: 1.6rem; color: var(--gold-deep); margin-bottom: 1rem; }
.invite-card__lead { font-style: italic; line-height: 1.8; color: var(--ink); font-size: 1.02rem; margin-bottom: 1.6rem; }

.invite-card__names { margin-bottom: 1.6rem; }
.invite-card__name { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.6rem, 7vw, 2rem); color: var(--plum); letter-spacing: .03em; }
.invite-card__parents { font-size: .95rem; color: var(--ink); opacity: .85; margin-top: .15rem; }
.invite-card__with { font-family: var(--font-script); font-size: 1.3rem; color: var(--gold-deep); margin: .8rem 0; }

.invite-card__meta { display: grid; gap: .5rem; text-align: left; max-width: 300px; margin: 0 auto 1.4rem; border-top: 1px solid rgba(200,162,90,.4); padding-top: 1.2rem; }
.invite-card__meta-row { display: flex; justify-content: space-between; gap: 1rem; font-size: .95rem; }
.invite-card__meta-row span { color: var(--gold-deep); font-family: var(--font-heading); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; align-self: center; }
.invite-card__meta-row strong { font-weight: 600; text-align: right; }

.invite-card__line { font-style: italic; font-size: .92rem; color: var(--ink); opacity: .85; }

/* ============================================================================
   5. COUNTDOWN
============================================================================ */
.countdown { text-align: center; background: linear-gradient(180deg, var(--ivory), var(--ivory-dim)); }
.countdown__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; max-width: 380px; margin: 0 auto; }
.countdown__unit {
  background: var(--plum); color: var(--ivory); border-radius: 4px; padding: .9rem .3rem;
  border: 1px solid var(--gold-deep);
}
.countdown__number {
  display: block; font-family: var(--font-heading); font-weight: 600; font-size: clamp(1.4rem, 6vw, 1.9rem); color: var(--gold-light);
  transition: transform .35s var(--ease-royal), opacity .35s var(--ease-royal);
}
.countdown__number.tick { animation: tick .45s var(--ease-royal); }
@keyframes tick { 0% { transform: translateY(-8px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
.countdown__label { display: block; font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; margin-top: .3rem; color: var(--lilac); }

/* ============================================================================
   6. STORY / TIMELINE
============================================================================ */
.story { background: var(--ivory); }
.story__intro { text-align: center; font-style: italic; line-height: 1.85; max-width: 46ch; margin: 0 auto 2.6rem; color: var(--ink); }

.timeline { position: relative; padding-left: 1.6rem; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: linear-gradient(180deg, var(--gold), var(--gold-deep)); }
.timeline-item { position: relative; padding-bottom: 2.4rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: -1.6rem; top: 6px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--gold-light); border: 2px solid var(--plum); box-shadow: 0 0 0 3px var(--ivory);
}
.timeline-item__date { display: block; font-family: var(--font-heading); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-deep); margin-bottom: .2rem; }
.timeline-item__title { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; color: var(--plum); margin-bottom: .4rem; }
.timeline-item__text { line-height: 1.75; margin-bottom: .8rem; }
.timeline-item__photo {
  width: 100%; aspect-ratio: 4 / 3; border-radius: 4px; overflow: hidden; border: 1px solid var(--gold);
  background: linear-gradient(135deg, var(--plum-soft), var(--plum)); display: flex; align-items: center; justify-content: center;
}
.timeline-item__photo img { width: 100%; height: 100%; object-fit: cover; }
.timeline-item__photo .ph-mono { font-family: var(--font-script); color: var(--gold-light); font-size: 1.6rem; }

/* ============================================================================
   7. GALLERY CAROUSEL + LIGHTBOX
============================================================================ */
.gallery { background: var(--ivory-dim); }
.gallery__track {
  display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: .5rem 0 1.2rem;
  margin: 0 calc(var(--section-pad-x) * -1); padding-left: var(--section-pad-x); padding-right: var(--section-pad-x);
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__item {
  flex: 0 0 72%; scroll-snap-align: center; aspect-ratio: 4 / 5; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--gold); position: relative; background: linear-gradient(160deg, var(--plum-soft), var(--plum-deep));
  box-shadow: 0 14px 30px -16px rgba(58,18,48,.5);
}
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-royal); }
.gallery__item:active img { transform: scale(1.04); }
.gallery__item .ph-mono { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-script); color: var(--gold-light); font-size: 1.8rem; }

.lightbox {
  position: fixed; inset: 0; z-index: 500; background: rgba(20,5,16,.94);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.lightbox[hidden] { display: none; }
.lightbox__img { max-height: 88vh; max-width: 100%; border-radius: 4px; border: 1px solid var(--gold); }
.lightbox__close { position: absolute; top: 1.2rem; right: 1.4rem; color: var(--ivory); font-size: 2rem; line-height: 1; }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); color: var(--gold-light); font-size: 1.4rem; padding: .6rem; }
.lightbox__nav--prev { left: .4rem; }
.lightbox__nav--next { right: .4rem; }

/* ============================================================================
   8. TEASER VIDEO (9:16 full width)
============================================================================ */
.teaser { padding-left: 0; padding-right: 0; max-width: 100%; background: var(--plum-deep); }
.teaser__frame { position: relative; width: 100%; aspect-ratio: 9 / 16; max-height: 100svh; margin: 0 auto; background: linear-gradient(160deg, var(--plum-soft), var(--plum-deep)); overflow: hidden; }
.teaser__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.teaser__play {
  position: absolute; inset: 0; margin: auto; width: 68px; height: 68px; border-radius: 50%;
  background: rgba(250,243,230,.9); color: var(--plum); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); transition: opacity .3s ease, transform .3s ease;
}
.teaser__play svg { transform: translateX(2px); }
.teaser__play.is-hidden { opacity: 0; pointer-events: none; transform: scale(.85); }

/* ============================================================================
   9. DETAILS RECAP
============================================================================ */
.details { background: var(--ivory); text-align: center; }
.details__grid { display: grid; gap: .9rem; max-width: 360px; margin: 0 auto 1.8rem; }
.details__item { display: flex; justify-content: space-between; border-bottom: 1px dashed rgba(156,122,52,.4); padding-bottom: .6rem; text-align: left; }
.details__k { font-family: var(--font-heading); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-deep); }
.details__v { font-weight: 600; text-align: right; }
.details__invited { font-family: var(--font-script); font-size: 1.4rem; color: var(--wine); }

/* ============================================================================
   10. VENUE
============================================================================ */
.venue { text-align: center; background: var(--ivory-dim); }
.venue__photo {
  aspect-ratio: 4 / 3; border-radius: 6px; border: 1px solid var(--gold); margin-bottom: 1.6rem;
  background: linear-gradient(160deg, var(--plum-soft), var(--plum-deep)) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
}
.venue__photo::after { content: "\1F3E0"; font-size: 2rem; opacity: .5; }
.venue__photo[style*="url"]::after { display: none; }
.venue__address { color: var(--ink); opacity: .85; margin: .6rem 0 1.6rem; line-height: 1.7; }

/* ============================================================================
   11. FAMILY
============================================================================ */
.family { text-align: center; background: var(--ivory); }
.family__hostline { font-family: var(--font-script); font-size: 1.5rem; color: var(--wine); margin-bottom: 2rem; }
.family__grid { display: grid; gap: 1rem; }
.family__card { border: 1px solid var(--gold); border-radius: 4px; padding: 1.6rem 1.2rem; background: var(--ivory-dim); }
.family__title { display: block; font-family: var(--font-heading); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-deep); margin-bottom: .6rem; }
.family__names { line-height: 1.9; font-size: 1.05rem; }
.family__contact { display: inline-flex; align-items: center; gap: .5rem; margin-top: .9rem; color: var(--wine); font-weight: 600; border-bottom: 1px solid var(--wine); padding-bottom: 2px; }

/* ============================================================================
   12. RSVP
============================================================================ */
.rsvp { background: var(--ivory-dim); }
.rsvp__sub { text-align: center; margin-bottom: 2rem; opacity: .85; }
.rsvp__form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .4rem; text-align: left; }
.field span, .field legend { font-family: var(--font-heading); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-deep); padding: 0; }
.field input[type="text"], .field input[type="number"], .field textarea {
  font: inherit; font-size: 1.05rem; padding: .8rem .9rem; border: 1px solid var(--gold-deep); border-radius: 3px;
  background: #fffdf8; color: var(--ink);
}
.field input:focus, .field textarea:focus { border-color: var(--wine); }
.field--radio { border: none; padding: 0; display: grid; gap: .5rem; }
.field--radio label { display: flex; align-items: center; gap: .5rem; font-size: 1rem; text-transform: none; letter-spacing: 0; font-family: var(--font-body); color: var(--ink); }

.btn--gold .btn__spinner {
  display: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(42,20,32,.3); border-top-color: var(--plum-deep); animation: spin .7s linear infinite;
}
#rsvp-submit.is-loading .btn__label { opacity: .5; }
#rsvp-submit.is-loading .btn__spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.rsvp__status { text-align: center; font-style: italic; min-height: 1.4em; }
.rsvp__status.is-success { color: var(--wine); }
.rsvp__status.is-error { color: #a33; }

/* ============================================================================
   FOOTER + MUSIC TOGGLE
============================================================================ */
.footer { text-align: center; padding: 3rem 1.5rem 4rem; background: var(--plum-deep); color: var(--ivory); }
.footer__monogram { font-family: var(--font-script); font-size: 1.8rem; color: var(--gold-light); margin-bottom: .5rem; }
.footer p { font-style: italic; font-size: .85rem; color: var(--lilac); }

.music-toggle {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 300;
  width: 48px; height: 48px; border-radius: 50%; background: var(--plum);
  border: 1px solid var(--gold); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 22px rgba(0,0,0,.35);
}
.music-toggle__bars { display: flex; align-items: flex-end; gap: 3px; height: 16px; }
.music-toggle__bars span { width: 3px; background: var(--gold-light); border-radius: 2px; height: 40%; animation: bar 1s ease-in-out infinite; animation-play-state: paused; }
.music-toggle.is-playing .music-toggle__bars span { animation-play-state: running; }
.music-toggle__bars span:nth-child(2) { animation-delay: .15s; }
.music-toggle__bars span:nth-child(3) { animation-delay: .3s; }
@keyframes bar { 0%, 100% { height: 30%; } 50% { height: 100%; } }

/* ============================================================================
   Responsive polish for larger phones / small tablets in portrait
============================================================================ */
@media (min-width: 420px) {
  .countdown__grid { max-width: 420px; }
}
