/* The Sorting Line. See DESIGN.md. Graphite = computed by code, blue = Jev's judgment. */
:root {
  --paper: #faf9f5; --surface: #ffffff; --ink: #1a1915; --ink-soft: #55534c; --ink-faint: #8a877d;
  --rule: #e4e1d8; --rule-strong: #1a1915;
  --code: #3b3a35; --jev: #2a78d6; --jev-ink: #1c5cab; --jev-wash: #eaf2fc;
  --other: #9a978c; --none: #d9d6cc; --can: #0a7a4f;
  --serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Source Serif Pro", "Sitka Text", Cambria, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Consolas, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141412; --surface: #1b1b19; --ink: #f2f0e8; --ink-soft: #c2bfb3; --ink-faint: #8d8a80;
    --rule: #2f2e2a; --rule-strong: #f2f0e8;
    --code: #a3a094; --jev: #3987e5; --jev-ink: #86b6ef; --jev-wash: #172638;
    --other: #7d7a70; --none: #3d3c37; --can: #4cc795;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--sans); }
a { color: var(--jev-ink); text-underline-offset: 2px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 10px 24px; background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule); font-size: 0.88rem;
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--serif); font-weight: 700; font-size: 1rem; color: var(--ink); text-decoration: none; }
.mark { width: 20px; height: 20px; color: var(--jev); }
.topbar .links { display: flex; gap: 20px; }
.topbar .links a { color: var(--ink-soft); text-decoration: none; }
.topbar .links a:hover { color: var(--ink); }

main { max-width: 1120px; margin: 0 auto; padding: 0 16px 64px; }
.masthead, .sorting, .story { max-width: 760px; margin-left: auto; margin-right: auto; }

/* Masthead */
.masthead { padding-top: 64px; }
.kicker { margin: 0 0 16px; font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); }
h1 {
  font-family: var(--serif); font-weight: 700; font-size: clamp(2.1rem, 5.4vw, 3.4rem);
  line-height: 1.08; letter-spacing: -0.015em; margin: 0 0 20px; text-wrap: balance;
}
h1 .hl { color: var(--jev-ink); }
.dek { font-family: var(--serif); font-size: 1.25rem; line-height: 1.5; color: var(--ink-soft); margin: 0 0 20px; }
.byline { font-size: 0.9rem; color: var(--ink-soft); margin: 0; }
.byline strong { color: var(--ink); font-weight: 600; }

/* Figures and sources */
figure { margin: 0; }
.fig-title { font-size: 0.86rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 18px; }
.fig-n { font-family: var(--mono); font-weight: 600; color: var(--ink); margin-right: 6px; }
.src { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-faint); margin: 14px 0 0; }
.src a { color: inherit; }

/* Fig. 1, the sorting line */
.sorting { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--rule-strong); }
.flow-box { position: relative; min-height: 420px; }
.flow-loading { color: var(--ink-faint); font-size: 0.9rem; }
.flow-box svg { position: absolute; inset: 0 auto auto 0; overflow: visible; }
.flow-box .s-code { fill: var(--code); }
.flow-box .s-drop { fill: var(--none); }
.flow-box .s-ai { fill: var(--jev); }
.flow-box .s-other { fill: var(--other); }
.flow-box .s-none { fill: var(--none); }
.flow-box .tick-code { stroke: var(--code); stroke-width: 1.5; }
.flow-box .tick-jev { stroke: var(--jev); stroke-width: 1.5; }
.flow-box .stream { cursor: pointer; transition: opacity 0.15s; }
.flow-box.hovering .stream:not(.on) { opacity: 0.35; }
.fl { position: absolute; transform: translateY(-50%); font-size: 0.86rem; line-height: 1.3; }
.fl.top { transform: none; }
.fl .num { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.fl.head { font-size: 0.95rem; }
.fl.head .num { font-size: 1.05rem; }
.fl.muted { color: var(--ink-faint); font-size: 0.8rem; }
.fl.station { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft); }
.fl.station b { display: inline-block; padding: 1px 6px; margin-right: 8px; border-radius: 3px; font-weight: 700; letter-spacing: 0.04em; }
.fl.station.code b { background: var(--code); color: var(--paper); }
.fl.station.jev b { background: var(--jev); color: #fff; }
button.fl { all: unset; position: absolute; transform: translateY(-50%); font-size: 0.88rem; line-height: 1.25; cursor: pointer; white-space: nowrap; padding: 2px 6px; margin-left: -6px; border-radius: 4px; }
button.fl:hover, button.fl:focus-visible, button.fl.on { background: var(--jev-wash); }
button.fl:focus-visible { outline: 2px solid var(--jev); }
button.fl .num { margin-left: 8px; }
button.fl.g-none { color: var(--ink-soft); }
.annotation {
  margin: 8px 0 0; padding-left: 12px; border-left: 2px solid var(--jev);
  font-family: var(--serif); font-style: italic; color: var(--ink-soft); font-size: 1.02rem; max-width: 60ch;
}
@media (prefers-reduced-motion: no-preference) {
  .flow-box svg.reveal { animation: reveal 1.4s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .flow-box .fl { animation: fade 0.5s ease-out both; animation-delay: var(--d, 0s); }
}
@keyframes reveal { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Story */
.story h2, .explorer h2 {
  font-family: var(--serif); font-size: 1.75rem; line-height: 1.2; margin: 72px 0 14px; letter-spacing: -0.01em;
}
.story p { margin: 0 0 16px; }
.pull {
  margin: 32px 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--jev);
  font-family: var(--serif); font-size: 1.4rem; line-height: 1.4; font-style: italic;
}
.facts { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule); }
.facts div { padding: 14px 16px 16px 0; }
.facts div + div { padding-left: 16px; border-left: 1px solid var(--rule); }
.facts dt { font-size: 0.8rem; color: var(--ink-soft); }
.facts dd { margin: 4px 0 0; font-family: var(--mono); font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.big { display: block; font-family: var(--mono); font-size: 2rem; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.cap { display: block; margin-top: 6px; font-size: 0.86rem; color: var(--ink-soft); line-height: 1.4; }
.eval-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 28px 0 32px; padding: 20px 0; border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule); }
.ebars { display: grid; gap: 8px; }
.erow { display: grid; grid-template-columns: 220px 1fr 52px; gap: 12px; align-items: center; font-size: 0.92rem; }
.erow .track { height: 10px; background: var(--rule); border-radius: 0 4px 4px 0; }
.erow .fill { display: block; height: 100%; width: 0; background: var(--jev); border-radius: 0 4px 4px 0; }
.erow b { text-align: right; font-family: var(--mono); font-size: 0.86rem; font-weight: 600; font-variant-numeric: tabular-nums; }
/* Fig. 2, the run ledger: facts in mono, the latest run in full ink, missed Mondays as their own row. */
table.ledger { border-top: 1px solid var(--rule-strong); }
.ledger tbody tr:hover { background: none; }
.ledger td { color: var(--ink-soft); }
.ledger tr.latest td { color: var(--ink); font-weight: 600; }
.ledger .when { display: block; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger td .sub { font-weight: 400; font-size: 0.76rem; }
.ledger tr.gap td { padding: 8px 10px; font-size: 0.82rem; font-style: italic; color: var(--ink-faint); background: repeating-linear-gradient(-45deg, transparent 0 6px, var(--rule) 6px 7px); }
.note { color: var(--ink-soft); font-size: 0.88rem; line-height: 1.55; margin-top: 24px; }

/* Explorer */
.explorer { margin-top: 32px; padding-top: 8px; border-top: 1px solid var(--rule-strong); }
.lead-in { max-width: 70ch; color: var(--ink-soft); margin: 0 0 8px; }
.lead-in strong { color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 20px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--ink-soft); }
.filters .grow { flex: 1 1 240px; }
.filters .check { flex-direction: row; align-items: center; gap: 6px; font-size: 0.92rem; color: var(--ink); padding-bottom: 9px; }
input[type=search], select {
  font: inherit; font-size: 0.95rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: 6px; padding: 7px 10px;
}
input[type=search]:focus, select:focus { outline: 2px solid var(--jev); outline-offset: -1px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--jev); }
.meta { color: var(--ink-soft); font-size: 0.88rem; }

.table-wrap { border-top: 1px solid var(--rule); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); font-weight: 600; white-space: nowrap; }
tbody tr:hover { background: var(--jev-wash); }
.r { text-align: right; font-family: var(--mono); font-size: 0.84rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
th.r { font-family: var(--sans); font-size: 0.74rem; }
td .co { display: block; font-size: 0.76rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
td .ttl { font-weight: 550; }
td a.ttl { color: var(--ink); text-decoration-color: var(--rule); }
td a.ttl:hover { color: var(--jev-ink); text-decoration-color: currentColor; }
td .sub { display: block; color: var(--ink-soft); font-size: 0.82rem; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.84rem; }
.dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.dot.g-ai { background: var(--jev); } .dot.g-other { background: var(--other); } .dot.g-none { background: var(--none); }
.can { color: var(--can); font-weight: 550; }
table.no-ai .col-ai { display: none; }
#more { margin-top: 16px; font: inherit; padding: 8px 18px; border-radius: 6px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); cursor: pointer; }
#more:hover { border-color: var(--jev); }

footer { margin-top: 64px; padding-top: 16px; border-top: 1px solid var(--rule); color: var(--ink-soft); font-size: 0.85rem; }
/* Maker signature, shared across gurn3k builds: copyright left, wordmark right.
   The wordmark is two masks: "gurn" in ink and "3k" in link blue, the one
   place blue may appear outside Jev's judgments. Both follow dark mode, and on
   hover the whole wordmark turns blue. */
.signature { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; margin-top: 12px; }
.maker { display: inline-flex; align-items: center; gap: 8px; }
.maker a { display: block; color: var(--ink); }
.maker a:hover { color: var(--jev-ink); }
.maker-mark { position: relative; display: block; width: 52px; height: 14px; }
/* Two layers in the brand kit's split: "gurn" in ink, "3k" in link blue. */
.maker-mark::before, .maker-mark::after { content: ""; position: absolute; inset: 0; }
.maker-mark::before { background: currentColor; -webkit-mask: url(gurn3k-gurn.svg) center / contain no-repeat; mask: url(gurn3k-gurn.svg) center / contain no-repeat; }
.maker-mark::after { background: var(--jev-ink); -webkit-mask: url(gurn3k-3k.svg) center / contain no-repeat; mask: url(gurn3k-3k.svg) center / contain no-repeat; }

/* Between phone cards and the full width, the explorer's seven columns are tight. */
@media (min-width: 761px) and (max-width: 900px) {
  #table th { white-space: normal; }
  #table th, #table td { padding: 12px 6px; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .topbar { padding: 10px 16px; }
  .topbar .links { gap: 12px; }
  .topbar .links a:not([href="#roles"]) { display: none; }
  .masthead { padding-top: 40px; }
  .dek { font-size: 1.1rem; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:nth-child(3) { padding-left: 0; border-left: 0; }
  .facts div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .eval-hero { grid-template-columns: 1fr; }
  .erow { grid-template-columns: 1fr 52px; }
  .erow .track { grid-column: 1 / -1; grid-row: 2; }
  .filters label:not(.check) { flex: 1 1 140px; }
  .filters select { width: 100%; }

  /* Table becomes cards */
  thead { display: none; }
  table, tbody, tr, td { display: block; }
  tr { padding: 14px 0; border-bottom: 1px solid var(--rule); }
  td { border: 0; padding: 2px 0; }
  td.r { text-align: left; }
  td[data-label]::before { content: attr(data-label) " "; color: var(--ink-soft); font-family: var(--sans); font-size: 0.8rem; }
  td.empty-sm { display: none; }

  /* The ledger stays a table on phones, with its widest columns dropped. */
  table.ledger { display: table; }
  .ledger thead { display: table-header-group; }
  .ledger tbody { display: table-row-group; }
  .ledger tr { display: table-row; padding: 0; }
  .ledger th, .ledger td { display: table-cell; padding: 10px 4px; border-bottom: 1px solid var(--rule); }
  .ledger th { white-space: normal; }
  .ledger td.r { text-align: right; }
  .ledger .wide { display: none; }
  .ledger tr.gap td { padding: 8px 4px; }
}
