/* ==========================================================
   Royal Curtain — film wedding invitation
   ========================================================== */

:root {
  --ink: #1B1208;
  --umber: #2B1D0E;
  --bronze: #6B4E22;
  --gold: #C9A055;
  --gold-hi: #F6E2AE;
  --gold-lo: #8A6528;
  --honey: #9C7430;
  --cream: #FBF3E1;
  --cream-dim: rgba(251, 243, 225, .72);

  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", system-ui, sans-serif;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --gold-grad: linear-gradient(115deg, var(--gold-hi), var(--gold) 48%, var(--gold-lo));
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; height: 100vh; }
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p { margin: 0; }

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 300;
  background: var(--gold); color: var(--ink); padding: 8px 14px; border-radius: 4px;
  transition: top .2s;
}
.skip-link:focus { top: 16px; }
:focus-visible { outline: 1px solid var(--gold-hi); outline-offset: 4px; }

/* ---------- Shared type ---------- */
.kicker {
  font-family: var(--sans); font-weight: 400;
  font-size: 11px; letter-spacing: .34em; text-transform: uppercase;
  color: var(--gold-hi);
}
.headline {
  font-weight: 300;
  font-size: clamp(48px, 9.5vw, 104px);
  line-height: 1;
  letter-spacing: -.015em;
  color: var(--cream);
}

/* ==========================================================
   Intro
   ========================================================== */
.intro {
  position: fixed; inset: 0; z-index: 100;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 45%, #5A3F17, var(--umber) 55%, #120C05);
  transition: opacity 1.2s var(--ease), visibility 0s 1.2s;
}
.intro.is-gone { opacity: 0; visibility: hidden; }

/* The film's first frame is the curtain still, so the poster and the film line up exactly */
.intro__film {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  pointer-events: none;
}
@media (min-aspect-ratio: 3/4) {
  .intro__film {
    left: 50%; translate: -50% 0; width: calc(100svh * 9 / 16);
    box-shadow: 0 0 120px rgba(246, 226, 174, .25);
  }
  /* A blurred copy of the curtains fills the sides on wide screens */
  .intro::before {
    content: ""; position: absolute; inset: -60px;
    background: url("media/intro-poster.webp") center / cover;
    filter: blur(40px) brightness(.6) saturate(1.2);
  }
}

/* Fine threads of gold light drifting down, over everything */
.intro__rain {
  position: absolute; inset: -10% 0 0; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, transparent 0 71px, rgba(246, 226, 174, .2) 71px 72px, transparent 72px 157px),
    repeating-linear-gradient(90deg, transparent 0 113px, rgba(201, 160, 85, .16) 113px 114px, transparent 114px 233px);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 70%);
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
  animation: rain 10s linear infinite;
  transition: opacity 1s ease;
}
@keyframes rain { from { transform: translateY(-5%); } to { transform: translateY(5%); } }
.intro__vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 44%, transparent 35%, rgba(18, 12, 5, .55) 100%);
  transition: opacity 1s ease;
}
.intro.is-playing .intro__rain, .intro.is-playing .intro__vignette { opacity: 0; }

/* The pill sits on the medallion (45.5% down the frame) */
.tap {
  position: absolute; z-index: 3; left: 50%; top: 45.5%;
  translate: -50% -50%;
  display: inline-flex; align-items: center; gap: 14px;
  padding: 12px 26px 12px 12px;
  white-space: nowrap;
  border: 1px solid rgba(246, 226, 174, .6); border-radius: 999px;
  background: rgba(27, 18, 8, .66);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-family: var(--sans); font-size: 13px; letter-spacing: .32em; text-transform: uppercase;
  color: var(--gold-hi);
  box-shadow: 0 0 40px rgba(246, 226, 174, .3), inset 0 0 0 1px rgba(27, 18, 8, .4);
  animation: tap-in 1.4s .6s var(--ease) both;
  transition: opacity .6s ease, transform .6s ease;
}
@keyframes tap-in { from { opacity: 0; transform: scale(.94); } }
.tap__icon {
  position: relative;
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, var(--gold-hi), var(--gold) 70%);
}
.tap__icon svg { width: 10px; height: 10px; fill: var(--ink); translate: 1px 0; }
.tap__icon::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 1px solid var(--gold-hi); opacity: 0;
  animation: ping 2.2s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
.intro.is-playing .tap { opacity: 0; transform: scale(1.1); pointer-events: none; }

.intro__flash {
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: radial-gradient(circle at 50% 42%, #FFF9E8, rgba(246, 226, 174, .75) 45%, rgba(201, 160, 85, .2) 80%);
  opacity: 0; transition: opacity 1s ease;
}
.intro.is-flash .intro__flash { opacity: 1; }

/* ==========================================================
   Controls + rail
   ========================================================== */
.controls {
  position: fixed; z-index: 150; top: 16px; right: 16px;
  display: flex; gap: 8px; align-items: center;
}
.controls[hidden], .ctl[hidden] { display: none; }
.ctl {
  display: grid; place-items: center;
  width: 38px; height: 38px; padding: 0; border-radius: 50%;
  border: 1px solid rgba(246, 226, 174, .55);
  background: rgba(27, 18, 8, .55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: var(--gold-hi);
}
.ctl--text {
  width: auto; padding: 0 16px; border-radius: 999px;
  font-family: var(--sans); font-size: 11px; letter-spacing: .24em; text-transform: uppercase;
}
.ctl svg { width: 18px; height: 18px; fill: var(--gold-hi); }
.ctl .ico-off { display: none; }
.ctl[aria-pressed="false"] .ico-on { display: none; }
.ctl[aria-pressed="false"] .ico-off { display: inline; }

/* Vertical rail with a gliding marker, like a chapter index */
.rail {
  position: fixed; z-index: 90; right: 22px; top: 50%; translate: 0 -50%;
  display: grid; gap: 20px; justify-items: end;
  padding-right: 18px;
  border-right: 1px solid rgba(246, 226, 174, .25);
}
.rail[hidden] { display: none; }
.rail a {
  position: relative;
  font-family: var(--sans); font-size: 10px; letter-spacing: .28em; text-transform: uppercase;
  color: transparent; text-decoration: none;
  transition: color .4s ease;
}
.rail a::after {
  content: ""; position: absolute; right: -23px; top: 50%; translate: 0 -50%;
  width: 9px; height: 9px; border-radius: 50%;
  background: #3A2A14; border: 1px solid rgba(246, 226, 174, .35);
  transition: background .4s, box-shadow .4s, transform .4s;
}
.rail a.is-active { color: var(--cream); }
.rail a.is-active::after { background: var(--gold-hi); transform: scale(1.25); box-shadow: 0 0 12px rgba(246, 226, 174, .8); }
.rail a:hover { color: var(--cream-dim); }
.rail.on-light a.is-active { color: var(--ink); }
@media (max-width: 640px) {
  .rail { right: 10px; padding-right: 12px; }
  .rail a { font-size: 0; }
  .rail a::after { right: -17px; }
}

/* ==========================================================
   Hero
   ========================================================== */
.hero {
  position: relative;
  height: 100vh; height: 100svh; min-height: 620px;
  overflow: hidden;
  text-align: center;
  background: var(--ink);
}
.hero::before {
  content: ""; position: absolute; inset: -60px;
  background: url("media/couple-poster.webp") center / cover;
  filter: blur(36px) brightness(.5) saturate(1.2);
}
/* Sits a little low so the couple stays below the names as the camera pushes in */
.hero__film {
  position: absolute; top: 8%; left: 50%; translate: -50% 0;
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%);
  mask-image: linear-gradient(to bottom, transparent, #000 14%);
}
@media (min-aspect-ratio: 3/4) {
  .hero__film { width: calc(100svh * 9 / 16); box-shadow: 0 0 100px rgba(0, 0, 0, .5); }
}
.hero__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(18, 12, 5, .9) 0%, rgba(18, 12, 5, .62) 24%, rgba(18, 12, 5, .2) 38%, rgba(18, 12, 5, 0) 48%),
    linear-gradient(to top, rgba(27, 18, 8, .92) 0%, rgba(27, 18, 8, .55) 20%, rgba(27, 18, 8, 0) 38%);
}
.confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.hero__text, .hero__foot {
  position: relative; z-index: 2;
  display: grid; justify-items: center;
  padding: 0 24px;
  text-shadow: 0 2px 20px rgba(18, 12, 5, .65);
}
.hero__text { padding-top: max(5vh, 36px); gap: 2px; }
.hero__foot { position: absolute; left: 0; right: 0; bottom: 56px; gap: 8px; }
.hero__names { display: grid; justify-items: center; font-weight: 300; line-height: .9; margin-top: 6px; }
.hero__names span {
  display: inline-block;
  font-size: clamp(52px, 13vw, 76px); font-weight: 400; letter-spacing: .01em;
  /* Brighter than the shared gold so the names stand off the grand hall */
  background: linear-gradient(115deg, #FFF8E4, var(--gold-hi) 45%, #E2BC6E);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding: 0 .1em;
  filter: drop-shadow(0 2px 12px rgba(18, 12, 5, .7));
}
.hero__names em { font-size: 28px; font-weight: 300; color: var(--cream); margin: 0; }
.flourish { width: 120px; height: 20px; overflow: visible; }
.flourish path:first-child { fill: none; stroke: var(--gold); stroke-width: .8; }
.flourish path:nth-child(2), .flourish circle { fill: var(--gold-hi); }
.hero__date { font-family: var(--sans); font-size: 14px; letter-spacing: .5em; color: var(--cream); padding-left: .5em; }
.hero__line { max-width: 300px; font-style: italic; font-size: 17px; line-height: 1.45; color: var(--cream-dim); }

.fade { opacity: 0; transform: translateY(16px); }
.is-open .fade { animation: rise 1.4s var(--ease) var(--d, 0s) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ==========================================================
   Story + countdown
   ========================================================== */
.story {
  position: relative; overflow: hidden;
  padding: 130px max(28px, 9vw) 120px;
  background:
    radial-gradient(ellipse at 15% 10%, rgba(246, 226, 174, .14), transparent 50%),
    linear-gradient(180deg, var(--ink), var(--umber) 55%, #3A2810);
}
.story > * { max-width: 780px; margin-left: auto; margin-right: auto; }
.story .headline { margin: 20px auto 44px; }
.story__cols { display: grid; gap: 18px 44px; color: var(--cream-dim); font-family: var(--sans); font-weight: 300; font-size: 16px; line-height: 1.75; }
@media (min-width: 720px) { .story__cols { grid-template-columns: 1fr 1fr; } }

.count { margin-top: 72px; padding-top: 34px; border-top: 1px solid rgba(201, 160, 85, .35); }
.count__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  margin: 18px 0 14px;
  background: rgba(201, 160, 85, .32);
  border: 1px solid rgba(201, 160, 85, .32);
}
.count__grid div { background: rgba(18, 12, 5, .78); padding: 20px 14px 16px; }
.count__grid span {
  display: block; font-size: clamp(36px, 8vw, 58px); line-height: 1; font-weight: 300;
  font-variant-numeric: tabular-nums; color: var(--cream);
}
.count__grid small {
  display: block; margin-top: 10px;
  font-family: var(--sans); font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--gold);
}
.count__when { font-style: italic; color: var(--cream-dim); }

/* ==========================================================
   Chapters
   ========================================================== */
.chapters {
  padding: 120px max(20px, 7vw) 110px;
  background: linear-gradient(180deg, #8A6427, var(--honey) 40%, #B48A40);
}
.chapters > * { max-width: 1080px; margin-left: auto; margin-right: auto; }
.chapters .kicker { color: #F3DDA3; }
.chapters__head { display: grid; gap: 18px; align-items: end; margin: 16px auto 40px; }
.chapters__head p { color: rgba(251, 243, 225, .78); max-width: 360px; font-family: var(--sans); font-weight: 300; font-size: 16px; }
@media (min-width: 760px) { .chapters__head { grid-template-columns: 1.2fr 1fr; } }

.chapter {
  position: relative; overflow: hidden;
  display: grid; min-height: 480px;
  background:
    repeating-linear-gradient(120deg, rgba(246, 226, 174, .025) 0 2px, transparent 2px 26px),
    #120C05;
  box-shadow: 0 40px 80px rgba(27, 18, 8, .35);
}
.chapter__art { position: relative; height: 300px; overflow: hidden; }
.chapter__art img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
  transition: opacity .5s ease, transform 7s ease;
}
.chapter:hover .chapter__art img { transform: scale(1.05); }
.chapter__body { position: relative; padding: 0 30px 44px; display: grid; gap: 8px; align-content: start; }
@media (min-width: 760px) {
  .chapter { grid-template-columns: 1fr 1fr; height: 560px; }
  .chapter__art { height: 560px; }
  .chapter__art img { -webkit-mask-image: linear-gradient(to right, #000 60%, transparent); mask-image: linear-gradient(to right, #000 60%, transparent); }
  .chapter__body { padding: 60px 56px; align-content: center; }
}
.chapter__num { font-size: 44px; font-weight: 300; line-height: 1; color: rgba(201, 160, 85, .75); letter-spacing: .06em; }
.chapter__when { font-family: var(--sans); font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--gold-hi); margin-top: 14px; }
.chapter__title { font-size: clamp(54px, 9vw, 84px); font-weight: 300; line-height: 1; color: var(--cream); }
.chapter__tag { font-style: italic; font-size: 22px; color: rgba(251, 243, 225, .85); }
.chapter__place {
  margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(201, 160, 85, .3);
  font-family: var(--sans); font-weight: 300; font-size: 14px; letter-spacing: .06em; color: var(--cream-dim);
}
.chapter__body > *, .chapter__art img { transition: opacity .35s ease; }
.chapter.is-swapping .chapter__body > *, .chapter.is-swapping .chapter__art img { opacity: 0; }

.chapter__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(246, 226, 174, .1); }
.chapter__progress span { display: block; height: 100%; width: 0; background: var(--gold-grad); }
.chapter__progress span.is-running { animation: progress var(--dwell, 7s) linear forwards; }
@keyframes progress { to { width: 100%; } }

.chapter-nav {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 0; border-top: 1px solid rgba(27, 18, 8, .2);
}
.chapter-nav button {
  display: grid; gap: 2px; justify-items: start;
  padding: 18px 10px 14px; border: 0; background: none; text-align: left;
  color: rgba(27, 18, 8, .55);
  border-top: 2px solid transparent; margin-top: -1px;
  transition: color .3s, border-color .3s;
}
.chapter-nav b { font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1; }
.chapter-nav span { font-family: var(--sans); font-size: 10px; letter-spacing: .24em; text-transform: uppercase; }
.chapter-nav button[aria-selected="true"] { color: var(--ink); border-top-color: var(--ink); }
.chapter-nav button:hover { color: var(--ink); }
@media (max-width: 520px) {
  .chapter-nav button { padding: 14px 4px 10px; justify-items: center; text-align: center; }
  .chapter-nav span { font-size: 8px; letter-spacing: .14em; }
}

/* ==========================================================
   Venue
   ========================================================== */
.venue {
  position: relative; overflow: hidden;
  padding: 120px 24px 120px; text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 244, 214, .3), transparent 60%),
    linear-gradient(180deg, #B48A40, #C9A055 50%, #D4B06A);
  color: var(--ink);
}
.venue > *:not(.petals) { position: relative; z-index: 2; }
.venue .kicker { color: rgba(27, 18, 8, .7); }
.venue__name { font-size: clamp(32px, 6.5vw, 52px); font-weight: 400; line-height: 1.15; margin: 14px auto 10px; max-width: 700px; }
.venue__addr { font-family: var(--sans); font-weight: 300; font-size: 16px; color: rgba(27, 18, 8, .8); }
.venue__note { margin-top: 8px; }
.venue__map {
  width: min(100%, 640px); aspect-ratio: 16 / 10; margin: 34px auto 28px;
  border: 1px solid rgba(27, 18, 8, .2); box-shadow: 0 26px 56px rgba(27, 18, 8, .28);
  background: rgba(251, 243, 225, .4);
}
.venue__map iframe { width: 100%; height: 100%; border: 0; display: block; filter: sepia(.35) saturate(.85); }
.venue__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 220px; padding: 14px 26px;
  background: var(--ink); color: var(--gold-hi);
  font-family: var(--sans); font-size: 11px; letter-spacing: .26em; text-transform: uppercase;
  text-decoration: none;
  transition: transform .3s, background .3s, color .3s;
}
.btn:hover { transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(27, 18, 8, .6); }
.btn--ghost:hover { background: var(--ink); color: var(--gold-hi); }

.petals { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.petal {
  position: absolute; top: 0; left: var(--x); width: var(--size);
  will-change: transform;
  animation: fall var(--dur) linear var(--delay) infinite;
  opacity: 0;
}
/* Warm the ivory petals toward gold so they belong to this palette */
.petal img { width: 100%; filter: sepia(.55) saturate(1.4) brightness(1.08); animation: flutter var(--sway) ease-in-out infinite alternate; }
@keyframes fall {
  0%   { transform: translate3d(0, -10%, 0) rotate(0deg); opacity: 0; }
  8%   { opacity: var(--alpha); }
  90%  { opacity: var(--alpha); }
  100% { transform: translate3d(var(--drift), var(--fall), 0) rotate(var(--rot)); opacity: 0; }
}
@keyframes flutter {
  from { transform: translateX(-16px) rotateY(0deg) rotateZ(-12deg); }
  to   { transform: translateX(16px) rotateY(60deg) rotateZ(12deg); }
}

/* ==========================================================
   Closing
   ========================================================== */
.closing {
  padding: 100px 24px 110px; text-align: center;
  display: grid; gap: 10px; justify-items: center;
  background: radial-gradient(ellipse at 50% 0%, #3A2810, var(--ink) 70%);
}
.closing__bloom { width: 58px; filter: sepia(.6) saturate(1.5) drop-shadow(0 0 16px rgba(246, 226, 174, .5)); }
.closing__names {
  font-size: clamp(44px, 9vw, 64px); font-weight: 300; line-height: 1.1; margin-top: 8px;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.closing__date { font-family: var(--sans); font-size: 13px; letter-spacing: .5em; color: var(--cream); }
.closing__line { font-style: italic; color: var(--cream-dim); margin-top: 6px; }
.replay {
  margin-top: 26px; background: none; border: 0; border-bottom: 1px solid rgba(246, 226, 174, .4);
  padding: 4px 2px; font-size: 16px; color: var(--gold-hi);
}

/* ==========================================================
   Scroll reveals + reduced motion
   ========================================================== */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .petals, .confetti, .intro__rain { display: none; }
  html { scroll-behavior: auto; }
}
