/* Celeste — a wedding under the stars. The palette comes from js/config.js; the skeleton's styles are
   in css/core.css. Every picture of the template is drawn here and in js/main.js: no image files. */
:root {
  /* For the skeleton (css/core.css). */
  --bar-ink: var(--ink);
  --loader-bg: var(--night);
  --loader-fg: var(--paper);
  --footer-bg: var(--night);
  --footer-fg: var(--paper);
  --font-ui: var(--font-sans);

  --font-serif: "Cormorant Garamond", "Cormorant", Georgia, serif;
  --font-sans: "Manrope", system-ui, -apple-system, sans-serif;
  --screen-h: 852px;
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-soft: cubic-bezier(0.45, 0, 0.2, 1);
  --c1: #3a4a8c; /* the dress code's two colours (js/config.js sets them) */
  --c2: #c9a9c9;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--paper); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p, ol, fieldset, legend { margin: 0; padding: 0; font-weight: 400; }
ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
img { display: block; max-width: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { display: block; overflow: visible; }

.app { position: relative; max-width: var(--screen-w); margin: 0 auto; overflow-x: clip; background: var(--night); }
@media (max-width: 600px) { .app { max-width: none; } }

.screen { position: relative; min-height: max(var(--screen-h), var(--screen-full)); overflow: hidden; isolation: isolate; }
.screen--night { background: var(--night); color: var(--paper); }
.screen--deep  { background: var(--deep); color: var(--paper); }
.screen--paper { background: var(--paper); color: var(--ink); }
.stage { position: absolute; inset: 0 auto 0 50%; width: var(--screen-w); translate: -50% 0; }
.screen > .stage { top: calc((100% - var(--screen-h)) / 2); bottom: auto; height: var(--screen-h); }
.at { position: absolute; left: var(--x, 0); top: var(--y, 0); width: var(--w, auto); }
.heading { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }

/* A sky: stars on a canvas behind the screen (js/main.js draws and twinkles them). */
.sky { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }

/* Hairlines of engraving, on paper and on the sky alike. */
.hair { fill: none; stroke: currentColor; stroke-width: 0.8; vector-effect: non-scaling-stroke; }
.hair--soft { opacity: 0.4; }

/* ---------- Type ---------- */
.t-display  { font: italic 400 56px/56px var(--font-serif); letter-spacing: -0.015em; }
.t-title    { font: italic 400 42px/44px var(--font-serif); letter-spacing: -0.01em; }
.t-subtitle { font: italic 500 28px/32px var(--font-serif); }
.t-caps     { font: 500 11px/16px var(--font-sans); letter-spacing: 0.24em; text-transform: uppercase; }
.t-body     { font: 400 15px/22px var(--font-sans); }
.t-small    { font: 400 12px/16px var(--font-sans); letter-spacing: 0.06em; }
.t-date     { font: 500 15px/20px var(--font-sans); letter-spacing: 0.28em; }
.t-time     { font: italic 500 26px/30px var(--font-serif); color: var(--ink); }
.t-count    { font: 400 44px/48px var(--font-serif); font-variant-numeric: lining-nums tabular-nums; }
.screen--night .t-caps, .screen--deep .t-caps { color: var(--gold); }
.screen--paper .t-caps { color: color-mix(in srgb, var(--ink) 62%, var(--gold)); }

/* Words that come up like stars: letter by letter, each out of its own blur, in no fixed order. */
.w { display: inline-block; white-space: nowrap; }
/* Each letter has room round it, taken back by its margin so nothing moves: a blurred letter is
   painted inside its own box, and an italic J's tail was cut off until the blur was over. */
.ch { display: inline-block; white-space: pre; padding: 0.3em 0.25em; margin: -0.3em -0.25em; }
.is-animated [data-split] .ch { opacity: 0; filter: blur(5px); }
.is-animated [data-split].is-in .ch { opacity: 1; filter: blur(0); transition: opacity 0.9s ease var(--d), filter 1.1s var(--ease-out) var(--d); }
@media (prefers-reduced-motion: reduce) { .is-animated [data-split] .ch { opacity: 1; filter: none; } }

/* A thin rule with a star in the middle. */
.rule { position: relative; display: block; width: 120px; height: 9px; }
.rule::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold) 30%, var(--gold) 70%, transparent); }
.rule::after { content: ""; position: absolute; left: 50%; top: 0; width: 9px; height: 9px; translate: -50% 0; background: var(--gold); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); box-shadow: 0 0 0 4px var(--night); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 26px; border-radius: 24px; background: var(--ink); color: var(--paper); font: 500 12px/1 var(--font-sans); letter-spacing: 0.2em; text-transform: uppercase; transition: background 0.3s ease, color 0.3s ease, box-shadow 0.4s ease; }
.btn--gold { background: none; color: var(--gold); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 70%, transparent); }
@media (hover: hover) { .btn--gold:hover { background: color-mix(in srgb, var(--gold) 12%, transparent); } }
.btn--ghost { background: none; color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 40%, transparent); }
.btn.at { left: calc(var(--x) + var(--w) / 2); width: auto; min-width: var(--w); transform: translateX(-50%); }

/* ---------- 0. Gate ---------- */
.gate { position: fixed; inset: 0 0 -40vh; padding-bottom: 40vh; z-index: 50; background: var(--night); color: var(--paper); cursor: pointer; outline: none; overflow: hidden; }
.gate .sky, .gate__heart { position: absolute; left: 0; top: 0; width: 100%; height: calc(100% - 40vh); }
.gate .sky { z-index: 0; transition: scale 1.8s cubic-bezier(0.55, 0, 0.3, 1), opacity 1.4s ease; }
.gate__heart { z-index: 1; pointer-events: none; }
.gate__board { position: absolute; z-index: 2; left: 50%; top: calc(50% - 20vh); width: 393px; height: 852px; translate: -50% -50%; scale: var(--fit, 1); pointer-events: none; }
.gate__kicker { position: absolute; left: 0; right: 0; top: 150px; text-align: center; color: var(--gold); transition: opacity 0.6s ease; }
.gate__hint { position: absolute; left: 0; right: 0; bottom: 118px; text-align: center; opacity: 0.8; transition: opacity 0.5s ease; }
.gate.is-touched { cursor: default; }
.gate.is-touched .gate__hint { opacity: 0; }
/* Into the heart: the words go first, the sky rushes past, a hole of light opens at the heart's
   middle (--hole, set by js/main.js) and shows the first screen through it. */
.gate.is-diving .gate__kicker { opacity: 0; filter: blur(4px); transition: opacity 0.5s ease, filter 0.5s ease; }
.gate.is-diving .sky { scale: 1.7; opacity: 0; }
.gate.is-diving {
  cursor: default; pointer-events: none;
  -webkit-mask-image: radial-gradient(circle at var(--hx, 50%) var(--hy, 45%), transparent var(--hole, 0px), #000 calc(var(--hole, 0px) + 90px));
  mask-image: radial-gradient(circle at var(--hx, 50%) var(--hy, 45%), transparent var(--hole, 0px), #000 calc(var(--hole, 0px) + 90px));
}
.gate.is-open { visibility: hidden; }

/* ---------- 1. Opening ---------- */
/* Laid out in the window the invitation opened in (--hero-h), but as tall as --screen-full: the
   96px below go under Safari's see-through bottom bar, so the next screen never peeks in there. */
.screen.hero { height: var(--screen-full); min-height: 0; }
/* Scaled to the window it opened in (--pk, js/main.js), so a phone shorter than the mock still has
   the whole moon below the bar. */
.hero > .stage { top: calc((var(--hero-h, 100svh) - var(--screen-h)) / 2); height: var(--screen-h); scale: var(--pk, 1); }
.hero__heading { gap: 20px; }
.hero__heading .t-caps { color: var(--gold); }
/* The heart's light, still on the sky as the screen opens out of it: gold at the middle, rose round
   it, spreading and fading into the night. */
.hero__dawn { position: absolute; z-index: -1; left: 50%; top: var(--dawn-y, 45%); width: 900px; height: 900px; translate: -50% -50%; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--gold) 70%, var(--night)) 0%, color-mix(in srgb, #c98fae 45%, var(--night)) 22%, color-mix(in srgb, #5a4a8c 40%, var(--night)) 42%, transparent 68%); opacity: 0; pointer-events: none; }
.hero.is-arriving .hero__dawn { animation: dawn 3.2s cubic-bezier(0.3, 0, 0.2, 1) both; }
@keyframes dawn { 0% { opacity: 1; scale: 0.25; } 35% { opacity: 0.9; } 100% { opacity: 0; scale: 1.5; } }
.hero.is-arriving > .stage { animation: arrive 2.4s cubic-bezier(0.2, 0.6, 0.2, 1) both; }
.hero.is-arriving .sky { animation: sky-in 2.6s ease both; }
@keyframes arrive { 0% { scale: calc(var(--pk, 1) * 0.82); filter: blur(10px); opacity: 0; } 40% { opacity: 1; } 100% { scale: var(--pk, 1); filter: none; opacity: 1; } }
@keyframes sky-in { 0% { opacity: 0; scale: 1.25; } 100% { opacity: 1; scale: 1; } }
.moon__glow { transform-box: fill-box; transform-origin: center; animation: moon-breathe 7s ease-in-out infinite; }
@keyframes moon-breathe { 50% { opacity: 0.55; scale: 0.92; } }
.hero__moon { opacity: 0; translate: -10px 14px; }
.hero.is-in .hero__moon { opacity: 1; translate: none; transition: opacity 2s ease 0.8s, translate 2.6s var(--ease-out) 0.8s; }
.hero .rule { scale: 0 1; }
.hero.is-in .rule { scale: 1; transition: scale 1.4s var(--ease-out) 1.2s; }
.scroll-hint { position: absolute; left: 50%; top: calc(var(--hero-h, 100svh) - 104px - env(safe-area-inset-bottom)); translate: -50% 0; display: flex; flex-direction: column; align-items: center; gap: 12px; color: color-mix(in srgb, var(--paper) 70%, transparent); }
/* A star falls down a thread, over and over. */
.scroll-hint i { position: relative; width: 1px; height: 46px; background: linear-gradient(color-mix(in srgb, var(--gold) 50%, transparent), transparent); overflow: visible; }
.scroll-hint i::after { content: ""; position: absolute; left: 50%; top: 0; width: 5px; height: 5px; border-radius: 50%; translate: -50% 0; background: var(--star); box-shadow: 0 0 8px 2px color-mix(in srgb, var(--star) 60%, transparent); animation: fall 2.6s cubic-bezier(0.5, 0, 0.3, 1) infinite; }
@keyframes fall { 0% { top: 0; opacity: 0; } 15% { opacity: 1; } 80% { opacity: 1; } 100% { top: 46px; opacity: 0; } }

/* ---------- 2. Welcome: the engraved ring, the words inside it ---------- */
.letter-track { background: var(--paper); }
/* Two lights go round the paper with the ring: a warm one, and a cool one opposite. */
.letter__light { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at var(--l1x, 30%) var(--l1y, 30%), color-mix(in srgb, var(--gold) 34%, transparent) 0, transparent 46%),
    radial-gradient(circle at var(--l2x, 70%) var(--l2y, 70%), color-mix(in srgb, #9aa6d8 30%, transparent) 0, transparent 44%); }
.letter__ring { height: 393px; color: var(--ink); }
.letter__scale { rotate: var(--ring, 0deg); }
.letter__scale line { stroke: currentColor; stroke-width: 0.7; vector-effect: non-scaling-stroke; }
.letter__scale .major { stroke: var(--gold); stroke-width: 1.3; }
.letter__scale text { fill: currentColor; font: 500 7px/1 var(--font-sans); letter-spacing: 0.1em; opacity: 0.6; }
.letter__phases { rotate: calc(var(--ring, 0deg) * -0.35); }
.letter__phases .phase-lit { fill: var(--gold); }
.letter__phases .phase-dark { fill: color-mix(in srgb, var(--ink) 16%, var(--paper)); }
@keyframes turn { to { rotate: 360deg; } }
.letter__ring .hair { stroke-dasharray: 1200; stroke-dashoffset: 1200; }
.letter.is-in .letter__ring .hair { stroke-dashoffset: 0; transition: stroke-dashoffset 2.4s var(--ease-soft); }
.letter__phases > g { opacity: 0; scale: 0.4; transform-box: fill-box; transform-origin: center; }
.letter.is-in .letter__phases > g { opacity: 1; scale: 1; transition: opacity 0.8s ease var(--d), scale 0.9s var(--ease-out) var(--d); }
/* The words: each line placed by js/main.js on a chord of the ring; a part at a time. */
.letter__copy { height: 393px; pointer-events: none; }
.page { position: absolute; inset: 0; }
.page__line { position: absolute; left: 0; right: 0; text-align: center; white-space: nowrap; font: 500 21px/30px var(--font-serif); color: color-mix(in srgb, var(--ink) 88%, transparent); }
.page__line em { font-style: italic; color: color-mix(in srgb, var(--ink) 78%, var(--gold)); }
.page .word { display: inline-block; opacity: 0; filter: blur(6px); translate: 0 6px; transition: opacity 0.6s ease var(--d), filter 0.7s ease var(--d), translate 0.8s var(--ease-out) var(--d); }
.page.is-on .word { opacity: 1; filter: none; translate: none; }
.letter__dots { display: flex; justify-content: center; gap: 10px; }
.letter__dots i { width: 6px; height: 6px; background: color-mix(in srgb, var(--ink) 25%, transparent); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); transition: background 0.4s ease, scale 0.4s ease; }
.letter__dots i.is-on { background: var(--gold); scale: 1.6; }

/* ---------- 3. Save the date: the planisphere ---------- */
/* Until the wheel is set the page ends here: the screens below are out of the document, so a phone
   stops by itself, the screen filling the window (nothing pulls the scroll back). */
:root { --date-held: max(var(--pin-h), var(--lvh, 100lvh)); }
/* Held, nothing lies below: Safari's see-through bottom bar shows the page past its end — the html. */
html.is-held { background: var(--night); }
.screen.date { min-height: 0; height: calc(var(--date-held) + 96px); }
.is-held .screen.date { height: var(--date-held); }
.is-held #date ~ *, .is-held .app > #date ~ * { display: none; }
.date > .stage { top: calc(var(--date-held) / 2); translate: -50% -50%; scale: var(--pk, 1); }
.date__hint { display: grid; text-align: center; }
.date__hint span { grid-area: 1 / 1; transition: opacity 0.6s ease, translate 0.8s var(--ease-out); color: color-mix(in srgb, var(--paper) 78%, transparent); font-size: 13px; line-height: 18px; }
.date__hint span + span { opacity: 0; translate: 0 6px; color: var(--gold); }
.date.is-set .date__hint span:first-child { opacity: 0; translate: 0 -6px; }
.date.is-set .date__hint span + span { opacity: 1; translate: none; }
.date.is-loud .date__hint span:first-child { color: var(--paper); }
.wheel { height: 331px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; outline: none; border-radius: 50%; }
.wheel:focus-visible { box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 60%, transparent); }
.wheel.is-dragging { cursor: grabbing; }
.date.is-set .wheel { cursor: default; touch-action: pan-y; } /* set, a finger on it scrolls on */
.wheel svg { width: 100%; height: 100%; }
.wheel__disc { rotate: var(--turn, 0deg); }
.wheel__rim { fill: #1f2757; stroke: var(--gold); stroke-width: 0.8; }
.wheel__days line { stroke: var(--paper); stroke-width: 0.5; opacity: 0.55; }
.wheel__days .long { opacity: 0.9; }
.wheel__days .ours { stroke: var(--gold); stroke-width: 2; opacity: 1; }
.wheel__target { fill: var(--gold); transform-box: fill-box; transform-origin: center; animation: target 2.4s ease-in-out infinite; }
@keyframes target { 50% { scale: 1.5; } }
.date.is-set .wheel__target { animation: none; }
.wheel__months text { fill: var(--paper); font: 500 8.5px/1 var(--font-sans); letter-spacing: 0.2em; }
.wheel__stars circle { fill: var(--star); }
.wheel__paper { fill: var(--paper); filter: drop-shadow(0 6px 16px rgb(0 0 0 / 0.35)); }
.wheel__cover { color: var(--ink); }
.wheel__hours line { stroke: var(--ink); stroke-width: 0.7; }
.wheel__hours text { fill: var(--ink); font: 500 7px/1 var(--font-sans); letter-spacing: 0.06em; opacity: 0.7; }
.wheel__pointer { fill: var(--gold); stroke: var(--ink); stroke-width: 0.6; }
.wheel__time { fill: var(--ink); font: italic 500 14px/1 var(--font-serif); }
.wheel__initials { fill: var(--ink); font: italic 500 16px/1 var(--font-serif); opacity: 0.75; }
.wheel__rose path { fill: var(--gold); }
.wheel__flash { fill: var(--star); opacity: 0; transform-box: fill-box; transform-origin: center; filter: url(#star-glow); }
.date.is-set .wheel__flash { animation: flash 1.4s var(--ease-out); }
@keyframes flash { 0% { opacity: 0; scale: 0.2; } 20% { opacity: 0.9; } 100% { opacity: 0; scale: 2.4; } }
/* The lovers: the Milky Way, Vega and Altair with their constellations, the bridge of stars. */
.milky__band { fill: color-mix(in srgb, #c9cff5 55%, transparent); opacity: 0.32; filter: url(#milky); }
.milky__dust circle { fill: var(--star); }
.lovers__lines path { fill: none; stroke: color-mix(in srgb, var(--gold) 75%, transparent); stroke-width: 0.7; stroke-dasharray: 1; stroke-dashoffset: 1; }
.lovers__minor { fill: var(--star); opacity: 0.6; }
.lovers__star { fill: var(--star); }
.lovers__halo { fill: var(--star); opacity: 0.3; filter: url(#star-glow); transform-box: fill-box; transform-origin: center; }
.lovers__name { fill: var(--gold); font: 600 7.5px/1 var(--font-sans); letter-spacing: 0.16em; opacity: 0; transition: opacity 1s ease 1.2s; }
.bridge__line { fill: none; stroke: var(--gold); stroke-width: 0.6; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0.7; }
.bridge__star { fill: var(--star); opacity: 0; transform-box: fill-box; transform-origin: center; scale: 0; }
.bridge__meet { fill: var(--gold); opacity: 0; filter: url(#star-glow); transform-box: fill-box; transform-origin: center; }
.date.is-set .lovers__name { opacity: 1; }
.date.is-set .lovers__halo { animation: lover 3.6s ease-in-out 2.6s infinite; }
@keyframes lover { 50% { opacity: 0.55; scale: 1.35; } }
.bridge__star.is-on { opacity: 1; scale: 1; transition: opacity 0.3s ease, scale 0.6s cubic-bezier(0.3, 1.6, 0.5, 1); }
.date.is-met .bridge__meet { animation: meet 2.4s var(--ease-out) forwards; }
@keyframes meet { 0% { opacity: 0; scale: 0.3; } 25% { opacity: 0.9; } 100% { opacity: 0.35; scale: 1.6; } }
/* The hint: a fingertip that turns the ring along its rim, its trail fading behind it. */
.wheel__demo { opacity: 0; pointer-events: none; transition: opacity 0.4s ease; }
.wheel__demo.is-on { opacity: 1; }
.wheel__finger { fill: color-mix(in srgb, var(--star) 22%, transparent); stroke: color-mix(in srgb, var(--star) 75%, transparent); stroke-width: 1; }
.wheel__finger-core { fill: var(--star); opacity: 0.85; }
.wheel__trail { fill: none; stroke: var(--star); stroke-width: 2; stroke-linecap: round; opacity: 0.45; }
.date.is-loud .wheel__finger { stroke: var(--gold); fill: color-mix(in srgb, var(--gold) 30%, transparent); }
.date.is-loud .wheel__trail { stroke: var(--gold); opacity: 0.8; }
/* A way through for anyone the wheel defeats, after a couple of tries. */
.date__skip { color: var(--gold); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; height: 32px; opacity: 0; pointer-events: none; transition: opacity 0.6s ease; }
.date.can-skip .date__skip { opacity: 1; pointer-events: auto; }
.date.is-set .date__skip { opacity: 0; pointer-events: none; }
/* The answer is not there at all until it is won. */
.date__when { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; visibility: hidden; }
.date.is-set .date__when { visibility: visible; }
.date__when .t-date { color: var(--gold); font-size: 17px; letter-spacing: 0.26em; }
.date__when .t-body { opacity: 0; translate: 0 8px; }
.date.is-set .date__when .t-body { opacity: 1; translate: none; transition: opacity 0.8s ease 1.6s, translate 1s var(--ease-out) 1.6s; }
.date__calendar { visibility: hidden; opacity: 0; translate: 0 10px; }
.date.is-set .date__calendar { visibility: visible; opacity: 1; translate: none; transition: opacity 0.8s ease 2.2s, translate 1s var(--ease-out) 2.2s; }

/* ---------- Pinned screens: held while their scene plays, let go when it is over ---------- */
.pin-track { position: relative; height: calc(var(--pin-h) + var(--hold)); }
.pin { position: sticky; top: 0; height: var(--pin-h); min-height: 0; }
.pin > .stage { top: 50%; bottom: auto; height: var(--screen-h); translate: -50% -50%; scale: var(--pk, 1); }
.program-track { background: var(--paper); }
.venue-track { background: var(--deep); }
.dress-track { background: var(--night); }

/* ---------- 4. Programme ---------- */
.program__line, .program__thread { position: absolute; left: 196px; top: 196px; width: 1px; height: 590px; background: color-mix(in srgb, var(--ink) 18%, transparent); }
.program__thread { background: var(--gold); transform-origin: top; scale: 1 var(--p, 0); }
.program__thread::after { content: ""; position: absolute; left: 50%; bottom: -3px; width: 7px; height: 7px; border-radius: 50%; translate: -50% 0; scale: 1 calc(1 / max(var(--p, 0), 0.01)); background: var(--gold); box-shadow: 0 0 10px 3px color-mix(in srgb, var(--gold) 55%, transparent); opacity: calc(var(--p, 0) * 40); }
.moment { position: absolute; left: 0; width: 393px; top: var(--y); height: 100px; }
.scene { position: absolute; left: 62px; top: 0; width: 100px; height: 100px; fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0; translate: 0 10px; transition: opacity 0.7s ease 0.15s, translate 0.9s var(--ease-out) 0.15s; }
.moment__text { position: absolute; left: 222px; width: 150px; top: 50%; translate: 0 -50%; display: flex; flex-direction: column; gap: 2px; }
.moment__text > * { opacity: 0; translate: -10px 0; transition: opacity 0.6s ease, translate 0.8s var(--ease-out); }
.moment__text .t-body { transition-delay: 0.08s; color: color-mix(in srgb, var(--ink) 80%, transparent); }
.moment--flip .scene { left: 231px; }
.moment--flip .moment__text { left: 21px; text-align: right; }
.moment--flip .moment__text > * { translate: 10px 0; }
.moment .dot { position: absolute; left: 191.5px; top: 50%; width: 10px; height: 10px; translate: 0 -50%; background: color-mix(in srgb, var(--ink) 25%, var(--paper)); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); transition: background 0.4s ease, scale 0.6s var(--ease-out); }
.moment.is-on .dot { background: var(--gold); scale: 1.5; }
.moment.is-on .scene, .moment.is-on .moment__text > * { opacity: 1; translate: none; }
.scene .soft { opacity: 0.45; }
.scene .glow { fill: var(--gold); stroke: none; opacity: 0; }
.scene .flame, .scene .gem, .scene .spark, .scene .label { fill: var(--gold); stroke: none; }
.scene .wine { fill: color-mix(in srgb, var(--gold) 55%, transparent); stroke: none; }
.scene .bubble { fill: var(--gold); stroke: none; opacity: 0; }
.scene * { transform-box: fill-box; }
/* The scenes run only while their moment is open. */
.scene * { animation-play-state: paused !important; }
.moment.is-on .scene * { animation-play-state: running !important; }
/* Lantern: it sways on its hook, its flame flickers and glows. */
.scene--lantern .swing { transform-box: view-box; transform-origin: 50px 5px; animation: sway 4.6s var(--ease-soft) infinite; }
@keyframes sway { 0%, 100% { rotate: -5deg; } 50% { rotate: 5deg; } }
.scene--lantern .flame { transform-origin: 50% 100%; animation: flicker 1.7s ease-in-out infinite; }
.scene--lantern .glow { transform-origin: center; animation: glow 1.7s ease-in-out infinite; }
@keyframes flicker { 0%, 100% { scale: 1 1; skew: 0deg; } 30% { scale: 0.92 1.08; skew: 2deg; } 60% { scale: 1.04 0.95; skew: -1.5deg; } }
@keyframes glow { 0%, 100% { opacity: 0.16; scale: 1; } 40% { opacity: 0.26; scale: 1.08; } }
/* Rings: they slide together and link; the stone catches the light. */
.scene--rings .ring--a { translate: -12px 0; }
.scene--rings .ring--b { translate: 12px 0; }
.moment.is-on .scene--rings .ring--a, .moment.is-on .scene--rings .ring--b { translate: none; transition: translate 1.3s var(--ease-soft) 0.35s; }
.scene--rings .spark { transform-origin: center; scale: 0; animation: spark 3.4s var(--ease-out) 1.4s infinite; }
@keyframes spark { 0% { scale: 0; rotate: 0deg; } 12% { scale: 1; } 30% { scale: 0; rotate: 90deg; } 100% { scale: 0; } }
/* Glasses: they lean in and clink, a spark where they touch; bubbles rise. */
.scene--glasses .flute--l { transform-box: view-box; transform-origin: 37px 83px; animation: clink-l 3.6s var(--ease-soft) infinite; }
.scene--glasses .flute--r { transform-box: view-box; transform-origin: 63px 83px; animation: clink-r 3.6s var(--ease-soft) infinite; }
@keyframes clink-l { 0%, 100% { rotate: 0deg; } 35%, 48% { rotate: 9deg; } }
@keyframes clink-r { 0%, 100% { rotate: 0deg; } 35%, 48% { rotate: -9deg; } }
.scene--glasses .spark { transform-origin: center; scale: 0; animation: spark-clink 3.6s ease-out infinite; }
@keyframes spark-clink { 0%, 34% { scale: 0; } 40% { scale: 1; rotate: 45deg; } 56%, 100% { scale: 0; rotate: 90deg; } }
.scene--glasses .bubble { animation: bubble 2.4s ease-in infinite; }
.scene--glasses .b2 { animation-delay: 0.7s; } .scene--glasses .b3 { animation-delay: 1.2s; } .scene--glasses .b4 { animation-delay: 1.8s; }
@keyframes bubble { 0% { opacity: 0; translate: 0 0; } 20% { opacity: 0.9; } 100% { opacity: 0; translate: 0 -12px; } }
/* Candles: two flames, each flickering its own way, their light breathing. */
.scene--candles .flame { transform-origin: 50% 100%; }
.scene--candles .f1 { animation: flicker 1.9s ease-in-out infinite; }
.scene--candles .f2 { animation: flicker 2.3s ease-in-out -0.8s infinite; }
.scene--candles .glow { transform-origin: center; }
.scene--candles .g1 { animation: glow 1.9s ease-in-out infinite; }
.scene--candles .g2 { animation: glow 2.3s ease-in-out -0.8s infinite; }
/* Record: the arm swings onto the record, it turns, notes float up. */
.scene--record .arm { transform-box: view-box; transform-origin: 80px 27px; rotate: 28deg; }
.moment.is-on .scene--record .arm { rotate: 0deg; transition: rotate 1.4s var(--ease-soft) 0.3s; }
.scene--record .disc { transform-box: view-box; transform-origin: 44px 51px; animation: turn 3.2s linear infinite; }
.scene--record .label { fill: var(--gold); }
.scene--record .shine { stroke: var(--gold); stroke-width: 1.2; }
.scene--record .note { stroke: var(--gold); opacity: 0; animation: note 3.4s ease-out infinite; }
.scene--record .n2 { animation-delay: 1.7s; }
@keyframes note { 0% { opacity: 0; translate: 0 6px; } 25% { opacity: 1; } 100% { opacity: 0; translate: 6px -10px; } }

/* ---------- 5. Location: the telescope ---------- */
.scope { height: 311px; }
.scope__ring { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--gold); rotate: var(--focus, 0deg); }
.scope__ticks line { stroke: var(--gold); stroke-width: 0.8; }
.scope__lens { position: absolute; inset: 22px; border-radius: 50%; overflow: hidden; background: var(--deep); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 50%, transparent), 0 0 60px rgb(0 0 0 / 0.5); -webkit-mask-image: -webkit-radial-gradient(white, black); }
.scope__lens::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, transparent 58%, rgb(5 6 18 / 0.85) 100%); pointer-events: none; }
.scope__view, .scope__photo { position: absolute; left: 0; top: 0; width: 100%; height: auto; translate: 0 var(--pan, 0%); filter: blur(var(--blur, 0px)); will-change: translate, filter; }
.scope__photo { height: 100%; object-fit: cover; translate: none; object-position: 50% var(--pan-photo, 0%); scale: 1.15; }
.view__stars circle { fill: var(--star); }
.hill { fill: #0e1230; }
.hill--far { fill: #1a2150; }
.cypress path { fill: #0a0d24; }
.villa path { fill: #0a0d24; }
.villa .villa__roof { fill: #070918; }
.villa .win { fill: var(--gold); opacity: 0.08; transition: opacity 0.6s ease; }
.villa .win.is-lit { opacity: 1; filter: drop-shadow(0 0 3px var(--gold)); }
.path-lights circle { fill: var(--gold); opacity: 0; transition: opacity 0.6s ease; }
.path-lights circle.is-lit { opacity: 0.95; }
.venue__text { gap: 12px; opacity: 0; translate: 0 14px; transition: opacity 0.8s ease, translate 1s var(--ease-out); }
.venue__text .t-body { color: color-mix(in srgb, var(--paper) 80%, transparent); }
.venue.is-focused .venue__text { opacity: 1; translate: none; }
.venue .btn { opacity: 0; transition: opacity 0.8s ease 0.2s; }
.venue.is-focused .btn { opacity: 1; }

/* ---------- 6. Dress code: constellations ---------- */
.dress__swatches { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.swatches { display: flex; justify-content: center; gap: 56px; --swatch-size: 44px; }
.swatches .swatch { box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 60%, transparent), 0 0 0 5px var(--night), 0 0 0 6px color-mix(in srgb, var(--gold) 30%, transparent), 0 0 24px color-mix(in srgb, var(--swatch) 70%, transparent); }
.swatch-names { display: flex; justify-content: center; gap: 24px; }
.swatch-names span { width: 100px; text-align: center; }
.dress__text { gap: 10px; }
.dress__text .t-body { color: color-mix(in srgb, var(--paper) 78%, transparent); }
.dress__art { height: 440px; }
.figure .nebula { fill: var(--c); opacity: calc(var(--fill, 0) * 0.42); filter: url(#nebula); }
.figure .body { fill: var(--c); opacity: calc(var(--fill, 0) * 0.2); }
.figure .light { fill: url(#dress-light); opacity: calc(var(--fill, 0) * 0.35); mix-blend-mode: screen; }
.figure .veil { fill: color-mix(in srgb, var(--star) 60%, var(--c)); opacity: calc(var(--fill, 0) * 0.22); filter: url(#nebula); }
.figure .dust circle { fill: var(--star); opacity: calc(var(--fill, 0) * var(--a, 0.7)); }
.figure .line { fill: none; stroke: color-mix(in srgb, var(--gold) 55%, var(--star)); stroke-width: var(--sw, 0.9); stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--draw, 0)); }
.figure .glowline { stroke: var(--gold); stroke-width: 2.2; opacity: 0.16 !important; filter: url(#line-glow); }
.figure .detail { stroke: color-mix(in srgb, var(--star) 85%, var(--gold)); }
.figure .star { fill: var(--star); opacity: 0; scale: 0.2; transform-box: fill-box; transform-origin: center; transition: opacity 0.4s ease, scale 0.7s cubic-bezier(0.3, 1.5, 0.5, 1); }
.figure .star.is-on { opacity: var(--a, 1); scale: 1; }
.figure .flare { fill: var(--star); opacity: 0; transform-box: fill-box; transform-origin: center; }
.figure .flare.is-on { opacity: 0.85; animation: flare 3.4s ease-in-out var(--d, 0s) infinite; }
@keyframes flare { 0%, 100% { scale: 0.85; opacity: 0.6; } 50% { scale: 1.2; opacity: 1; } }

/* ---------- 7. RSVP: the star chart's card ---------- */
.rsvp__chart { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; color: var(--ink); opacity: 0.12; }
.rsvp__chart path, .rsvp__chart circle { fill: none; stroke: currentColor; stroke-width: 0.6; }
.rsvp__chart .dot { fill: currentColor; stroke: none; }
.rsvp__card { height: 740px; color: var(--ink); background: color-mix(in srgb, var(--paper) 70%, #fffaf0); box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--ink) 35%, transparent); }
.rsvp__frame { position: absolute; inset: 0; width: 100%; height: 100%; color: color-mix(in srgb, var(--ink) 55%, var(--gold)); }
.corner { position: absolute; width: 26px; height: 26px; background: var(--gold); clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%); }
.corner--tl { left: -13px; top: -13px; } .corner--tr { right: -13px; top: -13px; }
.corner--bl { left: -13px; bottom: -13px; } .corner--br { right: -13px; bottom: -13px; }
.rsvp__ask, .rsvp__done { position: absolute; inset: 0; padding: 44px 30px 34px; display: flex; flex-direction: column; gap: 26px; }
.rsvp .heading { gap: 12px; }
.rsvp__by { color: color-mix(in srgb, var(--ink) 70%, transparent); }
.reply { display: flex; flex-direction: column; gap: 24px; }
/* A name on a line: the label rests on it, and rises small when there is something written. */
.field--line { position: relative; display: block; padding-top: 16px; }
.field--line .field__input { width: 100%; height: 40px; padding: 0 2px; border: 0; background: none; color: var(--ink); font: italic 500 22px/40px var(--font-serif); outline: none; border-radius: 0; }
.field--line .field__label { position: absolute; left: 2px; top: 26px; font: 400 15px/20px var(--font-sans); color: color-mix(in srgb, var(--ink) 55%, transparent); pointer-events: none; transform-origin: left top; transition: translate 0.35s var(--ease-out), scale 0.35s var(--ease-out), color 0.3s ease, letter-spacing 0.35s ease; }
.field--line .field__input:focus + .field__label, .field--line .field__input:not(:placeholder-shown) + .field__label { translate: 0 -24px; scale: 0.75; letter-spacing: 0.18em; text-transform: uppercase; color: color-mix(in srgb, var(--ink) 62%, var(--gold)); }
.field__rule { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: color-mix(in srgb, var(--ink) 30%, transparent); }
.field__rule::after { content: ""; position: absolute; inset: 0; background: var(--gold); scale: 0 1; transition: scale 0.6s var(--ease-out); }
.field--line .field__input:focus ~ .field__rule::after { scale: 1 1; }
.field.is-invalid .field__rule { background: #b4574e; }
.field__legend { display: block; margin-bottom: 12px; color: color-mix(in srgb, var(--ink) 62%, var(--gold)) !important; }
/* The two answers, side by side: a star and a moon, each lit when chosen. */
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.answers legend { grid-column: 1 / -1; }
.answer { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px 12px; border-radius: 14px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 22%, transparent); text-align: center; font: 400 14px/18px var(--font-sans); cursor: pointer; transition: background 0.4s ease, color 0.4s ease, box-shadow 0.4s ease; }
.answer input { position: absolute; opacity: 0; pointer-events: none; }
.answer__icon { width: 36px; height: 36px; }
.answer__halo { fill: var(--gold); opacity: 0; transform-box: fill-box; transform-origin: center; scale: 0.4; transition: opacity 0.4s ease, scale 0.6s var(--ease-out); }
.answer__rays { stroke: var(--gold); stroke-width: 1.2; stroke-linecap: round; opacity: 0; transition: opacity 0.4s ease; }
.answer__mark { fill: none; stroke: currentColor; stroke-width: 1.1; stroke-linejoin: round; transform-box: fill-box; transform-origin: center; transition: fill 0.4s ease, stroke 0.4s ease, rotate 0.7s var(--ease-out); }
.answer:has(input:checked) { background: var(--ink); color: var(--paper); box-shadow: none; }
.answer:has(input:checked) .answer__mark { fill: var(--gold); stroke: var(--gold); rotate: 90deg; }
.answer:has(input:checked) .answer__halo { opacity: 0.22; scale: 1; }
.answer:has(input:checked) .answer__rays { opacity: 1; }
.answer:has(input:focus-visible) { box-shadow: inset 0 0 0 1px var(--gold), 0 0 0 3px color-mix(in srgb, var(--gold) 30%, transparent); }
.answers.is-invalid .answer { box-shadow: inset 0 0 0 1px #b4574e; }
/* A note on ruled lines, like the margin of a chart. */
.field--note { display: block; }
.field__input--area { width: 100%; height: 96px; padding: 3px 2px 0; border: 0; resize: none; outline: none; color: var(--ink); font: italic 500 19px/32px var(--font-serif); background: repeating-linear-gradient(transparent 0 31px, color-mix(in srgb, var(--ink) 22%, transparent) 31px 32px); background-attachment: local; }
.field__input--area:focus { background-image: repeating-linear-gradient(transparent 0 31px, color-mix(in srgb, var(--gold) 70%, transparent) 31px 32px); }
.reply__send { position: relative; align-self: center; min-width: 200px; margin-top: 4px; overflow: hidden; }
.reply__send svg { width: 12px; height: 12px; fill: var(--gold); transition: rotate 0.8s var(--ease-out); }
.reply__send::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--gold) 40%, transparent) 50%, transparent 70%); translate: -120% 0; animation: shimmer 4.5s ease-in-out infinite 1s; }
@keyframes shimmer { 0%, 60% { translate: -120% 0; } 100% { translate: 120% 0; } }
@media (hover: hover) { .reply__send:hover svg { rotate: 90deg; } }
/* Sent: the guest's star is born, then rays, and it joins a little constellation of guests. */
.rsvp__done { justify-content: center; gap: 18px; }
.rsvp__sky { width: 100%; height: 300px; }
.rsvp__stars circle { fill: var(--ink); opacity: 0; transform-box: fill-box; transform-origin: center; animation: dot-in 0.6s ease forwards; animation-delay: var(--d); }
@keyframes dot-in { from { opacity: 0; scale: 0; } to { opacity: var(--a, 0.6); scale: 1; } }
.rsvp__lines path { fill: none; stroke: color-mix(in srgb, var(--ink) 40%, var(--gold)); stroke-width: 0.7; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw-on 1.6s var(--ease-soft) forwards; animation-delay: var(--d); }
@keyframes draw-on { to { stroke-dashoffset: 0; } }
.rsvp__guest { animation: guest-rise 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes guest-rise { 0% { translate: 0 150px; opacity: 0; } 15% { opacity: 1; } 100% { translate: 0 0; } }
.rsvp__halo { fill: var(--gold); opacity: 0.2; transform-box: fill-box; transform-origin: center; animation: halo 4s ease-in-out 1.6s infinite; }
@keyframes halo { 50% { opacity: 0.32; scale: 1.15; } }
.rsvp__rays { stroke: var(--gold); stroke-width: 1; stroke-linecap: round; stroke-dasharray: 20; stroke-dashoffset: 20; animation: rays 1s var(--ease-out) 1.3s forwards; }
@keyframes rays { to { stroke-dashoffset: 0; } }
.rsvp__core { fill: var(--gold); transform-box: fill-box; transform-origin: center; animation: born 1.6s var(--ease-out) both; }
@keyframes born { 0% { rotate: -180deg; } 100% { rotate: 0deg; } }
.rsvp__name { fill: var(--ink); font: 600 10px/1 var(--font-sans); letter-spacing: 0.24em; text-transform: uppercase; opacity: 0; animation: fade-in 1s ease 1.8s forwards; }
@keyframes fade-in { to { opacity: 1; } }
.rsvp__done .heading { animation: fade-in 1s ease 1.2s both; }
.rsvp__done .heading .btn { margin-top: 10px; }

/* ---------- 8. Closing ---------- */
.closing .heading { gap: 18px; }
.countdown { display: flex; gap: 30px; justify-content: center; margin-top: 10px; }
.countdown > div { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; }
.countdown .t-small { color: var(--gold); letter-spacing: 0.22em; font-size: 10px; }
.closing__moon { opacity: 0; translate: 0 30px; }
.closing.is-in .closing__moon { opacity: 1; translate: none; transition: opacity 2s ease, translate 2.8s var(--ease-out); }
.closing__top { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--paper); }
.closing__top i { position: relative; width: 1px; height: 40px; background: linear-gradient(transparent, color-mix(in srgb, var(--gold) 70%, transparent)); }
.closing__top i::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 5px; height: 5px; border-radius: 50%; translate: -50% 0; background: var(--star); box-shadow: 0 0 8px 2px color-mix(in srgb, var(--star) 60%, transparent); animation: rise-star 2.6s cubic-bezier(0.5, 0, 0.3, 1) infinite; }
@keyframes rise-star { 0% { bottom: 0; opacity: 0; } 15% { opacity: 1; } 80% { opacity: 1; } 100% { bottom: 40px; opacity: 0; } }

/* ---------- Footer: the site's serif, the night's colours ---------- */
.credit { font: italic 500 17px/1 var(--font-serif); }
.footer { border-top: 1px solid color-mix(in srgb, var(--gold) 25%, transparent); }

/* ---------- Sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet__backdrop { position: absolute; inset: 0; background: rgb(5 7 22 / 0.6); opacity: 0; transition: opacity 0.35s ease; }
.sheet__panel { position: absolute; left: 50%; bottom: 0; width: min(100%, var(--screen-w)); display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 48px 24px calc(32px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; background: var(--paper); color: var(--ink); text-align: center; translate: -50% 100%; transition: translate 0.45s var(--ease-out); }
.sheet.is-open .sheet__backdrop { opacity: 1; }
.sheet.is-open .sheet__panel { translate: -50% 0; }
.sheet__close { position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; display: grid; place-items: center; }
.calendar { display: grid; grid-template-columns: repeat(7, 40px); gap: 8px 4px; font: 400 15px/30px var(--font-sans); }
.calendar__dow { font-size: 11px; opacity: 0.6; }
.calendar__day { position: relative; z-index: 0; color: var(--ink); font-weight: 600; }
.calendar__day::before { content: ""; position: absolute; inset: -6px -2px; z-index: -1; background: var(--gold); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.map { position: relative; display: block; width: 329px; height: 220px; border-radius: 16px; overflow: hidden; background: var(--night); color: var(--gold); }
.map svg { width: 100%; height: 100%; }
.map__grid line { stroke: var(--gold); stroke-width: 0.5; opacity: 0.18; }
.map__rose { fill: color-mix(in srgb, var(--gold) 22%, transparent); stroke: var(--gold); stroke-width: 0.8; }
.map__n { fill: var(--gold); font: 500 10px/1 var(--font-sans); letter-spacing: 0.2em; }
.map__pin { fill: var(--paper); }
.map__dot { fill: var(--night); }
.map__open { position: absolute; left: 50%; bottom: 14px; translate: -50% 0; padding: 7px 14px; border-radius: 14px; background: var(--paper); color: var(--ink); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01s !important; }
}
