@font-face { font-family: "Basteleur Moonlight"; src: url(/fonts/Basteleur-Moonlight.otf) format("opentype"); font-display: swap; }
@font-face { font-family: "Basteleur"; font-weight: 700; src: url(/fonts/Basteleur-Bold.otf) format("opentype"); font-display: swap; }
@font-face { font-family: "Vollkorn"; font-weight: 400 900; src: url(/fonts/Vollkorn.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Vollkorn"; font-style: italic; font-weight: 400 900; src: url(/fonts/Vollkorn-Italic.woff2) format("woff2"); font-display: swap; }

:root {
  --paper: #EDE0CC;
  --ink: #3A3226;
  --ink-soft: #5A5042;
  --ink-faint: #6E6353;
  --pine: #10301F;
  --pine-soft: #24402D;
  --marigold: #8F5600;
  --sun: #F2A413;
  --cream: #FFF6DD;
  --cream-soft: #E9DFC6;
  --night-paper: #0E2A1B;
  --rule: rgba(58, 50, 38, 0.17);
  --rule-night: rgba(255, 246, 221, 0.16);
  --wash: rgba(211, 142, 19, 0.16);
  --serif: "Vollkorn", "Iowan Old Style", Charter, Georgia, serif;
  --display: "Basteleur Moonlight", Georgia, serif;
  --headline: "Basteleur", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --linen: linear-gradient(rgba(237, 224, 204, 0.58), rgba(237, 224, 204, 0.58)), url(/art/linen.webp) center top / 100% auto repeat-y, #EDE0CC;
  --linen-night: linear-gradient(rgba(12, 36, 23, 0.86), rgba(12, 36, 23, 0.86)), url(/art/linen.webp) center top / 100% auto repeat-y, #0E2A1B;
  --day: 0;
  --dusk: 0;
  --night: 0;
  --head: clamp(56px, 11vh, 96px);
  --fell-width: max(112vw, 960px);
  --orb: clamp(96px, 17vh, 160px);
  --rise: clamp(108px, calc(100vh - 600px), 25vh);
  --gap: 34vh;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: #FCE8B7; scroll-behavior: smooth; scroll-padding: 92px 0 150px; scrollbar-color: var(--pine-soft) transparent; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); font: 400 18px/1.58 var(--serif); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
::selection { background: rgba(242, 164, 19, 0.4); color: inherit; }
a { color: var(--pine); text-decoration: underline 1px var(--marigold); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--marigold); outline-offset: 3px; border-radius: 6px; }
b { font-weight: 680; color: var(--pine); }
q { quotes: "“" "”"; }
[hidden] { display: none !important; }
.skip { position: fixed; z-index: 9; top: 10px; left: 10px; padding: 8px 14px; background: var(--pine); color: var(--cream); border-radius: 8px; transform: translateY(-200%); }
.skip:focus { transform: none; }

.scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #FCE8B7; }
.sky { position: absolute; inset: 0; background: center / cover no-repeat; }
.sky-dawn { background-image: url(/art/sky-dawn.webp); }
.sky-day { background-image: url(/art/sky-day.webp); opacity: var(--day); }
.sky-dusk { background-image: url(/art/sky-dusk.webp); background-position: center 62%; opacity: var(--dusk); }
.sky-night { background-image: url(/art/sky-night.webp); opacity: var(--night); }
.glow { position: absolute; left: 50%; top: calc(100vh - var(--rise)); width: min(92vw, 120vh); aspect-ratio: 1; transform: translate(-50%, -50%); background: url(/art/glow-sun.webp) center / contain no-repeat; opacity: calc(0.6 * (1 - var(--night))); pointer-events: none; }
.live .glow { left: 0; top: 0; }

.orb { position: fixed; z-index: 1; left: 50%; top: calc(100vh - var(--rise) - var(--orb) * 0.12); width: var(--orb); aspect-ratio: 640 / 664; margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; transform: translate(-50%, -50%); cursor: grab; touch-action: none; -webkit-tap-highlight-color: transparent; }
.live .orb { left: 0; top: 0; }
.orb.is-held { cursor: grabbing; }
.orb:focus-visible { outline-offset: 6px; border-radius: 50%; }
.rise, .sun, .moon { position: absolute; inset: 0; display: block; }
.sun, .moon { background: center / contain no-repeat; transition: opacity 0.4s; }
.sun { background-image: url(/art/sun.webp); }
.moon { inset: 20%; background-image: url(/art/moon.webp); opacity: 0; }
.orb.is-moon .sun { opacity: 0; }
.orb.is-moon .moon { opacity: 1; }
.orb:hover .sun, .orb.is-held .sun { filter: brightness(1.06) saturate(1.08); }

.top { position: fixed; z-index: 5; top: max(14px, env(safe-area-inset-top)); left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.tag { pointer-events: auto; display: inline-flex; align-items: center; background: var(--linen); border-radius: 11px; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 8px 18px -9px rgba(40, 30, 10, 0.55); }
.brand { gap: 9px; padding: 7px 15px 7px 8px; text-decoration: none; transform: rotate(-1.2deg); }
.brand img { display: block; border-radius: 7px; }
.brand span { color: var(--pine); font: 700 21px/1 var(--headline); padding-top: 2px; }
.links { gap: 22px; padding: 6px 6px 6px 20px; transform: rotate(0.7deg); font-size: 16px; }
.links a { color: var(--ink); text-decoration: none; }
.links a:hover { color: var(--pine); text-decoration: underline 2px var(--marigold); }
.links .get { padding: 6px 14px 5px; border-radius: 7px; background: var(--pine); color: var(--cream); font: 700 16px/1.4 var(--headline); }
.links .get:hover { color: var(--cream); background: #174329; text-decoration: none; }

.preview { position: fixed; z-index: 6; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; margin: 0; padding: 5px 14px; transform: translateX(-50%); background: var(--pine); color: var(--cream-soft); border-radius: 999px; font-size: 14.5px; font-style: italic; line-height: 1.4; white-space: nowrap; }

main { position: relative; z-index: 2; pointer-events: none; }
section { scroll-margin-top: 92px; }

.hero { min-height: 100vh; min-height: 100svh; display: grid; justify-items: center; align-content: start; padding: clamp(88px, 11.5vh, 132px) 20px calc(var(--rise) + var(--head) + 4vh); text-align: center; margin-bottom: 8vh; }
.hero-copy > *, .closing-copy > * { pointer-events: auto; }
h1, .closing h2 { margin: 0 auto 0.3em; max-width: 13.5em; font: 400 clamp(40px, min(5.7vw, 9.2vh), 84px)/1.03 var(--display); letter-spacing: -0.01em; text-wrap: balance; }
h1 { color: var(--pine); }
.lede { max-width: 35rem; margin: 0 auto; color: var(--pine-soft); font-size: clamp(18px, 1.5vw, 21px); line-height: 1.45; text-wrap: pretty; }
.gets { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: start; gap: 18px 22px; margin-top: clamp(20px, 3.4vh, 32px); }
.get-one { display: grid; justify-items: center; gap: 7px; }
.get-one .button { width: 100%; }
.get-one.is-missing { order: 1; }
.beside { font-size: 14.5px; line-height: 1.3; }
.fine { max-width: 33rem; margin: clamp(14px, 2.6vh, 24px) auto 0; color: var(--pine-soft); font-size: 15.5px; line-height: 1.45; text-wrap: pretty; }

.button { position: relative; display: inline-flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 24px 10px 12px; border-radius: 16px; text-align: left; text-decoration: none; transition: transform 0.12s, filter 0.12s, box-shadow 0.12s; }
.button img { display: block; flex: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25)); }
.button > span { display: grid; gap: 1px; }
.button b { color: inherit; font: 700 19px/1.2 var(--headline); }
.button small { font-size: 14.5px; line-height: 1.3; font-variant-numeric: lining-nums tabular-nums; }
.button.day { color: #2B1B00; background: #F2A413 url(/art/paint-sun.webp) center / cover; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -2px 0 rgba(120, 60, 0, 0.28), 0 10px 20px -10px rgba(90, 50, 0, 0.7); }
.button.night { color: var(--cream); background: #0B2A16 url(/art/paint-fell.webp) center / cover; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 10px 20px -10px rgba(0, 20, 8, 0.8); }
.button.night small { color: var(--cream-soft); }
.button:hover { transform: translateY(-1px); filter: brightness(1.06); text-decoration: none; }
.button:active { transform: translateY(1px); filter: brightness(0.97); }
.button:focus-visible { outline-offset: 4px; border-radius: 16px; }
.button[aria-disabled="true"] { filter: saturate(0.35) brightness(0.96); opacity: 0.78; cursor: default; transform: none; }
.half .button { padding-left: 22px; }

.sheet { position: relative; pointer-events: auto; width: min(100% - 28px, 46rem); margin: 0 auto var(--gap); padding: clamp(26px, 5vw, 54px) clamp(22px, 6vw, 68px) clamp(30px, 5vw, 58px); background: var(--linen); box-shadow: 0 34px 60px -34px rgba(40, 30, 10, 0.6); }
.sheet.wide { width: min(100% - 28px, 62rem); }
.sheet::before, .sheet::after { content: ""; position: absolute; left: 0; right: 0; height: 24px; background: var(--paper); -webkit-mask: center / 100% 100% no-repeat; mask: center / 100% 100% no-repeat; }
.sheet::before { bottom: calc(100% - 1px); -webkit-mask-image: url(/art/edge-1.svg); mask-image: url(/art/edge-1.svg); }
.sheet::after { top: calc(100% - 1px); transform: scaleY(-1); -webkit-mask-image: url(/art/edge-2.svg); mask-image: url(/art/edge-2.svg); }
.sheet h2 { margin: 0 0 0.5em; color: var(--pine); font: 700 clamp(30px, 3.6vw, 44px)/1.08 var(--headline); letter-spacing: -0.005em; text-wrap: balance; }
.sheet p { margin: 0 0 0.9em; max-width: 38rem; text-wrap: pretty; }
.sheet .intro { color: var(--ink-soft); font-size: 19.5px; line-height: 1.48; }
.sheet .aside { margin-top: 1.4em; color: var(--ink-soft); font-size: 16px; line-height: 1.5; }
code { font: 0.84em var(--mono); padding: 0.08em 0.34em; border-radius: 4px; background: var(--wash); }

.parts { margin: 26px 0 0; }
.parts > div { display: grid; grid-template-columns: 8.6rem minmax(0, 1fr); column-gap: 2rem; padding: 0.82em 0 0.88em; border-top: 1px solid var(--rule); }
.parts dt { text-align: right; color: var(--marigold); font: 700 18.5px/1.52 var(--headline); }
.parts dd { margin: 0; max-width: 34rem; text-wrap: pretty; }

.ledger { width: 100%; margin-top: 26px; border-collapse: collapse; }
.ledger caption { padding-bottom: 7px; text-align: left; color: var(--marigold); font: 700 19px/1.4 var(--headline); }
.ledger th, .ledger td { padding: 0.56em 0 0.62em; border-top: 1px solid var(--rule); vertical-align: baseline; }
.ledger th { padding-right: 1.4em; text-align: left; font-weight: 400; }
.ledger td { text-align: right; color: var(--ink-faint); font-style: italic; white-space: nowrap; }
.ledger.sent td { color: var(--pine); }

.steps { margin: 24px 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 0.78em 0 0.84em 3.7rem; border-top: 1px solid var(--rule); text-wrap: pretty; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0.5em; width: 2.5rem; text-align: right; color: var(--pine); font: 400 38px/1 var(--display); font-variant-numeric: lining-nums; }
.steps + .aside { margin-top: 0.6em; padding-top: 0.9em; border-top: 1px solid var(--rule); }
.commands { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 4px; }
.command { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; border-radius: 12px; background: var(--linen-night); box-shadow: 0 10px 20px -12px rgba(0, 20, 8, 0.7); }
.command code { flex: 1; min-width: 0; padding: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; background: none; color: var(--cream); font-size: 13.5px; line-height: 1.5; }
.copy { flex: none; min-width: 5.4em; padding: 7px 12px 6px; border: 0; border-radius: 8px; background: var(--paper); color: var(--pine); font: 680 15px/1.3 var(--serif); cursor: pointer; }
.copy:hover { background: #F7ECD6; }
.copy:active { transform: translateY(1px); }
.window { margin: 34px 0 0; }
.window img { display: block; width: 100%; height: auto; border-radius: 11px; box-shadow: 0 18px 34px -18px rgba(40, 30, 10, 0.7); }
.window figcaption { margin-top: 12px; color: var(--ink-soft); font-size: 15.5px; font-style: italic; line-height: 1.45; }

.halves { display: grid; grid-template-columns: 1fr 1fr; margin: 30px calc(-1 * clamp(22px, 6vw, 68px)) 0; }
.half { padding: 30px clamp(22px, 4.4vw, 52px) 34px; }
.half.day { background: linear-gradient(rgba(242, 164, 19, 0.16), rgba(242, 164, 19, 0.07)); }
.half.night { background: var(--linen-night); color: var(--cream-soft); }
.half .app { display: block; margin: 0 0 4px -10px; }
.half h3 { margin: 0 0 6px; color: var(--pine); font: 700 34px/1.1 var(--headline); }
.half h3 span { margin-left: 8px; color: var(--marigold); font: italic 400 17px/1 var(--serif); }
.half > p { min-height: 4.8em; }
.half.night h3 { color: var(--cream); }
.half.night h3 span, .half.night .facts dt { color: #E9A93A; }
.half.night a:not(.button) { color: var(--cream); text-decoration-color: #E9A93A; }
.facts { margin: 22px 0 0; }
.facts > div { display: grid; grid-template-columns: 5.4rem minmax(0, 1fr); column-gap: 1rem; padding: 0.42em 0 0.46em; border-top: 1px solid var(--rule); align-items: baseline; }
.half.night .facts > div { border-color: var(--rule-night); }
.facts dt { color: var(--ink-soft); font-size: 15.5px; font-style: italic; }
.facts dd { margin: 0; font-size: 16.5px; font-variant-numeric: lining-nums tabular-nums; }
.facts .sum { font: 12.5px/1.5 var(--mono); overflow-wrap: anywhere; }
.sheet .sources { margin: 16px 0 0; font-size: 16px; }
.sources [data-engine] { margin-left: 14px; }
.is-missing .facts, .is-missing .sources { display: none; }
.fine a { white-space: nowrap; }
.ledger caption { text-wrap: balance; }

.closing { min-height: 100vh; min-height: 100svh; display: grid; justify-items: center; align-content: start; padding: 23vh 20px calc(26vh + var(--head)); text-align: center; color: var(--cream); background: #061D13 url(/art/sky-night.webp) center / cover; }
.live .closing { background: none; }
.live .closing-copy { opacity: var(--night); }
.closing h2 { color: var(--cream); }
.closing .lede, .closing .fine { color: var(--cream-soft); }
.closing a:not(.button) { color: var(--cream); text-decoration-color: #E9A93A; }
.closing .button.night { color: #2A2410; background: #EADFB6 url(/art/paint-moon.webp) center / cover; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -2px 0 rgba(90, 80, 30, 0.3), 0 10px 20px -10px rgba(0, 0, 0, 0.8); }
.closing .button.night small { color: #4A4220; }

.fell { position: fixed; z-index: 3; left: 0; right: 0; bottom: 0; height: calc(var(--rise) + var(--head)); overflow: hidden; contain: layout paint; pointer-events: none; will-change: transform; }
.fell img { position: absolute; left: calc(50% - var(--fell-width) / 2); top: calc(var(--head) - var(--fell-width) * 0.07); width: var(--fell-width); height: calc(var(--fell-width) / 3); max-width: none; }
.fell-night { opacity: var(--night); }
.fell-fill { position: absolute; left: 0; right: 0; bottom: 0; top: calc(var(--head) + var(--fell-width) * 0.2633 - 2px); background: color-mix(in srgb, #031C08 calc(var(--night) * 100%), #043F11); }
.grass { position: absolute; inset: 0; width: 100%; height: 100%; }

.lost { min-height: 100vh; margin: 0; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px 24px 30vh; text-align: center; background: #FCE8B7 url(/art/sky-dawn.webp) center / cover; }
.lost h1 { margin: 0; }
.lost p { margin: 0; color: var(--pine-soft); font-size: 20px; }

@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 1.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
  .glow { animation: bloom 2.2s cubic-bezier(0.16, 1, 0.3, 1) both; }
  @keyframes rise { from { transform: translateY(46%) rotate(-10deg) scale(0.94); } }
  @keyframes bloom { from { opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .sun, .moon { transition: none; }
}

@media (max-width: 1560px) {
  .wide-only { display: none; }
  .links { padding-left: 6px; }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  :root { --gap: 26vh; --orb: clamp(84px, 15vh, 150px); --rise: clamp(96px, calc(100vh - 705px), 22vh); }
  .closing { padding-top: 25vh; padding-bottom: calc(var(--rise) + var(--head)); }
  .preview { white-space: normal; width: max-content; max-width: calc(100% - 24px); text-align: center; }
  .hero { padding-top: clamp(84px, 12vh, 120px); }
  .gets { grid-auto-flow: row; gap: 14px; }
  .sheet .intro { font-size: 18px; }
  .parts > div { display: block; }
  .parts dt { text-align: left; }
  .ledger th { padding-right: 0.8em; }
  .ledger td { white-space: normal; max-width: 8.5em; }
  .halves { grid-template-columns: 1fr; }
  .half > p { min-height: 0; }
  .command { padding-left: 14px; }
}
