/* Colo Buyer's Library — the /answers hub stylesheet.
   ONE file, no JS dependency, no build step: these pages must render completely for a
   crawler that executes nothing (docs/AEO-PLAYBOOK.md §3). Everything below is layout
   and colour only — if the stylesheet never loads, the page is still a readable,
   correctly-ordered document.

   Tokens mirror app/src/index.css so the library reads as the same product as the
   workspace: near-black void, colour EMITTED not painted, Linear-calm on reading
   surfaces (docs/MOTION-IDENTITY.md — reading is a WORKING surface, so function first
   and motion essentially absent). */

:root {
  --teal: #01e3d1;
  --magenta: #f700db;
  --purple-lt: #9c7ff2;

  --bg: #06070b;
  --panel: #0e1017;
  --panel-2: #12151e;
  --line: #1e2331;
  --line-soft: #171b27;

  --text: #eef1f6;
  --text-2: #b9c0cf;
  --dim: #8992a3;
  --faint: #5b6376;

  --amber: #f0b429;

  --r-sm: 7px;
  --r: 10px;
  --r-lg: 14px;

  --mono: 'SF Mono', ui-monospace, 'JetBrains Mono', 'Roboto Mono', monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Montserrat, sans-serif;

  /* Long-form reading measure. Wider than the workspace's dense panels on purpose:
     these pages are prose, and prose wants ~70 characters. */
  --measure: 74ch;
  --wide: 1120px;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  /* The void gets texture (Elevation Kit §6) — one fixed layer, no per-element cost. */
  background-image: radial-gradient(1200px 600px at 50% -10%, rgba(1, 227, 209, .045), transparent 70%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Skip link: the first focusable thing on every page. */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--panel-2);
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--r-sm);
  z-index: 10;
}
.skip:focus { left: 12px; top: 12px; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ------------------------------------------------------------------ chrome */

.masthead {
  border-bottom: 1px solid var(--line-soft);
  background: rgba(6, 7, 11, .82);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.masthead-in {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 650;
  letter-spacing: -.01em;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
}

.brand-mark {
  background: linear-gradient(90deg, var(--teal), var(--purple-lt));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.masthead nav { margin-left: auto; }
.masthead nav a {
  color: var(--dim);
  text-decoration: none;
  font-size: 13px;
  margin-left: 18px;
}
.masthead nav a:hover { color: var(--text-2); }

.crumbs {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 18px 24px 0;
  font-size: 12.5px;
  color: var(--faint);
}
.crumbs a { color: var(--dim); text-decoration: none; }
.crumbs a:hover { color: var(--teal); }
.crumbs span { margin: 0 7px; }

/* -------------------------------------------------------------------- page */

.page {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 26px 24px 90px;
}

.eyebrow {
  font: 600 11px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 14px;
}

h1 {
  font-size: clamp(30px, 3.4vw, 43px);
  line-height: 1.12;
  letter-spacing: -.022em;
  font-weight: 660;
  max-width: 22ch;
  margin-bottom: 16px;
}

.standfirst {
  font-size: 18.5px;
  line-height: 1.6;
  color: var(--text-2);
  max-width: var(--measure);
  margin-bottom: 22px;
}

.dateline {
  display: flex;
  gap: 10px 18px;
  flex-wrap: wrap;
  align-items: center;
  font: 11.5px/1.5 var(--mono);
  color: var(--faint);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 0;
  margin-bottom: 38px;
}
.dateline b { color: var(--dim); font-weight: 500; }

/* ------------------------------------------------------------------- prose */

article { max-width: var(--measure); }
article.wide { max-width: none; }

section { margin-bottom: 46px; scroll-margin-top: 80px; }

h2 {
  font-size: 25px;
  line-height: 1.25;
  letter-spacing: -.016em;
  font-weight: 640;
  margin-bottom: 16px;
  padding-top: 6px;
}

h3 {
  font-size: 17px;
  letter-spacing: -.008em;
  font-weight: 620;
  margin: 30px 0 10px;
  color: var(--text);
}

p { margin-bottom: 17px; color: var(--text-2); max-width: var(--measure); }
p strong, li strong { color: var(--text); font-weight: 600; }

a { color: var(--teal); text-decoration: none; border-bottom: 1px solid rgba(1, 227, 209, .28); }
a:hover { border-bottom-color: var(--teal); }

ul, ol { margin: 0 0 18px 20px; max-width: var(--measure); }
li { margin-bottom: 9px; color: var(--text-2); }
li::marker { color: var(--faint); }

code {
  font: 13px var(--mono);
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text);
}

/* Section anchor: present for deep-linking (an answer engine cites a heading, not a
   page), invisible until the heading is hovered or the link itself is focused. */
.anchor {
  color: var(--faint);
  border: 0;
  margin-left: 9px;
  font-size: .62em;
  opacity: 0;
  transition: opacity .12s;
}
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }

/* ------------------------------------------------------------- note callout */

.note {
  border-left: 2px solid var(--teal);
  background: linear-gradient(90deg, rgba(1, 227, 209, .05), transparent 70%);
  padding: 14px 18px;
  margin: 0 0 20px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  max-width: var(--measure);
}
.note p { margin: 0; font-size: 15px; }
.note.warn { border-left-color: var(--amber); background: linear-gradient(90deg, rgba(240, 180, 41, .06), transparent 70%); }

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

.table-wrap {
  overflow-x: auto;
  margin: 0 0 24px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
}

table { border-collapse: collapse; width: 100%; font-size: 14px; }

caption {
  caption-side: top;
  text-align: left;
  padding: 13px 16px 11px;
  color: var(--dim);
  font-size: 12.5px;
  border-bottom: 1px solid var(--line-soft);
}

th, td {
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
th {
  font: 600 11px/1.4 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}
td { color: var(--text-2); }
td:first-child { color: var(--text); font-weight: 550; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, .016); }

/* --------------------------------------------------------------- glossary */

dl.terms { margin: 0; max-width: var(--measure); }

dl.terms > div {
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
  scroll-margin-top: 80px;
}
dl.terms > div:last-child { border-bottom: 0; }

dt {
  font-size: 16.5px;
  font-weight: 620;
  color: var(--text);
  margin-bottom: 7px;
  letter-spacing: -.006em;
}
dt .anchor { opacity: 0; }
dl.terms > div:hover dt .anchor { opacity: 1; }
dd { margin: 0; color: var(--text-2); }
dd + dd { margin-top: 9px; }
dd.aka { font-size: 13.5px; color: var(--faint); }

.term-index {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 34px;
  padding: 0;
  list-style: none;
  max-width: none;
}
.term-index li { margin: 0; }
.term-index a {
  display: inline-block;
  font: 12px var(--mono);
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--dim);
  background: var(--panel);
}
.term-index a:hover { color: var(--teal); border-color: rgba(1, 227, 209, .4); }

/* ------------------------------------------------------------------- cards */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 14px;
  margin-bottom: 34px;
  list-style: none;
  max-width: none;
}
.cards li { margin: 0; }

.card {
  display: block;
  height: 100%;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, background .15s, transform .15s;
}
.card:hover {
  border-color: rgba(1, 227, 209, .34);
  background: var(--panel-2);
  transform: translateY(-1px);
}

.card-kicker {
  font: 600 10px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 10px;
}
.card h3 { margin: 0 0 7px; font-size: 16.5px; }
.card p { margin: 0; font-size: 14px; color: var(--dim); }

/* ------------------------------------------------------------------ footer */

.foot {
  border-top: 1px solid var(--line-soft);
  margin-top: 20px;
}
.foot-in {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 30px 24px 60px;
  color: var(--faint);
  font-size: 13px;
}
.foot-in p { color: var(--faint); font-size: 13px; max-width: 78ch; }
.foot-in a { color: var(--dim); border-bottom-color: transparent; }
.foot-in a:hover { color: var(--teal); }

.sources { margin: 0 0 18px 18px; }
.sources li { font-size: 13px; color: var(--faint); }

@media (max-width: 620px) {
  body { font-size: 15.5px; }
  .page { padding: 20px 18px 70px; }
  .masthead-in, .crumbs, .foot-in { padding-left: 18px; padding-right: 18px; }
}
