:root {
  --paper: #f3f0e8;
  --ink: #1b1a18;
  --font: "Gill Sans", "Gill Sans MT", Jost, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--paper); }
body { background: var(--paper); color: var(--ink); font-family: var(--font); overflow-x: hidden; }
#gl, #sheet { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#sheet { pointer-events: none; }
#scroll { height: 3800vh; }

.mark {
  position: fixed; top: 28px; left: 32px; z-index: 3;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; letter-spacing: 0.32em; text-transform: uppercase; font-weight: 400;
}
.mark .sub { font-size: 10px; letter-spacing: 0.24em; opacity: 0.6; }

.caps { position: fixed; left: 32px; bottom: 36px; z-index: 3; pointer-events: none; }
.cap {
  position: absolute; left: 0; bottom: 0; width: min(440px, calc(100vw - 64px));
  visibility: hidden; opacity: 0; color: var(--ink);
}
.cap span { display: block; font-size: 19px; line-height: 26px; font-weight: 300; letter-spacing: 0.01em; }
.cap .k { font-size: 10.5px; line-height: 20px; letter-spacing: 0.3em; text-transform: uppercase; font-weight: 500; opacity: 0.75; }
.cap.light { color: #fbf7ef; text-shadow: 0 1px 14px rgba(0, 0, 0, 0.45); }

#loader {
  position: fixed; inset: 0; z-index: 10; background: var(--paper);
  display: flex; align-items: center; justify-content: center; gap: 18px;
  font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
  transition: opacity 0.9s ease, visibility 0.9s;
}
#loader.done { opacity: 0; visibility: hidden; }
#loader .pct { opacity: 0.5; font-variant-numeric: tabular-nums; }

/* ---------- title screen */
.hero {
  position: fixed; left: 32px; top: 50%; transform: translateY(-50%); z-index: 3;
  width: min(360px, calc(50vw - 260px)); pointer-events: none;
}
.hero .eyebrow, .facts .eyebrow { font-size: 10.5px; letter-spacing: 0.3em; text-transform: uppercase; font-weight: 500; opacity: 0.7; margin-bottom: 14px; }
.hero h1 { font-size: clamp(34px, 3.4vw, 52px); line-height: 1.02; font-weight: 300; letter-spacing: -0.01em; margin-bottom: 18px; }
.hero .lede { font-size: 16px; line-height: 24px; font-weight: 300; opacity: 0.85; margin-bottom: 28px; }
.hero .cue { font-size: 10.5px; letter-spacing: 0.3em; text-transform: uppercase; display: flex; align-items: center; gap: 12px; }
.hero .cue span { width: 1px; height: 34px; background: var(--ink); animation: cue 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
.todo { background: #f7e27a; padding: 0 3px; }

/* ---------- facts, after the film */
.facts {
  position: relative; z-index: 5; background: var(--paper);
  padding: 120px 32px 64px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px;
  border-top: 1px solid rgba(27, 26, 24, 0.15);
}
.facts h2 { font-size: clamp(28px, 2.6vw, 40px); line-height: 1.12; font-weight: 300; margin-bottom: 22px; }
.facts-head > p { font-size: 16px; line-height: 25px; font-weight: 300; max-width: 46ch; margin-bottom: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: baseline; gap: 10px; padding: 14px 20px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper); text-decoration: none; font-size: 13px; letter-spacing: 0.08em;
}
.btn small { font-size: 11px; opacity: 0.7; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn:focus-visible { outline: 2px solid #b08d57; outline-offset: 3px; }
.facts-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid rgba(27, 26, 24, 0.2); }
.facts-grid div { padding: 18px 0 18px; border-bottom: 1px solid rgba(27, 26, 24, 0.2); padding-right: 24px; }
.facts-grid dt { font-size: 10.5px; letter-spacing: 0.26em; text-transform: uppercase; opacity: 0.6; margin-bottom: 6px; }
.facts-grid dd { font-size: 16px; line-height: 23px; font-weight: 300; }
.credits { grid-column: 1 / -1; font-size: 12px; opacity: 0.55; letter-spacing: 0.02em; }

/* ---------- no WebGL: show the drawing and the facts */
.fallback { display: none; }
.no-webgl #gl, .no-webgl #sheet, .no-webgl .caps, .no-webgl #loader, .no-webgl #scroll { display: none; }
.no-webgl .hero { position: relative; transform: none; top: auto; left: auto; width: auto; padding: 120px 32px 40px; max-width: 560px; }
.no-webgl .hero .cue { display: none; }
.no-webgl .fallback { display: block; width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 32px; }
.no-webgl .mark { position: absolute; }

@media (max-width: 900px) {
  .hero { left: 16px; right: 16px; top: auto; bottom: 28px; transform: none; width: auto; padding: 20px; background: rgba(243, 240, 232, 0.92); }
  .hero .lede { font-size: 15px; line-height: 22px; margin-bottom: 18px; }
  .facts { grid-template-columns: 1fr; gap: 40px; padding: 80px 16px 48px; }
}
@media (max-width: 640px) {
  .mark { top: 18px; left: 16px; }
  .caps { left: 16px; bottom: 22px; }
  .cap { width: calc(100vw - 32px); }
  .cap span { font-size: 16px; line-height: 22px; }
  .facts-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .hero .cue span { animation: none; }
}
