/* Who Shipped It First? — OpenAI, Anthropic and Google, feature by feature.
 *
 * The paper, type and sidebar are the three timelines' own, so the page reads
 * as their companion. Vendor colors are categorical and were checked as a set
 * with the dataviz skill's palette validator on the page surface (#f5f3ec),
 * every pair against every other: OpenAI violet, Anthropic orange, Google
 * blue; worst CVD ΔE 13.0 (deutan, violet↔blue), and all three clear 3:1
 * against the paper. A vendor is never identified by color alone: every row
 * names the vendors in ink beside the dots. The vendor who shipped first wears
 * an ink ring.
 */
:root {
  --paper: #f5f3ec;
  --card: #fbfaf6;
  --card-strong: #fffefb;
  --ink: #1c1b18;
  --ink-2: #4f4c45;
  --ink-3: #847f74;
  --rule: #dad5c9;
  --rule-soft: #e8e4d9;
  --accent: #a64f2a;
  --wash: rgba(28, 27, 24, 0.045);

  --v-openai: #4a3aa7;
  --v-anthropic: #d65a24;
  --v-google: #2a78d6;

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --side-w: 316px;
  --name-w: 15.5rem;
  --verdict-w: 15rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-padding-top: calc(var(--appnav-h, 0px) + 24px); }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: 0.92em; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ---------- layout ---------- */

.layout {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  max-width: 1720px;
  margin: 0 auto;
}

/* ---------- sidebar ---------- */

.side {
  position: sticky;
  top: var(--appnav-h, 0px);
  height: calc(100vh - var(--appnav-h, 0px));
  height: calc(100dvh - var(--appnav-h, 0px));
  border-right: 1px solid var(--rule-soft);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.side-inner { padding: 1.3rem 1.2rem 1.6rem 1.35rem; }

.kicker {
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.wordmark {
  margin-top: 0.3rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.5rem;
  line-height: 0.98;
  letter-spacing: -0.01em;
}
.wordmark em { font-style: italic; color: var(--accent); }
.lede { margin-top: 0.7rem; font-size: 0.86rem; line-height: 1.55; color: var(--ink-2); }
.lede strong { color: var(--ink); font-weight: 600; }

.side-h {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.score { margin-top: 1.1rem; }
.score-table { width: 100%; border-collapse: collapse; margin-top: 0.3rem; font-size: 0.76rem; }
.score-table thead th {
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 500;
  color: var(--ink-3);
  text-align: right;
  padding: 0 0 0.2rem 0.3rem;
  vertical-align: bottom;
  line-height: 1.15;
}
.score-table tbody th { text-align: left; font-weight: 500; white-space: nowrap; padding: 0.22rem 0; }
.score-table tbody th i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 0.4rem; vertical-align: 0; }
.score-table td { text-align: right; font-family: var(--mono); font-size: 0.72rem; color: var(--ink-2); padding: 0.22rem 0 0.22rem 0.3rem; }
.score-table td b { color: var(--ink); font-weight: 600; font-size: 0.8rem; }
.score-table tbody tr + tr > * { border-top: 1px solid var(--rule-soft); }
.score-note { margin-top: 0.4rem; font-size: 0.7rem; line-height: 1.45; color: var(--ink-3); }

.controls { margin-top: 1.1rem; display: grid; gap: 0.6rem; }
.control-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; }
.control-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  width: 3rem;
}
.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; flex: 1; }
.chip {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.16rem 0.55rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.chip:hover { border-color: var(--ink-3); }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.seg button { font-size: 0.72rem; font-weight: 500; padding: 0.2rem 0.55rem; border: 0; background: var(--card); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--rule); }
.seg button:hover { background: var(--wash); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.key {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 0.6rem;
  margin-top: 1rem;
  font-size: 0.7rem;
  color: var(--ink-2);
}
.key li { display: flex; align-items: center; gap: 0.38rem; }
.k-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.k-first { background: var(--card); box-shadow: 0 0 0 1.6px var(--ink); }
.k-none { background: var(--paper); border: 1.6px dashed var(--ink-3); }
.rule { margin-top: 0.8rem; font-size: 0.7rem; line-height: 1.5; color: var(--ink-3); }
.side-foot { margin-top: 1rem; font-size: 0.78rem; color: var(--ink-3); }

/* ---------- the race ---------- */

.race { padding: 0 1.4rem 3rem 1.4rem; min-width: 0; }

.race-head, .frow {
  display: grid;
  grid-template-columns: var(--name-w) minmax(0, 1fr) var(--verdict-w);
  column-gap: 1.1rem;
}
.race-head {
  position: sticky;
  top: var(--appnav-h, 0px);
  z-index: 5;
  background: var(--paper);
  align-items: end;
  padding: 1.2rem 0 0.4rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--rule);
}
.rh-track { position: relative; height: 1rem; }
.ax-yr { position: absolute; bottom: 0; text-align: center; letter-spacing: 0.04em; color: var(--ink-2); }
.rh-verdict { line-height: 1.2; }

.fgroup { margin-top: 1.4rem; }
.fgroup.flat { margin-top: 0.4rem; }
.g-head {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.45rem;
  line-height: 1.1;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule);
}
.g-desc { font-family: var(--sans); font-size: 0.78rem; color: var(--ink-3); margin-left: 0.4rem; }

.frow {
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.frow:target, .frow.flash { background: var(--wash); }
.f-name { min-width: 0; }
.f-toggle {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.3;
}
.f-toggle:hover .f-title { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.f-chev { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-3); font-weight: 400; transition: transform 0.2s; }
.f-toggle[aria-expanded="true"] .f-chev { transform: rotate(45deg); }
.f-def { margin-top: 0.12rem; font-size: 0.72rem; line-height: 1.4; color: var(--ink-2); }
.f-grp { font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }

.track { position: relative; height: 30px; }
.grid-line { position: absolute; top: 2px; bottom: 2px; width: 0; border-left: 1px solid var(--rule-soft); }
.grid-band { position: absolute; top: 0; bottom: 0; background: var(--wash); }
.span { position: absolute; top: 50%; height: 2px; margin-top: -1px; background: var(--ink-3); border-radius: 2px; }
.span.open { background: none; border-top: 2px dotted var(--rule); height: 0; }
.dot {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  margin: -6.5px 0 0 -6.5px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 2px var(--paper);
  z-index: 1;
  transition: transform 0.15s;
}
a.dot:hover, a.dot:focus-visible { transform: scale(1.3); z-index: 2; }
.dot.first { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.6px var(--ink); }
.dot.none { background: var(--paper); border: 1.6px dashed var(--c); box-shadow: none; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; }
.dot.early::after { content: "‹"; position: absolute; left: -11px; top: -4px; font-size: 0.8rem; color: var(--ink-3); }

.f-verdict { font-size: 0.74rem; line-height: 1.45; color: var(--ink-2); }
.vd { white-space: nowrap; color: var(--ink); font-weight: 500; }
.vd i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.25rem; vertical-align: 0.02em; }
.vd-t { font-family: var(--mono); font-size: 0.66rem; color: var(--ink-2); white-space: nowrap; }
.vd-sep { color: var(--ink-3); }

.f-more { grid-column: 1 / -1; padding: 0.4rem 0 0.2rem; }
.f-detail { list-style: none; display: grid; gap: 0.3rem; }
.f-detail li {
  display: grid;
  grid-template-columns: 7rem 11rem minmax(0, 1fr);
  column-gap: 0.8rem;
  font-size: 0.78rem;
  line-height: 1.45;
  padding: 0.3rem 0.5rem;
  background: var(--card);
  border-radius: 5px;
}
.fd-v { font-weight: 600; white-space: nowrap; }
.fd-v i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.3rem; }
.fd-when { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-2); padding-top: 0.08rem; }
.fd-what a { color: var(--ink); text-decoration-color: var(--rule); }
.fd-what a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.fd-app { color: var(--ink-3); font-size: 0.72rem; }
.fd-why { display: block; margin-top: 0.15rem; font-size: 0.72rem; color: var(--ink-2); }
.f-note { margin-top: 0.35rem; font-size: 0.74rem; color: var(--ink-2); max-width: 80ch; }

/* ---------- reading ---------- */

.reading, .sources, .table-sec {
  max-width: 1720px;
  margin: 0 auto;
  padding: 3rem 1.6rem 1rem calc(var(--side-w) + 1.4rem);
}
.reading h2, .sources h2, .table-sec h2 { font-family: var(--serif); font-weight: 400; font-size: 2.2rem; line-height: 1; }
.reading h2 em, .sources h2 em, .table-sec h2 em { font-style: italic; color: var(--accent); }
.reading .reading-lede, .sources .sources-lede { margin-top: 0.6rem; max-width: 70ch; color: var(--ink-2); font-size: 0.95rem; }
.findings {
  list-style: none;
  counter-reset: f;
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr));
  gap: 1rem 1.6rem;
}
.findings li { counter-increment: f; border-top: 1px solid var(--rule); padding-top: 0.75rem; }
.findings h3 { font-size: 1rem; font-weight: 600; line-height: 1.35; }
.findings h3::before {
  content: counter(f, decimal-leading-zero);
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ink-3);
  margin-bottom: 0.2rem;
}
.findings p { margin-top: 0.4rem; font-size: 0.875rem; line-height: 1.6; }
.findings .refs { font-size: 0.76rem; color: var(--ink-3); }
.findings .refs a { color: var(--ink-2); }

.cu-fig { margin-top: 2.2rem; max-width: 64rem; }
.cu-fig h3 { font-size: 1rem; font-weight: 600; }
.cu-lede { margin-top: 0.3rem; font-size: 0.85rem; color: var(--ink-2); max-width: 70ch; }
.cu-key { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin-top: 0.6rem; font-size: 0.74rem; color: var(--ink-2); list-style: none; }
.cu-key li { display: inline-flex; align-items: center; gap: 0.35rem; }
.cu-key i { width: 9px; height: 9px; border-radius: 50%; }
.cu-key i.cu-k-med { width: 16px; height: 0; border-radius: 0; border-top: 2px solid var(--ink); }
.cu-svg { display: block; width: 100%; height: auto; margin-top: 0.5rem; overflow: visible; }
.cu-band { fill: var(--wash); }
.cu-grid { stroke: var(--rule-soft); stroke-width: 1; }
.cu-tick { font-family: var(--mono); font-size: 10px; fill: var(--ink-3); }
.cu-axis { font-family: var(--mono); font-size: 10px; fill: var(--ink-2); }
.cu-med { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.cu-medl { font-family: var(--mono); font-size: 10px; fill: var(--ink-2); }
.cu-dot { stroke: var(--paper); stroke-width: 2; cursor: pointer; }
.cu-open { margin-top: 0.5rem; font-size: 0.8rem; color: var(--ink-2); max-width: 80ch; }

/* ---------- table ---------- */

.tbl-scroll { overflow-x: auto; margin-top: 1rem; }
.ftable { border-collapse: collapse; font-size: 0.8rem; min-width: 42rem; width: 100%; max-width: 72rem; }
.ftable th, .ftable td { text-align: left; padding: 0.3rem 0.8rem 0.3rem 0; border-bottom: 1px solid var(--rule-soft); vertical-align: baseline; }
.ftable thead th { font-weight: 600; font-size: 0.78rem; white-space: nowrap; border-bottom-color: var(--rule); }
.ftable thead th i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 0.35rem; }
.ftable tbody th { font-weight: 500; }
.ftable tbody th a { color: var(--ink); text-decoration-color: var(--rule); }
.ftable td { font-family: var(--mono); font-size: 0.74rem; white-space: nowrap; }
.ftable td a { color: var(--ink-2); text-decoration-color: var(--rule); }
.ftable td.t-first a { color: var(--ink); font-weight: 600; }
.t-tag, .t-lag { font-size: 0.64rem; color: var(--ink-3); }
.t-tag { text-transform: uppercase; letter-spacing: 0.06em; }
.ftable td.t-none { color: var(--ink-3); }
.ftable tr.tg th { padding-top: 0.9rem; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }

/* ---------- sources ---------- */

.apps-list { list-style: none; margin-top: 1rem; font-size: 0.86rem; line-height: 1.5; }
.apps-list li { margin-bottom: 0.4rem; }
.apps-list a { color: var(--ink); font-weight: 600; text-decoration-color: var(--rule); }
.apps-list .pub, .source-list .pub { color: var(--ink-3); font-size: 0.8rem; }
.sources-sub { margin-top: 1rem; font-size: 0.8rem; color: var(--ink-2); }
.source-list { margin-top: 0.5rem; columns: 2 26rem; column-gap: 2rem; font-size: 0.78rem; line-height: 1.45; color: var(--ink-2); padding-left: 1.4rem; }
.source-list li { break-inside: avoid; margin-bottom: 0.4rem; }
.source-list a { color: var(--ink); text-decoration-color: var(--rule); }

.colophon {
  max-width: 1720px;
  margin: 0 auto;
  padding: 1.6rem 1.6rem 3rem calc(var(--side-w) + 1.4rem);
  font-size: 0.76rem;
  color: var(--ink-3);
  line-height: 1.6;
}

/* ---------- tooltip ---------- */

.tip {
  position: fixed;
  z-index: 4000;
  max-width: 19rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 7px;
  padding: 0.55rem 0.7rem 0.6rem;
  font-size: 0.78rem;
  line-height: 1.45;
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.tip b { font-weight: 600; }
.tip code { font-size: 0.9em; }
.tip .tip-k { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; color: #bdb8ac; margin-bottom: 0.15rem; }
.tip .tip-why { margin-top: 0.25rem; color: #dcd8cd; font-size: 0.74rem; }
.tip .tip-since { margin-top: 0.3rem; font-family: var(--mono); font-size: 0.64rem; color: #bdb8ac; }

/* ---------- medium screens: the sidebar moves above ---------- */

@media (max-width: 1299px) {
  :root { --side-w: 0px; }
  .layout { display: block; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--rule-soft); overflow: visible; }
  .side-inner {
    max-width: 66rem;
    padding: 1.4rem 1.2rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 2.2rem;
    align-items: start;
  }
  .side-inner > .kicker, .side-inner > .wordmark, .side-inner > .lede { grid-column: 1; }
  .side-inner > .score { grid-column: 2; grid-row: 1 / span 3; margin-top: 0; }
  .side-inner > .controls, .side-inner > .key, .side-inner > .rule, .side-inner > .side-foot { grid-column: 1 / -1; }
  .reading, .sources, .table-sec, .colophon { padding-left: 1.6rem; }
}

/* ---------- narrow screens: the name and verdict wrap around the track ---------- */

@media (max-width: 860px) {
  .side-inner { display: block; }
  .side-inner > .score { margin-top: 1.1rem; }
  .race { padding: 0 1rem 2.4rem; }
  .race-head, .frow { grid-template-columns: minmax(0, 1fr); }
  .race-head .rh-name, .race-head .rh-verdict { display: none; }
  .race-head { padding-top: 0.8rem; }
  .frow { row-gap: 0.15rem; }
  .f-verdict { padding-left: 0; }
  .f-detail li { grid-template-columns: minmax(0, 1fr); row-gap: 0.1rem; }
}

@media (max-width: 560px) {
  body { font-size: 14.5px; }
  .reading, .sources, .table-sec, .colophon { padding-left: 1rem; padding-right: 1rem; }
  .key { grid-template-columns: 1fr; }
  .ax-yr { font-size: 0.56rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
