@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jbmono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #efefec;
  --ink: #121214;
  --mute: #63636a;
  --line: rgba(18, 18, 20, 0.16);
  --acc: #d93a12;
  --band: 42lvh;
  --pad: clamp(22px, 7vw, 128px);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e10;
    --ink: #ecebe6;
    --mute: #94938e;
    --line: rgba(236, 235, 230, 0.18);
    --acc: #ff5a2b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.55 "Archivo", system-ui, sans-serif;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection { background: var(--acc); color: #fff; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 4px; }

/* ---------- 3D canvas ---------- */
#gl {
  position: fixed;
  top: 0; right: 0;
  width: 62vw; height: 100lvh;
  display: block;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
}
#gl.on { opacity: 1; }
#gl { cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
#gl.drag { cursor: grabbing; }

/* ---------- header ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 5;
  display: flex; align-items: center; gap: 24px;
  padding: 22px var(--pad);
  font: 500 12px/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.06em; text-transform: uppercase;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.top .me { font: 800 17px/1 "Archivo", sans-serif; font-stretch: 118%; letter-spacing: -0.02em; text-transform: none; }
.top .count { color: var(--mute); margin-right: auto; font-variant-numeric: tabular-nums; }
.top .count b { color: var(--ink); font-weight: 500; }
.top nav { display: flex; gap: 22px; }
.top nav a, .ln a, .big a { background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; padding-bottom: 3px; transition: background-size 0.45s var(--ease), color 0.2s; }
.top nav a:hover, .ln a:hover, .big a:hover { background-size: 0 1px; background-position: 100% 100%; color: var(--acc); }

/* ---------- section rail ---------- */
.rail {
  position: fixed; right: 20px; top: 50%; z-index: 5;
  transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: flex-end;
}
.rail a {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  height: 22px; padding-left: 20px;
  font: 500 10.5px/1 "JetBrains Mono", monospace; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--mute);
}
.rail a span { opacity: 0; transform: translateX(6px); transition: opacity 0.3s, transform 0.3s var(--ease); white-space: nowrap; }
.rail a::after { content: ""; width: 14px; height: 1px; background: currentColor; transform-origin: right; transition: transform 0.4s var(--ease), background 0.2s; }
.rail a:hover span { opacity: 1; transform: none; }
.rail a.on span { opacity: 1; transform: translateX(-20px); }
.rail a.on { color: var(--ink); }
.rail a.on::after { transform: scaleX(2.2); background: var(--acc); height: 2px; }

/* ---------- sections ---------- */
main { position: relative; z-index: 1; pointer-events: none; }
.s {
  min-height: 100vh; min-height: 100lvh;
  display: flex; align-items: center;
  padding: 110px var(--pad);
  pointer-events: none;
}
.c { width: min(43vw, 560px); pointer-events: auto; }
.hero .c { width: min(54vw, 780px); }

.k {
  font: 500 12px/1.5 "JetBrains Mono", monospace;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 22px;
}
.k .n { color: var(--acc); margin-right: 14px; }

h1, h2 {
  font-weight: 780; font-stretch: 114%;
  letter-spacing: -0.04em; line-height: 0.96;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 5.6vw, 5.6rem); margin-bottom: 32px; }
h2 { font-size: clamp(2.3rem, 4.5vw, 4.3rem); margin-bottom: 20px; }
.lead { font-size: clamp(1.2rem, 1.55vw, 1.45rem); line-height: 1.3; font-weight: 560; letter-spacing: -0.012em; margin-bottom: 16px; text-wrap: balance; }
.b { color: var(--mute); max-width: 54ch; text-wrap: pretty; }
.hero .b { font-size: 1.1rem; max-width: 50ch; }

.st {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 22px;
  margin-top: 32px; padding-top: 18px;
  border-top: 1px solid var(--line);
}
.st dt { font-weight: 640; font-stretch: 122%; font-size: clamp(1.3rem, 1.9vw, 1.8rem); letter-spacing: -0.03em; line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.st dd { margin-top: 7px; font-size: 13px; line-height: 1.4; color: var(--mute); }

.cv { margin-top: 24px; padding-left: 14px; border-left: 2px solid var(--acc); font-size: 14px; line-height: 1.5; color: var(--mute); max-width: 52ch; }
.cv span { display: block; margin-bottom: 3px; font: 500 10.5px/1.4 "JetBrains Mono", monospace; letter-spacing: 0.09em; text-transform: uppercase; color: var(--acc); }

.ln { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 28px; font: 500 12px/1 "JetBrains Mono", monospace; letter-spacing: 0.07em; text-transform: uppercase; }
.ln a::after { content: " ↗"; }

.cue { margin-top: 54px; display: flex; align-items: center; gap: 14px; font: 500 12px/1 "JetBrains Mono", monospace; letter-spacing: 0.07em; text-transform: uppercase; color: var(--mute); }
.arrow { width: 1px; height: 34px; background: var(--line); position: relative; overflow: hidden; }
.arrow::after { content: ""; position: absolute; inset: 0; background: var(--acc); animation: drop 2.2s var(--ease) infinite; }
@keyframes drop { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }

/* upstream list */
.up { list-style: none; margin-top: 26px; border-top: 1px solid var(--line); }
.up a { display: grid; grid-template-columns: 7.2em 1fr auto; gap: 14px; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; line-height: 1.4; transition: padding 0.4s var(--ease), color 0.2s; }
.up a:hover { padding-left: 8px; }
.up a:hover b { color: var(--acc); }
.up b { font-weight: 660; font-stretch: 112%; letter-spacing: -0.01em; transition: color 0.2s; }
.up span { color: var(--mute); }
.up i { font: 500 10.5px/1 "JetBrains Mono", monospace; letter-spacing: 0.08em; text-transform: uppercase; font-style: normal; color: var(--mute); white-space: nowrap; }
.up i.ok { color: var(--acc); }

.big { margin-top: 30px; font-weight: 600; font-stretch: 110%; font-size: clamp(1.15rem, 2vw, 1.75rem); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.fine { margin-top: 56px; font: 400 11px/1.5 "JetBrains Mono", monospace; letter-spacing: 0.05em; color: var(--mute); }

/* ---------- reveal ---------- */
.js .r { opacity: 0; transform: translate3d(0, 22px, 0); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js .in .r { opacity: 1; transform: none; }
.js .in .r:nth-child(2) { transition-delay: 0.07s; }
.js .in .r:nth-child(3) { transition-delay: 0.14s; }
.js .in .r:nth-child(4) { transition-delay: 0.21s; }
.js .in .r:nth-child(5) { transition-delay: 0.28s; }
.js .in .r:nth-child(6) { transition-delay: 0.35s; }
.js .in .r:nth-child(7) { transition-delay: 0.42s; }

/* ---------- phones and portrait tablets: the model sits in a band on top ---------- */
@media (max-width: 860px), (orientation: portrait) {
  :root { --pad: 22px; }
  body { font-size: 16px; }
  #gl, #gl.on { left: 0; right: auto; width: 100vw; height: var(--band); z-index: 3; background: var(--bg); opacity: 1; transition: none; }
  body::before {
    content: ""; position: fixed; left: 0; right: 0; top: calc(var(--band) - 1px); height: 34px; z-index: 3;
    background: linear-gradient(var(--bg), transparent); pointer-events: none;
  }
  .rail { display: none; }
  .top { padding: 16px var(--pad); }
  .top nav a:first-child { display: none; }
  main { padding-top: var(--band); }
  .s { min-height: calc(100lvh - var(--band)); align-items: flex-start; padding: 44px var(--pad) 56px; }
  .c, .hero .c { width: 100%; max-width: 620px; }
  h1 { font-size: clamp(2.1rem, 9.6vw, 3.6rem); margin-bottom: 22px; }
  h2 { font-size: clamp(2rem, 9vw, 3.4rem); }
  .k { margin-bottom: 16px; font-size: 11px; }
  .st { gap: 0 14px; margin-top: 26px; }
  .st dt { font-size: clamp(1.1rem, 5.2vw, 1.6rem); }
  .st dd { font-size: 12px; }
  .cue { margin-top: 34px; }
  .up a { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .up span { grid-column: 1 / -1; grid-row: 2; }
  .end { padding-bottom: 96px; }
}
@media (min-width: 861px) and (orientation: landscape) {
  .top .count { visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .r { transition-duration: 0.01s; transform: none; }
  .arrow::after { animation: none; }
}
