/* Knicks docs — whitepaper layout on House tokens (frost theme, ops/tooling/diagrams/tokens.mjs). */
:root {
  --page: #EBEEF4;          /* frost bg */
  --surface: #FFFFFF;
  --ink: #1A2233;           /* frost text */
  --muted: #555A68;         /* frost muted */
  --accent: #5B6CFF;        /* iris */
  --accent-soft: #EEF0FF;
  --line: #D9DEE8;
  --line-soft: #E7EAF1;
  --note: #FFF6E5;
  --note-line: #F0C674;
  --radius: 14px;
  --font: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--page); scroll-padding-top: 84px; }
body { margin: 0; font-family: var(--font); color: var(--ink); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10; height: 64px;
  display: flex; align-items: center; gap: 20px; padding: 0 32px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 20px; letter-spacing: -0.02em; color: var(--ink); }
.brand span { color: var(--accent); font-weight: 600; }
.header-label { font-size: 13px; color: var(--muted); padding-left: 20px; border-left: 1px solid var(--line); }
.draft-chip { margin-left: auto; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #8A5A00; background: var(--note); border: 1px solid var(--note-line); border-radius: 999px; padding: 4px 10px; }

/* Eyebrows */
.eyebrow { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .085em; text-transform: uppercase; color: var(--accent); }

/* Cover */
.editorial-cover {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center;
  max-width: 1280px; margin: 28px auto 0; padding: 56px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.editorial-cover h1 { margin: 14px 0 18px; font-size: clamp(40px, 5.4vw, 68px); line-height: 1.02; font-weight: 600; letter-spacing: -0.045em; }
.cover-lede { margin: 0 0 28px; font-size: 18px; color: var(--muted); max-width: 32em; }
.cover-link { font-weight: 600; font-size: 15px; }
.cover-image { margin: 0; }
.cover-image img { width: 100%; border-radius: 12px; display: block; }
.cover-art {
  aspect-ratio: 4 / 3; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 28px;
  background: radial-gradient(120% 90% at 20% 10%, #8D99FF 0%, var(--accent) 45%, #2F3BB8 100%);
  color: #fff; font-size: clamp(36px, 5vw, 64px); font-weight: 700; letter-spacing: -0.04em;
}
.cover-art span + span { opacity: .55; }

/* Paper: contents rail + article */
.paper { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; max-width: 1280px; margin: 28px auto 64px; padding: 0 0; }
.toc {
  position: sticky; top: 90px; align-self: start; padding: 16px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.toc .eyebrow { padding: 0 8px 10px; color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 6px 8px; border-radius: 8px; font-size: 13px; color: var(--muted); }
.toc a:hover { background: var(--accent-soft); color: var(--ink); text-decoration: none; }
.toc a.active { background: var(--accent-soft); color: var(--accent); }
.toc-n { color: var(--accent); margin-right: 4px; font-variant-numeric: tabular-nums; }

.paper-article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 48px 24px; min-width: 0; }
.paper-article section { display: grid; grid-template-columns: 44px minmax(0, 1fr); padding: 36px 0; border-top: 1px solid var(--line-soft); }
.paper-article section:first-child { border-top: 0; }
.section-index { padding-top: 12px; font-variant-numeric: tabular-nums; }
.section-body { min-width: 0; max-width: 760px; }
.section-body h2 { margin: 0 0 14px; font-size: 32px; line-height: 1.15; font-weight: 600; letter-spacing: -0.035em; }
.section-body h3 { margin: 30px 0 8px; font-size: 19px; font-weight: 600; letter-spacing: -0.015em; }
.section-body p, .section-body li { color: var(--ink); }
.section-body p { margin: 0 0 14px; }
.section-body ul, .section-body ol { padding-left: 20px; margin: 0 0 16px; }
.section-body li { margin: 4px 0; }
.section-body strong { font-weight: 600; }
.section-body code { font-size: .88em; background: var(--accent-soft); border-radius: 5px; padding: 1px 5px; }

/* Stat tiles */
.paper-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 22px 0; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.stat-value { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--muted); line-height: 1.35; }

/* Tables */
.paper-table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { background: var(--accent-soft); text-align: left; font-weight: 600; padding: 10px 12px; }
td { padding: 10px 12px; border-top: 1px solid var(--line-soft); vertical-align: top; }

/* Figures: card, corner brackets in the accent, all-caps kicker, italic takeaway */
.paper-diagram { margin: 26px 0; }
.paper-diagram img { width: 100%; display: block; }
.paper-diagram figcaption { margin-top: 10px; font-size: 14px; font-style: italic; color: var(--muted); }
.fig-frame {
  position: relative; aspect-ratio: 1200 / 560; border-radius: 12px; background: var(--page);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.fig-frame::before, .fig-frame::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid var(--accent); }
.fig-frame::before { top: 14px; left: 14px; border-right: 0; border-bottom: 0; }
.fig-frame::after { bottom: 14px; right: 14px; border-left: 0; border-top: 0; }
.fig-kicker { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.fig-todo { font-size: 13px; color: var(--muted); }

/* Draft notes (removed by the clean build) */
.draft-note { margin: 18px 0; padding: 12px 16px; background: var(--note); border: 1px solid var(--note-line); border-radius: 10px; font-size: 14px; }
.draft-note p:last-child { margin-bottom: 0; }
.draft-tag { display: block; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #8A5A00; margin-bottom: 4px; }

/* Footers */
.paper-foot { display: flex; justify-content: flex-end; padding: 18px 0 8px; border-top: 1px solid var(--line-soft); font-size: 14px; }
.site-footer { max-width: 1280px; margin: 0 auto 40px; padding: 0 8px; font-size: 12px; color: var(--muted); }

/* Narrow screens: rail collapses, cover stacks */
@media (max-width: 960px) {
  .editorial-cover { grid-template-columns: 1fr; padding: 32px; margin: 16px; }
  .paper { grid-template-columns: 1fr; margin: 16px; }
  .toc { position: static; }
  .paper-article { padding: 4px 22px 16px; }
  .paper-article section { grid-template-columns: 1fr; }
  .section-index { padding: 0 0 4px; }
}
@media (max-width: 640px) {
  .site-header { padding: 0 16px; }
  .section-body h2 { font-size: 26px; }
}
