/* ───────── THEME — change these and the whole 3D world re-colours ───────── */
:root {
  --sky-top: #2c1832;      /* top of the night sky */
  --sky-bottom: #80586d;   /* horizon colour */
  --glow: #f4cdd4;         /* warm horizon glow */
  --gold: #ecd3bd;         /* primary accent (lanterns, rings, particles) */
  --rose: #d68db8;         /* secondary accent (petals, heart) */
  --ivory: #fcf4ec;        /* text */
  --ink: #3b1d3a;         /* text on gold buttons */

  --serif: 'Cormorant Garamond', Georgia, serif;
  --script: 'Great Vibes', cursive;
  --sans: 'Jost', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
body {
  background: linear-gradient(var(--sky-top), var(--sky-bottom));
  color: var(--ivory);
  font-family: var(--serif);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; height: 100svh; }

#stage { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
main { position: relative; z-index: 2; }

.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 30; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--rose), var(--gold)); box-shadow: 0 0 12px var(--gold); }

/* ───────── typography ───────── */
.script { font-family: var(--script); font-weight: 400; letter-spacing: 0; }
em { font-style: italic; }
.eyebrow { font-family: var(--sans); font-weight: 300; font-size: .72rem; letter-spacing: .42em; text-transform: uppercase; color: var(--gold); }
.title { font-weight: 400; font-size: clamp(2.4rem, 6.4vw, 4.6rem); line-height: 1.05; margin: .5rem 0 1.2rem; text-shadow: 0 2px 30px rgba(0,0,0,.5); }
.title em { color: var(--gold); }
.title.small { font-size: clamp(1.5rem, 3.4vw, 2.2rem); }
.lede { font-size: clamp(1.15rem, 2.2vw, 1.5rem); line-height: 1.55; font-weight: 400; opacity: .92; text-shadow: 0 2px 20px rgba(0,0,0,.6); }
.name-big { font-size: clamp(4.6rem, 14vw, 9rem); line-height: 1; margin: .1rem 0 .4rem; color: var(--ivory); text-shadow: 0 0 40px color-mix(in srgb, var(--gold) 55%, transparent), 0 2px 20px rgba(0,0,0,.5); }

/* ───────── layout ───────── */
.sec { min-height: 100svh; display: flex; align-items: center; padding: 14vh 7vw; }
.copy { max-width: 34rem; position: relative; }
.copy.center { margin: 0 auto; text-align: center; }
.copy.wide { max-width: 64rem; width: 100%; }
.feature.left .copy { margin-right: auto; }
.feature.right .copy { margin-left: auto; }
.feature .copy { padding: 1rem 0; }

.hero { align-items: flex-end; padding-bottom: 4vh; }
.hero .copy { width: 100%; max-width: 44rem; }
.names { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: .1em .35em; margin: .6rem 0 1rem; line-height: 1; }
.names .script { font-size: clamp(3.6rem, 11vw, 7.2rem); text-shadow: 0 0 50px color-mix(in srgb, var(--gold) 60%, transparent), 0 2px 24px rgba(0,0,0,.55); }
.names em { font-size: clamp(1.3rem, 3vw, 2rem); color: var(--gold); font-weight: 300; }
.dates { font-size: clamp(1.3rem, 3vw, 1.9rem); letter-spacing: .12em; }
.dates b { color: var(--gold); font-weight: 400; margin: 0 .25em; }
.places { font-family: var(--sans); font-weight: 300; font-size: .78rem; letter-spacing: .4em; text-transform: uppercase; opacity: .75; margin-top: .6rem; }
.scroll { margin-top: 1.3rem; display: flex; flex-direction: column; align-items: center; gap: .7rem; font-family: var(--sans); font-size: .62rem; letter-spacing: .4em; text-transform: uppercase; opacity: .7; }
.scroll i { width: 1px; height: 46px; background: linear-gradient(var(--gold), transparent); animation: drip 2s ease-in-out infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); opacity: 0; } 40% { opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

.poem p { font-size: clamp(1.15rem, 2vw, 1.45rem); line-height: 1.6; margin-bottom: .7rem; opacity: .95; text-shadow: 0 2px 20px rgba(0,0,0,.6); }

/* countdown */
.count { align-items: flex-end; padding-bottom: 9vh; }
.cd { display: flex; justify-content: center; gap: clamp(.6rem, 2.5vw, 1.6rem); margin-top: 1.6rem; }
.cd > div { min-width: clamp(64px, 17vw, 108px); padding: 1rem .4rem .8rem; border-radius: 18px; background: rgba(255,255,255,.06); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 10px 40px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.12); }
.cd b { display: block; font-weight: 500; font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1; font-variant-numeric: tabular-nums; color: var(--ivory); }
.cd span { display: block; margin-top: .5rem; font-family: var(--sans); font-weight: 300; font-size: .6rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.cd-done { margin-top: 1.4rem; font-size: 1.4rem; font-style: italic; }

/* event cards */
.events { padding-top: 12vh; padding-bottom: 12vh; }
.events .lede { max-width: 38rem; margin: 0 auto 2.4rem; }
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1rem, 3vw, 2rem); text-align: left; perspective: 1200px; }
.cards.one { grid-template-columns: minmax(0, 34rem); justify-content: center; }
.card { --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 0%;
  position: relative; padding: clamp(1.4rem, 3vw, 2.2rem); border-radius: 26px; overflow: hidden;
  background: linear-gradient(160deg, rgba(40,19,48,.78), rgba(62,30,68,.66));
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  backdrop-filter: blur(18px) saturate(1.1); -webkit-backdrop-filter: blur(18px) saturate(1.1);
  box-shadow: 0 30px 70px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.18);
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .25s ease-out; transform-style: preserve-3d; }
.card::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in srgb, var(--gold) 26%, transparent), transparent 60%); opacity: .9; }
.card > * { position: relative; }
.card .tag { font-family: var(--sans); font-size: .64rem; letter-spacing: .38em; text-transform: uppercase; color: var(--gold); }
.card h3 { font-weight: 500; font-size: clamp(1.7rem, 3.4vw, 2.3rem); margin: .35rem 0 1rem; line-height: 1.1; }
.card .when { display: flex; align-items: center; gap: 1rem; padding: .9rem 0; border-block: 1px solid rgba(255,255,255,.14); margin-bottom: 1rem; }
.card .day { text-align: center; line-height: 1; padding-right: 1rem; border-right: 1px solid rgba(255,255,255,.18); }
.card .day b { display: block; font-size: 3.2rem; font-weight: 500; color: var(--gold); }
.card .day span { font-family: var(--sans); font-size: .68rem; letter-spacing: .3em; text-transform: uppercase; }
.card .time { font-size: 1.25rem; line-height: 1.35; }
.card .time small { display: block; font-family: var(--sans); font-size: .64rem; letter-spacing: .3em; text-transform: uppercase; opacity: .65; margin-bottom: .2rem; }
.card .venue { font-weight: 600; font-size: 1.2rem; margin-bottom: .3rem; }
.card address { font-style: normal; font-size: 1.1rem; line-height: 1.5; opacity: .95; }
.card .row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.3rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; border: 0; font-family: var(--sans); font-weight: 500; font-size: .74rem; letter-spacing: .24em; text-transform: uppercase; padding: 1rem 1.6rem; border-radius: 999px; transition: transform .25s, box-shadow .25s, background .25s; position: relative; overflow: hidden; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.97); }
.btn-gold { color: var(--ink); background: linear-gradient(120deg, color-mix(in srgb, var(--gold) 80%, #fff), var(--gold) 45%, color-mix(in srgb, var(--rose) 70%, var(--gold))); box-shadow: 0 8px 30px color-mix(in srgb, var(--gold) 45%, transparent); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 14px 44px color-mix(in srgb, var(--gold) 60%, transparent); }
.btn-gold::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.55) 50%, transparent 65%); transform: translateX(-120%); animation: shine 3.6s ease-in-out infinite; }
@keyframes shine { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.btn-ghost { color: var(--ivory); background: rgba(255,255,255,.07); border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); }
.btn-ghost:hover { background: rgba(255,255,255,.14); transform: translateY(-2px); }
.btn.sm { padding: .8rem 1.15rem; font-size: .66rem; }

.finale { padding-bottom: 14vh; }
.sign { font-size: clamp(2.4rem, 7vw, 4rem); margin: 1.6rem 0 2rem; }
.sign em { color: var(--gold); font-size: .5em; margin: 0 .2em; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }
.foot { margin-top: 3rem; font-family: var(--sans); font-weight: 300; font-size: .66rem; letter-spacing: .34em; text-transform: uppercase; opacity: .6; }

/* soft linen grain over everything (static, cheap) */
body::after { content: ''; position: fixed; inset: 0; z-index: 40; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>"); }

/* ───────── gate ───────── */
#gate { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; text-align: center; padding: 2rem;
  background: radial-gradient(ellipse at center, rgba(11,10,36,.15) 0%, rgba(11,10,36,.72) 75%);
  transition: opacity 1.4s ease, visibility 1.4s; }
#gate.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.gate-inner { max-width: 32rem; }
.gate-names { font-weight: 400; display: flex; flex-direction: column; align-items: center; line-height: .95; margin: 1rem 0 .8rem; }
.gate-names .script { font-size: clamp(4.2rem, 17vw, 7rem); text-shadow: 0 0 50px color-mix(in srgb, var(--gold) 60%, transparent); }
.gate-names em { font-size: 1.5rem; color: var(--gold); margin: .1em 0; }
.gate-sub { font-size: 1.3rem; font-style: italic; opacity: .9; margin-bottom: 2.2rem; }
.dear { font-size: 1.5rem; font-style: italic; color: var(--rose); margin-top: .8rem; }
.hint { margin-top: 1.4rem; font-family: var(--sans); font-size: .68rem; letter-spacing: .25em; text-transform: uppercase; opacity: .55; }
#open { animation: pulse 2.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 8px 30px color-mix(in srgb, var(--gold) 40%, transparent); } 50% { box-shadow: 0 8px 60px color-mix(in srgb, var(--gold) 80%, transparent), 0 0 0 10px color-mix(in srgb, var(--gold) 12%, transparent); } }

/* ───────── music button ───────── */
.music { position: fixed; top: 16px; right: 16px; z-index: 31; width: 46px; height: 46px; border-radius: 50%; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding-bottom: 15px; background: rgba(255,255,255,.08); border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; pointer-events: none; transition: opacity 1s; }
.music.show { opacity: 1; pointer-events: auto; }
.music i { width: 3px; height: 5px; background: var(--gold); border-radius: 2px; transition: height .3s; }
.music.on i { animation: eq 1s ease-in-out infinite; }
.music.on i:nth-child(2) { animation-delay: -.3s; } .music.on i:nth-child(3) { animation-delay: -.6s; } .music.on i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%, 100% { height: 5px; } 50% { height: 16px; } }

/* ───────── reveal on scroll ───────── */
.rv { opacity: 0; transform: translateY(26px); filter: blur(8px); transition: opacity 1.1s cubic-bezier(.2,.7,.2,1) var(--d, 0s), transform 1.1s cubic-bezier(.2,.7,.2,1) var(--d, 0s), filter 1.1s ease var(--d, 0s); }
.rv.in { opacity: 1; transform: none; filter: none; }
.btn.rv.in, .card.rv.in { transition: opacity 1.1s var(--d, 0s), transform .25s, box-shadow .25s, filter 1s; }

/* ───────── small screens ───────── */
@media (max-width: 820px) {
  .sec { padding: 12vh 6vw; }
  .feature { align-items: flex-end; padding-bottom: 8vh; }
  .feature .copy { padding-top: 1.6rem; }
  .feature .copy, .feature.left .copy, .feature.right .copy { margin: 0 auto; text-align: center; max-width: 26rem; }
  .cards { grid-template-columns: 1fr; }
  .hero { padding-bottom: 3vh; }
  .poem p { font-size: 1.1rem; margin-bottom: .45rem; }
  .title { font-size: clamp(2.2rem, 9vw, 3rem); margin-bottom: .8rem; }
  .actions .btn { width: 100%; }
}

/* ───────── no-WebGL fallback ───────── */
.no-webgl #stage { display: none; }

@media (prefers-reduced-motion: reduce) {
  .rv { transition-duration: .01s; }
  .btn-gold::after, #open, .scroll i { animation: none; }
}

#gate { touch-action: none; }
#draw { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.gate-inner { position: relative; z-index: 1; }

/* ───────── kinetic words ───────── */
.kin { opacity: 1 !important; transform: none !important; filter: none !important; }
.kin .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding: 0 .04em .14em; margin-bottom: -.14em; }
.name-big .w, .lede .w { overflow: visible; }
.kin .w > span { display: inline-block; transform: translateY(115%) rotate(5deg); opacity: 0; filter: blur(6px);
  transition: transform 1.1s cubic-bezier(.2,.8,.2,1) calc(var(--d, 0s) + var(--i) * 70ms), opacity .9s ease calc(var(--d, 0s) + var(--i) * 70ms), filter .9s ease calc(var(--d, 0s) + var(--i) * 70ms); }
.kin.in .w > span { transform: none; opacity: 1; filter: none; }

/* ───────── chapters ───────── */
.chapters { height: 340vh; position: relative; }
.stick { position: sticky; top: 0; height: 100svh; display: grid; place-items: center; text-align: center; padding: 0 7vw; }
.stick .eyebrow { position: absolute; top: 14vh; left: 0; right: 0; }
.chap { grid-area: 1 / 1; font-weight: 400; max-width: 16ch; font-size: clamp(2.6rem, 8vw, 5.6rem); line-height: 1.04; text-shadow: 0 4px 40px rgba(0,0,0,.45); pointer-events: none; }
.chap em { color: var(--gold); }
.chap .w { overflow: hidden; }
.chap .w > span { transform: translateY(115%) rotate(5deg); opacity: 0; filter: blur(8px); }
.chap.on .w > span { transform: none; opacity: 1; filter: none; }
.chap:not(.on) .w > span { transform: translateY(-115%) rotate(-5deg); }
.dots { position: absolute; bottom: 12vh; left: 0; right: 0; display: flex; gap: .7rem; justify-content: center; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.3); transition: all .5s; }
.dots i.on { background: var(--gold); width: 26px; border-radius: 6px; box-shadow: 0 0 14px var(--gold); }

.card .time small, .card .tag { opacity: 1; }
.card .time small { color: var(--gold); }
.card .venue { font-size: 1.3rem; }
.lede, .poem p { text-shadow: 0 1px 3px rgba(30,12,40,.8), 0 2px 24px rgba(30,12,40,.7); }

/* ───────── custom cursor: a glowing pearl with a soft ring ───────── */
.cur { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 9999; opacity: 0; transition: opacity .3s; will-change: transform; }
.cur.on { opacity: 1; }
.cur-dot { width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #f4cdd4 60%, #d68db8); box-shadow: 0 0 12px 3px rgba(244,205,212,.7); transition: transform .25s; }
.cur-ring { width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 1px solid rgba(236,211,189,.75); border-radius: 50%; transition: width .3s, height .3s, margin .3s, background .3s, border-color .3s; }
.cur-ring.hover { width: 66px; height: 66px; margin: -33px 0 0 -33px; background: rgba(244,205,212,.14); border-color: #f4cdd4; }
.cur-ring.down { width: 24px; height: 24px; margin: -12px 0 0 -12px; }
body.has-cursor, body.has-cursor * { cursor: none !important; }

/* readability without a blotchy backing: a uniform night veil eases in over text scenes, plus a tight shadow on the type */
#veil { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: #1c0b26; opacity: 0; transition: opacity .7s ease; }
.title, .name-big, .chap { text-shadow: 0 1px 2px rgba(28,11,38,.7), 0 4px 30px rgba(28,11,38,.55); }
.lede, .poem p { text-shadow: 0 1px 2px rgba(28,11,38,.85), 0 2px 16px rgba(28,11,38,.6); }
.photoScene { align-items: flex-end; padding-bottom: 8vh; }
.storyText .copy { max-width: 40rem; }

.gap { height: 160vh; height: 160svh; }

.names { margin: .3rem 0 .6rem; }
.places { margin-top: .4rem; }
