/* Think Open Robots. Fonts are self-hosted (SIL OFL 1.1, see fonts/OFL-*.txt). */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --ink: #11141B;
  --paper: #F7F8FA;
  --white: #FFFFFF;
  --muted: #4A5160;
  --body: #2A2F3A;
  --rule: #C9CED8;
  --grid: #E3E6EC;
  --row-rule: #DDE1E8;
  --accent: #1E50FF;
  --accent-tint: #CED9FF;
  --yellow: #FFC800;
  --green: #00A65A;
  --red: #D9301A;
  --base-bg: #FFF7D1;
  --agent-bg: #F2F4F7;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease-mech: cubic-bezier(0.65, 0, 0.35, 1);
}

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
}
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 1rem; top: -5rem; z-index: 10;
  background: var(--white); border: 2px solid var(--ink); padding: 8px 12px; font-weight: 700;
}
.skip:focus { top: 0.5rem; }

.wrap {
  max-width: 1200px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.mono { font-family: var(--mono); }
.bg-yellow { background: var(--yellow); }
.bg-blue { background: var(--accent); color: var(--white); }
.bg-green { background: var(--green); }
.bg-red { background: var(--red); }
.bg-ink { background: var(--ink); }
.bg-white { background: var(--white); }
.band-rule { border-bottom: 2px solid var(--ink); }
.pad-section { padding-top: clamp(24px, 2vw, 28px); padding-bottom: clamp(24px, 2vw, 28px); }
.grid-ground {
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
}
.eyebrow { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.title { margin: 0; font-weight: 800; font-stretch: 125%; font-size: clamp(28px, 2.8vw, 40px); line-height: 1; letter-spacing: -0.02em; }
.subtitle { margin: 0; font-weight: 800; font-stretch: 125%; font-size: clamp(20px, 1.7vw, 25px); line-height: 1.1; letter-spacing: -0.01em; }

/* ---------- header ---------- */
header.site { background: var(--white); border-bottom: 2px solid var(--ink); }
header.site .bar { padding-top: 12px; padding-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 32px; }
.brand { display: flex; align-items: center; gap: 14px; min-height: 44px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
/* the mark: the hero's red cube stacked on the green one, the small yellow cube beside them */
.logo { display: block; flex: none; }
.brand-name { font-weight: 800; font-stretch: 125%; font-size: 18px; letter-spacing: 0.02em; line-height: 1; text-transform: uppercase; }
header.site nav { margin-left: auto; }
header.site nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
header.site nav a { display: flex; align-items: center; min-height: 44px; padding: 0 14px; font-weight: 700; font-size: 15px; text-decoration: none; color: var(--ink); }
header.site nav a:hover { color: var(--accent); }
header.site nav a[aria-current="page"] { box-shadow: inset 0 -4px 0 var(--accent); }
/* the GitHub mark sits just right of the nav: the bar's 32px gap less 24px */
.gh { display: flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; margin-left: -24px; color: var(--ink); }
.gh svg { display: block; }
.gh:hover { color: var(--accent); }

/* ---------- hero ---------- */
.hero { border-bottom: 2px solid var(--ink); }
.hero-in { padding-top: clamp(48px, 7vw, 96px); padding-bottom: clamp(48px, 7vw, 96px); display: flex; flex-wrap: wrap; align-items: center; gap: 40px 56px; }
.hero-text { flex: 1 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.display { margin: 0; font-weight: 800; font-stretch: 125%; font-size: clamp(40px, 5vw, 72px); line-height: 1; letter-spacing: -0.025em; text-wrap: balance; }
.hl { background: var(--yellow); padding: 0 0.08em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.lead { margin: 0; max-width: 58ch; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.55; color: var(--body); text-wrap: pretty; }
.hero-art { flex: 0 1 440px; min-width: 0; max-width: 100%; }
.hero-art svg { display: block; width: 100%; height: auto; max-width: 100%; }

/* ---------- section heads: title and its statement side by side ---------- */
.head-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 48px; align-items: end; }
.kicker { margin: 0; max-width: 46ch; font-size: clamp(18px, 1.6vw, 23px); font-weight: 650; font-stretch: 110%; line-height: 1.3; text-wrap: balance; }
.kicker-s { margin: 0; max-width: 60ch; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.45; font-weight: 600; }

/* ---------- challenge: progress and standings ---------- */
.board-block { margin-top: clamp(18px, 1.8vw, 24px); display: flex; flex-direction: column; gap: clamp(22px, 2vw, 28px); scroll-margin-top: 12px; }
.sub-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.sec-meta { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--muted); max-width: 80ch; }
.sample-tag { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--ink); background: var(--white); padding: 3px 10px 3px 3px; font-family: var(--mono); font-size: 12px; font-weight: 700; }
.hatch-sq { width: 18px; height: 18px; background: repeating-linear-gradient(135deg, var(--ink) 0 4px, var(--yellow) 4px 8px); }

.notice { margin-top: 10px; border: 2px solid var(--ink); background: var(--white); padding: 12px 16px; font-size: 16px; line-height: 1.5; }
.notice.error { background: var(--base-bg); }
.notice button, .btn-plain {
  margin-left: 12px; min-height: 40px; padding: 0 14px; font: inherit; font-weight: 700; cursor: pointer;
  color: var(--ink); background: var(--white); border: 2px solid var(--ink);
}
.notice button:hover { background: var(--yellow); }

.controls { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.controls label { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; cursor: pointer; }
.controls input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }

/* tables: real <table> with explicit ARIA roles, laid out as grid rows */
.board-host { margin-top: 10px; }
.table-wrap { border: 2px solid var(--ink); background: var(--white); overflow-x: auto; }
.board { display: block; min-width: 1142px; border-collapse: collapse; }
.board thead, .board tbody { display: block; }
.board tr { display: grid; grid-template-columns: 80px minmax(300px, 2.5fr) minmax(300px, 2.3fr) 150px 196px 116px; align-items: center; background: var(--white); }
.board.final tr { grid-template-columns: 80px minmax(300px, 2.5fr) minmax(300px, 2.3fr) 150px 196px; }
.board thead tr { background: var(--paper); border-bottom: 2px solid var(--ink); align-items: end; }
.board th { display: block; padding: 10px 16px 9px; text-align: left; font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.board th.th-score { display: flex; flex-direction: column; gap: 4px; }
.th-scale { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.th-scale > span:last-child { display: flex; justify-content: space-between; }
.board td { display: block; padding: 8px 16px; min-width: 0; }
.board tbody tr + tr { border-top: 1px solid var(--row-rule); }
.board tbody tr + tr.band-first { border-top: 2px solid var(--ink); }
.board tr.is-base { background: var(--base-bg); }
.board td.cell-band { padding: 8px 16px; }
.band-badge { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; box-sizing: border-box; border: 2px solid var(--ink); color: var(--ink); font-family: var(--mono); font-weight: 700; font-size: 15px; }
.band-first .band-badge { background: var(--ink); color: var(--white); }

.board td.cell-account { display: flex; align-items: center; gap: 12px; }
.avatar { position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%; box-sizing: border-box; border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; font-weight: 800; font-stretch: 115%; font-size: 14px; line-height: 1; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--white); }
.avatar.av-0 { background: var(--yellow); color: var(--ink); }
.avatar.av-1 { background: var(--accent); color: var(--white); }
.avatar.av-2 { background: var(--green); color: var(--ink); }
.avatar.av-3 { background: var(--red); color: var(--white); }
.avatar.av-base { background: var(--ink); border: 0; }
.avatar.av-base span { width: 11px; height: 11px; background: var(--yellow); }
.who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.who-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.who-name { font-weight: 800; font-size: 16px; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
a.who-name:hover { color: var(--accent); text-decoration: underline; }
.base-tag { background: var(--ink); color: var(--white); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 6px; }
.agent-tag { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; box-sizing: border-box; padding: 1px 9px 1px 2px; border: 1.5px solid var(--ink); background: var(--agent-bg); font-size: 13px; font-weight: 650; line-height: 18px; }
.is-base .agent-tag { background: var(--white); }
.agent-tag svg { flex: none; }
.agent-tag > span { min-width: 0; overflow-wrap: anywhere; }
.who-sub { font-size: 13px; line-height: 1.35; color: var(--muted); }

.board td.cell-score { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: center; }
.score-num { display: flex; flex-direction: column; gap: 1px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.score-num .num { font-size: 19px; font-weight: 700; line-height: 1.1; }
.score-num .ci { font-size: 12.5px; color: var(--muted); }
.ivl { position: relative; display: block; height: 26px; }
.ivl .track { position: absolute; left: 0; right: 0; top: 12px; height: 2px; background: var(--grid); }
.ivl .base-tick { position: absolute; top: 0; bottom: 0; border-left: 2px dotted var(--muted); }
.ivl .range { position: absolute; top: 7px; height: 12px; box-sizing: border-box; background: var(--accent-tint); border-left: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.ivl .dot { position: absolute; top: 3px; width: 4px; height: 20px; margin-left: -2px; background: var(--ink); }
.ivl .scale { display: none; }

.board td.cell-tokens { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.pips { display: flex; gap: 3px; }
.pips span { width: 9px; height: 9px; border: 2px solid var(--ink); background: var(--white); }
.pips span.on { background: var(--ink); }
.board td.cell-date { font-family: var(--mono); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.board td.cell-date time span { display: block; white-space: pre; }
.board td.cell-commit, .board td.cell-picks { font-family: var(--mono); font-size: 14px; font-weight: 700; }
.board td.cell-commit a, .board td.cell-picks a { color: var(--accent); }
.board td.cell-commit a:hover, .board td.cell-picks a:hover { color: var(--ink); }
.board td.cell-runs { font-size: 15px; }
.picks { display: flex; flex-direction: column; gap: 4px; }
.picks .who-sub { font-family: var(--sans); font-weight: 400; }
.empty { margin: 0; padding: 20px 16px; color: var(--muted); text-align: center; }

/* chart */
.legend { list-style: none; margin: 0 0 0 auto; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 14px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.lg-best { width: 26px; height: 0; border-top: 3px solid var(--accent); }
.lg-base { width: 26px; height: 0; border-top: 2px dashed var(--muted); }
.lg-pt { width: 12px; height: 12px; box-sizing: border-box; background: var(--white); border: 2px solid var(--ink); }
.lg-rec { width: 12px; height: 12px; box-sizing: border-box; background: var(--accent); border: 2px solid var(--accent); }
figure.chart { margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.chart-box { position: relative; height: clamp(240px, 19.5vw, 280px); background: var(--white); border: 2px solid var(--ink); }
.plot { position: absolute; left: 60px; right: 24px; top: 24px; bottom: 44px; }
.ytick { position: absolute; left: 0; right: 0; border-top: 1px solid var(--grid); }
.ytick.zero { border-top: 2px solid var(--ink); }
.ytick span, .xtick, .base-lbl { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.ytick span { position: absolute; right: calc(100% + 10px); top: -9px; line-height: 18px; }
.xtick { position: absolute; top: 100%; transform: translateX(-50%); padding-top: 12px; line-height: 18px; }
.base-line { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--muted); }
.base-lbl { position: absolute; right: 6px; padding-top: 6px; line-height: 16px; }
.step-svg { position: absolute; left: 0; top: 0; overflow: visible; }
.step { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: miter; }
.best-lbl { position: absolute; transform: translate(-100%, -150%); padding: 0 4px; background: var(--white); font-family: var(--mono); font-size: 13px; font-weight: 700; line-height: 18px; color: var(--accent); white-space: nowrap; }
.pt { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; padding: 0; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pt i { display: block; width: 13px; height: 13px; box-sizing: border-box; background: var(--white); border: 2px solid var(--ink); }
.pt.record i { background: var(--accent); border-color: var(--accent); }
.pt:hover i, .pt.on i { outline: 2px solid var(--ink); outline-offset: 2px; }
.tip { position: absolute; z-index: 2; pointer-events: none; min-width: 210px; max-width: 280px; box-sizing: border-box; background: var(--ink); color: var(--white); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.35; }
.tip .t-who { font-weight: 800; font-size: 15px; overflow-wrap: anywhere; }
.tip .t-agent { display: flex; align-items: center; gap: 7px; color: var(--yellow); font-weight: 650; }
.tip .t-agent svg { flex: none; }
.tip .t-score { font-family: var(--mono); font-size: 14px; font-weight: 700; white-space: pre; }
.tip .t-when { font-family: var(--mono); font-size: 12px; color: var(--rule); }

/* ---------- how it works: pipeline ---------- */
.pipe-wrap { margin-top: clamp(14px, 1.4vw, 20px); }
.pipe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 48px; }
.card { position: relative; display: flex; flex-direction: column; background: var(--white); border: 2px solid var(--ink); }
.card-head { padding: 6px 10px 6px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--ink); }
.card-head svg { flex: none; width: 22px; height: 22px; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.card-body h3 { margin: 0; font-size: 18px; font-weight: 800; font-stretch: 115%; line-height: 1.15; }
.card-body p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--body); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.chips li { border: 1.5px solid var(--ink); padding: 1px 7px; font-size: 13px; line-height: 1.4; }
.arrow-h { position: absolute; right: -47px; top: calc(50% - 8px); overflow: visible; }
.token { fill: var(--yellow); stroke: var(--ink); stroke-width: 2; opacity: 0; }
.loop { position: relative; margin-inline: calc((100% - 144px) / 8); height: 26px; }
.loop-lines { position: absolute; left: 1px; right: 1px; top: 0; bottom: 1px; width: calc(100% - 2px); height: calc(100% - 1px); overflow: visible; }
.loop-lines line { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 6 6; }
.loop-head { position: absolute; left: -7px; top: -2px; }
.loop-label { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); background: var(--paper); padding: 0 12px; font-family: var(--mono); font-size: 12px; line-height: 20px; white-space: nowrap; }

/* ---------- how it works: tasks and scenes ---------- */
.facts { margin-top: clamp(18px, 1.6vw, 22px); border-top: 2px solid var(--ink); display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
.fact { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; min-width: 0; }
.fact-tasks { padding-right: 36px; }
.fact-scenes { padding-left: 36px; border-left: 1px solid var(--rule); }
.fact-h { margin: 0; font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.fact-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fact-lead { margin: 0; font-size: 16px; line-height: 1.5; max-width: 62ch; }
.tasks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tasks li { background: var(--white); border: 2px solid var(--ink); padding: 5px 8px 5px 5px; display: flex; align-items: center; gap: 8px; }
.tasks svg { display: block; flex: none; width: 48px; height: 36px; }
.tasks li > span { font-size: 14px; font-weight: 700; line-height: 1.25; }

.scenes { gap: 8px; }
.split { display: grid; grid-template-columns: 210fr 140fr 350fr; gap: 6px; }
.split-nums { font-family: var(--mono); font-weight: 700; font-size: clamp(20px, 2vw, 28px); line-height: 1; }
.split-bar { height: 30px; }
.seg { border: 2px solid var(--ink); transform-origin: left center; }
.seg-private { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg-private span:first-child { background: var(--ink); }
.seg-private span:last-child { background: repeating-linear-gradient(135deg, var(--ink) 0 5px, var(--white) 5px 11px); }
/* the three labels as rows: name, then what it is */
.split.split-labels { margin-top: 4px; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.split-item { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 4px 12px; align-items: baseline; }
.split-h { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; line-height: 1.45; }
.key { width: 12px; height: 12px; border: 2px solid var(--ink); flex: none; box-sizing: border-box; }
.split-t { font-size: 15px; line-height: 1.45; color: var(--body); }
.private-split { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.private-split > span { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 1.4; }
.private-split b { font-family: var(--mono); }
.key-sq { width: 14px; height: 14px; margin-top: 2px; background: var(--ink); flex: none; box-sizing: border-box; }
.key-sq.hatch { border: 2px solid var(--ink); background: repeating-linear-gradient(135deg, var(--ink) 0 2px, var(--white) 2px 5px); }

/* ---------- infrastructure ---------- */
.infra { margin-top: clamp(14px, 1.4vw, 20px); display: grid; grid-template-columns: minmax(0, 1fr) 184px minmax(0, 1fr); align-items: stretch; }
.box { border: 2px solid var(--ink); background: var(--white); display: flex; flex-direction: column; min-width: 0; }
.box-head { padding: 10px 16px; border-bottom: 2px solid var(--ink); display: flex; flex-direction: column; gap: 3px; }
.box-head h3 { margin: 0; font-size: 22px; font-weight: 800; font-stretch: 120%; line-height: 1.1; }
.box-body { padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.box-body > p { margin: 0; font-size: 16px; line-height: 1.5; }
.box-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding-top: 10px; border-top: 1px solid var(--rule); }
.row-h { font-weight: 700; font-size: 15px; line-height: 1.35; }
.row-t { flex: 1 1 220px; font-size: 15px; line-height: 1.5; }
.quota { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.quota .mono { font-size: 13px; }
.squares { display: flex; gap: 3px; }
.squares span { width: 14px; height: 14px; background: var(--accent); border: 2px solid var(--ink); box-sizing: border-box; }
.mono-chips li { border-width: 2px; padding: 2px 9px; font-family: var(--mono); font-size: 13px; line-height: 1.5; }
.infra-link { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; padding: 12px 8px; text-align: center; }
.infra-link svg { max-width: 100%; }
.link-t { font-size: 14px; line-height: 1.45; color: var(--body); max-width: 30ch; }

/* ---------- join ---------- */
.join { background: var(--yellow); border-top: 2px solid var(--ink); }
.join-in { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 20px 56px; align-items: start; }
/* the prompt block is wider than the text column, so its four lines (71 characters at most) do not wrap */
@media (min-width: 900px) { .join-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); } }
.join-text { display: flex; flex-direction: column; gap: 12px; }
.join-title { margin: 0; font-weight: 800; font-stretch: 125%; font-size: clamp(40px, 4vw, 56px); line-height: 0.95; letter-spacing: -0.03em; }
.join-text p { margin: 0; max-width: 46ch; font-size: clamp(16px, 1.3vw, 18px); line-height: 1.5; }
.join-act { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
pre.prompt { margin: 0; background: var(--ink); color: var(--white); border: 2px solid var(--ink); padding: 14px 16px; font-family: var(--mono); font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; -webkit-user-select: all; user-select: all; }
pre.prompt:focus-visible { outline-color: var(--ink); outline-offset: 3px; }
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
/* the hard shadow is the wrapper behind the button, so pressing moves the button with transform only */
.press { display: inline-block; margin: 4px 0 0 4px; background: var(--ink); }
.copy-btn {
  display: block; min-height: 48px; padding: 0 24px; background: var(--accent); color: var(--white);
  border: 2px solid var(--ink); font-family: inherit; font-size: 17px; font-weight: 800; font-stretch: 112%; cursor: pointer;
  transform: translate(-4px, -4px); transition: transform 90ms var(--ease-mech), background-color 120ms linear;
}
.copy-btn:hover { background: #1440DB; }
.copy-btn:active { transform: translate(-1px, -1px); }
.copy-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.copy-status { font-size: 15px; font-weight: 650; }
.join-links { margin: 0; font-size: 16px; line-height: 1.5; }
.join-links a { font-weight: 700; }

/* ---------- videos: a collage of square clips on black rules, the feature clip two by two ---------- */
.videos { background: var(--white); border-top: 2px solid var(--ink); }
.clips { margin-top: clamp(14px, 1.4vw, 20px); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; background: var(--ink); border: 2px solid var(--ink); }
.clip { margin: 0; display: flex; flex-direction: column; min-width: 0; background: var(--white); }
.clip-feature { grid-column: span 2; grid-row: span 2; }
.clip-media { position: relative; aspect-ratio: 1 / 1; background: var(--ink); overflow: hidden; }
/* the feature fills the two rows the small clips set */
.clip-feature .clip-media { aspect-ratio: auto; flex: 1 1 0; min-height: 0; }
.clip video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; background: var(--ink); }
.clip video:fullscreen { object-fit: contain; }
.clip video:-webkit-full-screen { object-fit: contain; }
.clips.enhanced video { cursor: pointer; }
.clip-cap { border-top: 2px solid var(--ink); padding: 6px 10px 7px; display: flex; flex-direction: column; gap: 1px; }
.clip-feature .clip-cap { flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; }
.clip-name { font-weight: 800; font-stretch: 115%; font-size: 15px; line-height: 1.3; }
.clip-feature .clip-name { font-size: 17px; }
.clip-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.05em; line-height: 1.5; text-transform: uppercase; }
.clip-out { display: inline-flex; align-items: center; gap: 6px; }
.clip-id { text-transform: none; }
.clip-ctl { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.clip-btn { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; background: var(--white); color: var(--ink); border: 2px solid var(--ink); cursor: pointer; }
.clip-btn:hover { background: var(--yellow); }
.clip-btn svg { display: block; }
@media (max-width: 759px) {
  .clips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clip-feature { grid-row: auto; }
  .clip-feature .clip-media { aspect-ratio: 1 / 1; flex: none; }
}

/* ---------- medium screens: heads stack ---------- */
@media (max-width: 899px) {
  .head-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .legend { margin-left: 0; flex-basis: 100%; }
}

/* ---------- narrow screens (from the phone layout) ---------- */
@media (max-width: 760px) {
  .join-title { font-size: 36px; }
  pre.prompt { padding: 12px 14px; }
  .controls { margin-left: 0; }
}

/* ---------- touch screens: bigger hit areas around the chart points and the table's links, same look ---------- */
@media (max-width: 1000px) {
  .pt { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
  a.who-name, .board td.cell-commit a, .board td.cell-picks a { display: inline-block; padding-block: 10px; margin-block: -10px; }
}

/* ---------- horizontal scrollers: the standings table, and below 1000px the how-it-works and infrastructure diagrams ---------- */
/* app.js makes a scroller focusable while it scrolls and marks its frame more-left / more-right,
 * which shows a shadow on that edge: the content continues there. */
.table-wrap { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.board-host, .scroll-frame { position: relative; }
.board-host::before, .board-host::after, .scroll-frame::before, .scroll-frame::after {
  content: ""; position: absolute; z-index: 1; top: 0; bottom: 0; width: 28px; pointer-events: none; opacity: 0; transition: opacity 160ms linear;
}
.board-host::before, .scroll-frame::before { left: 0; background: linear-gradient(to right, rgba(17, 20, 27, 0.18), rgba(17, 20, 27, 0)); }
.board-host::after, .scroll-frame::after { right: 0; background: linear-gradient(to left, rgba(17, 20, 27, 0.18), rgba(17, 20, 27, 0)); }
/* inside the table's border */
.board-host::before, .board-host::after { top: 2px; bottom: 2px; }
.board-host::before { left: 2px; }
.board-host::after { right: 2px; }
.more-left::before, .more-right::after { opacity: 1; }
.table-wrap:focus-visible, .scroller:focus-visible { outline-offset: -3px; }

@media (max-width: 999px) {
  /* the frame runs to the screen edges, so the diagrams are cut by the screen, not by the page margin */
  .scroll-frame { margin-inline: calc(-1 * max(20px, env(safe-area-inset-left, 0px))) calc(-1 * max(20px, env(safe-area-inset-right, 0px))); }
  .scroller {
    display: flex; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
    padding-left: max(20px, env(safe-area-inset-left, 0px));
  }
  /* the right margin as a flex item: end padding of a scroller is not kept by every browser */
  .scroller::after { content: ""; flex: 0 0 max(20px, env(safe-area-inset-right, 0px)); }
  .scroller > * { flex: 1 0 0%; }
  /* widths at which each diagram reads as on desktop */
  .pipe-wrap { min-width: 1000px; padding-bottom: 12px; }
  .facts { min-width: 1000px; }
  .infra { min-width: 860px; }
}

/* ---------- hero stacked (text above the arm): crop the arm's empty sky, the top 100 of its 420 viewBox units ---------- */
@media (max-width: 1120px) {
  .hero-art { overflow: hidden; }
  .hero-art svg { margin-top: calc(-100% / 5.2); }
}
@media (min-width: 641px) and (max-width: 1120px) {
  .hero-in { row-gap: 16px; }
  .hero-art { margin-left: auto; }
}

/* ---------- phones ---------- */
@media (max-width: 640px) {
  /* header: the wordmark and the GitHub mark on one line, the nav as tabs on the rule under them */
  header.site .bar { padding-top: 6px; padding-bottom: 0; column-gap: 8px; row-gap: 0; flex-wrap: wrap; }
  .brand { flex: 1 1 auto; min-width: 0; gap: 10px; }
  .logo { width: 24px; height: 24px; }
  .brand-name { font-size: clamp(14px, 4.2vw, 17px); }
  .gh { order: 2; margin: 0 -10px 0 0; }
  header.site nav { order: 3; flex-basis: 100%; margin-left: 0; }
  header.site nav ul { gap: 0; }

  /* hero: tighter, the arm full width */
  .hero-in { padding-top: 32px; padding-bottom: 24px; row-gap: 12px; }
  .hero-text { gap: 16px; }
  .display { font-size: clamp(36px, 10.6vw, 46px); }
  .lead { font-size: 17px; line-height: 1.5; }
  .hero-art { flex: 1 1 100%; }

  .kicker { font-size: 17px; }
  .legend { gap: 4px 16px; font-size: 13px; }
  .controls label { font-size: 14px; line-height: 1.35; }
  .chart-box { height: 220px; }

  /* the prompt flows as one paragraph instead of breaking mid-line (copying uses its own text) */
  pre.prompt { white-space: normal; font-size: 12.5px; line-height: 1.65; }
  .join-text p { font-size: 16px; }
}

/* ---------- motion (only when motion.js sets .motion: never with reduced motion) ---------- */
/* Start states are screen-only, so a printout always shows the finished state. */
@media screen {
  .motion .split-bar:not(.revealed) .seg { transform: scaleX(0); }
  .motion .board-host:not(.revealed) .ivl .range { transform: scaleX(0); }
  .motion .chart-box:not(.revealed) .step { stroke-dashoffset: var(--len, 0); }
  .motion .chart-box:not(.revealed) .pt i, .motion .chart-box:not(.revealed) .best-lbl { opacity: 0; transform: scale(0.2); }
  .motion .chart-box:not(.revealed) .best-lbl { transform: translate(-100%, -150%); }
}
.motion .split-bar .seg { transition: transform 900ms var(--ease-mech); }
.motion .split-bar .seg:nth-child(2) { transition-delay: 120ms; }
.motion .split-bar .seg:nth-child(3) { transition-delay: 240ms; }

.motion .board-host .ivl .range { transform-origin: var(--o, 50%) 50%; transition: transform 700ms var(--ease-mech); transition-delay: calc(var(--i, 0) * 45ms); }

.motion .chart-box .step { stroke-dasharray: var(--len, none); transition: stroke-dashoffset 1400ms var(--ease-mech); }
.motion .chart-box .pt i { transition: transform 360ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 200ms linear; transition-delay: calc(300ms + var(--i, 0) * 70ms); }
.motion .chart-box .best-lbl { transition: opacity 400ms linear 1300ms; }

.motion .pipe-wrap .token { animation: token-h 5.4s var(--ease-mech) infinite paused; }
.motion .pipe-wrap .card:nth-child(2) .token { animation-delay: 1.2s; }
.motion .pipe-wrap .card:nth-child(3) .token { animation-delay: 2.4s; }
.motion .pipe-wrap .loop-lines line { animation: march 900ms linear infinite paused; }
.motion .pipe-wrap.playing .token, .motion .pipe-wrap.playing .loop-lines line { animation-play-state: running; }
@keyframes token-h {
  0% { transform: translateX(0); opacity: 0; }
  3% { opacity: 1; }
  14% { transform: translateX(26px); opacity: 1; }
  18%, 100% { transform: translateX(26px); opacity: 0; }
}
@keyframes march { to { stroke-dashoffset: -12; } }

.copy-status.pop { animation: pop 260ms var(--ease-mech); }
@keyframes pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
