/* Palette and type lifted from ismaelroblesrazzaq.github.io */
:root {
  --bg: #f5f1e8;
  --card: #ffffff;
  --muted: #64635f;
  --text: #1a1a1a;
  --accent: #1a1a1a;
  --border: #e5dfd4;
  --surface: #ece6db;
  --hover: rgba(26, 26, 26, 0.04);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Chart categoricals — validated against the cream surface for lightness,
     chroma, CVD separation, normal-vision separation and contrast. */
  --c-input: #1565a8;
  --c-cached: #0a8f6a;
  --c-write: #b56a00;
  --c-output: #a12a5c;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 840px; margin: 0 auto; padding: 64px 24px 120px; }

h1 { font-size: 2rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; margin-bottom: 8px; }
h2 { font-size: 1.35rem; font-weight: 600; margin: 56px 0 16px; letter-spacing: -0.01em; }
h3 { font-size: 1rem; font-weight: 600; margin: 32px 0 8px; }
p { margin-bottom: 20px; }
a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #b9b2a4; }
a:hover { text-decoration-color: var(--text); }

/* Link back to the blog index (one level up when deployed). */
.post-back { font-size: 0.9rem; margin-bottom: 28px; }

.byline { color: var(--muted); font-size: 0.9rem; margin-bottom: 4px; }
.postdate { color: var(--muted); font-size: 0.9rem; margin-bottom: 40px; }
.lede { font-size: 1.1rem; }
ul, ol { margin: 0 0 20px 26px; }
li { margin-bottom: 4px; }

hr { border: 0; border-top: 1px solid var(--border); margin: 48px 0; }

/* ---------- figures ---------- */
figure { margin: 32px auto; }
figure img { width: 100%; display: block; border: 1px solid var(--border); border-radius: 6px; background: var(--card); }
figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 10px; }
figure.small { max-width: 300px; margin-left: auto; margin-right: auto; }

/* Author's own unfilled placeholders, kept visible so they are easy to find. */
mark.todo { background: #ffe9a8; padding: 1px 5px; border-radius: 3px; color: #6b5410; }
mark.todo a { color: inherit; }

/* Paragraphs flagged for rewriting. */
.revise { border-left: 3px solid #d9a520; background: #fdf7e6; padding: 12px 14px; border-radius: 0 6px 6px 0; }
.revise-tag {
  display: inline-block; font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: #8a6d1f; background: #f7e6b8;
  border-radius: 3px; padding: 1px 6px; margin-right: 8px; vertical-align: 1px;
}

.footnote-note { font-size: 0.78rem; color: var(--muted); margin: 10px 0 0; }

/* Phrase marked for a link that hasn't been added yet. */
.pending-link { border-bottom: 1px dashed #a89b80; cursor: help; }

/* ---------- sticky player bar ---------- */
.player {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 241, 232, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  margin: 0 -24px 28px;
  padding: 12px 24px;
  display: flex; align-items: center; gap: 14px;
}
.player button {
  font: inherit; font-size: 0.85rem; font-weight: 500;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 14px; cursor: pointer; min-width: 74px;
}
.player button:hover { background: var(--hover); }
/* The guessing grid's player scrolls with its section rather than sticking. */
.player.inline { position: static; margin: 0 0 16px; padding: 0; background: none; border: 0; backdrop-filter: none; }
.player input[type=range] { flex: 1; accent-color: var(--text); cursor: pointer; height: 22px; touch-action: none; }
.player input[type=range]::-webkit-slider-thumb { cursor: grab; }
.player input[type=range]:active::-webkit-slider-thumb { cursor: grabbing; }
.speed { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--muted); }
.speed input[type=range] { width: 74px; flex: none; height: 18px; accent-color: var(--muted); }
.speed span { min-width: 34px; font-variant-numeric: tabular-nums; }
.turn-readout { font-variant-numeric: tabular-nums; font-size: 0.85rem; color: var(--muted); min-width: 92px; text-align: right; }

/* ---------- video grids ---------- */
.grid { display: grid; gap: 20px; margin: 28px 0; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* Before/after pair: equal columns, captions centred under each. */
.grid.compare { max-width: 620px; margin: 32px auto; gap: 18px; }
.grid.compare figure { margin: 0; }
.grid.compare figcaption { text-align: center; margin-top: 8px; }

/* Guessing grid: names hidden until revealed, set plainly on the page
   background rather than in a labelled card. */
.reveal-name { font-size: 0.9rem; font-weight: 600; margin-top: 8px; visibility: hidden; }
.revealed .reveal-name { visibility: visible; }
.reveal-btn {
  font: inherit; font-size: 0.85rem; font-weight: 500; margin-top: 14px;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 20px; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.reveal-btn:hover { background: var(--surface); border-color: #c9bfa8; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.reveal-btn:active { box-shadow: none; }

/* The ten-model wall breaks out of the prose column so five fit across. */
.breakout { width: min(1320px, calc(100vw - 48px)); margin-left: 50%; transform: translateX(-50%); }
.grid.wall { grid-template-columns: repeat(5, 1fr); gap: 16px; align-items: start; }
.model-tile .label { display: flex; flex-direction: column; gap: 2px; }
.model-tile .statement { font-size: 0.78rem; padding: 10px 11px; margin-top: 8px; }
.desc-toggle {
  font: inherit; font-size: 0.78rem; margin-top: 8px; align-self: flex-start;
  background: var(--surface); color: var(--muted); border: 1px solid var(--border);
  border-radius: 5px; padding: 3px 9px; cursor: pointer;
}
.desc-toggle:hover { color: var(--text); }
.desc-toggle.open { color: var(--text); background: var(--hover); }
.model-tile .tile-note { font-size: 0.75rem; color: var(--muted); margin: 6px 0 0; }
@media (max-width: 1180px) { .grid.wall { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .grid.wall { grid-template-columns: repeat(2, 1fr); } }

.tile { background: var(--card); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.tile video, .tile img { width: 100%; display: block; aspect-ratio: 1; background: #fff; }
.tile .label { padding: 10px 12px; border-top: 1px solid var(--border); font-size: 0.85rem; }
.tile .label .name { font-weight: 600; }
.tile .label .sub { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.tile.done .label .sub::after { content: " · finished"; }

/* Model cards in the main gallery */
.model-card { margin: 36px 0; padding-top: 28px; border-top: 1px solid var(--border); }
.model-card:first-of-type { border-top: 0; padding-top: 0; }
.model-card .head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.model-card .head h3 { margin: 0; font-size: 1.1rem; }
.model-card .stats { font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.model-card .media { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.model-card .media > figure { margin: 0; }
.model-card .media video, .model-card .media img {
  width: 100%; display: block; aspect-ratio: 1; border: 1px solid var(--border); border-radius: 6px; background: #fff;
}
.model-card .cap { font-size: 0.78rem; color: var(--muted); margin-top: 6px; }
.statement { background: var(--surface); border-radius: 6px; padding: 14px 16px; margin-top: 14px; font-size: 0.92rem; }
.statement p { margin-bottom: 10px; }
.statement p:last-child { margin-bottom: 0; }
.statement .st-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); display: block; margin-bottom: 6px; }
.rating { font-weight: 600; }
.rating.pending { color: var(--muted); font-weight: 400; font-style: italic; }

/* ---------- charts ---------- */
.chart { margin: 28px 0; }
.chart-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; }
.chart-sub { font-size: 0.82rem; color: var(--muted); margin-bottom: 16px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; font-size: 0.8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

.bars { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 12px; align-items: center; }
.bars .bl { font-size: 0.85rem; text-align: right; white-space: nowrap; }
.bars .bv { font-size: 0.85rem; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.bar { display: flex; height: 18px; border-radius: 4px; overflow: hidden; background: var(--surface); }
.bar i { display: block; height: 100%; border-right: 2px solid var(--bg); }
.bar i:last-child { border-right: 0; }

table.data { width: auto; max-width: 100%; border-collapse: collapse; font-size: 0.85rem; margin: 20px auto; }
table.data th, table.data td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); }
table.data th { font-weight: 600; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

.note {
  border-left: 2px solid #c8bda6; background: var(--surface);
  padding: 12px 16px; margin: 24px 0; font-size: 0.88rem; color: var(--muted); border-radius: 0 6px 6px 0;
}

/* ---------- transcript pages ---------- */
.transcript-page .wrap { max-width: 720px; }
.transcript-page .back { font-size: 0.85rem; margin-bottom: 24px; }
.transcript-page .meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 24px; }
.transcript-page p { margin-bottom: 14px; }
.transcript-page .toolcall {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem; color: var(--muted);
  background: var(--surface); border-radius: 4px; padding: 4px 9px;
  display: inline-block; margin-bottom: 10px;
}
.transcript-page .statement { margin-bottom: 24px; }

@media (max-width: 720px) {
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .model-card .media { grid-template-columns: 1fr; }
  .wrap { padding: 40px 18px 80px; }
}

/* ---------- footnotes ---------- */
/* Superscript markers in the body, and the list python-markdown appends. */
sup[id^="fnref"] { font-size: 0.7em; line-height: 0; vertical-align: super; }
sup[id^="fnref"] a { text-decoration: none; padding: 0 1px; }
.footnote {
  margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--border);
  font-size: 0.88rem; color: var(--muted);
}
.footnote hr { display: none; }
.footnote ol { margin: 0 0 0 22px; }
.footnote li { margin-bottom: 8px; }
.footnote li p { margin: 0; }
.footnote a.footnote-backref { text-decoration: none; margin-left: 4px; }
