@font-face { font-family: Quill; src: url(/assets/fonts/pinyon.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: Note; src: url(/assets/fonts/caveat.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: Brush; src: url(/assets/fonts/kalam.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Brush; src: url(/assets/fonts/kalam-bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --violet: #2f0b7c; --deep: #1a0638; --night: #0b0416; --magenta: #b23ac8; --plum: #9120ad;
  --gold: #d9a521; --gold-d: #bb8a24; --ink-gold: #7a560f; --paper: #f1e9f6; --white: #fffaf3;
  --tape-h: 34px;
}
* { box-sizing: border-box; }
html { background: var(--night); color: var(--white); scroll-behavior: smooth; }
html.film { scroll-behavior: auto; }
body { margin: 0; font-family: Brush, 'Comic Sans MS', cursive; overflow-x: hidden; }
img { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the two hands: the white quill for the blurb's lines, loose gold for the notes */
.q { font-family: Quill, cursive; font-weight: 400; color: var(--white); margin: 0; line-height: 1.12;
  font-size: clamp(32px, 3.7vw, 64px); text-shadow: 0 2px 18px rgba(11, 4, 22, .75); }
.q .k { font-size: 1.3em; }
.q.small { font-size: clamp(26px, 2.7vw, 46px); }
.n { font-family: Note, cursive; font-weight: 600; color: var(--gold); margin: 0; line-height: 1.05;
  font-size: clamp(22px, 2.1vw, 36px); text-shadow: 0 1px 12px rgba(11, 4, 22, .8); }
.n .k { font-family: Brush; font-weight: 700; font-size: 1.55em; line-height: .9; }
.b { font-family: Brush; font-weight: 700; color: var(--gold); margin: 0; line-height: 1.05;
  font-size: clamp(34px, 4.4vw, 76px); text-shadow: 0 2px 20px rgba(11, 4, 22, .7); }
.b .k { font-size: 1.45em; }
.w .r { display: block; }
/* a line writes itself on: the mask runs left to right with --w, row by row */
html.film .w .r { -webkit-mask-image: linear-gradient(90deg, #000 calc(var(--w, 0) * 112% - 12%), transparent calc(var(--w, 0) * 112%));
  mask-image: linear-gradient(90deg, #000 calc(var(--w, 0) * 112% - 12%), transparent calc(var(--w, 0) * 112%)); }

.skip, .buy-mini { position: fixed; z-index: 40; top: 14px; font-family: Note; font-weight: 600; font-size: 20px; color: var(--gold);
  text-decoration: none; padding: 6px 14px; border-radius: 999px; transition: opacity .4s; }
.skip { left: 14px; opacity: .75; }
.skip:hover, .skip:focus { opacity: 1; }
.buy-mini { right: 14px; border: 1.5px solid var(--gold); background: rgba(26, 6, 56, .55); backdrop-filter: blur(4px); }
.buy-mini:hover, .buy-mini:focus { background: var(--gold); color: var(--night); }
.buy-mini.gone { opacity: 0; pointer-events: none; }
.btn { display: inline-block; font-family: Note; font-weight: 700; font-size: clamp(22px, 1.9vw, 30px); color: var(--night);
  background: var(--gold); padding: 10px 26px 12px; border-radius: 999px; text-decoration: none; box-shadow: 0 6px 30px rgba(217, 165, 33, .35); }
.btn:hover, .btn:focus-visible { background: #f0bd34; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- the film: one sticky stage ---------- */
#film { position: relative; }
html.film #film { height: calc(18.6 * 100vh); }
#stage { position: relative; }
html.film #stage { position: sticky; top: 0; height: 100vh; overflow: hidden; background: var(--night); }
html.film .sc, html.film #hall, html.film #bk, html.film #flat, html.film #leads, html.film #strip { position: absolute; inset: 0; }
html.film .still-only { display: none !important; }
html:not(.film) #bk, html:not(.film) #flat, html:not(.film) #leads, html:not(.film) .thread, html:not(.film) .ink,
html:not(.film) .love, html:not(.film) .s2-husband, html:not(.film) .s3-looking, html:not(.film) .guests .gr,
html:not(.film) .s3-chand { display: none; }

#hall img { width: 100%; height: 100%; object-fit: cover; }
html.film #hall { opacity: 0; will-change: opacity, transform, filter; }
html.film #hall::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 60%, transparent 30%, rgba(11, 4, 22, .85) 100%); }

/* 1 */
#s1 { background: radial-gradient(ellipse at 50% 45%, rgba(145, 32, 173, .25), transparent 65%); }
.s1-a, .s1-b { position: absolute; left: 0; right: 0; text-align: center; z-index: 6; }
.s1-a { top: 7vh; } .s1-b { top: calc(7vh + 1.3em); }
.s1-a .r, .s1-b .r { display: inline-block; }
#bk { z-index: 4; pointer-events: none; }
#bk .bk-in { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
#bk img { width: 100%; height: 100%; object-fit: contain; }
html:not(.film) #bk { display: none; }
#flat { z-index: 5; pointer-events: none; opacity: 0; transform-origin: 0 0; inset: auto; left: 0; top: 0; width: 1000px; height: 1608px; }
#flat > * { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
#flat .f-couple, #flat .f-type, #flat .f-cover { opacity: 0; }
/* at the second chance the cover stands in the dark hall; its sides melt away until the reveal */
#flat { -webkit-mask-image: linear-gradient(90deg, transparent, #000 calc(var(--fe, 0) * 18%), #000 calc(100% - var(--fe, 0) * 18%), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 calc(var(--fe, 0) * 18%), #000 calc(100% - var(--fe, 0) * 18%), transparent); }
.f-loop { overflow: visible; }
.f-loop path, .thread path, .love path, .ink path, .own-arrow path { fill: none; stroke: var(--gold); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.f-loop path { stroke-width: 2; }
.thread path { stroke-width: 2.2; filter: drop-shadow(0 0 3px rgba(217, 165, 33, .6)); }
html.film .f-loop path, html.film .thread path, html.film .love path, html.film .ink path { stroke-dasharray: 1 1; stroke-dashoffset: 1; }

/* 2 and 3 sit side by side; the camera pans from one to the other */
html.film #strip { z-index: 3; opacity: 0; width: 200vw; right: auto; will-change: transform; }
html.film #s2 { right: auto; width: 100vw; } html.film #s3 { left: 100vw; right: auto; width: 100vw; }
.wall { position: absolute; inset: 0; background: radial-gradient(ellipse 55% 75% at 52% 45%, #6a2bab, #3a1178 45%, #1a0640 80%, var(--night)); }
#s3 .wall { background: radial-gradient(ellipse 60% 75% at 55% 45%, #5d2699, #300e66 45%, #170536 80%, var(--night)); }
.thread { position: absolute; left: 0; top: 0; width: 200vw; height: 100vh; z-index: 3; overflow: visible; }
.s2-window { position: absolute; left: 57vw; top: 5vh; height: 80vh; width: auto; filter: drop-shadow(0 0 40px rgba(178, 58, 200, .45)); }
.s2-light { position: absolute; left: 40vw; right: 0; bottom: 0; height: 30vh; background: radial-gradient(ellipse 50% 60% at 50% 100%, rgba(178, 58, 200, .38), transparent 70%); }
.s2-matilda { position: absolute; left: 30vw; bottom: 3vh; height: 84vh; width: auto; }
.s2-husband { position: absolute; left: 49.5vw; bottom: 3vh; height: 88vh; width: auto; opacity: 0; filter: blur(.5px) brightness(4.5) saturate(.4) sepia(.4) hue-rotate(220deg); mix-blend-mode: screen; }
.s2-a { position: absolute; left: 5vw; top: 12vh; }
.s2-b { position: absolute; left: 12vw; top: 22vh; }
.s2-widow { position: absolute; left: 13vw; top: 32vh; }
.s2-needle { position: absolute; left: 10vw; top: 55vh; }
.s2-never { position: absolute; left: 74vw; top: 64vh; }
.s2-never .k { font-size: 1.9em; text-decoration: underline double; text-decoration-thickness: 2px; text-underline-offset: .12em; }
.ink { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 5; }
.sc .q, .sc .n, .sc .b, .sc .btn { z-index: 6; }

.s3-window { position: absolute; left: 62vw; top: 8vh; height: 62vh; width: auto; filter: drop-shadow(0 0 30px rgba(178, 58, 200, .4)); }
.s3-light { position: absolute; left: 40vw; right: 0; bottom: 0; height: 30vh; background: radial-gradient(ellipse 45% 60% at 60% 100%, rgba(178, 58, 200, .3), transparent 70%); }
.s3-chand { position: absolute; left: calc(50vw - 11vh); top: -46vh; width: 22vh; height: auto; }
.s3-glow { position: absolute; left: calc(50vw - 40vh); top: -76vh; width: 80vh; height: 80vh; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, rgba(255, 228, 160, .95), rgba(217, 165, 33, .45) 30%, transparent 68%); }
html:not(.film) .s3-glow { display: none; }
#paperfade { z-index: 7; opacity: 0; pointer-events: none; background: radial-gradient(ellipse at 30% 0%, #fbf6ff, var(--paper) 55%, #e4d6ee); }
html:not(.film) #paperfade { display: none; }
html.film #paperfade { position: absolute; inset: 0; }
.s3-shelf { position: absolute; bottom: 0; height: 92vh; width: auto; will-change: transform; }
.s3-shelf-l { left: -6vw; } .s3-shelf-r { right: -14vw; transform: scaleX(-1); }
.s3-greg { position: absolute; left: 29vw; bottom: 3vh; height: 66vh; width: auto; }
.s3-looking { opacity: 0; }
.s3-a { position: absolute; left: 25vw; top: 9vh; }
.s3-decade { position: absolute; left: 78vw; top: 27vh; }
.s3-marry { position: absolute; left: 60vw; top: 30vh; }
.s3-deb { position: absolute; left: 7vw; top: 80vh; }

/* 4 */
html.film #s4 { z-index: 3; opacity: 0; }
.s4-chand { position: absolute; top: -2vh; width: 22vh; height: auto; filter: drop-shadow(0 0 22px rgba(255, 210, 120, .5)); }
.s4-chand.c1 { left: calc(18vw - 11vh); } .s4-chand.c2 { left: calc(50vw - 11vh); } .s4-chand.c3 { left: calc(82vw - 11vh); }
.glitter { position: absolute; inset: 0; background-image: radial-gradient(1.5px 1.5px at 20% 30%, #ffe9a8, transparent), radial-gradient(1px 1px at 70% 20%, #fff, transparent), radial-gradient(1.5px 1.5px at 45% 12%, #ffe9a8, transparent), radial-gradient(1px 1px at 85% 35%, #fff, transparent), radial-gradient(1.5px 1.5px at 10% 15%, #fff, transparent);
  background-size: 300px 220px; opacity: .55; animation: twinkle 3s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .25; } to { opacity: .7; } }
.guests { position: absolute; left: 0; right: 0; bottom: 0; height: 60vh; }
.guests img { position: absolute; bottom: 2vh; height: 100%; width: auto; left: 50%; transform: translateX(-50%); will-change: transform; }
.g-back { height: 50vh; bottom: 7vh; filter: brightness(0) invert(.08) sepia(1) hue-rotate(230deg) saturate(3); opacity: .9; }
html.film .guests .gl { clip-path: inset(0 50% 0 0); } html.film .guests .gr { clip-path: inset(0 0 0 50%); }
.s4-a { position: absolute; left: 0; right: 0; top: 23vh; text-align: center; }
.s4-a .r { display: inline-block; }
.s4-cous { position: absolute; left: 80vw; top: 33vh; }
.s4-not .r { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .15em; }
.s4-not { position: absolute; left: 62vw; top: 22vh; font-size: clamp(26px, 2.6vw, 44px); }
.s4-very { position: absolute; left: 14vw; top: 22vh; font-size: clamp(26px, 2.6vw, 44px); }
.s4-quiet { position: absolute; left: 42vw; top: 50vh; text-align: center; }
.s4-greg, .s4-mat { height: 70vh; width: auto; position: absolute; bottom: 3vh; }
.s4-greg { left: 12vw; } .s4-mat { right: 10vw; }

/* the leading pair, carried from the ballroom into the windows */
#leads { z-index: 6; pointer-events: none; }
html.film #leads .ld { position: absolute; left: 0; top: 0; width: auto; opacity: 0; transform-origin: 0 0; will-change: transform, opacity; }
#leads .ghost { filter: blur(.6px) brightness(4.5) saturate(.4) sepia(.4) hue-rotate(220deg); mix-blend-mode: screen; }

/* 5 */
html.film #s5 { z-index: 7; }
.s5-a { position: absolute; left: 5vw; bottom: 20vh; }
.s5-b { position: absolute; left: 5vw; bottom: 9vh; }
.s5-c { position: absolute; right: 5vw; top: 34vh; text-align: right; }
.s5-twice { position: absolute; left: 0; right: 0; top: 6vh; text-align: center; }
.s5-twice .r { display: inline-block; }
.love { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.love .ellipse { stroke-width: 3.5; filter: drop-shadow(0 0 6px rgba(217, 165, 33, .7)); }

/* 6 */
html.film #s6 { z-index: 8; pointer-events: none; }
html.film #s6 .btn { pointer-events: auto; }
.s6-q { position: absolute; left: 5vw; bottom: 14vh; }
.s6-btn { position: absolute; right: 8vw; bottom: 14vh; }
html.film .s6-btn { opacity: 0; transform: translateY(16px); }

/* ---------- the calm page ---------- */
.paper { position: relative; color: var(--deep); background: radial-gradient(ellipse at 30% 0%, #fbf6ff, var(--paper) 55%, #e4d6ee);
  box-shadow: inset 0 0 0 10px #f1e9f6, inset 0 0 0 11.5px rgba(187, 138, 36, .55); padding: 9vh 6vw calc(var(--tape-h) + 40px); }
.paper-in { display: grid; grid-template-columns: minmax(260px, 5fr) 7fr; gap: 5vw; align-items: center; max-width: 1240px; margin: 0 auto; }
.own-book { position: relative; }
#bk2 { position: relative; height: min(72vh, 640px); }
#bk2 img { width: 100%; height: 100%; object-fit: contain; }
.own-note { position: absolute; right: -2vw; top: -4vh; color: var(--ink-gold); text-shadow: none; font-size: clamp(20px, 1.7vw, 28px); transform: rotate(-4deg); }
.own-arrow { position: absolute; right: 2vw; top: 1vh; width: 110px; height: 80px; transform: rotate(-8deg); }
.own-arrow path { stroke: var(--gold-d); stroke-width: 2.5; }
.own-copy h2 { color: var(--violet); text-shadow: none; font-size: clamp(38px, 4vw, 66px); margin-bottom: .3em; }
.blurb p { font-family: Brush; font-size: clamp(17px, 1.3vw, 20px); line-height: 1.6; color: #4a2a0a; margin: 0 0 1em; }
.date { font-family: Note; font-weight: 700; font-size: clamp(24px, 2vw, 32px); color: var(--ink-gold); margin: .4em 0; }
.cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0; }
.btn.is-waiting { cursor: default; }
.wait { font-family: Note; font-size: 20px; color: #6a4f86; }
.author { display: flex; flex-direction: column; align-items: center; margin: 12vh auto 6vh; text-align: center; }
.author img { width: min(240px, 50vw); height: auto; border-radius: 50% 50% 46% 46% / 36% 36% 30% 30%; filter: sepia(.25) saturate(.8) hue-rotate(-10deg);
  box-shadow: 0 0 0 4px var(--paper), 0 0 0 5.5px rgba(187, 138, 36, .7); }
.author .n { color: var(--ink-gold); text-shadow: none; margin-top: 18px; }
.author .q { color: var(--violet); text-shadow: none; }
footer p { text-align: center; font-family: Note; font-size: 18px; color: #6a4f86; margin: 0; }

/* ---------- the still version: no JavaScript, or reduced motion ---------- */
html:not(.film) .sc { position: relative; min-height: 100vh; overflow: hidden; }
html:not(.film) #s1 { background: radial-gradient(ellipse at 50% 50%, #4a1170, var(--night)); }
html:not(.film) .s1-cover img { position: absolute; left: 50%; top: 56%; height: 62vh; width: auto; transform: translate(-50%, -50%); box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
html:not(.film) .s1-cover { margin: 0; }
html:not(.film) #hall { display: none; }
html:not(.film) #strip { position: relative; }
html:not(.film) #s4 { background: url(/assets/art/hall.webp) center / cover; }
html:not(.film) .s4-chand { display: none; }
html:not(.film) .s4-a { top: 8vh; }
html:not(.film) #s5 { background: var(--night); }
html:not(.film) .s5-still, html:not(.film) .s6-cover { margin: 0; position: absolute; inset: 0; }
html:not(.film) .s5-still img { height: 100%; width: auto; margin: 0 auto; opacity: .85; }
html:not(.film) .s6-cover img { position: absolute; left: 50%; top: 45%; height: 60vh; width: auto; transform: translate(-50%, -50%); }
html:not(.film) .s5-a, html:not(.film) .s5-b, html:not(.film) .s5-c { z-index: 6; }

/* ---------- phones ---------- */
@media (max-aspect-ratio: 4/5) {
  .q { font-size: clamp(28px, 8.4vw, 46px); }
  .q.small { font-size: clamp(22px, 6.4vw, 34px); }
  .n { font-size: clamp(19px, 5.4vw, 28px); }
  .b { font-size: clamp(30px, 9vw, 50px); }
  .skip { font-size: 16px; } .buy-mini { font-size: 17px; padding: 4px 12px; }
  .s1-a, .s1-b { font-size: 6.6vw; } .s1-a { top: 10vh; } .s1-b { top: calc(10vh + 1.4em); }
  .s2-window { left: 58vw; top: 26vh; height: 50vh; }
  .s2-matilda { left: -2vw; height: 66vh; }
  .s2-husband { left: 40vw; height: 69vh; }
  .s2-a { left: 6vw; top: 8vh; } .s2-b { left: 40vw; top: 15vh; }
  .s2-widow { left: 64vw; top: 19vh; }
  .s2-needle { left: 50vw; top: 80vh; }
  .s2-never { left: 6vw; top: 9vh; }
  .s3-window { left: 50vw; top: 22vh; height: 40vh; }
  .s3-shelf { height: 64vh; } .s3-shelf-l { left: -46vw; } .s3-shelf-r { right: -52vw; }
  .s3-greg { left: -6vw; height: 40vh; bottom: 4vh; }
  .s3-a { left: 6vw; top: 8vh; }
  .s3-decade { left: 64vw; top: 15vh; }
  .s3-marry { left: 6vw; top: 37vh; }
  .s3-deb { left: 6vw; top: 27.5vh; }
  .s4-chand { width: 16vh; } .s4-chand.c1 { left: calc(10vw - 8vh); } .s4-chand.c2 { left: calc(50vw - 8vh); } .s4-chand.c3 { left: calc(90vw - 8vh); }
  .guests { height: 42vh; } .g-back { height: 36vh; bottom: 6vh; }
  .s4-a { top: 9vh; padding: 0 6vw; } .s4-a .r { display: block; }
  .s4-cous { left: 50vw; top: 35vh; }
  .s4-not { left: 54vw; top: 29vh; } .s4-very { left: 4vw; top: 21vh; }
  .s4-quiet { left: 30vw; top: 41vh; }
  .s4-greg, .s4-mat { height: 46vh; }
  .s5-a { left: 6vw; right: 6vw; top: 8vh; bottom: auto; }
  .s5-b { left: 6vw; top: 8vh; bottom: auto; }
  .s5-c { left: 6vw; right: auto; top: 8vh; text-align: left; }
  .s5-twice { top: 7vh; padding: 0 5vw; }
  .s6-q { left: 6vw; right: 6vw; top: 8vh; bottom: auto; }
  .s6-btn { right: auto; left: 50%; bottom: calc(var(--tape-h) + 4vh); transform: translateX(-50%); white-space: nowrap; }
  html.film .s6-btn { transform: translate(-50%, 16px); }
  .paper-in { grid-template-columns: 1fr; }
  #bk2 { height: 50vh; }
  .own-note { right: 0; top: -5vh; } .own-arrow { display: none; }
}

/* ---------- concept tape ---------- */
.tape { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: var(--tape-h); display: flex; align-items: center; gap: 8px;
  padding: 0 8px env(safe-area-inset-bottom); background: repeating-linear-gradient(-45deg, rgba(250, 204, 21, .92) 0 18px, rgba(17, 17, 17, .9) 18px 22px);
  font: 600 12px/1 system-ui, sans-serif; color: #111; pointer-events: none; }
.tape-run { flex: 1; overflow: hidden; background: rgba(250, 204, 21, .95); height: 22px; display: flex; align-items: center; border-radius: 3px; }
.tape-track { display: flex; white-space: nowrap; animation: tape 40s linear infinite; }
.tape-track span { padding: 0 1.2em; letter-spacing: .04em; text-transform: uppercase; }
.tape.paused .tape-track { animation-play-state: paused; }
@keyframes tape { to { transform: translateX(-50%); } }
.tape-pause { pointer-events: auto; width: 26px; height: 22px; border: 0; border-radius: 3px; background: #111; color: #facc15; display: grid; place-items: center; cursor: pointer; }
.tape-cta { pointer-events: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #111; color: #facc15; text-decoration: none;
  height: 26px; padding: 0 10px; border-radius: 4px; font-size: 11px; line-height: 1.05; white-space: nowrap; }
.tape-cta small { font-size: 9px; font-weight: 500; color: #fff; }
@media (prefers-reduced-motion: reduce) { .tape-track { animation: none; } .glitter { animation: none; } }
