/* ============================================================
   HESHAN & SAMADEI — "WRITTEN IN THE STARS"
   A night-sky storybook: a live starfield, the film seen through a golden portal on
   wide screens, chapters joined as a constellation, script lettering, gold sparkle.
   Same film, same clips, same order — a different world around them.
   ============================================================ */

/* ---------- Fonts (self-hosted, latin, OFL) ---------- */
@font-face { font-family: 'Great Vibes'; src: url('assets/fonts/great-vibes-latin.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('assets/fonts/jost-latin.woff2') format('woff2'); font-weight: 200 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('assets/fonts/jost-italic-latin.woff2') format('woff2'); font-weight: 200 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('assets/fonts/cormorant-garamond-latin.woff2') format('woff2'); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('assets/fonts/cormorant-garamond-italic-latin.woff2') format('woff2'); font-weight: 300 700; font-style: italic; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --night: #070B1A;
  --night-2: #0C1230;
  --violet: #241B4D;
  --moon: #F4EFE3;
  --moon-soft: #C9C4BA;
  --mist: #8A8AA3;
  --star: #FFE29A;
  --gold: #D9B45C;
  --gold-deep: #B08D3A;
  --rose: #E6A4B4;
  --line: rgba(217, 180, 92, 0.35);
  --line-soft: rgba(244, 239, 227, 0.14);
  --font-script: 'Great Vibes', 'Snell Roundhand', 'Brush Script MT', cursive;
  --font-serif: 'Cormorant Garamond', Garamond, 'Times New Roman', serif;
  --font-sans: 'Jost', 'Avenir Next', 'Helvetica Neue', Arial, sans-serif;
  --max-w: 1120px;
  --portal-w: 50vh;    /* the arch the film is seen through on wide screens */
  --portal-h: 88vh;
  --portal-top: 6vh;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: radial-gradient(120% 70% at 50% -10%, var(--violet) 0%, var(--night-2) 45%, var(--night) 100%) fixed, var(--night);
  color: var(--moon); font-family: var(--font-sans); font-weight: 300; font-size: 1.05rem; line-height: 1.7;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg, canvas, video { max-width: 100%; display: block; }
a { color: var(--star); }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.wrap { max-width: var(--max-w); margin: 0 auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 300; background: var(--gold); color: var(--night); padding: 0.7rem 1.1rem; border-radius: 4px; transition: top 0.2s; font-weight: 500; text-decoration: none; }
.skip-link:focus { top: 1rem; }
.amp { font-family: var(--font-script); font-weight: 400; color: var(--gold); }
.muted { color: var(--mist); }
.draft { font-style: italic; color: var(--rose); }

/* the sky sits under everything; the page content is opaque so it only shows around the film */
#sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#main, .site-footer { position: relative; z-index: 40; background: linear-gradient(180deg, rgba(7, 11, 26, 0.92), var(--night) 30%); }

/* ---------- Type ---------- */
.whisper { font-family: var(--font-sans); font-weight: 400; font-size: 0.68rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--gold); }
.h-script { font-family: var(--font-script); font-weight: 400; font-size: clamp(3rem, 8vw, 5.6rem); line-height: 1; color: var(--moon); margin: 0.4rem 0 1.2rem; text-shadow: 0 0 30px rgba(217, 180, 92, 0.25); }
.names-script { font-family: var(--font-script); font-weight: 400; font-size: clamp(3.4rem, 11vw, 7.6rem); line-height: 1; color: var(--moon); text-shadow: 0 0 40px rgba(255, 226, 154, 0.35), 0 0 90px rgba(217, 180, 92, 0.2); }
.names-script.small { font-size: clamp(2.2rem, 5vw, 3.2rem); }
.lede { color: var(--moon-soft); max-width: 52ch; font-size: 1.08rem; }
.text-link { display: inline-block; margin-top: 0.8rem; font-size: 0.7rem; font-weight: 500; letter-spacing: 0.26em; text-transform: uppercase; color: var(--star); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 0.2rem; }
.text-link:hover { color: var(--moon); border-color: var(--moon); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0.6rem 1.6rem; border: 1px solid var(--gold); border-radius: 999px; font-family: var(--font-sans); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.26em; text-transform: uppercase; text-decoration: none; color: var(--moon); background: transparent; transition: box-shadow 0.2s, background 0.2s, color 0.2s; }
.btn:hover, .btn:focus-visible { box-shadow: 0 0 24px rgba(255, 226, 154, 0.35); }
.btn-primary { background: linear-gradient(135deg, var(--star), var(--gold)); border-color: transparent; color: var(--night); box-shadow: 0 0 18px rgba(255, 226, 154, 0.25); }
.btn-primary:hover, .btn-primary:focus-visible { box-shadow: 0 0 34px rgba(255, 226, 154, 0.55); }
.btn-ghost { border-color: rgba(244, 239, 227, 0.35); }
.btn-link { border-color: transparent; color: var(--moon-soft); padding-inline: 0.6rem; }
.btn-lg { min-height: 56px; padding-inline: 2.2rem; font-size: 0.78rem; }
.btn[disabled] { opacity: 0.6; cursor: wait; }

/* ============================================================
   THE FILM — engine chrome restyled (engine CSS lives in @layer sw; these win)
   ============================================================ */
.sw-root { --sw-bg: #070B1A; --sw-ink: #F4EFE3; --sw-ink-soft: #C9C4BA; --sw-accent: #FFE29A; --sw-font-display: var(--font-script); --sw-font-body: var(--font-sans); }
.sw-sky { background: transparent !important; }
.sw-particles { display: none !important; }
.sw-topbar { padding-inline: clamp(16px, 3vw, 40px) !important; }
.sw-brand__mark { display: none !important; }
.sw-brand { color: var(--moon) !important; }
.sw-brand__name { font-family: var(--font-script) !important; font-weight: 400 !important; font-size: 1.9rem !important; color: var(--moon); text-shadow: 0 0 18px rgba(255, 226, 154, 0.35); }
.sw-topcta { font-family: var(--font-sans); font-weight: 500; letter-spacing: 0.26em; text-transform: uppercase; font-size: 0.68rem !important; background: linear-gradient(135deg, var(--star), var(--gold)) !important; color: var(--night) !important; min-height: 42px; display: inline-flex; align-items: center; box-shadow: 0 0 18px rgba(255, 226, 154, 0.3); }
.sw-scrollbar { background: rgba(255, 226, 154, 0.1) !important; }
.sw-scrollbar span { background: linear-gradient(90deg, var(--gold), var(--star)) !important; }
/* copy panel: script title, whisper eyebrow */
.sw-copy__num { font-family: var(--font-sans) !important; font-size: 0.64rem !important; letter-spacing: 0.34em !important; color: var(--gold) !important; }
.sw-copy__eyebrow { margin-top: 12px !important; font-family: var(--font-sans) !important; font-weight: 400 !important; letter-spacing: 0.3em !important; font-size: 0.66rem !important; color: var(--star) !important; }
.sw-copy__title { font-family: var(--font-script) !important; font-weight: 400 !important; letter-spacing: 0 !important; font-size: clamp(3.4rem, 7vw, 6rem) !important; line-height: 1 !important; color: var(--moon) !important; text-shadow: 0 0 30px rgba(255, 226, 154, 0.35), 0 2px 30px rgba(0, 0, 0, 0.7) !important; }
.sw-copy__body { font-family: var(--font-sans) !important; font-weight: 300 !important; color: var(--moon-soft) !important; font-size: clamp(1rem, 1.3vw, 1.15rem) !important; line-height: 1.6; text-shadow: 0 1px 18px rgba(0, 0, 0, 0.8) !important; }
.sw-copy__tags li { font-family: var(--font-sans); font-size: 0.64rem !important; font-weight: 500 !important; letter-spacing: 0.22em; text-transform: uppercase; color: var(--moon) !important; background: rgba(7, 11, 26, 0.55) !important; border: 1px solid var(--line) !important; }
.sw-btn--primary { background: linear-gradient(135deg, var(--star), var(--gold)) !important; color: var(--night) !important; font-family: var(--font-sans); font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase; font-size: 0.7rem !important; box-shadow: 0 0 22px rgba(255, 226, 154, 0.35); }
.sw-btn--ghost { color: var(--moon) !important; border: 1px solid rgba(244, 239, 227, 0.4) !important; font-family: var(--font-sans); letter-spacing: 0.24em; text-transform: uppercase; font-size: 0.7rem !important; background: rgba(7, 11, 26, 0.35) !important; }
.sw-hint { font-family: var(--font-sans); font-weight: 500; font-size: 0.78rem !important; letter-spacing: 0.36em !important; color: var(--star) !important; text-shadow: 0 0 18px rgba(255, 226, 154, 0.5), 0 1px 12px rgba(0, 0, 0, 0.9); gap: 12px !important; padding: 10px 18px 12px; border-radius: 999px; background: rgba(7, 11, 26, 0.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid rgba(255, 226, 154, 0.22); }
.sw-hint i { border-color: rgba(255, 226, 154, 0.75) !important; }
body.has-intro .sw-hint { opacity: 0 !important; }
.sw-brand, .sw-topcta, .sw-btn { min-height: 44px !important; }
.sw-brand, .sw-btn { display: inline-flex !important; align-items: center; }
/* the route rail becomes a constellation: 4-point stars on a thread drawn by magic.js */
.sw-route { gap: 26px !important; padding: 18px 10px !important; }
.sw-route::before { display: none !important; }
.sw-route__dot { width: 44px !important; height: 44px !important; }
.sw-route__dot i { width: 10px !important; height: 10px !important; border-radius: 0 !important; background: var(--star) !important; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); opacity: 0.55; transition: transform 0.4s, opacity 0.4s, filter 0.4s !important; box-shadow: none !important; }
.sw-route__dot:hover i { transform: scale(1.4) !important; opacity: 1; }
.sw-route__dot.is-active i { transform: scale(1.9) !important; opacity: 1; filter: drop-shadow(0 0 8px var(--star)) drop-shadow(0 0 18px rgba(255, 226, 154, 0.6)); }
.sw-route__label { font-family: var(--font-script); font-size: 1.15rem !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--moon) !important; background: rgba(7, 11, 26, 0.7) !important; border-color: var(--line) !important; }
.constellation { position: fixed; inset: 0; z-index: 39; pointer-events: none; width: 100%; height: 100%; transition: opacity 0.35s; }
.constellation path { fill: none; stroke: rgba(255, 226, 154, 0.35); stroke-width: 1; stroke-dasharray: 3 5; }
/* copy scrim: mobile keeps a bottom fade; on wide screens the sky is dark enough */
.sw-copylayer::before { background: linear-gradient(90deg, rgba(7, 11, 26, 0.85) 0%, rgba(7, 11, 26, 0.45) 40%, transparent 70%) !important; }

/* retire the film chrome once the page takes over (script.js sets .past-world) */
body.past-world .sw-topbar, body.past-world .sw-route, body.past-world .sw-hint, body.past-world .sw-scrollbar, body.past-world .sw-copylayer, body.past-world .constellation, body.past-world .portal { opacity: 0; pointer-events: none; transition: opacity 0.35s ease; }
body.past-world .sw-stage { visibility: hidden; }
.sw-topbar, .sw-route, .sw-scrollbar, .portal { transition: opacity 0.35s ease; }

/* ---------- Wide screens: the film through a golden portal ---------- */
.portal { display: none; }
@media (min-width: 861px) and (orientation: landscape) {
  .sw-stage { clip-path: inset(var(--portal-top) calc(50vw - var(--portal-w) / 2) calc(100vh - var(--portal-top) - var(--portal-h)) calc(50vw - var(--portal-w) / 2) round calc(var(--portal-w) / 2) calc(var(--portal-w) / 2) 22px 22px); }
  .sw-scene { background: var(--night); }
  .sw-scene__still, .sw-scene__video { object-fit: contain !important; object-position: center center !important; transform: scale(1.14); transform-origin: center var(--sw-focus, 50%); }
  .sw-scene__video { z-index: 2 !important; }
  .portal {
    display: block; position: fixed; z-index: 15; pointer-events: none;
    top: var(--portal-top); left: calc(50vw - var(--portal-w) / 2); width: var(--portal-w); height: var(--portal-h);
    border-radius: calc(var(--portal-w) / 2) calc(var(--portal-w) / 2) 22px 22px;
    border: 1px solid rgba(255, 226, 154, 0.55);
    box-shadow: 0 0 0 6px rgba(7, 11, 26, 0.6), 0 0 60px rgba(255, 226, 154, 0.18), 0 0 140px rgba(217, 180, 92, 0.12), inset 0 0 40px rgba(0, 0, 0, 0.35);
  }
  .portal__glow { position: absolute; inset: -14px; border-radius: inherit; border: 1px solid rgba(255, 226, 154, 0.16); }
  .portal::before, .portal::after { content: ""; position: absolute; width: 8px; height: 8px; background: var(--star); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); filter: drop-shadow(0 0 6px var(--star)); }
  .portal::before { top: -6px; left: 50%; transform: translateX(-50%); }
  .portal::after { bottom: -6px; left: 50%; transform: translateX(-50%); }
  .sw-copylayer::before { background: none !important; }
  .sw-copy { left: clamp(24px, 4vw, 72px) !important; width: min(27vw, 460px) !important; }
  .sw-route { right: clamp(24px, 4vw, 72px) !important; }
}

/* ---------- Mobile film chrome ---------- */
@media (max-width: 900px) {
  .sw-brand__name { font-size: 1.5rem !important; }
  .sw-topcta { font-size: 0.62rem !important; padding: 8px 14px; }
  .sw-hint { white-space: nowrap; }
  .sw-copylayer::before { background: linear-gradient(0deg, rgba(7, 11, 26, 0.95) 0%, rgba(7, 11, 26, 0.7) 42%, rgba(7, 11, 26, 0.15) 75%, transparent 100%) !important; }
  .sw-copy__title { font-size: clamp(3rem, 13vw, 4.4rem) !important; }
  .sw-copy__body { font-size: 1rem !important; margin-top: 8px !important; }
  .sw-copy__tags { margin-top: 12px !important; }
  .sw-copy__tags li { font-size: 0.6rem !important; padding: 5px 10px !important; }
  .sw-route { gap: 14px !important; right: 6px !important; }
  .constellation path { stroke-width: 0.8; }
}

/* ---------- Film fallbacks (shared with script.js) ---------- */
.film-tap { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 70; transform: translateX(-50%); background: linear-gradient(135deg, var(--star), var(--gold)); color: var(--night); border: 0; border-radius: 999px; padding: 0.8rem 1.4rem; font-family: var(--font-sans); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.24em; text-transform: uppercase; box-shadow: 0 0 30px rgba(255, 226, 154, 0.45); }
body.past-world .film-tap { display: none; }
.film-diag { position: fixed; left: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 80; font: 11px/1.3 ui-monospace, Menlo, monospace; color: #fff; background: rgba(0, 0, 0, 0.75); padding: 4px 6px; border-radius: 4px; max-width: 90vw; }

/* ---------- Compact header after the film ---------- */
.page-header { position: fixed; top: 0; left: 0; right: 0; z-index: 60; display: none; align-items: center; gap: 1rem; padding: 0.5rem clamp(1rem, 3vw, 2.2rem); background: rgba(7, 11, 26, 0.8); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-soft); }
body.past-world .page-header { display: flex; }
.ph-brand { font-family: var(--font-script); font-size: 1.7rem; color: var(--moon); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.ph-nav { margin-left: auto; display: flex; align-items: center; gap: 1.4rem; }
.ph-nav a:not(.btn) { font-size: 0.66rem; font-weight: 500; letter-spacing: 0.26em; text-transform: uppercase; color: var(--moon-soft); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.ph-nav a:not(.btn):hover { color: var(--moon); }
.page-header .btn { min-height: 40px; padding: 0.3rem 1.1rem; font-size: 0.64rem; }
@media (max-width: 600px) { .ph-nav a:not(.btn) { display: none; } }

/* ---------- The invitation ---------- */
.invite { padding: clamp(4rem, 10vw, 7rem) 0 clamp(3rem, 8vw, 6rem); text-align: center; border-top: 1px solid var(--line-soft); }
.invite-inner { max-width: 820px; }
.invite .names-script { margin: 0.6rem 0 0.4rem; }
.invite-line { font-family: var(--font-serif); font-style: italic; font-weight: 300; font-size: clamp(1.3rem, 2.4vw, 1.8rem); color: var(--moon-soft); }
.orbit { position: relative; width: min(380px, 72vw); aspect-ratio: 1; margin: 2.2rem auto 1.6rem; }
.orbit__ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(255, 226, 154, 0.35); animation: spin 60s linear infinite; }
.orbit__ring--2 { inset: -7%; border-color: rgba(255, 226, 154, 0.16); border-style: dashed; animation-duration: 90s; animation-direction: reverse; }
.orbit__photo { position: absolute; inset: 9%; border-radius: 50%; overflow: hidden; margin: 0; box-shadow: 0 0 0 1px var(--line), 0 0 60px rgba(255, 226, 154, 0.25), 0 30px 80px rgba(0, 0, 0, 0.6); }
.orbit__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 28%; }
.orbit__star { position: absolute; width: 12px; height: 12px; background: var(--star); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); filter: drop-shadow(0 0 8px var(--star)); animation: twinkle 3s ease-in-out infinite; }
.orbit__star--a { top: -2%; left: 50%; }
.orbit__star--b { top: 62%; right: -5%; animation-delay: 1s; }
.orbit__star--c { bottom: 6%; left: -4%; animation-delay: 2s; width: 9px; height: 9px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes twinkle { 0%, 100% { opacity: 0.5; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.15); } }
.date-script { font-family: var(--font-script); font-size: clamp(1.9rem, 4.6vw, 3rem); color: var(--star); line-height: 1.1; }
.year { font-family: var(--font-serif); font-weight: 300; font-size: clamp(2.6rem, 7vw, 4.6rem); letter-spacing: 0.3em; color: var(--moon); line-height: 1; margin: 0.2rem 0 1.6rem; text-indent: 0.3em; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 2rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1.3rem 0; max-width: 760px; margin: 0 auto; }
.facts dt { font-size: 0.62rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.25rem; }
.facts dd { font-family: var(--font-serif); font-size: 1.3rem; line-height: 1.25; color: var(--moon); }
.facts .muted { font-family: var(--font-sans); font-size: 0.82rem; letter-spacing: 0.04em; }
.countdown { margin-top: 1.5rem; min-height: 1.4em; display: grid; justify-items: center; gap: 0.5rem; }
.countdown.is-now { font-family: var(--font-script); font-size: 1.9rem; color: var(--star); }
.cd-label { font-family: var(--font-script); font-size: 1.6rem; color: var(--star); line-height: 1.1; }
.cd-units { display: flex; gap: clamp(0.9rem, 3.5vw, 2rem); align-items: flex-start; }
.cd-unit { display: grid; justify-items: center; gap: 0.15rem; min-width: 3.6ch; position: relative; }
.cd-unit + .cd-unit::before { content: ":"; position: absolute; left: calc(-0.5 * clamp(0.9rem, 3.5vw, 2rem) - 0.25ch); top: 0.05em; font-family: var(--font-serif); font-weight: 300; font-size: clamp(2rem, 5.5vw, 3.2rem); line-height: 1; color: rgba(255, 226, 154, 0.45); }
.cd-unit b { font-family: var(--font-serif); font-weight: 300; font-size: clamp(2.3rem, 6.5vw, 3.6rem); line-height: 1; color: var(--moon); font-variant-numeric: tabular-nums; text-shadow: 0 0 24px rgba(255, 226, 154, 0.25); }
.cd-unit small { font-size: 0.58rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.7rem; margin-top: 1rem; }

/* ---------- The story: a constellation thread ---------- */
.story { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 4rem); border-top: 1px solid var(--line-soft); text-align: center; }
.thread { list-style: none; position: relative; max-width: 1000px; margin: 2rem auto 0; padding: 1rem clamp(1.25rem, 4vw, 2.5rem); }
.thread::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: repeating-linear-gradient(180deg, rgba(255, 226, 154, 0.45) 0 4px, transparent 4px 10px); transform: translateX(-50%); }
.node { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.6rem, 5vw, 4rem); align-items: center; padding: clamp(1.6rem, 4vw, 3rem) 0; text-align: left; }
.node--flip .node__photo { order: 2; }
.node--flip .node__text { text-align: right; }
.node__star { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; transform: translate(-50%, -50%); background: var(--star); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); filter: drop-shadow(0 0 8px var(--star)) drop-shadow(0 0 20px rgba(255, 226, 154, 0.5)); }
.node__photo { margin: 0; justify-self: center; width: min(100%, 340px); aspect-ratio: 4 / 5; border-radius: 170px 170px 18px 18px; overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 0 50px rgba(255, 226, 154, 0.15), 0 24px 60px rgba(0, 0, 0, 0.6); }
.node__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.chapter-no { font-size: 0.64rem; letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold); }
.node__text .h-script { font-size: clamp(2.6rem, 5vw, 4rem); margin: 0.3rem 0 0.6rem; }
.node__text p:not(.chapter-no) { color: var(--moon-soft); max-width: 42ch; }
.node--flip .node__text p:not(.chapter-no) { margin-left: auto; }

/* ---------- Gallery: polaroids under the stars ---------- */
.gallery { padding: clamp(2rem, 5vw, 4rem) 0 clamp(3rem, 7vw, 5rem); border-top: 1px solid var(--line-soft); }
.gallery .wrap { text-align: center; margin-bottom: 1.4rem; }
.polaroids { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 1.4rem 1rem; padding: 0 clamp(1.25rem, 4vw, 2.5rem); max-width: 1180px; margin: 0 auto; }
.polaroids li { flex: 0 1 190px; background: var(--moon); padding: 8px 8px 26px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55); transform: rotate(var(--tilt, -2deg)); transition: transform 0.3s, box-shadow 0.3s; }
.polaroids li:nth-child(2n) { --tilt: 2.2deg; } .polaroids li:nth-child(3n) { --tilt: -1.2deg; } .polaroids li:nth-child(5n) { --tilt: 3deg; }
.polaroids li:hover { transform: rotate(0) scale(1.04); box-shadow: 0 0 40px rgba(255, 226, 154, 0.35), 0 24px 50px rgba(0, 0, 0, 0.6); z-index: 2; }
.polaroids img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; }

/* ---------- The night: a star chart ---------- */
.night { padding: clamp(3rem, 8vw, 6rem) 0; border-top: 1px solid var(--line-soft); }
.night-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.chart { list-style: none; margin-top: 1rem; position: relative; padding-left: 2.2rem; }
.chart::before { content: ""; position: absolute; left: 0.45rem; top: 0.6rem; bottom: 0.6rem; width: 1px; background: repeating-linear-gradient(180deg, rgba(255, 226, 154, 0.45) 0 4px, transparent 4px 10px); }
.chart li { position: relative; display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: 1.1rem 0; }
.chart__star { position: absolute; left: -2.2rem; top: 1.35rem; width: 14px; height: 14px; background: var(--star); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); filter: drop-shadow(0 0 8px var(--star)); }
.chart .t { font-family: var(--font-serif); font-weight: 300; font-size: 1.9rem; line-height: 1.1; color: var(--star); }
.chart .what { color: var(--moon-soft); padding-top: 0.25rem; }
.chart .what strong { display: block; font-family: var(--font-serif); font-weight: 400; font-size: 1.35rem; color: var(--moon); }
.cards { display: grid; gap: 0.9rem; position: sticky; top: 4.8rem; }
.card, .glass { background: rgba(244, 239, 227, 0.04); border: 1px solid var(--line-soft); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-radius: 18px; }
.card { padding: 1.1rem 1.3rem; }
.card h3 { font-size: 0.62rem; letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.45rem; font-weight: 500; }
.card p { color: var(--moon-soft); font-size: 1rem; }
.card strong { color: var(--moon); font-weight: 500; }

/* ---------- RSVP ---------- */
.rsvp { padding: clamp(3rem, 8vw, 6rem) 0 clamp(4rem, 10vw, 7rem); border-top: 1px solid var(--line-soft); }
.rsvp-inner { max-width: 720px; }
.rsvp .lede { margin-bottom: 2rem; }
.form-grid { display: grid; gap: 1.3rem; padding: clamp(1.2rem, 3vw, 2.2rem); box-shadow: 0 0 80px rgba(255, 226, 154, 0.08); }
.field { display: grid; gap: 0.4rem; }
.field label, .field legend { font-size: 0.64rem; font-weight: 500; letter-spacing: 0.28em; text-transform: uppercase; color: var(--star); }
.optional { font-weight: 300; color: var(--mist); letter-spacing: 0.12em; }
.field .hint, .hint { font-size: 0.82rem; color: var(--mist); }
.field input, .field select, .field textarea { font: inherit; font-size: 1.1rem; min-height: 50px; padding: 0.6rem 0; border: 0; border-bottom: 1px solid rgba(244, 239, 227, 0.3); border-radius: 0; background: transparent; color: var(--moon); width: 100%; }
.field select option { background: var(--night-2); color: var(--moon); }
.field textarea { resize: vertical; min-height: 90px; border: 1px solid rgba(244, 239, 227, 0.2); border-radius: 12px; padding: 0.7rem 0.8rem; margin-top: 0.3rem; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: none; border-color: var(--star); box-shadow: 0 1px 0 var(--star); }
.field.has-error input, .field.has-error select { border-color: var(--rose); }
.error-msg { font-size: 0.82rem; color: var(--rose); min-height: 1.1em; }
.form-error:empty { display: none; }
fieldset.field { border: 0; padding: 0; }
.radio-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 0.5rem; }
.radio-pill { position: relative; }
.radio-pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.radio-pill span { display: inline-flex; align-items: center; min-height: 46px; padding: 0.5rem 1.4rem; border: 1px solid rgba(244, 239, 227, 0.3); border-radius: 999px; font-family: var(--font-serif); font-size: 1.15rem; color: var(--moon); transition: background 0.2s, color 0.2s, box-shadow 0.2s; }
.radio-pill input:checked + span { background: linear-gradient(135deg, var(--star), var(--gold)); color: var(--night); border-color: transparent; box-shadow: 0 0 22px rgba(255, 226, 154, 0.4); }
.radio-pill input:focus-visible + span { outline: 2px solid var(--moon); outline-offset: 2px; }
.field-check .check { display: flex; gap: 0.8rem; align-items: flex-start; font-size: 0.98rem; letter-spacing: 0; text-transform: none; color: var(--moon-soft); cursor: pointer; font-weight: 300; }
.field-check input { width: 20px; height: 20px; margin-top: 0.2rem; accent-color: var(--gold); flex: 0 0 auto; }
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.privacy-note { text-align: center; }
.form-success { padding: 2.4rem 1.8rem; display: grid; gap: 0.6rem; justify-items: center; text-align: center; }
.form-success strong { font-family: var(--font-serif); font-weight: 300; font-size: 2.2rem; line-height: 1.05; color: var(--moon); }
.form-success p { max-width: 46ch; color: var(--moon-soft); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line-soft); text-align: center; }
.footer-inner { padding: 3rem 1.25rem 3.5rem; display: grid; gap: 0.5rem; }
.footer-small { font-size: 0.78rem; color: var(--mist); letter-spacing: 0.08em; }

/* ---------- Mobile page ---------- */
@media (max-width: 900px) {
  .night-grid { grid-template-columns: 1fr; }
  .cards { position: static; }
  .node, .node--flip { grid-template-columns: 1fr; text-align: center; }
  .node--flip .node__photo { order: 0; }
  .node--flip .node__text { text-align: center; }
  .node__text p:not(.chapter-no), .node--flip .node__text p:not(.chapter-no) { margin: 0 auto; }
  .node__star { top: auto; bottom: -7px; }
  .thread::before { left: 50%; }
  .facts { grid-template-columns: 1fr; gap: 0.9rem; }
}
@media (max-width: 600px) {
  .chart li { grid-template-columns: 1fr; gap: 0.2rem; }
  .form-grid { padding: 1rem; }
  .polaroids li { flex-basis: 40%; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orbit__ring, .orbit__star { animation: none; }
  .btn, .radio-pill span, .polaroids li { transition: none; }
}

/* ---------- Welcome screen: how to watch (script.js initIntro) ---------- */
.intro { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); background: radial-gradient(120% 90% at 50% 100%, rgba(7, 11, 26, 0.96) 0%, rgba(7, 11, 26, 0.82) 55%, rgba(7, 11, 26, 0.55) 100%); transition: opacity 0.6s ease, visibility 0.6s; }
.intro.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.intro__card { width: min(100%, 520px); text-align: center; display: grid; justify-items: center; gap: 0.9rem; padding: clamp(1.4rem, 4vw, 2.4rem) clamp(1.2rem, 4vw, 2.2rem); border: 1px solid var(--line); border-radius: 22px; background: rgba(7, 11, 26, 0.6); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 0 0 6px rgba(7, 11, 26, 0.35), 0 0 80px rgba(255, 226, 154, 0.12); animation: intro-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes intro-in { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }
.intro__eyebrow { font-size: 0.62rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--gold); }
.intro__names { font-family: var(--font-script); font-size: clamp(2.8rem, 9vw, 4rem); line-height: 1; color: var(--moon); text-shadow: 0 0 30px rgba(255, 226, 154, 0.35); margin-top: -0.3rem; }
.intro__sub { font-family: var(--font-serif); font-style: italic; font-weight: 300; font-size: clamp(1.15rem, 3.4vw, 1.4rem); color: var(--moon-soft); }
.intro__steps { list-style: none; counter-reset: step; display: grid; gap: 0.55rem; text-align: left; margin: 0.3rem 0 0.2rem; padding-top: 0.9rem; border-top: 1px solid var(--line-soft); width: 100%; }
.intro__steps li { counter-increment: step; position: relative; padding-left: 2.1rem; font-size: 0.95rem; line-height: 1.5; color: var(--moon-soft); }
.intro__steps li::before { content: counter(step); position: absolute; left: 0; top: 0.1rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 1px solid var(--line); color: var(--star); font-family: var(--font-serif); font-size: 0.9rem; display: grid; place-items: center; }
.intro__steps b { font-weight: 500; color: var(--moon); }
.intro__btn { margin-top: 0.4rem; min-height: 50px; padding: 0.9rem 2rem; border: 0; border-radius: 999px; background: linear-gradient(135deg, var(--star), var(--gold)); color: var(--night); font-family: var(--font-sans); font-weight: 500; font-size: 0.78rem; letter-spacing: 0.26em; text-transform: uppercase; box-shadow: 0 0 34px rgba(255, 226, 154, 0.45); transition: transform 0.2s, box-shadow 0.2s; }
.intro__btn:hover, .intro__btn:focus-visible { transform: translateY(-1px); box-shadow: 0 0 46px rgba(255, 226, 154, 0.6); outline: none; }
.intro__scroll { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 0.62rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--star); margin-top: 0.2rem; }
.intro__scroll i { width: 14px; height: 24px; position: relative; display: block; }
.intro__scroll i::before, .intro__scroll i::after { content: ""; position: absolute; left: 50%; width: 10px; height: 10px; border-right: 1.5px solid var(--star); border-bottom: 1.5px solid var(--star); transform: translateX(-50%) rotate(45deg); animation: chevron 1.8s ease-in-out infinite; }
.intro__scroll i::after { animation-delay: 0.3s; }
@keyframes chevron { 0% { top: -2px; opacity: 0; } 40% { opacity: 1; } 100% { top: 14px; opacity: 0; } }
@media (max-width: 480px) {
  .intro__card { gap: 0.7rem; padding: 1.3rem 1.1rem 1.2rem; border-radius: 18px; }
  .intro__steps li { font-size: 0.88rem; line-height: 1.45; }
}
@media (max-height: 640px) and (orientation: landscape) { .intro__steps { display: none; } .intro__sub { display: none; } }

/* one gentle reminder when the film is being flicked through (script.js initPaceNudge) */
.pace-nudge { position: fixed; left: 50%; top: max(76px, calc(56px + env(safe-area-inset-top))); z-index: 70; transform: translateX(-50%); display: grid; justify-items: center; gap: 2px; padding: 0.7rem 1.3rem; border-radius: 16px; background: rgba(7, 11, 26, 0.82); border: 1px solid var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); text-align: center; white-space: nowrap; box-shadow: 0 0 40px rgba(255, 226, 154, 0.18); animation: nudge-in 0.35s ease both; }
.pace-nudge b { font-family: var(--font-script); font-weight: 400; font-size: 1.5rem; line-height: 1; color: var(--star); }
.pace-nudge span { font-size: 0.62rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--moon-soft); }
@keyframes nudge-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .intro__card, .intro__scroll i::before, .intro__scroll i::after, .pace-nudge { animation: none; } }

/* phones: the hint sits under the top bar as a row (the copy owns the bottom of the screen),
   and the mouse wheel becomes an up-chevron for "swipe up slowly" */
@media (hover: none) and (pointer: coarse) {
  .sw-hint { top: calc(64px + env(safe-area-inset-top)); bottom: auto !important; flex-direction: row !important; gap: 10px !important; padding: 9px 16px 9px 14px; }
  .sw-hint i { width: 10px !important; height: 10px !important; border: 0 !important; border-left: 2px solid var(--star) !important; border-top: 2px solid var(--star) !important; border-radius: 1px !important; transform: rotate(45deg) translate(3px, 3px); animation: sw-up 1.6s ease-in-out infinite; }
  .sw-hint i::after { display: none !important; }
  .pace-nudge { top: calc(64px + env(safe-area-inset-top)); }
}
@keyframes sw-up { 0%, 100% { transform: rotate(45deg) translate(3px, 3px); } 50% { transform: rotate(45deg) translate(0, 0); } }
