@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-normal-latin.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-normal-latin-ext.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-italic-latin.woff2") format("woff2"); font-weight: 300 900; font-style: italic; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-italic-latin-ext.woff2") format("woff2"); font-weight: 300 900; font-style: italic; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson"; src: url("fonts/AtkinsonHyperlegibleNext.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --bg: #f4ede2; --surface: #fffaf1; --ink: #1b1720; --muted: #463f4c; --line: #d6cab8; --accent: #7c2d10; --accent-ui: #b8461c;
  --on-sky: #fff8ec; --on-sky-muted: #f1e4d2; --scrim: rgba(20, 16, 34, 0.55);
  --sky-top: #1d2550; --sky-mid: #6f5a8a; --sky-low: #de9474; --sky-glow: #f9d39a; --land: #1a1520; --bird: #0f0c14;
  --flare: #e2401a; --hi: #fff5dc; --falcon: #2a130a;
  --serif: "Fraunces", Georgia, "Times New Roman", serif; --sans: "Atkinson", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bar: 3.1rem; color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0c0e1b; --surface: #141729; --ink: #f2eadb; --muted: #cfc5b4; --line: #2d3150; --accent: #ffbe95; --accent-ui: #ff9f6a;
  --on-sky: #fff8ec; --on-sky-muted: #efe2cf; --scrim: rgba(4, 5, 14, 0.55);
  --sky-top: #060817; --sky-mid: #5d4273; --sky-low: #b8645a; --sky-glow: #e89a62; --land: #040409; --bird: #040308;
  --flare: #ffac55; --hi: #fff1cc; --falcon: #1a0b05; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0e1b; --surface: #141729; --ink: #f2eadb; --muted: #cfc5b4; --line: #2d3150; --accent: #ffbe95; --accent-ui: #ff9f6a;
    --on-sky: #fff8ec; --on-sky-muted: #efe2cf; --scrim: rgba(4, 5, 14, 0.55);
    --sky-top: #060817; --sky-mid: #5d4273; --sky-low: #b8645a; --sky-glow: #e89a62; --land: #040409; --bird: #040308;
    --flare: #ffac55; --hi: #fff1cc; --falcon: #1a0b05; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.075rem/1.62 var(--sans); overflow-wrap: break-word; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent-ui); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.08; letter-spacing: -0.01em; margin: 0; }
p { margin: 0 0 1em; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--surface); color: var(--ink); padding: 0.6rem 1rem; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- top bar ---------- */
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 40; height: var(--bar); display: flex; align-items: center; gap: 0.9rem; padding: 0 max(1rem, env(safe-area-inset-left)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); font-size: 0.92rem; }
.topbar a { color: var(--ink); text-decoration: none; }
.home { font-weight: 700; white-space: nowrap; }
.topnav { display: flex; gap: 1.1rem; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 0 1 auto; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { white-space: nowrap; padding: 0.7rem 0; border-bottom: 2px solid transparent; }
.topnav a[aria-current] { border-bottom-color: var(--accent-ui); }
.spacer { flex: 1 1 0; }
.chip { white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.75rem; min-height: 2.2rem; display: inline-flex; align-items: center; }
.icon-btn { width: 2.75rem; height: 2.75rem; flex: none; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn svg { display: block; }
.icon-btn svg[hidden] { display: none; }
@media (max-width: 560px) { .home { display: none; } .topbar { gap: 0.7rem; } }

/* ---------- reading rail ---------- */
.rail { position: fixed; right: 1rem; top: 50%; transform: translateY(-50%); z-index: 30; display: none; flex-direction: column; gap: 0.35rem; }
.rail a { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; text-decoration: none; color: var(--muted); font-size: 0.8rem; min-height: 1.6rem; }
.rail a span { opacity: 0; transition: opacity 0.2s; background: var(--surface); padding: 0.1rem 0.45rem; border-radius: 4px; color: var(--ink); }
.rail a:hover span, .rail a:focus-visible span { opacity: 1; }
.rail i { width: 0.55rem; height: 0.55rem; border-radius: 50%; border: 1.5px solid var(--muted); background: var(--bg); }
.rail a[aria-current] i { background: var(--accent-ui); border-color: var(--accent-ui); }
@media (min-width: 1180px) { .rail { display: flex; } }
.theatre:hover ~ .rail { opacity: 1; }

/* ---------- the stage: the sky behind the story ---------- */
.theatre { position: relative; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; margin-bottom: -100vh; margin-bottom: -100svh; z-index: 0; overflow: hidden; background: var(--sky-top); }
.stage canvas { display: block; width: 100%; height: 100%; }
html:not(.js) .needs-js, .no-canvas .needs-js { display: none !important; }
.stage .fallback { position: absolute; inset: 0; margin: 0; }
.stage .fallback img { width: 100%; height: 100%; object-fit: cover; display: block; }
html.sky-ready .stage .fallback { display: none; }
.hud { position: absolute; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 3; display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.btn { font: 600 0.95rem/1 var(--sans); min-height: 2.75rem; padding: 0 1.05rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.btn:hover { border-color: var(--accent-ui); }
.btn.solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn svg { width: 1rem; height: 1rem; flex: none; }
.hud .btn { background: var(--scrim); color: var(--on-sky); border-color: rgba(255, 248, 236, 0.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pp .i-play { display: none; }
.pp.paused .i-play { display: block; }
.pp.paused .i-pause { display: none; }
#fly-done { display: none; }
html.flying { overflow: hidden; }
html.flying .stage { position: fixed; inset: 0; height: 100%; margin: 0; z-index: 60; }
html.flying .stage canvas { touch-action: none; cursor: crosshair; }
html.flying #fly-done { display: inline-flex; }
html.flying .hud [data-fly] { display: none; }
.fly-tip { display: none; position: absolute; left: 50%; top: max(1rem, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 3; color: var(--on-sky); background: var(--scrim); padding: 0.5rem 0.9rem; border-radius: 999px; font-size: 0.95rem; text-align: center; width: max-content; max-width: calc(100% - 2rem); }
html.flying .fly-tip { display: block; }
@media (hover: hover) and (pointer: fine) { .stage canvas { cursor: crosshair; } }

/* ---------- hero ---------- */
.hero { position: relative; z-index: 1; min-height: 100vh; min-height: 100svh; padding: calc(var(--bar) + 6vh) max(1.25rem, 6vw) 6rem; color: var(--on-sky); pointer-events: none; }
.hero > * { pointer-events: auto; }
.kicker { font: 600 0.8rem/1.2 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--on-sky-muted); margin-bottom: 1rem; }
.hero h1 { font-size: clamp(2.5rem, 7.2vw, 5.6rem); max-width: 11.5em; font-weight: 500; font-variation-settings: "opsz" 144, "SOFT" 50; text-wrap: balance; }
.hero h1 em { font-style: italic; font-weight: 400; }
.deck { font-size: clamp(1.1rem, 1.8vw, 1.32rem); max-width: 34rem; margin-top: 1.3rem; color: var(--on-sky); text-wrap: pretty; }
.byline { font-size: 0.9rem; color: var(--on-sky-muted); margin-top: 1rem; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 1.1rem; }
.share .btn { background: var(--scrim); color: var(--on-sky); border-color: rgba(255, 248, 236, 0.35); }
.share [role="status"] { font-size: 0.9rem; color: var(--on-sky-muted); min-height: 1.2em; }
#share-field { width: 100%; max-width: 28rem; font: inherit; font-size: 0.9rem; padding: 0.5rem; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.cue { position: absolute; right: 16rem; left: max(1.25rem, 6vw); bottom: 1.4rem; font-size: 0.9rem; color: var(--on-sky-muted); margin: 0; }

/* ---------- story steps over the sky ---------- */
.story { position: relative; z-index: 1; pointer-events: none; }
.step { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 12vh max(1.25rem, 6vw); }
.card { pointer-events: auto; max-width: 27rem; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-radius: 14px; padding: 1.4rem 1.5rem 1.2rem; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22); }
.card h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 0.7rem; text-wrap: balance; }
.card p:last-child { margin-bottom: 0; }
.card .btn { margin-top: 0.2rem; }
.card .src { font-size: 0.86rem; color: var(--muted); }
.step.right { justify-content: flex-end; }
@media (max-width: 700px) {
  .step { align-items: flex-end; padding: 50vh 0.75rem 5.5rem; min-height: 115svh; }
  .step.right { justify-content: flex-start; }
  .card { max-width: none; padding: 1.1rem 1.15rem 1rem; }
  .hero { padding-top: calc(var(--bar) + 1.2rem); }
  .cue { display: none; }
}

/* the playground card */
.controls { display: grid; gap: 0.9rem; margin-top: 0.4rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.slider label { display: flex; justify-content: space-between; font-weight: 600; font-size: 0.95rem; }
.slider output { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }
input[type="range"] { width: 100%; height: 2.75rem; accent-color: var(--accent-ui); margin: 0; }
.hint { font-size: 0.9rem; color: var(--muted); margin: 0; }

/* ---------- ordinary reading blocks ---------- */
.after { position: relative; z-index: 2; background: var(--bg); }
.block { max-width: 70rem; margin: 0 auto; padding: 5.5rem max(1.25rem, 5vw) 1rem; }
section[id], .step[id] { scroll-margin-top: calc(var(--bar) + 0.5rem); }
.block h2 { font-size: clamp(1.9rem, 3.8vw, 3rem); max-width: 18em; margin-bottom: 1.1rem; text-wrap: balance; }
.block h3 { font-size: 1.35rem; margin: 1.6rem 0 0.5rem; }
.prose { max-width: 38rem; }
.anchor { color: inherit; text-decoration: none; }
.anchor:hover, .anchor:focus-visible { text-decoration: underline; text-decoration-thickness: 2px; }
.lede { font-size: 1.2rem; max-width: 38rem; }

/* two flocks */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.6rem 0 0.8rem; }
.pair figure { margin: 0; min-width: 0; }
.pair canvas { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; background: var(--sky-top); }
.pair figcaption { margin-top: 0.55rem; font-size: 0.95rem; }
.pair figcaption b { display: block; font-family: var(--serif); font-size: 1.15rem; }
.pair output { display: block; font-weight: 700; margin-top: 0.25rem; min-height: 1.5em; }
@media (max-width: 700px) { .pair { grid-template-columns: 1fr; } .pair canvas { aspect-ratio: 16 / 10; } }

/* photographs */
.photos { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; margin: 2rem 0; }
.photos figure { margin: 0; grid-column: span 6; min-width: 0; }
.photos figure.wide { grid-column: span 12; }
.photos figure.third { grid-column: span 4; }
.photos img { display: block; width: 100%; height: auto; border-radius: 8px; background: var(--line); }
figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 0.5rem; }
figcaption .cr { display: block; font-size: 0.8rem; margin-top: 0.2rem; }
@media (max-width: 700px) { .photos figure, .photos figure.third { grid-column: span 12; } }

/* the list of reasons and places */
.reasons { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.4rem 2rem; margin: 1.6rem 0; padding: 0; list-style: none; }
.reasons li h3 { margin-top: 0; font-size: 1.2rem; }
.reasons .verdict { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0.1rem 0.55rem; margin-bottom: 0.4rem; }
.places { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin: 1.4rem 0; padding: 0; list-style: none; }
.places li { border-top: 2px solid var(--ink); padding-top: 0.6rem; }
.places b { display: block; font-family: var(--serif); font-size: 1.2rem; }
.tips { border-left: 3px solid var(--accent-ui); padding: 0.2rem 0 0.2rem 1rem; max-width: 38rem; }

/* sources */
.srcs { padding-left: 1.1rem; font-size: 0.95rem; max-width: 50rem; }
.srcs li { margin-bottom: 0.45rem; }
.method { max-width: 44rem; color: var(--muted); }
.foot { position: relative; z-index: 2; background: var(--bg); border-top: 1px solid var(--line); padding: 2rem max(1.25rem, 5vw) 3rem; font-size: 0.92rem; color: var(--muted); }
.foot p { margin: 0.2rem 0; }
.foot a { color: var(--ink); }
body.nf main { max-width: 40rem; margin: 20vh auto; padding: 0 1.25rem; }
