/* Colours, fonts, radius and scale are set from JS (WK.applyTheme); these are the fallbacks. */
:root {
  --bg: #F8F1EC;
  --surface: #FFFCFA;
  --ink: #3A1A22;
  --accent: #7B1E34;
  --accent2: #C8A27C;
  --on-accent: #FFFFFF;
  --r: 20px;
  --scale: 1;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-name: var(--font-display);
  --font-body: "Jost", system-ui, sans-serif;
  --name-style: italic;
  --muted: color-mix(in srgb, var(--ink) 66%, var(--bg));
  --line: color-mix(in srgb, var(--ink) 14%, transparent);
  --soft: color-mix(in srgb, var(--accent) 12%, var(--bg));
  --panel: color-mix(in srgb, var(--surface) 56%, transparent);
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 12px 40px -12px rgb(0 0 0 / .14);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: calc(100% * var(--scale)); -webkit-text-size-adjust: 100%; }
html, body { height: 100%; overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  /* Landscape tones, shared by the storybook cover and the journey. */
  --scene: var(--accent);
  --hill0: color-mix(in srgb, var(--scene) 11%, var(--bg));
  --hill1: color-mix(in srgb, var(--scene) 20%, var(--bg));
  --hill2: color-mix(in srgb, var(--scene) 40%, var(--bg));
  --hill3: color-mix(in srgb, var(--scene) 62%, var(--bg));
  --forest: color-mix(in srgb, var(--scene) 30%, var(--bg));
  --sil1: color-mix(in srgb, var(--scene) 40%, var(--bg));
  --sil2: color-mix(in srgb, var(--scene) 68%, var(--bg));
  --sil3: color-mix(in srgb, var(--scene) 62%, #000);
  --turf: 17svh;
}
[data-dark="1"] body {
  --scene: var(--accent2);
  --forest: color-mix(in srgb, var(--ink) 16%, var(--bg));
  --sil1: color-mix(in srgb, var(--ink) 30%, var(--bg));
  --sil2: color-mix(in srgb, var(--ink) 55%, var(--bg));
  --sil3: color-mix(in srgb, var(--bg) 75%, #000);
}
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- atmosphere ---------- */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .07; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-dark="1"] .grain { mix-blend-mode: screen; opacity: .05; }

/* Sky and far hills. JS sets --sx (pixels scrolled) and --p (0 at the start of the journey, 1 at the end). */
.land { --sx: 0; --p: 0; --ox: 0px; position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: linear-gradient(180deg, color-mix(in srgb, var(--scene) 16%, var(--bg)), var(--bg) 58%); }
.land > * { position: absolute; }
.land-dusk { inset: 0; opacity: clamp(0, calc((var(--p) - .5) * 2.2), 1); background: linear-gradient(180deg, color-mix(in srgb, var(--scene) 40%, var(--bg)), color-mix(in srgb, var(--accent2) 58%, var(--bg)) 64%, transparent 88%); }
.land-stars { inset: 0 0 45% 0; opacity: clamp(0, calc((var(--p) - .78) * 5), .9); background-image: radial-gradient(1.5px 1.5px at 12% 30%, #fff, transparent), radial-gradient(1.5px 1.5px at 27% 62%, #fff, transparent), radial-gradient(2px 2px at 41% 18%, #fff, transparent), radial-gradient(1.5px 1.5px at 58% 48%, #fff, transparent), radial-gradient(2px 2px at 69% 22%, #fff, transparent), radial-gradient(1.5px 1.5px at 83% 58%, #fff, transparent), radial-gradient(1.5px 1.5px at 93% 26%, #fff, transparent), radial-gradient(1.5px 1.5px at 6% 74%, #fff, transparent); }
/* The sun crosses the sky as the story goes on, highest at the midpoint. */
.land-sun { left: calc(10% + var(--p) * 74%); top: calc(11% + (var(--p) - .5) * (var(--p) - .5) * 64%); width: min(17vw, 6rem); aspect-ratio: 1; border-radius: 50%; background: color-mix(in srgb, var(--accent2) 40%, #fff); box-shadow: 0 0 50px 16px color-mix(in srgb, var(--accent2) 45%, transparent); opacity: .75; }
.land-birds { --m: url(../img/birds.webp); top: 12svh; left: 0; width: min(46vw, 16rem); aspect-ratio: 520 / 156; opacity: .6; animation: fly 60s linear infinite; }
.land-hills { left: 0; right: 0; bottom: 0; }
.land-hills.far { height: 50svh; background: var(--hill0); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 200' preserveAspectRatio='none'%3E%3Cpath d='M0 200V110C100 60 200 60 300 110S500 160 600 110V200Z'/%3E%3C/svg%3E") calc(var(--ox) - var(--sx) * .15px) 100% / 95svh 100% repeat-x; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 200' preserveAspectRatio='none'%3E%3Cpath d='M0 200V110C100 60 200 60 300 110S500 160 600 110V200Z'/%3E%3C/svg%3E") calc(var(--ox) - var(--sx) * .15px) 100% / 95svh 100% repeat-x; }
.land-hills.mid { height: 37svh; background: var(--hill1); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 200' preserveAspectRatio='none'%3E%3Cpath d='M0 200V90C80 130 180 140 300 90S520 40 600 90V200Z'/%3E%3C/svg%3E") calc(var(--ox) - var(--sx) * .4px) 100% / 70svh 100% repeat-x; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 200' preserveAspectRatio='none'%3E%3Cpath d='M0 200V90C80 130 180 140 300 90S520 40 600 90V200Z'/%3E%3C/svg%3E") calc(var(--ox) - var(--sx) * .4px) 100% / 70svh 100% repeat-x; }

/* ---------- type ---------- */
.eyebrow { font-size: .72rem; letter-spacing: .34em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
h2 { font: 500 clamp(1.900rem, 8vw, 2.700rem)/1.08 var(--font-display); margin: .3rem 0 .8rem; text-wrap: balance; }
h3 { font: 500 1.5rem/1.2 var(--font-display); margin-bottom: .4rem; }
.lede { color: var(--muted); max-width: 30rem; margin-inline: auto; white-space: pre-line; text-wrap: pretty; }
.hint { color: var(--muted); font-size: .86rem; }
.link { background: none; border: 0; padding: .5rem; cursor: pointer; color: var(--accent); font-weight: 500; text-decoration: underline; text-underline-offset: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 3rem; padding: .7rem 1.5rem; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--on-accent); font-weight: 500; font-size: .92rem; letter-spacing: .04em;
  text-decoration: none; white-space: nowrap; cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s, background-color .25s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px var(--accent); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .6; pointer-events: none; }
.btn-block { width: 100%; }
.btn svg, .dock svg, .fab svg, .icon-btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; margin-top: .9rem; }
.btn-row .btn { flex: 1 1 9.5rem; padding-inline: .9rem; font-size: .88rem; }

/* ---------- envelope cover ---------- */
.gate {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 1.5rem; text-align: center; overflow: hidden;
  background:
    radial-gradient(60vmax 60vmax at 12% 0%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%),
    radial-gradient(60vmax 60vmax at 92% 100%, color-mix(in srgb, var(--accent2) 34%, transparent), transparent 70%),
    var(--bg);
  transition: opacity .9s ease, visibility 0s .9s;
}
.gate-inner { display: grid; justify-items: center; gap: .7rem; animation: rise 1.2s var(--ease) both; }
.gate-names { font: var(--name-style) 400 clamp(2.2rem, 10vw, 3.2rem)/1.1 var(--font-name); }
.gate-date { letter-spacing: .3em; font-size: .85rem; color: var(--muted); }
.gate-guest { font-size: .95rem; color: var(--muted); }
.gate-guest b { display: block; font: 500 1.5rem/1.3 var(--font-display); color: var(--ink); }
.gate-fade { transition: opacity .3s ease, transform .3s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

.env-wrap { position: relative; width: min(80vw, 21rem, 46svh); margin: 2.6rem 0 1.6rem; transition: transform .7s var(--ease), opacity .6s ease; }
.envelope { position: relative; z-index: 1; aspect-ratio: 3 / 2; perspective: 1400px; }
.env-back, .env-pocket, .env-flap { position: absolute; inset: 0; border-radius: 8px; }
.env-back { background: color-mix(in srgb, var(--accent) 72%, #000); box-shadow: 0 24px 40px -14px rgb(0 0 0 / .4); }
.env-letter {
  position: absolute; z-index: 2; left: 5%; right: 5%; top: 6%; height: 88%; border-radius: 4px; padding: 8% 6% 0;
  background: var(--surface); color: var(--ink); box-shadow: 0 2px 10px rgb(0 0 0 / .18);
  display: grid; align-content: start; justify-items: center; gap: .2rem;
  transition: transform .85s var(--ease) 1.05s;
}
.env-letter small { font-size: .56rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.env-letter b { font: var(--name-style) 400 1.7rem/1.1 var(--font-name); }
.env-letter span { font-size: .62rem; letter-spacing: .26em; color: var(--muted); }
.env-pocket { z-index: 3; background: var(--accent); clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%); }
.env-pocket::after { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--accent) 86%, #fff); clip-path: polygon(0 100%, 50% 42%, 100% 100%); }
.env-flap {
  z-index: 4; bottom: auto; height: 58%; transform-origin: top; clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 92%, #000), color-mix(in srgb, var(--accent) 80%, #000));
  transition: transform .7s cubic-bezier(.45, 0, .55, 1) .35s, z-index 0s .7s;
}
.env-seal {
  position: absolute; z-index: 5; left: 50%; top: 54%; width: 44%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent2) 80%, #fff), var(--accent2));
  background-size: cover; background-position: center; color: color-mix(in srgb, var(--accent) 80%, #000);
  border: 3px solid var(--surface); outline: 1px solid var(--accent2); box-shadow: 0 8px 20px rgb(0 0 0 / .35);
  font: var(--name-style) 400 1.9rem/1 var(--font-name); transition: opacity .3s ease, scale .35s var(--ease);
}
.env-seal.has-image span { display: none; }


/* Opening runs in strict order so nothing crosses anything else:
   1. text and seal fade  2. flap folds back  3. card slides out  4. a plain veil covers it  5. the veil lifts off the page. */
.gate-veil { position: absolute; inset: 0; z-index: 10; background: var(--bg); opacity: 0; pointer-events: none; transition: opacity .55s ease; }
.gate.opening .gate-fade { opacity: 0; transform: translateY(-6px); pointer-events: none; }
.gate.opening .env-seal { opacity: 0; scale: .8; }
.gate.opening .env-flap { transform: rotateX(180deg); z-index: 1; }
.gate.opening .env-letter { transform: translateY(-58%); }
.gate.lifting .gate-veil { opacity: 1; }
.gate.lifting .env-wrap { transform: translateY(-4%) scale(1.04); }
.gate.out { opacity: 0; visibility: hidden; }

/* ---------- storybook cover ---------- */
.story {
  --bw: min(28vw, 14svh, 8rem);
  --zoom: 2.3;
  display: block; padding: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--scene) 28%, var(--bg)), var(--bg) 60%);
}
@media (min-width: 700px) { .story { --zoom: 2.7; } }
/* The stage zooms toward the middle of the book. */
/* The opening is three layers that zoom together about the centre of the book: the scenery behind it, the book,
   and the foreground in front of it. Each is drawn once and that drawing is scaled; re-drawing tile by tile at
   every new size, or switching that behaviour on and off part-way, is what glitched on phones. */
.story-stage { position: absolute; inset: 0; overflow: hidden; transform-origin: 50% calc(100% - 19svh - var(--bw) * .68); transition: transform 1.2s cubic-bezier(.6, 0, .2, 1); will-change: transform; }
.story-stage > *, .st-front > * { position: absolute; pointer-events: none; }
.st-front { position: absolute; inset: 0; pointer-events: none; transform-origin: 50% calc(100% - 19svh - var(--bw) * .68); transition: opacity .5s ease, transform 1.2s cubic-bezier(.6, 0, .2, 1); will-change: transform; }
.book-glow, .st-owl, .story-text { pointer-events: none; }
.story-hint { cursor: pointer; }
.st-moon { top: 27svh; right: 9vw; width: min(17vw, 6rem); aspect-ratio: 1; border-radius: 50%; background: color-mix(in srgb, var(--accent2) 40%, #fff); box-shadow: 0 0 50px 16px color-mix(in srgb, var(--accent2) 45%, transparent); opacity: .8; animation: glow 4s ease-in-out infinite alternate; }
.st-hill { left: 0; bottom: 0; width: 100%; }
.st-hill.h0 { height: 74svh; fill: var(--hill0); }
.st-hill.h1 { height: 62svh; fill: var(--hill1); }
.st-hill.h2 { height: 52svh; fill: var(--hill2); }
.st-hill.h3 { height: 30svh; fill: var(--hill3); transition: opacity .5s ease, transform .9s var(--ease); }

/* Silhouettes are masks, so they take their colour from the theme. */
.sil { background: var(--sil2); -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }

/* Sky: birds, butterflies and floating candles. */
.st-birds { --m: url(../img/birds.webp); top: 13svh; left: 0; width: min(46vw, 16rem); aspect-ratio: 520 / 156; opacity: .75; animation: fly 44s linear infinite; }
.st-candle { width: .260rem; height: 1.250rem; border-radius: 1px; background: color-mix(in srgb, var(--surface) 80%, var(--accent2)); animation: float 5s ease-in-out infinite alternate; }
.st-candle::before { content: ""; position: absolute; left: 50%; bottom: 100%; width: .340rem; height: .560rem; translate: -50% 0; border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%; background: #FFD98A; box-shadow: 0 0 10px 4px rgb(255 205 120 / .65); animation: twinkle .9s ease-in-out infinite alternate; }

/* Distance: stone viaduct with a steam train, and the castle on its cliff. */
.st-viaduct { left: 0; width: 100%; bottom: 44svh; height: 8svh; background: color-mix(in srgb, var(--scene) 24%, var(--bg)); -webkit-mask: radial-gradient(ellipse 40% 84% at 50% 100%, transparent 97%, #000 100%) 0 0 / 5.500svh 100% repeat-x; mask: radial-gradient(ellipse 40% 84% at 50% 100%, transparent 97%, #000 100%) 0 0 / 5.500svh 100% repeat-x; }
.st-train { left: 0; bottom: 51.800svh; height: 3.400svh; display: flex; align-items: flex-end; animation: rail 40s linear 4s infinite backwards; }
.st-train > * { flex: none; }
.st-loco { --m: url(../img/loco.webp); height: 100%; aspect-ratio: 420 / 105; }
.st-cars { height: 60%; width: 26svh; margin-left: .300svh; background: repeating-linear-gradient(90deg, var(--sil2) 0 6svh, transparent 0 6.500svh); }
.st-train b { position: absolute; left: 4%; bottom: 85%; width: 1.600svh; aspect-ratio: 1; border-radius: 50%; background: color-mix(in srgb, var(--surface) 75%, transparent); animation: puff 1.800s ease-out infinite; }
.st-train b:nth-of-type(2) { animation-delay: -.6s; }
.st-train b:nth-of-type(3) { animation-delay: -1.2s; }
.st-castle { left: 4vw; bottom: 40svh; width: 36svh; fill: color-mix(in srgb, var(--scene) 48%, var(--bg)); overflow: visible; }
.st-castle .w, .st-hut .w { fill: #FFD98A; animation: twinkle 2.300s ease-in-out infinite alternate; }

/* Middle ground: forest edge, stag, trees, a hut with a smoking chimney. */
.st-forest { left: 0; width: 100%; bottom: 29svh; height: 13svh; background: var(--forest); -webkit-mask: url(../img/forest.webp) left bottom / auto 100% repeat-x; mask: url(../img/forest.webp) left bottom / auto 100% repeat-x; }
.st-deer { --m: url(../img/deer.webp); left: 0; bottom: 30svh; height: 13svh; aspect-ratio: 300 / 420; animation: cross-r 64s linear -20s infinite, bob 1.100s ease-in-out infinite alternate; }
.st-oak { --m: url(../img/oak.webp); left: -12vw; bottom: 33svh; height: 16svh; aspect-ratio: 520 / 440; }
.st-gnarl { --m: url(../img/gnarl.webp); right: -9vw; bottom: 33svh; height: 18svh; aspect-ratio: 480 / 449; }
.st-tallpine { --m: url(../img/tallpine.webp); right: 19vw; bottom: 35svh; height: 14svh; aspect-ratio: 362 / 440; }
.st-pine { --m: url(../img/pine.webp); aspect-ratio: 245 / 420; }
.st-pine.p1 { right: 2vw; bottom: 36svh; height: 12svh; }
.st-pine.p2 { left: 25vw; bottom: 35svh; height: 9svh; }
.st-pine.p3 { left: 7vw; bottom: 36svh; height: 12svh; }
.st-hut { left: 68vw; bottom: 27svh; width: 7svh; fill: var(--sil2); overflow: visible; }
.st-hut .smoke { fill: color-mix(in srgb, var(--surface) 75%, transparent); animation: rise 2.600s ease-out infinite; }
.st-hut .s2 { animation-delay: -1.3s; }
.st-fox { --m: url(../img/fox.webp); left: 0; bottom: 21.500svh; height: 5.500svh; aspect-ratio: 420 / 182; animation: dash-l 22s linear 2s infinite backwards, bob .26s ease-in-out infinite alternate; }

/* Foreground: cats, flowers and a rabbit keep the book company. */
.st-near { background: var(--sil3); transition: opacity .5s ease; }
.st-cat { --m: url(../img/cat.webp); right: 13vw; bottom: 10svh; height: 9svh; aspect-ratio: 137 / 260; animation: bob 3s ease-in-out infinite alternate; }
.st-cat2 { --m: url(../img/cat2.webp); left: 9vw; bottom: 8svh; height: 5svh; aspect-ratio: 400 / 294; animation: bob 4s ease-in-out infinite alternate; }
.st-cat3 { --m: url(../img/cat3.webp); left: 25vw; bottom: 19svh; height: 6svh; aspect-ratio: 300 / 232; scale: -1 1; animation: bob 2.200s ease-in-out infinite alternate; }
.st-flower { fill: currentColor; stroke: var(--sil3); overflow: visible; transform-origin: 50% 100%; transition: opacity .5s ease; animation: sway 3.400s ease-in-out infinite alternate; }
.st-flower .eye { fill: #FFD98A; stroke: none; }
.f0 { color: color-mix(in srgb, var(--surface) 92%, var(--accent2)); }
.f1 { color: color-mix(in srgb, var(--accent2) 78%, #fff); }
.f2 { color: color-mix(in srgb, var(--scene) 30%, #fff); }
.st-rabbit { --m: url(../img/rabbit.svg); left: 30vw; bottom: 10svh; height: 3.600svh; aspect-ratio: 200 / 172; }
.st-butterfly { --m: url(../img/butterfly.webp); background: currentColor; width: 1.500rem; aspect-ratio: 160 / 134; transition: opacity .5s ease; animation: wander 17s ease-in-out infinite alternate, flap .55s ease-in-out infinite alternate; }

@keyframes fly { from { translate: -60vw 5svh; } to { translate: 110vw -7svh; } }
@keyframes rail { from { translate: 105vw 0; } 52%, to { translate: -130vw 0; } }
@keyframes cross-r { from { translate: -30vw 0; } to { translate: 110vw 0; } }
@keyframes dash-l { from { translate: 110vw 0; } 42%, to { translate: -60vw 0; } }
@keyframes bob { to { transform: translateY(-3px); } }
@keyframes wing { to { transform: scaleY(.35); } }
@keyframes flap { to { transform: scaleX(.25); } }
@keyframes wander { 0% { translate: 0 0; } 30% { translate: 9vw -5svh; } 60% { translate: -4vw -9svh; } 100% { translate: 12vw 3svh; } }
@keyframes sway { from { rotate: -5deg; } to { rotate: 5deg; } }
@keyframes float { to { translate: 0 -1.400svh; } }
@keyframes twinkle { to { opacity: .45; } }
@keyframes puff { from { opacity: .85; transform: scale(.4); } to { opacity: 0; transform: translate(5svh, -4svh) scale(1.7); } }
@keyframes rise { from { opacity: .8; transform: translate(0, 0); } to { opacity: 0; transform: translate(5px, -16px); } }
@keyframes glow { to { opacity: 1; scale: 1.06; } }

/* The book. Flipping parts carry their own perspective so plain z-index decides what is on top. */
/* The book is laid out at the size it has once zoomed in, and shown shrunk until then. */
.book-wrap { position: absolute; left: 50%; top: calc(100% - 19svh - var(--bw) * .68); width: calc(var(--bw) * var(--zoom)); aspect-ratio: 1 / 1.36; transform: translate(-50%, -50%) rotate(-6deg) scale(calc(1 / var(--zoom))); transition: transform 1.2s cubic-bezier(.6, 0, .2, 1); will-change: transform; }
.book-glow { position: absolute; inset: -34%; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent2) 70%, #fff), transparent); opacity: .55; animation: glow 2.400s ease-in-out infinite alternate; transition: opacity .5s ease; }
.st-owl { --m: url(../img/owl.webp); background: var(--sil3); position: absolute; right: -4%; bottom: 97%; height: 36%; aspect-ratio: 249 / 300; transition: opacity .5s ease, translate .9s ease-in; animation: bob 2.200s ease-in-out infinite alternate; }
.book { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: inherit; font-size: calc(var(--bw) * var(--zoom) / 16); -webkit-tap-highlight-color: transparent; }
.book > * { position: absolute; }
.book::after { content: ""; position: absolute; inset: -14%; }
.book-block { inset: 0; z-index: 0; border-radius: calc(3px * var(--zoom)) calc(6px * var(--zoom)) calc(6px * var(--zoom)) calc(3px * var(--zoom)); background: color-mix(in srgb, var(--accent) 70%, #000); box-shadow: calc(4px * var(--zoom)) calc(5px * var(--zoom)) 0 calc(-1px * var(--zoom)) color-mix(in srgb, var(--surface) 80%, var(--ink)), calc(7px * var(--zoom)) calc(8px * var(--zoom)) 0 calc(-1px * var(--zoom)) color-mix(in srgb, var(--accent) 60%, #000), 0 calc(20px * var(--zoom)) calc(26px * var(--zoom)) calc(-8px * var(--zoom)) rgb(0 0 0 / .5); }
.book-page, .book-leaf { inset: 3% 3% 3% 0; border-radius: 0 calc(3px * var(--zoom)) calc(3px * var(--zoom)) 0; }
.book-page { z-index: 1; overflow: hidden; background: linear-gradient(180deg, color-mix(in srgb, var(--scene) 16%, var(--bg)), var(--bg) 50%, var(--hill3) 50%); color: var(--ink); }
.book-page::after { content: ""; position: absolute; inset: 0; box-shadow: inset calc(9px * var(--zoom)) 0 calc(10px * var(--zoom)) calc(-8px * var(--zoom)) rgb(0 0 0 / .3); }
/* A live miniature of the card, built by JS at the size of the real screen and scaled down to fit the page. */
.book-preview { position: absolute; inset: 0; }
.book-preview .shot { position: absolute; left: 50%; top: 50%; isolation: isolate; font-size: 1rem; text-align: center; }
/* Sky, hills and turf are stretched a screen to either side so they run to the edges of the page. */
.book-preview .land { position: absolute; inset: 0; overflow: visible; }
.book-preview .land-hills { left: -100%; right: -100%; }
.book-preview .shot-track { position: absolute; inset: 0; }
.book-preview .ground { left: -100%; width: 300%; }
.book-preview .scene { position: absolute; left: 0; top: 0; }
/* The picture in the book is a still. */
.book-preview *, .gate-shot * { animation: none !important; }
/* A sharp copy of that picture, on its own layer. It is laid exactly over the one in the book as soon as the pages
   have turned, and grows to fill the screen in step with the stage's last zoom. It has no background of its own:
   until the phone has drawn it, the identical picture in the book simply shows through. */
.gate-shot { position: absolute; left: 0; top: 0; z-index: 5; width: 100%; height: 100%; overflow: hidden; visibility: hidden; transform-origin: 0 0; pointer-events: none; will-change: transform; }
.gate-shot.placed { visibility: visible; }
.gate-shot.grown { transform: translate(0px, 0px) scale(1) !important; transition: transform .95s cubic-bezier(.5, 0, .25, 1); }
.gate-shot .shot { position: absolute; left: 0; top: 0; isolation: isolate; font-size: 1rem; text-align: center; }
.gate-shot .land { position: absolute; inset: 0; overflow: visible; }
.gate-shot .land-hills { left: -100%; right: -100%; }
.gate-shot .shot-track { position: absolute; inset: 0; }
.gate-shot .ground { left: -100%; width: 300%; }
.gate-shot .scene { position: absolute; left: 0; top: 0; }
.book-leaf { z-index: calc(20 - var(--i)); background: linear-gradient(90deg, color-mix(in srgb, var(--surface) 86%, var(--ink)), var(--surface) 14%); transform-origin: left; transform: perspective(calc(1500px * var(--zoom))) rotateY(0deg); transition: transform .3s cubic-bezier(.4, 0, .6, 1) calc(var(--i) * .075s), z-index 0s calc(.15s + var(--i) * .075s); }
/* The tale on the first page is laid out at on-screen size and shrunk to fit, so it stays sharp and readable once zoomed. */
.book-story { position: absolute; inset: 0; padding: calc(8% / var(--zoom)) calc(9% / var(--zoom)) calc(8% / var(--zoom)) calc(11% / var(--zoom)); display: grid; align-content: center; overflow: hidden; text-align: left; color: var(--ink); font: italic 400 calc(1.150rem * var(--fit, 1))/1.5 var(--font-display); white-space: pre-line; transition: opacity .15s ease; }
.book-story span { opacity: 0; }
.book-story span.on { opacity: 1; transition: opacity .3s ease; }
.book-story .cap { font-size: 2.200em; line-height: .9; font-style: normal; color: var(--accent); }
.book-story p::after { content: " ✦"; color: var(--accent2); opacity: 0; transition: opacity .6s ease; }
.book-story.done p::after { opacity: 1; }
.book-cover { inset: 0; z-index: 30; transform-origin: left; transform-style: preserve-3d; transform: perspective(calc(1500px * var(--zoom))) rotateY(0deg); transition: transform .6s cubic-bezier(.45, 0, .3, 1), z-index 0s .3s; }
.book-cover > * { position: absolute; inset: 0; border-radius: calc(3px * var(--zoom)) calc(6px * var(--zoom)) calc(6px * var(--zoom)) calc(3px * var(--zoom)); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cover-front { background: radial-gradient(70% 50% at 56% 38%, color-mix(in srgb, var(--accent) 80%, #fff) 0, transparent 70%), linear-gradient(90deg, color-mix(in srgb, var(--accent) 66%, #000) 0 7%, var(--accent) 9%, color-mix(in srgb, var(--accent) 82%, #000)); color: color-mix(in srgb, var(--accent2) 80%, #fff); display: grid; align-content: center; justify-items: center; gap: .8em; padding-left: 7%; }
.cover-front::before { content: ""; position: absolute; inset: 6% 6% 6% 13%; border: 1px solid currentColor; border-radius: 2px; opacity: .7; }
/* The cover of a fairytale romance: a gold frame with curled corners, a crest, and the title in gold. */
.cover-frame { position: absolute; inset: 8% 8.500% 8% 15.500%; width: auto; height: auto; overflow: visible; fill: none; stroke: currentColor; stroke-width: .9; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: .85; }
.cover-frame path { vector-effect: non-scaling-stroke; }
.cover-frame .leaf { fill: currentColor; stroke: none; }
.cover-title { display: grid; justify-items: center; gap: .3em; max-width: 76%; text-align: center; }
.cover-title small { font: 500 .5em/1.3 var(--font-display); letter-spacing: .3em; text-transform: uppercase; opacity: .9; }
.cover-front em { font: var(--name-style) 400 1.550em/1.05 var(--font-name); overflow-wrap: anywhere; background: linear-gradient(180deg, #FFF4DA, color-mix(in srgb, var(--accent2) 85%, #fff) 50%, color-mix(in srgb, var(--accent2) 80%, #5A3A14)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 .06em .1em rgb(0 0 0 / .35)); }
.cover-rule { position: relative; width: 5.500em; height: 1px; margin: .2em 0; background: linear-gradient(90deg, transparent, currentColor 30% 70%, transparent); }
.cover-rule::after { content: ""; position: absolute; left: 50%; top: 50%; width: .4em; height: .4em; translate: -50% -50%; rotate: 45deg; background: currentColor; }
.cover-title .cover-ever { font: italic 400 .66em/1.2 var(--font-display); letter-spacing: .06em; text-transform: none; }
.crest { display: block; width: 100%; height: auto; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.600; stroke-linecap: round; filter: drop-shadow(0 .05em .12em rgb(0 0 0 / .3)); }
.crest .thin { stroke-width: .8; opacity: .75; }
.crest .fill { fill: currentColor; stroke: none; }
.crest .hill { stroke-width: 1.200; }
.cover-inside { transform: rotateY(180deg); background: color-mix(in srgb, var(--accent2) 30%, var(--surface)); box-shadow: inset -9px 0 10px -8px rgb(0 0 0 / .3); }
.book-medal { width: 46%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font: var(--name-style) 400 1.500em/1 var(--font-name); }
.book-medal #sealMono { display: none; }
/* An uploaded cover picture takes the crest's place, framed in a gold ring. */
.book-medal.has-image { background: center / cover; box-shadow: 0 0 0 1px currentColor, 0 0 0 .3em color-mix(in srgb, var(--accent) 82%, #000), 0 0 0 calc(.3em + 1px) currentColor; }
.book-medal.has-image .crest { display: none; }
.book:focus-visible .cover-front { outline: 2px solid var(--accent2); outline-offset: 3px; }

.story-text { position: absolute; top: 7svh; left: 0; right: 0; padding: 0 1rem; display: grid; justify-items: center; gap: .45rem; }
.story-hint { position: absolute; left: 50%; bottom: 3.500svh; translate: -50% 0; white-space: nowrap; padding: .45rem 1.100rem; border-radius: 999px; background: rgb(0 0 0 / .22); color: #fff; font-size: .82rem; letter-spacing: .08em; animation: glow 1.800s ease-in-out infinite alternate; }

/* Opening: zoom to the book, then the cover and two leaves turn, leaving the invitation page. */
.story.opening .story-stage { transform: scale(var(--zoom)); }
.story.opening .story-hint { animation: none; }
.story.opening .book-wrap { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
.story.opening .book-glow { opacity: 0; }
.story.opening .st-owl { opacity: 0; translate: 60% -140%; }
.story.opening .st-front { opacity: 0; transform: scale(var(--zoom)); }
.story.flip .book-cover { transform: perspective(calc(1500px * var(--zoom))) rotateY(-180deg); z-index: 1; }
.story.riffle .book-leaf { transform: perspective(calc(1500px * var(--zoom))) rotateY(-180deg); z-index: calc(2 + var(--i)); }
.story.riffle .book-story { opacity: 0; }
/* Then keep zooming until the page fills the screen, and let the cover dissolve straight onto the card. */
.story.lifting .story-stage, .story.lifting .book-wrap { transition: transform .95s cubic-bezier(.5, 0, .25, 1); }
.story.lifting .gate-veil { opacity: 0; }
.story.out { transition: opacity .4s ease, visibility 0s .4s; }
/* Envelope: the card grows into place. Storybook: the card must already sit exactly where the miniature lands. */
main { transform-origin: 50% 50svh; transition: transform 1.300s var(--ease); }
body.locked main { transform: scale(.9); }
.gate.story ~ main { transform: none; }

/* ---------- the journey ---------- */
/* One strip of scenes that scrolls sideways. Each scene is a screen wide on phones, narrower on big screens. */
.journey { position: fixed; inset: 0; z-index: 2; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior: none; }
.journey::-webkit-scrollbar { display: none; }
.locked .journey { overflow: hidden; }
@media (pointer: coarse) { .journey { scroll-snap-type: x proximity; } }
.track { position: relative; display: flex; width: max-content; height: 100%; overflow: clip; }
.scene { --focus: 1; --room: calc(100svh - 3.600rem - var(--turf) - 1rem); position: relative; z-index: 3; flex: none; width: min(100vw, 44rem); height: 100%; padding: 3.600rem 1.4rem calc(var(--turf) + 1rem); display: grid; align-content: center; justify-items: center; text-align: center; scroll-snap-align: center; }
.scene-wide { width: 100vw; }
.scene-inner { width: 100%; max-width: 34rem; max-height: var(--room); overflow-y: auto; scrollbar-width: none; padding: .4rem .55rem; transform: scale(calc(.93 + .07 * var(--focus))); opacity: calc(.3 + .7 * var(--focus)); }
.scene-inner::-webkit-scrollbar { display: none; }
.scene h3 { margin-top: 0; }

/* Ground and garden. Trees stand behind the turf; flowers and cats sit in front of it. */
.ground { position: absolute; left: 0; bottom: 0; z-index: 1; width: 100%; height: var(--turf); background: var(--hill3); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 200' preserveAspectRatio='none'%3E%3Cpath d='M0 200V52C100 22 200 22 300 52S500 82 600 52V200Z'/%3E%3C/svg%3E") var(--ox, 0px) 100% / 72svh 100% repeat-x; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 200' preserveAspectRatio='none'%3E%3Cpath d='M0 200V52C100 22 200 22 300 52S500 82 600 52V200Z'/%3E%3C/svg%3E") var(--ox, 0px) 100% / 72svh 100% repeat-x; }
.decor { position: absolute; inset: 0; pointer-events: none; }
.decor-back { z-index: 0; }
.decor-front { z-index: 2; }
.decor > * { position: absolute; }
.d-oak { --m: url(../img/oak.webp); aspect-ratio: 520 / 440; }
.d-pine { --m: url(../img/pine.webp); aspect-ratio: 245 / 420; }
.d-tallpine { --m: url(../img/tallpine.webp); aspect-ratio: 362 / 440; }
.d-gnarl { --m: url(../img/gnarl.webp); aspect-ratio: 480 / 449; }
.d-deer { --m: url(../img/deer.webp); aspect-ratio: 300 / 420; }
.d-fox { --m: url(../img/fox.webp); aspect-ratio: 420 / 182; }
.d-cat { --m: url(../img/cat.webp); aspect-ratio: 137 / 260; background: var(--sil3); }
.d-cat2 { --m: url(../img/cat2.webp); aspect-ratio: 400 / 294; background: var(--sil3); }
.d-cat3 { --m: url(../img/cat3.webp); aspect-ratio: 300 / 232; background: var(--sil3); }
.d-rabbit { --m: url(../img/rabbit.svg); aspect-ratio: 200 / 172; background: var(--sil3); }
.fa, .f3 { color: var(--accent); }
.d-fly { --m: url(../img/butterfly.webp); aspect-ratio: 160 / 134; background: currentColor; animation: wander 15s ease-in-out infinite alternate, flap .55s ease-in-out infinite alternate; }
.d-tone1 { background: var(--hill1); }
.d-tone2 { background: var(--forest); }
.d-bloom { fill: currentColor; stroke: var(--sil3); overflow: visible; transform-origin: 50% 100%; animation: sway 3.400s ease-in-out infinite alternate; }
.d-bloom .eye { fill: #FFD98A; stroke: none; }
/* A butterfly keeps pace with the reader and doubles as a progress marker. */
.guide { --m: url(../img/butterfly.webp); position: fixed; z-index: 4; left: calc(5vw + var(--p, 0) * 86vw); bottom: calc(var(--turf) + .4rem); width: 1.600rem; aspect-ratio: 160 / 134; background: var(--accent); pointer-events: none; transition: left .5s var(--ease); animation: float 2.400s ease-in-out infinite alternate, flap .6s ease-in-out infinite alternate; }
.locked .guide { opacity: 0; }

/* ---------- scene: names ---------- */
.scene-home .scene-inner { display: grid; justify-items: center; gap: .9rem; overflow: visible; }
.scene-home .scene-inner, .seq, .scene h2, .scene h3, .scene .lede, .scene .eyebrow, .facts { text-shadow: 0 0 .7rem var(--bg), 0 0 .25rem var(--bg); }
.card, .btn, .path li, .registry li, .contacts li, .wish { text-shadow: none; }
.arch {
  width: min(52vw, 14rem, 30svh); aspect-ratio: 3 / 4; border-radius: 999px 999px var(--r) var(--r); overflow: hidden; position: relative;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 55%, var(--bg)), color-mix(in srgb, var(--accent2) 60%, var(--bg)));
  background-size: cover; background-position: center;
  box-shadow: var(--shadow); outline: 1px solid var(--line); outline-offset: 9px;
}
.arch.is-cut { box-shadow: none; outline: 0; }
.arch-mono { position: absolute; inset: 0; display: grid; place-items: center; font: var(--name-style) 400 3.600rem/1 var(--font-name); color: var(--on-accent); opacity: .95; container-type: inline-size; }
/* The monogram: both initials in a copperplate script, set over one another so their strokes weave together,
   both in white. Sized to the arch (cqi), so it fits any arch. */
.monogram { position: relative; width: 84cqi; aspect-ratio: 1 / 1.05; translate: 0 2cqi; font: 400 54cqi/1 'Pinyon Script', var(--font-name); }
.monogram b { position: absolute; font-weight: 400; text-shadow: 0 .02em .06em rgb(0 0 0 / .22); }
.monogram-a { left: 3%; top: 6%; }
.monogram-b { left: 35%; top: 25%; }
.monogram.single .monogram-a { left: 50%; top: 10%; translate: -50% 0; }
.arch.has-photo .arch-mono { display: none; }
.arch-mono { text-shadow: none; }
.names { z-index: 3; font: var(--name-style) 400 clamp(2.800rem, 14vw, 5rem)/.98 var(--font-name); margin-top: -2.200rem; position: relative; display: grid; text-shadow: 0 0 1.4rem var(--bg), 0 0 .5rem var(--bg); overflow-wrap: anywhere; }
.names em { font: italic 400 .42em/1.3 var(--font-display); color: var(--accent); text-shadow: none; }
.hero-date { display: flex; align-items: center; gap: 1rem; letter-spacing: .3em; font-size: .88rem; font-weight: 500; }
.hero-date::before, .hero-date::after { content: ""; width: 2.4rem; height: 1px; background: var(--ink); opacity: .35; }
.hashtag { color: var(--muted); font-size: .9rem; letter-spacing: .08em; }
.swipe-hint { display: flex; align-items: center; gap: .7rem; margin-top: .5rem; color: var(--muted); font-size: .7rem; letter-spacing: .26em; text-transform: uppercase; transition: opacity .5s ease; }
.swipe-hint i { position: relative; width: 1.800rem; height: 1px; background: currentColor; animation: nudge 1.800s ease-in-out infinite; }
.swipe-hint i::after { content: ""; position: absolute; right: 0; top: -3px; width: 6px; height: 6px; border: solid currentColor; border-width: 1px 1px 0 0; rotate: 45deg; }
.swipe-hint.gone { opacity: 0; }
@keyframes nudge { 50% { translate: .5rem 0; } }

/* ---------- lines that arrive one after another ---------- */
.seq > *, .seq .hosts > * { opacity: 0; transform: translateY(16px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: calc(var(--i, 0) * .5s); }
.seen .seq > *, .seen .seq .hosts > * { opacity: 1; transform: none; }
.seq > .hosts { opacity: 1; transform: none; }
.seq > :nth-child(2) { --i: 1; }
.seq > :nth-child(3) { --i: 2; }
.seq > :nth-child(4) { --i: 3; }
.seq > :nth-child(5) { --i: 4; }
.seq .hosts > :nth-child(1) { --i: 1; }
.seq .hosts > :nth-child(2) { --i: 2; }
.seq .hosts > :nth-child(3) { --i: 3; }
.seq > .hosts ~ * { --i: 4; }
.glitter { position: absolute; inset: 3rem 0 var(--turf); pointer-events: none; }
.glitter i { position: absolute; width: .7rem; aspect-ratio: 1; background: var(--accent2); clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); opacity: 0; scale: 0; }
.glitter i:nth-child(3n) { width: 1rem; background: color-mix(in srgb, var(--accent2) 55%, #fff); }
.glitter i:nth-child(4n + 1) { width: .45rem; }
.seen .glitter i { animation: sparkle 2.600s ease-in-out calc(var(--n) * .17s) infinite; }
@keyframes sparkle { 0%, 100% { opacity: 0; scale: 0; rotate: 0deg; } 45% { opacity: .95; scale: 1; rotate: 60deg; } }

/* ---------- sections ---------- */
.scene .card { margin-top: 1rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 1.150rem 1.250rem; box-shadow: var(--shadow); backdrop-filter: blur(10px); text-align: left; margin-top: 1.6rem; }

.greeting { font: 500 1.45rem/1.3 var(--font-display); margin-bottom: 1.2rem; }
.hosts { display: grid; justify-items: center; gap: 1rem; margin-bottom: 1.6rem; }
.host-group small { display: block; font-size: .68rem; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.host-group p { margin-top: .6rem; font: 500 1.3rem/1.3 var(--font-display); text-wrap: balance; }
.host-group p > span:not(.wd) { display: block; margin-top: .1rem; font: 400 .86rem/1.4 var(--font-body); color: var(--muted); }
.hosts em { font: italic 400 1.5rem/1 var(--font-display); color: var(--accent); }
@media (min-width: 560px) { .hosts:has(em) { grid-template-columns: 1fr auto 1fr; align-items: start; } .hosts:has(em) em { margin-top: 1.8rem; } }
.fullname { margin-top: .8rem; font: 500 clamp(1.600rem, 7vw, 2.200rem)/1.25 var(--font-display); text-wrap: balance; }
#couple .amp { display: block; font: italic 400 1.800rem/1.5 var(--font-display); color: var(--accent); }
.verse { font: italic 400 1.15rem/1.6 var(--font-display); color: var(--muted); white-space: pre-line; max-width: 28rem; margin: 2.4rem auto 0; padding-top: 2.2rem; position: relative; text-wrap: pretty; }
.verse::before { content: ""; position: absolute; top: 0; left: 50%; width: 1px; height: 1.5rem; background: var(--accent); }

/* A hand-drawn map: parchment, doodled hills and rivers, and (when coordinates are set) real streets washed in sepia. */
.fmap { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; max-height: 25svh; margin: 0 auto; overflow: hidden; border-radius: calc(var(--r) * .7); color: inherit; text-decoration: none; background: radial-gradient(120% 90% at 50% 40%, color-mix(in srgb, var(--accent2) 16%, var(--surface)), color-mix(in srgb, var(--accent2) 44%, var(--surface))); box-shadow: var(--shadow), inset 0 0 0 1px color-mix(in srgb, var(--ink) 30%, transparent), inset 0 0 0 5px color-mix(in srgb, var(--surface) 70%, transparent), inset 0 0 0 6px color-mix(in srgb, var(--ink) 22%, transparent), inset 0 0 40px color-mix(in srgb, var(--ink) 22%, transparent); }
.fmap-tiles { position: absolute; inset: 0; mix-blend-mode: multiply; opacity: .8; filter: sepia(1) saturate(.6) contrast(.95) brightness(1.04); }
.fmap-tiles img { position: absolute; width: 256px; height: 256px; max-width: none; }
.fmap-art { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: color-mix(in srgb, var(--ink) 55%, transparent); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.fmap-art .route { stroke: var(--accent); stroke-dasharray: 2 6; stroke-width: 2; }
.fmap-art .house path, .fmap-art .house circle { fill: color-mix(in srgb, var(--surface) 80%, var(--accent2)); }
.fmap-art .house .win { fill: color-mix(in srgb, var(--accent) 65%, transparent); stroke: none; }
/* A small compass tucked inside the frame's top right corner. */
.fmap-compass { position: absolute; top: .6rem; right: .6rem; width: 2.100rem; height: auto; overflow: visible; fill: none; stroke: color-mix(in srgb, var(--ink) 60%, transparent); stroke-width: 1.4; pointer-events: none; }
.fmap-compass path { fill: color-mix(in srgb, var(--accent) 80%, transparent); stroke: none; }
.fmap-compass text { fill: var(--ink); stroke: none; font: 500 15px var(--font-display); }
.fmap.has-tiles .doodle { display: none; }
.fmap-pin { position: absolute; left: 50%; top: 50%; translate: -50% -100%; display: grid; justify-items: center; gap: .2rem; }
.fmap-pin i { width: 1.500rem; height: 1.500rem; border-radius: 50% 50% 50% 0; rotate: -45deg; background: var(--accent); box-shadow: 0 0 0 3px var(--surface), 0 6px 10px rgb(0 0 0 / .3); order: 2; animation: float 2s ease-in-out infinite alternate; }
.fmap-pin b { order: 1; max-width: 13rem; padding: .2rem .7rem; border-radius: 999px; background: var(--surface); box-shadow: 0 2px 8px rgb(0 0 0 / .18); font: 500 .95rem/1.3 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* OpenStreetMap asks for its credit wherever its map is shown, so it stays, but small and tucked into the map's
   bottom right corner. (It sits after the map rather than inside it, as a link may not sit inside another link.) */
.fmap-credit { position: relative; z-index: 1; display: block; width: fit-content; margin: -1.300rem .6rem .2rem auto; padding: .05rem .4rem; border-radius: 999px; background: color-mix(in srgb, var(--surface) 70%, transparent); font-size: .52rem; line-height: 1.5; color: var(--muted); }
.fmap-credit a { color: inherit; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1rem; margin-top: .7rem; }
.facts .wide { grid-column: 1 / -1; }
.facts small { display: block; font-size: .68rem; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); margin-bottom: .2rem; }
.facts strong { display: block; font: 500 1.150rem/1.2 var(--font-display); }
.facts span { color: var(--muted); font-size: .92rem; white-space: pre-line; }

/* A small divider drawn under the countdown's title. */
.flourish { width: min(12rem, 58vw); margin: 0 auto .9rem; color: var(--accent); }
.flourish svg { display: block; width: 100%; height: auto; overflow: visible; fill: currentColor; }
.flourish .line { fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; opacity: .55; }
/* The countdown, in the manner of a calendar app's: days, hours, minutes and seconds stacked down a card, each
   with its unit's letter, then a line of words. A number that changes flips over (JS). Beside them a dotted trail
   climbs to the wedding day, with a little walker standing as far up it as the days left allow. */
.scene .cd-card { --fa: 2.400rem; --fb: 2.100rem; width: min(100%, 21rem); margin: 0 auto 1.100rem; padding: 1.300rem 1.100rem 1rem 1.700rem; }
.countdown { display: grid; grid-template-columns: 1fr 5.500rem; gap: .5rem; }
.cd-rows { display: grid; gap: .1rem; }
.cd-row { display: flex; align-items: baseline; gap: .6rem; }
.cd-number { display: flex; min-width: 1.200em; perspective: 30em; font: 400 clamp(2.400rem, 11vw, 2.900rem)/1.05 var(--font-display); font-variant-numeric: lining-nums tabular-nums; }
.cd-word { display: inline-block; backface-visibility: hidden; }
.cd-row small { font-size: .95rem; color: var(--muted); }
.cd-note { margin-top: .7rem; font-size: .92rem; line-height: 1.5; color: var(--muted); }
.cd-note b { font-weight: 600; color: var(--accent); }
.cd-trail { position: relative; }
.trail-map { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.trail-path { fill: none; stroke: color-mix(in srgb, var(--accent) 28%, transparent); stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 0 8; }
.trail-path.walked { stroke: var(--accent); }
.trail-start { fill: none; stroke: var(--accent); stroke-width: 1.4; }
.trail-end { fill: var(--accent); }
.trail-bride { fill: var(--accent); }
/* The walker stands with its feet on the point JS gives it (its translate). */
.walker { position: absolute; left: 0; top: 0; }
.walker svg { position: absolute; left: -.350rem; bottom: -.1rem; width: .700rem; height: 1.950rem; overflow: visible; fill: var(--accent); transform-origin: 50% 100%; }
/* In his long tunic the groom has no legs to swing, so he sways from side to side as he goes. */
.walker.walking svg { animation: waddle .3s ease-in-out infinite alternate; }
@keyframes waddle { from { rotate: -7deg; translate: 0 0; } to { rotate: 7deg; translate: 0 -2px; } }
.when-cal { display: flex; justify-content: center; gap: .5rem; }
.when-cal .btn { min-height: 2rem; padding: .3rem .85rem; gap: .4rem; font-size: .72rem; letter-spacing: .02em; }

/* Programme: signposts along a dotted garden path. The scene is as wide as the path needs. */
.scene-path { width: auto; min-width: min(100vw, 44rem); padding-inline: 2.400rem; }
.path-box { display: grid; }
/* An uploaded picture is stretched to the full length of the path so its parts line up with the stops. */
.path-image { width: 0; min-width: 100%; height: 22svh; object-fit: fill; margin-top: .6rem; border-radius: calc(var(--r) * .6); }
.path { position: relative; display: flex; gap: 1.200rem; margin-top: 1rem; }
/* Each stop is a column: a small drawing and its card, swapping places each time. */
.path li { flex: none; width: 10.500rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; transition-duration: 1.200s; }
.path li:nth-child(even) { flex-direction: column-reverse; }
.path .doodle, .path .stop { width: 100%; height: 6rem; }
.path .doodle svg { display: block; height: 100%; margin: 0 auto; fill: none; stroke: color-mix(in srgb, var(--ink) 78%, transparent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: url(#wobble); }
.path .stop { position: relative; display: grid; align-content: center; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); box-shadow: var(--shadow); text-shadow: none; }
.path time { display: block; font-size: .8rem; letter-spacing: .1em; color: var(--accent); font-weight: 500; font-variant-numeric: tabular-nums; }
.path span.label { display: block; margin-top: .2rem; font: 500 1.200rem/1.2 var(--font-display); text-wrap: balance; }
/* With a picture above, the cards simply sit in a row beneath it. */
.path.has-image .doodle { display: none; }
.path.has-image li { flex-direction: column; }

/* ---------- attire ---------- */
/* The palette as small paint-chip cards. */
.shades { display: flex; flex-wrap: wrap; justify-content: center; gap: .9rem; margin-top: 1.300rem; }
.shade { position: relative; display: flex; align-items: flex-end; width: 5.600rem; height: 7.400rem; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; box-shadow: var(--shadow); text-shadow: none; transition: transform .35s var(--ease); }
.shade:hover { transform: translateY(-6px); }
.shade span { width: 100%; padding: .35rem .2rem .4rem; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(6px); display: grid; gap: .1rem; }
.shade b { font: 500 .88rem/1.15 var(--font-display); color: var(--ink); overflow-wrap: anywhere; }
.shade code { font: .58rem/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .06em; color: var(--muted); }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: .75rem; }
.field > span { display: block; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .35rem; }
.field input, .field textarea { width: 100%; min-height: 2.700rem; padding: .55rem .95rem; border: 1px solid var(--line); border-radius: calc(var(--r) * .6); background: color-mix(in srgb, var(--bg) 55%, var(--surface)); transition: border-color .2s, box-shadow .2s; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.field input::placeholder { color: color-mix(in srgb, var(--muted) 60%, transparent); }
.plain { margin-top: .6rem; text-align: left; }
.plain .field > span { color: color-mix(in srgb, var(--ink) 78%, transparent); }
.plain .field input, .plain .field textarea { border: 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 42%, transparent); border-radius: 8px 8px 0 0; background: color-mix(in srgb, var(--surface) 38%, transparent); backdrop-filter: blur(4px); }
.plain .field input:focus, .plain .field textarea:focus { border-color: var(--accent); box-shadow: 0 2px 0 var(--accent); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.plain .seg, .plain .stepper { background: color-mix(in srgb, var(--surface) 42%, transparent); backdrop-filter: blur(4px); }
.plain .stepper { border-color: color-mix(in srgb, var(--ink) 25%, transparent); }
.plain .stepper-row > span { text-shadow: 0 0 .7rem var(--bg), 0 0 .25rem var(--bg); }
#rsvpForm { display: grid; grid-template-columns: 1fr 1fr; column-gap: .7rem; align-items: end; }
#rsvpForm > * { grid-column: 1 / -1; min-width: 0; }
#rsvpForm > label.field:nth-of-type(1), #rsvpForm > .seg { grid-column: 1; }
#rsvpForm > label.field:nth-of-type(2), #rsvpForm > .stepper-row { grid-column: 2; }
#rsvpForm:has(#paxRow[hidden]) > .seg { grid-column: 1 / -1; }
#rsvpForm > .seg { margin-bottom: .75rem; }
#rsvpForm > .stepper-row { flex-direction: column; align-items: stretch; gap: .2rem; }
#rsvpForm > .stepper-row > span { font-size: .62rem; letter-spacing: .1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#rsvpForm .stepper { justify-content: space-between; }
#rsvpForm .seg span { padding-inline: .2rem; font-size: .82rem; white-space: nowrap; }
#rsvpForm .stepper button { height: 2.300rem; }
/* The RSVP's shooting-star designer: a little night sky with the star falling through it, its tail streaming
   behind and above, and the colours beside it. */
.star-pick { display: grid; gap: .3rem; margin-bottom: .8rem; }
.star-pick-label { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: color-mix(in srgb, var(--ink) 78%, transparent); }
.star-pick-row { display: flex; align-items: center; gap: .6rem; }
.star-preview { position: relative; flex: 1 1 4.500rem; min-width: 4.500rem; height: 2.400rem; overflow: hidden; border-radius: 999px; container-type: inline-size; background: radial-gradient(circle at 20% 30%, rgb(255 255 255 / .5) 0 1px, transparent 1.5px) 0 0 / 1.400rem 1.100rem, linear-gradient(135deg, color-mix(in srgb, var(--accent) 42%, #1D1230), color-mix(in srgb, var(--accent) 22%, #3D2B4E)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent); }
.sp-star { position: absolute; left: 0; top: 0; width: 0; height: 0; animation: sp-fall 2.400s cubic-bezier(.45, 0, .8, .6) infinite; }
.sp-spark { position: absolute; left: -.2rem; top: -.2rem; width: .4rem; height: .4rem; border-radius: 50%; background: var(--star-head); box-shadow: 0 0 .3rem .1rem var(--star-head), 0 0 .8rem .25rem var(--star-glow); }
/* The tail streams back up the way the star came: it ends at the star and points up and to the left (50° above, to match the fall). */
.sp-trail { position: absolute; right: 0; top: -1px; width: 2.400rem; height: 2px; border-radius: 2px; rotate: 50deg; transform-origin: 100% 50%; background: linear-gradient(270deg, var(--star-head), color-mix(in srgb, var(--star-glow) 80%, transparent) 40%, transparent); }
/* Falling down and to the right at 50°, quickening as it goes, then a pause before the next one. */
@keyframes sp-fall { 0% { translate: calc(30cqi - 1rem) -1.200rem; opacity: 0; } 12% { opacity: 1; } 62% { opacity: 1; } 78%, 100% { translate: calc(30cqi + 2.100rem) 2.500rem; opacity: 0; } }
.star-preview.sp-pop .sp-spark { animation: sp-pop .5s ease; }
@keyframes sp-pop { 40% { scale: 2.2; } }
.star-colors { display: flex; flex-wrap: wrap; gap: .3rem; }
.star-dot { position: relative; cursor: pointer; }
.star-dot input { position: absolute; opacity: 0; pointer-events: none; }
.star-dot i { display: block; width: 1.350rem; height: 1.350rem; border-radius: 50%; background: var(--star-glow); transition: box-shadow .2s ease; }
.star-dot input:checked + i { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.500px var(--accent); }
.star-dot input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 3px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .3rem; padding: .3rem; border-radius: 999px; background: var(--soft); margin-bottom: 1rem; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: .6rem .8rem; border-radius: 999px; font-size: .9rem; font-weight: 500; transition: background-color .25s, color .25s; }
.seg input:checked + span { background: var(--accent); color: var(--on-accent); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg.small { margin: 0; min-width: 8rem; }
.seg.small span { padding: .35rem .8rem; }
.stepper-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.stepper-row > span { margin: 0; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.stepper button { min-width: 2.75rem; height: 2.75rem; border: 0; background: none; cursor: pointer; font-size: 1.05rem; border-radius: 999px; }
.stepper button:hover { background: var(--soft); }
.stepper button[disabled] { opacity: .3; cursor: default; }
.stepper output { min-width: 2.4rem; text-align: center; font-weight: 500; font-variant-numeric: tabular-nums; }
#rsvpDone { text-align: center; padding: 1rem 0; }
.tick { width: 3.6rem; height: 3.6rem; margin: 0 auto 1rem; border-radius: 50%; background: var(--accent); position: relative; animation: pop .5s var(--ease); }
.tick::after { content: ""; position: absolute; left: 1.3rem; top: .85rem; width: .8rem; height: 1.5rem; border: solid var(--on-accent); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.done-text { font: 500 1.4rem/1.35 var(--font-display); text-wrap: balance; }

/* ---------- gifts ---------- */
.salam { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5rem 1rem; align-items: center; text-align: center; }
.salam > h3 { grid-column: 1 / -1; margin: 0; }
.salam:has(#qrWrap[hidden]) .bank, .salam:has(#bank[hidden]) .qr { grid-column: 1 / -1; }
.qr { margin: 0 auto; width: min(7.500rem, 30vw, 19svh); }
.salam > .hint { display: none; }
.qr img { width: 100%; border-radius: calc(var(--r) * .6); border: 1px solid var(--line); background: #fff; padding: .5rem; }
.qr .link { display: inline-block; padding: .2rem; font-size: .78rem; }
.bank { text-align: left; }
.bank div { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .35rem 0; border-bottom: 1px solid var(--line); }
/* In the narrow column the copy button shows only its icon. */
.bank div:last-child { border-bottom: 0; padding-bottom: 0; }
.bank dt { font-size: .6rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.bank dd { font-weight: 500; overflow-wrap: anywhere; }
.bank dd.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; font-size: clamp(.800rem, 3.500vw, .95rem); white-space: nowrap; }
/* On narrow phones the QR gives up a little width so the account number fits on one line. */
@media (max-width: 390px) { .qr { width: min(6.400rem, 27vw, 19svh); } .salam { column-gap: .75rem; } }
/* The account number is itself the copy button; it glows for a moment when tapped. */
.acc-hint { display: inline-block; margin-left: .4rem; font-size: .95em; letter-spacing: .06em; text-transform: none; white-space: nowrap; opacity: .85; }
.acc-hint::before { content: "· "; }
.acc-copy { display: inline-flex; align-items: center; gap: .4rem; margin: -.15rem 0 -.15rem -.45rem; padding: .15rem .45rem; border: 0; border-radius: 999px; background: none; font: inherit; letter-spacing: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color .3s ease; }
.acc-copy:hover, .acc-copy:focus-visible { background: color-mix(in srgb, var(--accent) 10%, transparent); outline: 0; }
.acc-copy-icon { display: inline-grid; color: var(--accent); }
.acc-copy-icon svg { width: .9rem; height: .9rem; }
.acc-copy.acc-copied { animation: acc-glow 1.200s ease; }
@keyframes acc-glow { 0%, 30% { background: color-mix(in srgb, var(--accent) 22%, transparent); } 100% { background: transparent; } }
.icon-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .45rem .8rem; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); cursor: pointer; font-size: .8rem; font-weight: 500; text-decoration: none; transition: box-shadow .25s; }
.icon-btn:hover { box-shadow: 0 8px 18px -10px var(--accent); }
.registry { display: grid; gap: .9rem; margin-top: .6rem; padding: .7rem .7rem 1.800rem .7rem; text-align: left; max-height: min(48svh, 27rem); overflow-y: auto; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 50%, transparent) transparent; -webkit-mask: linear-gradient(180deg, #000 86%, transparent); mask: linear-gradient(180deg, #000 86%, transparent); }
.registry li { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); }
.registry .g-body { flex: 1; min-width: 0; }
.registry b { display: block; font: 500 1.2rem/1.25 var(--font-display); }
.registry small { color: var(--muted); font-size: .84rem; display: block; }
.registry .g-actions { display: flex; flex-direction: column; gap: .35rem; align-items: stretch; }
.registry li.taken { opacity: .6; }
.registry li.taken b { text-decoration: line-through; text-decoration-thickness: 1px; }
.registry li.mine { opacity: 1; border-color: var(--accent); }
.registry li.mine b { text-decoration: none; }
.badge { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.btn-sm { min-height: 2.3rem; padding: .35rem 1rem; font-size: .82rem; }

/* ---------- wishes ---------- */
/* The sky of the wishes scene. JS sends the wishes across it a few at a time, like slow shooting stars: each
   has a bright head at its leading corner and a trail pointing back the way it came. */
.wall { position: relative; width: 100vw; height: min(30rem, calc(var(--room) - 5.500rem)); margin: 0 -1.400rem; text-align: left; overflow: hidden; -webkit-mask: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
/* Shooting-star colours a guest can choose for their wish (data-star), Classic being the card's own. */
[data-star] { --star-head: #FFFFFF; --star-glow: color-mix(in srgb, var(--accent2) 80%, #fff); }
[data-star="rose"] { --star-head: #FFE1E9; --star-glow: #FF8FAE; }
[data-star="gold"] { --star-head: #FFF4CF; --star-glow: #F2BE45; }
[data-star="lilac"] { --star-head: #F0E6FF; --star-glow: #B08CFF; }
[data-star="sky"] { --star-head: #E3F4FF; --star-glow: #67BDF8; }
[data-star="mint"] { --star-head: #E2FFF3; --star-glow: #55D6A8; }
[data-star="coral"] { --star-head: #FFE6DA; --star-glow: #FF8A62; }
.star-wish { position: absolute; left: 0; top: 0; width: min(62vw, 17rem); padding: .2rem .4rem; text-shadow: 0 0 .7rem var(--bg), 0 0 .3rem var(--bg), 0 0 .15rem var(--bg); }
.star-wish p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden; font: italic 400 1.080rem/1.45 var(--font-display); overflow-wrap: anywhere; white-space: pre-line; }
.star-wish footer { margin-top: .25rem; font-size: .8rem; }
.star-wish footer b { font-weight: 500; color: var(--accent); overflow-wrap: anywhere; }
.star-wish .spark { position: absolute; top: -.35rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--star-head); box-shadow: 0 0 .35rem .12rem var(--star-head), 0 0 1rem .3rem var(--star-glow); }
.star-wish .trail { position: absolute; top: -.1rem; z-index: -1; width: 7rem; height: 2px; margin-top: -1px; border-radius: 2px; background: linear-gradient(90deg, var(--star-head), color-mix(in srgb, var(--star-glow) 80%, transparent) 35%, transparent); transform-origin: 0 50%; rotate: var(--a); pointer-events: none; }
.to-left .spark { left: -.55rem; }
.to-left .trail { left: -.3rem; }
.to-right .spark { right: -.55rem; }
.to-right .trail { left: calc(100% + .3rem); }
/* With reduced motion the wishes are simply listed, and the sky scrolls. */
.wall.still { display: grid; align-content: start; gap: 1.1rem; padding: .6rem 1.8rem; overflow-y: auto; }
.still .star-wish { position: static; width: auto; }
.still .spark, .still .trail { display: none; }
.wall-empty { margin-inline: 1.400rem; color: var(--muted); font: italic 400 1.15rem/1.5 var(--font-display); text-align: center; padding: 1.5rem 0; }

/* ---------- thanks ---------- */
.thanks-names { font: var(--name-style) 400 clamp(1.900rem, 8.500vw, 3rem)/1.1 var(--font-name); margin: 0 0 .15rem; }
/* The last scene: a hill with the ceremony on its crest, and the words above it. */
.scene-finale { --room: calc(100svh - 3.600rem - 41svh); align-content: start; padding-bottom: 0; overflow: hidden; }
.finale-land { position: absolute; right: 0; bottom: 0; z-index: 1; width: min(100%, 300vw); height: 40svh; overflow: hidden; pointer-events: none; }
/* The flowers on the hill are painted once onto a single canvas, so hundreds of them cost nothing to keep on screen. */
.meadow { position: absolute; bottom: 0; pointer-events: none; }
.finale-hill { position: absolute; right: calc(50vw - max(170vw, 64rem) / 2); bottom: 0; width: max(170vw, 64rem); height: 100%; fill: var(--hill2); }
.ceremony { position: absolute; left: 50%; bottom: 30.800svh; z-index: -1; height: min(17svh, 11rem); translate: -50% 0; fill: var(--sil3); overflow: visible; }
.ceremony .drape { fill: none; stroke: color-mix(in srgb, var(--surface) 80%, var(--accent2)); stroke-width: 3; stroke-linecap: round; }
.ceremony .blooms { fill: color-mix(in srgb, var(--surface) 88%, var(--accent2)); }
.ceremony .blooms circle:nth-child(even) { fill: color-mix(in srgb, var(--scene) 30%, #fff); }
.ceremony .lamps path { fill: none; stroke: var(--sil3); stroke-width: 3; }
.ceremony .lamps circle { fill: #FFD98A; filter: drop-shadow(0 0 6px #FFD98A); animation: twinkle 1.800s ease-in-out infinite alternate; }
.forward { margin-top: .6rem; font: italic 400 1.150rem/1.4 var(--font-display); color: var(--accent); }
/* The ending is kept simple: a few sparkles and butterflies in the sky, a few flowers and two cats on the hill. */
/* Animals that climb the hill to the couple. JS moves them along the hill's curve with the `translate` property,
   which leaves `transform` free for the little bob of their walk. */
.parade { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.parade i { position: absolute; left: 0; bottom: 0; opacity: 0; background: var(--sil3); transition: opacity .6s ease; }
.parade i.here { opacity: 1; }
.parade i.walking { animation: bob .3s ease-in-out infinite alternate; }
.parade i.resting { animation: bob 2.600s ease-in-out infinite alternate; }
/* The couple's names and the closing line sit together just above the arch, and arrive after the lines above. */
.finale-names { --i: 3; position: absolute; left: 0; right: 0; bottom: calc(30.800svh + min(17svh, 11rem) + .5rem); text-shadow: 0 0 .7rem var(--bg), 0 0 .25rem var(--bg); }
.finale-names .ever-after { --i: 4; }
.ever-after { font: italic 400 .95rem/1.3 var(--font-display); color: var(--accent); text-shadow: 0 0 .6rem var(--bg), 0 0 .25rem var(--bg); }
.flutter { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.flutter i { position: absolute; }
.scene-finale .glitter { inset: 0; }
.contacts { display: grid; gap: .7rem; margin: 1rem 0 0; text-align: left; }
.contacts li { display: flex; align-items: center; gap: .8rem; padding: .9rem 1.1rem; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); }
.contacts .c-body { flex: 1; min-width: 0; }
.contacts b { display: block; font: 500 1.2rem/1.25 var(--font-display); }
.contacts small { color: var(--muted); font-size: .84rem; }
.contacts .icon-btn { width: 2.75rem; height: 2.75rem; padding: 0; justify-content: center; }
.foot { position: absolute; left: 0; right: 0; bottom: 5.200rem; color: color-mix(in srgb, var(--ink) 82%, transparent); font-size: .9rem; letter-spacing: .12em; }
.foot-tag::before, .foot-tag::after { content: "✦"; margin: 0 .6em; color: var(--accent2); display: inline-block; animation: sparkle 2.400s ease-in-out infinite; }
.foot-tag::after { animation-delay: 1.2s; }
.foot-credit { margin-top: .5rem; font-size: .72rem; letter-spacing: .14em; opacity: .85; white-space: pre-line; }
.foot-link { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: .25em; transition: text-decoration-color .2s ease; }
.foot-link:hover, .foot-link:focus-visible { text-decoration-color: currentColor; }

/* ---------- floating UI ---------- */
.top-actions { position: fixed; top: max(.9rem, env(safe-area-inset-top)); right: .9rem; z-index: 40; display: flex; gap: .5rem; }
.fab { width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 72%, transparent); backdrop-filter: blur(12px); cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow); }
/* The language switch: BM and EN side by side, with a knob that slides under the one in use. */
.lang-switch { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; align-items: center; width: 5.400rem; height: 2.300rem; padding: .22rem; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--surface) 72%, transparent); backdrop-filter: blur(12px); box-shadow: var(--shadow); cursor: pointer; font: 500 .72rem/1 var(--font-body); letter-spacing: .08em; color: var(--muted); -webkit-tap-highlight-color: transparent; }
.lang-switch span { position: relative; z-index: 1; text-align: center; transition: color .3s ease; }
.lang-knob { position: absolute; top: .22rem; bottom: .22rem; left: .22rem; width: calc(50% - .22rem); border-radius: 999px; background: var(--accent); box-shadow: 0 2px 6px -2px var(--accent); transition: translate .35s var(--ease); }
.lang-switch.is-en .lang-knob { translate: 100% 0; }
.lang-switch:not(.is-en) span:first-of-type, .lang-switch.is-en span:last-of-type { color: var(--on-accent); }
.lang-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 70; pointer-events: none; }
/* The cloud cover over the page as it first loads: a pen-and-ink drawing of two banks of clouds meeting in the
   middle (drawn by JS to the screen's size; until then each half is a plain cover). Both shaded back rows lie
   beneath both front rows. Each half slides off its own side (JS adds .go), and the whole bank is removed once it
   has gone. */
.clouds { --cloud: color-mix(in srgb, var(--surface) 70%, #fff); position: fixed; inset: 0; z-index: 90; overflow: hidden; touch-action: none; } /* it takes every tap and swipe until it has gone */
.cloud-half { position: absolute; inset: 0; transition: translate 2.100s cubic-bezier(.62, .02, .3, 1), opacity .9s ease 1.200s; }
.cloud-half:not(.back)::before { content: ""; position: absolute; top: 0; bottom: 0; background: var(--cloud); }
.cloud-half.l::before { left: 0; right: 50%; }
.cloud-half.r::before { left: 50%; right: 0; }
.cloud-half.r .cloud-sketch { scale: -1 1; }
.cloud-sketch { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cloud-sketch .cl-fill { fill: var(--cloud); }
.cloud-sketch .cl-shade { fill: color-mix(in srgb, var(--surface) 76%, var(--accent2)); }
.cloud-sketch .cl-ink { fill: none; stroke: color-mix(in srgb, var(--ink) 60%, transparent); stroke-width: 1.700; stroke-linecap: round; stroke-linejoin: round; }
.cloud-sketch .cl-ink.cl-again { stroke-width: .9; opacity: .55; }
.cloud-sketch .cl-ink.cl-soft { stroke-width: 1.100; opacity: .5; }
.cloud-sketch .cl-ink.cl-faint { opacity: .3; }
/* The line written across the clouds before they part, in fantasy lettering: each letter comes into focus in turn
   (JS sets --k on each). */
.cloud-tale { position: absolute; left: 0; right: 0; top: 50%; z-index: 2; translate: 0 -60%; margin: 0; padding: 0 1.500rem; text-align: center; font: 400 clamp(1.450rem, 6.600vw, 2.500rem)/1.35 'Cinzel Decorative', var(--font-display); letter-spacing: .02em; text-wrap: balance; color: color-mix(in srgb, var(--ink) 82%, transparent); text-shadow: 0 0 .8rem var(--cloud), 0 0 .3rem var(--cloud); transition: opacity .5s ease; }
.ct-word { display: inline-block; white-space: nowrap; }
.ct-ch { display: inline-block; opacity: 0; filter: blur(5px); translate: 0 .25em; transition: opacity .6s ease, filter .7s ease, translate .7s ease; transition-delay: calc(var(--k) * 70ms); }
.cloud-tale.on .ct-ch { opacity: 1; filter: none; translate: none; }
.clouds.go .cloud-tale { opacity: 0; transition-duration: .35s; }
.clouds.go .cloud-half.l { translate: calc(-50% - 26vmax) 0; opacity: 0; }
.clouds.go .cloud-half.r { translate: calc(50% + 26vmax) 0; opacity: 0; }
/* Pinched in (JS sets .zoomed): the card holds still and the effects that become costly when magnified are
   switched off, so the phone only has to draw the still picture larger. */
.zoomed :is(.journey, .land, .ground, .gate:not(.opening)) *, .zoomed :is(.journey, .land, .ground, .gate:not(.opening)) :is(*::before, *::after), .zoomed .guide { animation-play-state: paused !important; }
.zoomed :is(.journey *, .dock, .top-actions *, .gate *) { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.zoomed .path .doodle svg { filter: none; }
.zoomed .grain, .zoomed .fx { display: none; }
.zoomed .journey { scroll-snap-type: none; }
.dock {
  position: fixed; left: 50%; bottom: max(.8rem, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40;
  display: flex; gap: .15rem; padding: .35rem; border-radius: 999px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 62%, transparent); backdrop-filter: blur(16px) saturate(1.4); box-shadow: var(--shadow);
  max-width: calc(100vw - 1.2rem);
}
.dock a, .dock-music { display: grid; justify-items: center; gap: .1rem; min-width: 3.100rem; padding: .45rem .5rem .35rem; border-radius: 999px; text-decoration: none; font-size: .62rem; letter-spacing: .06em; color: var(--muted); transition: background-color .3s, color .3s; }
.dock a svg, .dock-music svg { width: 1.25rem; height: 1.25rem; }
.dock-music { position: relative; margin-left: .35rem; border: 0; background: none; font-family: inherit; cursor: pointer; }
.dock-music::before { content: ""; position: absolute; left: -.2rem; top: 24%; bottom: 24%; width: 1px; background: var(--line); }
.dock-music.playing { color: var(--accent); }
.dock a.on { background: var(--accent); color: var(--on-accent); }

.sheet { border: 0; padding: 1.6rem 1.4rem calc(1.6rem + env(safe-area-inset-bottom)); width: min(100%, 28rem); max-width: 100%; margin: auto auto 0; border-radius: calc(var(--r) + 8px) calc(var(--r) + 8px) 0 0; background: var(--surface); color: var(--ink); box-shadow: 0 -20px 60px rgb(0 0 0 / .2); }
.sheet[open] { animation: sheet .45s var(--ease); }
.sheet::backdrop { background: rgb(0 0 0 / .4); backdrop-filter: blur(3px); }
@keyframes sheet { from { transform: translateY(100%); } }
@media (min-width: 640px) { .sheet { margin: auto; border-radius: calc(var(--r) + 8px); } @keyframes sheet { from { transform: translateY(24px); opacity: 0; } } }
.sheet h3 { margin-bottom: 1rem; }
.sheet .hint { margin: -.6rem 0 1rem; }
/* In the Reserve a Gift pop-up: where to send the gift, each detail a tap-to-copy button (as the account number). */
.ship { margin: 0 0 1rem; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: calc(var(--r) * .7); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.ship-title { margin-bottom: .4rem; font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.ship-list { display: grid; gap: .5rem; margin: 0; }
.ship-list dt { font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ship-list dd { margin: 0; }
.ship-copy { align-items: flex-start; text-align: left; white-space: pre-line; font-weight: 500; line-height: 1.4; }
.ship-copy .acc-copy-icon { margin-top: .2rem; }
.ship-done { margin: -.4rem 0 1rem; }
#reserveClose { margin-top: .2rem; }
.sheet-close { position: absolute; top: .8rem; right: .9rem; width: 2.5rem; height: 2.5rem; border: 0; background: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); border-radius: 50%; }
.toast { position: fixed; left: 50%; bottom: 6rem; transform: translate(-50%, 1rem); z-index: 80; background: var(--ink); color: var(--bg); padding: .7rem 1.2rem; border-radius: 999px; font-size: .88rem; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s var(--ease); max-width: calc(100vw - 2rem); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- keeping the opening smooth ---------- */
/* While the cover is up, nothing in the card behind it needs to move. */
.locked .journey *, .locked .land * { animation-play-state: paused !important; }

/* ---------- short screens ---------- */
@media (max-height: 780px) {
  body { --turf: 15svh; }
  .scene:not(.scene-finale) { --room: calc(100svh - 3.100rem - var(--turf) - .5rem); padding-top: 3.100rem; padding-bottom: calc(var(--turf) + .5rem); }
  h2 { font-size: clamp(1.600rem, 7vw, 2.200rem); margin: .15rem 0 .5rem; }
  .scene .lede { font-size: .9rem; line-height: 1.5; }
  .eyebrow { font-size: .64rem; }
  .fmap { max-height: 22svh; }
  .facts { gap: .3rem 1rem; margin-top: .5rem; }
  .facts strong { font-size: 1.050rem; }
  .facts span { font-size: .82rem; }
  .btn-row { margin-top: .55rem; gap: .5rem; }
  .btn { min-height: 2.500rem; padding-block: .45rem; }
  .field { margin-bottom: .5rem; }
  .field > span { margin-bottom: .2rem; font-size: .64rem; }
  .field input, .field textarea { min-height: 2.300rem; padding-block: .35rem; }
  #rsvpForm > .seg { margin-bottom: .5rem; }
  .seg span { padding-block: .4rem; }
  .scene .card { margin-top: .6rem; padding: .8rem 1rem; }
  .arch { width: min(46vw, 12rem, 27svh); }
  .names { font-size: clamp(2.400rem, 12vw, 4rem); }
  .cd-number { font-size: 2.300rem; }
  .cd-note { margin-top: .5rem; font-size: .84rem; }
  .flourish { margin-bottom: .6rem; }
  .greeting { font-size: 1.250rem; margin-bottom: .7rem; }
  .hosts { gap: .6rem; margin-bottom: 1rem; }
  .host-group p { margin-top: .35rem; font-size: 1.150rem; }
}
@media (max-height: 640px) {
  .star-pick { gap: .15rem; margin-bottom: .45rem; }
  .star-pick-label { font-size: .62rem; }
  .star-preview { height: 1.900rem; }
  .star-dot i { width: 1.150rem; height: 1.150rem; }
  .scene .cd-card { padding: .9rem .9rem .7rem 1.500rem; margin-bottom: .7rem; }
  .cd-number { font-size: 1.900rem; }
  .cd-row small { font-size: .82rem; }
  .cd-note { margin-top: .35rem; font-size: .78rem; line-height: 1.4; }
  .flourish { margin-bottom: .4rem; }
  .thanks-names { font-size: 1.600rem; }
  .ever-after { font-size: .84rem; }
  .scene:not(.scene-finale) { --room: calc(100svh - 2.800rem - var(--turf) - .3rem); padding-top: 2.800rem; padding-bottom: calc(var(--turf) + .3rem); }
  h2 { font-size: 1.450rem; margin-bottom: .35rem; }
  .scene .lede { font-size: .84rem; line-height: 1.4; }
  .fmap { max-height: 19svh; }
  .fmap-pin { gap: .1rem; }
  .fmap-pin i { width: 1.100rem; height: 1.100rem; }
  .fmap-pin b { padding: .1rem .55rem; font-size: .8rem; }
  .fmap-compass { top: .45rem; right: .45rem; width: 1.700rem; }
  .facts span { display: none; }
  .qr { width: min(6rem, 26vw, 19svh); }
  .field input, .field textarea { min-height: 2.100rem; }
  .btn { min-height: 2.300rem; }
  .arch { width: min(40vw, 10rem, 24svh); }
  /* The two families stand side by side when there is no room to stack them. */
  .hosts:has(em) { grid-template-columns: 1fr auto 1fr; align-items: start; gap: .4rem; }
  .hosts:has(em) em { margin-top: 1.400rem; }
  .host-group p { font-size: 1.050rem; }
  .host-group p > span:not(.wd) { font-size: .76rem; }
}

/* ---------- hand-drawn corner flowers ---------- */
/* Every box carries a flower at its top-left corner and a second at its bottom-right. ::before is the wash of
   colour in the petals, ::after the pen lines; both reach a little beyond the box so the flowers sit on its edge. */
.card, .path .stop, .registry li, .contacts li, .wish { position: relative; --fa: 3.600rem; --fb: 2.900rem; }
.path .stop, .registry li, .contacts li, .wish { --fa: 2.500rem; --fb: 2.100rem; }
:is(.card, .path .stop, .registry li, .contacts li, .wish)::before,
:is(.card, .path .stop, .registry li, .contacts li, .wish)::after { content: ""; position: absolute; inset: -.5rem; z-index: 1; pointer-events: none; }
:is(.card, .path .stop, .registry li, .contacts li, .wish)::before {
  background: linear-gradient(135deg, color-mix(in srgb, var(--scene) 34%, #fff) 50%, color-mix(in srgb, var(--accent2) 70%, #fff) 50%);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.045' numOctaves='2' seed='7'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='3.2'/%3E%3C/filter%3E%3Cg filter='url(%23w)' fill='%23000'%3E%3Cellipse cx='38' cy='22' rx='9.5' ry='13' transform='rotate(0 38 38)'/%3E%3Cellipse cx='38' cy='22' rx='9.5' ry='13' transform='rotate(72 38 38)'/%3E%3Cellipse cx='38' cy='22' rx='9.5' ry='13' transform='rotate(144 38 38)'/%3E%3Cellipse cx='38' cy='22' rx='9.5' ry='13' transform='rotate(216 38 38)'/%3E%3Cellipse cx='38' cy='22' rx='9.5' ry='13' transform='rotate(288 38 38)'/%3E%3Cellipse cx='82' cy='19' rx='7' ry='9.5' transform='rotate(38 82 19)'/%3E%3C/g%3E%3C/svg%3E") left top / var(--fa) no-repeat, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.045' numOctaves='2' seed='7'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='3.2'/%3E%3C/filter%3E%3Cg filter='url(%23w)' fill='%23000'%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(0 62 62)'/%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(60 62 62)'/%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(120 62 62)'/%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(180 62 62)'/%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(240 62 62)'/%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(300 62 62)'/%3E%3C/g%3E%3C/svg%3E") right bottom / var(--fb) no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.045' numOctaves='2' seed='7'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='3.2'/%3E%3C/filter%3E%3Cg filter='url(%23w)' fill='%23000'%3E%3Cellipse cx='38' cy='22' rx='9.5' ry='13' transform='rotate(0 38 38)'/%3E%3Cellipse cx='38' cy='22' rx='9.5' ry='13' transform='rotate(72 38 38)'/%3E%3Cellipse cx='38' cy='22' rx='9.5' ry='13' transform='rotate(144 38 38)'/%3E%3Cellipse cx='38' cy='22' rx='9.5' ry='13' transform='rotate(216 38 38)'/%3E%3Cellipse cx='38' cy='22' rx='9.5' ry='13' transform='rotate(288 38 38)'/%3E%3Cellipse cx='82' cy='19' rx='7' ry='9.5' transform='rotate(38 82 19)'/%3E%3C/g%3E%3C/svg%3E") left top / var(--fa) no-repeat, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.045' numOctaves='2' seed='7'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='3.2'/%3E%3C/filter%3E%3Cg filter='url(%23w)' fill='%23000'%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(0 62 62)'/%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(60 62 62)'/%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(120 62 62)'/%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(180 62 62)'/%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(240 62 62)'/%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(300 62 62)'/%3E%3C/g%3E%3C/svg%3E") right bottom / var(--fb) no-repeat;
}
:is(.card, .path .stop, .registry li, .contacts li, .wish)::after {
  background: color-mix(in srgb, var(--ink) 80%, transparent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.045' numOctaves='2' seed='7'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='3.2'/%3E%3C/filter%3E%3Cg filter='url(%23w)' fill='none' stroke='%23000' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='38' cy='22' rx='9.5' ry='13' transform='rotate(0 38 38)'/%3E%3Cellipse cx='38' cy='22' rx='9.5' ry='13' transform='rotate(72 38 38)'/%3E%3Cellipse cx='38' cy='22' rx='9.5' ry='13' transform='rotate(144 38 38)'/%3E%3Cellipse cx='38' cy='22' rx='9.5' ry='13' transform='rotate(216 38 38)'/%3E%3Cellipse cx='38' cy='22' rx='9.5' ry='13' transform='rotate(288 38 38)'/%3E%3Cellipse cx='82' cy='19' rx='7' ry='9.5' transform='rotate(38 82 19)'/%3E%3Ccircle cx='38' cy='38' r='5'/%3E%3Cpath d='M36 37l1 .5M40 36l.5 1M38 41l.5 .5'/%3E%3Cpath d='M36 52C31 68 20 78 6 95M46 31C58 23 66 22 76 22M24 71c-12-2-18 4-20 12 10 2 18-2 20-12ZM58 23c2-10 10-14 18-14 0 8-6 14-18 14ZM13 85c-8-4-10 4-4 6'/%3E%3C/g%3E%3C/svg%3E") left top / var(--fa) no-repeat, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.045' numOctaves='2' seed='7'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='3.2'/%3E%3C/filter%3E%3Cg filter='url(%23w)' fill='none' stroke='%23000' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(0 62 62)'/%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(60 62 62)'/%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(120 62 62)'/%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(180 62 62)'/%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(240 62 62)'/%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(300 62 62)'/%3E%3Ccircle cx='62' cy='62' r='4'/%3E%3Cpath d='M70 72C80 78 88 86 95 97M52 70C42 82 28 88 9 91M34 82c-4-10-12-12-20-10 2 8 10 12 20 10ZM86 84c8-2 10-10 8-16-6 2-10 8-8 16Z'/%3E%3C/g%3E%3C/svg%3E") right bottom / var(--fb) no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.045' numOctaves='2' seed='7'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='3.2'/%3E%3C/filter%3E%3Cg filter='url(%23w)' fill='none' stroke='%23000' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='38' cy='22' rx='9.5' ry='13' transform='rotate(0 38 38)'/%3E%3Cellipse cx='38' cy='22' rx='9.5' ry='13' transform='rotate(72 38 38)'/%3E%3Cellipse cx='38' cy='22' rx='9.5' ry='13' transform='rotate(144 38 38)'/%3E%3Cellipse cx='38' cy='22' rx='9.5' ry='13' transform='rotate(216 38 38)'/%3E%3Cellipse cx='38' cy='22' rx='9.5' ry='13' transform='rotate(288 38 38)'/%3E%3Cellipse cx='82' cy='19' rx='7' ry='9.5' transform='rotate(38 82 19)'/%3E%3Ccircle cx='38' cy='38' r='5'/%3E%3Cpath d='M36 37l1 .5M40 36l.5 1M38 41l.5 .5'/%3E%3Cpath d='M36 52C31 68 20 78 6 95M46 31C58 23 66 22 76 22M24 71c-12-2-18 4-20 12 10 2 18-2 20-12ZM58 23c2-10 10-14 18-14 0 8-6 14-18 14ZM13 85c-8-4-10 4-4 6'/%3E%3C/g%3E%3C/svg%3E") left top / var(--fa) no-repeat, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.045' numOctaves='2' seed='7'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='3.2'/%3E%3C/filter%3E%3Cg filter='url(%23w)' fill='none' stroke='%23000' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(0 62 62)'/%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(60 62 62)'/%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(120 62 62)'/%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(180 62 62)'/%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(240 62 62)'/%3E%3Cpath d='M62 60q8-15 0-28q-8 13 0 28Z' transform='rotate(300 62 62)'/%3E%3Ccircle cx='62' cy='62' r='4'/%3E%3Cpath d='M70 72C80 78 88 86 95 97M52 70C42 82 28 88 9 91M34 82c-4-10-12-12-20-10 2 8 10 12 20 10ZM86 84c8-2 10-10 8-16-6 2-10 8-8 16Z'/%3E%3C/g%3E%3C/svg%3E") right bottom / var(--fb) no-repeat;
}

/* ---------- text that arrives with a flourish ---------- */
/* JS wraps headings letter by letter (.ch inside .w, so words never break) and longer text word by word (.wd).
   --k is the position in the text; --i is the turn of a line inside a scene whose lines arrive one after another.
   Letters start a little above or below the line, tilted and small, and spring into place. */
.w { display: inline-block; white-space: nowrap; }
.ch, .wd { display: inline-block; opacity: 0; transition: opacity .5s ease, transform .75s cubic-bezier(.2, 1.5, .4, 1); transition-delay: calc(var(--i, 0) * .5s + var(--k) * 34ms); }
.ch { transform: translateY(.6em) rotate(12deg) scale(.6); }
.ch:nth-child(even) { transform: translateY(-.45em) rotate(-10deg) scale(.6); }
.wd { transform: translateY(.55em) rotate(-2deg); transition-delay: calc(var(--i, 0) * .5s + .15s + var(--k) * 24ms); }
.rv.in .ch, .rv.in .wd, .seen .seq .ch, .seen .seq .wd, .seen .finale-names .ch, .seen .finale-names .wd { opacity: 1; transform: none; }

/* ---------- motion ---------- */
.rv { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .rv { opacity: 1; transform: none; }
  .scene-inner { transform: none; opacity: 1; }
  .seq > *, .seq .hosts > * { opacity: 1; transform: none; }
  .ch, .wd { opacity: 1; transform: none; }
  .gate.opening .env-letter, .gate.opening .env-flap { transition-delay: 0s; }
}
