/* ─────────────────────────────────────────
   TALIS Design System — Unified Stylesheet
   ───────────────────────────────────────── */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Anybody:wght@400;500;600;700;800;900&family=Geist:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&family=Instrument+Serif&display=swap');

@font-face {
  font-family: 'Geist';
  src: url('https://cdn.jsdelivr.net/npm/geist@1.3.1/dist/fonts/geist-sans/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Tokens */
:root {
  --bg: #0a0a0a;
  --bg-2: #0e0e0e;
  --surface: #141414;
  --surface-2: #1c1c1c;
  --surface-3: #242424;
  --surface2: var(--surface-2);
  --border: #262626;
  --border-strong: #3a3a3a;
  --border-faint: #1a1a1a;
  --border-hover: #3a3a3a;
  --fg: #efefec;
  --fg-muted: #8a8a85;
  --muted: var(--fg-muted);
  --fg-dim: #5c5c58;
  --accent: #d7ff3a;
  --accent-dim: #abcc2e;
  --accent-fg: #0a0a0a;
  --signal: #37e1b5;
  --warning: #ffb020;
  --danger: #ff3b30;
  --error: #dc4a36;
  --warn: #e8a23f;
  --info: #5179b5;
  --success: #3fa68a;

  --font-display: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;

  --r-none: 0px;
  --r-xs: 2px;
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --r-xl: 22px;
  --r-full: 9999px;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;
  --s-11: 192px;

  --ease: cubic-bezier(.2, .7, .3, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: .12s;
  --t-med: .22s;
  --t-slow: .42s;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
h1 { font-size: clamp(40px, 5vw, 72px); letter-spacing: -0.04em; }
h2 { font-size: clamp(28px, 3.5vw, 48px); }
h3 { font-size: clamp(22px, 2.5vw, 32px); }
h4 { font-size: 20px; }
p { color: var(--muted); max-width: 65ch; }
a { color: inherit; text-decoration: none; transition: color 0.3s var(--ease-out-expo); }
a:hover { color: var(--accent); }
ul, ol { list-style: none; padding-left: 0; }

/* Layout */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--s-6); }

/* ─── Navigation ─── */
nav, .site-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,10,.85); backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.nav-inner, .site-nav {
  max-width: 1200px; margin: 0 auto; padding: 0 var(--s-6);
  display: flex; justify-content: space-between; align-items: center; height: 64px;
}
.site-nav { height: auto; padding: var(--s-5) 0; flex-wrap: wrap; gap: var(--s-3); margin-bottom: var(--s-6); }
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--fg-muted); text-decoration: none; transition: color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }

/* ─── Brand / Logo lockup ─── */
.brand, .site-nav .brand {
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  letter-spacing: -0.02em; margin-right: auto; color: var(--fg);
}
.brand span, .site-nav .brand span { color: var(--accent); }

/* ─── Utilities ─── */
.mono {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--fg-muted);
}
.mono-light { color: var(--fg-dim); }
.accent { color: var(--accent); }
.accent-bg { background: var(--accent); color: var(--bg); }

/* ─── Corner Ticks (Design System variant) ─── */
.corner-ticks { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; }
.corner-ticks span {
  position: absolute; width: 12px; height: 12px;
  border-left: 1px solid rgba(255,255,255,.22);
  border-top: 1px solid rgba(255,255,255,.22);
}
.corner-ticks .tl { top: 10px; left: 10px; }
.corner-ticks .tr { top: 10px; right: 10px; transform: rotate(90deg); }
.corner-ticks .bl { bottom: 10px; left: 10px; transform: rotate(-90deg); }
.corner-ticks .br { bottom: 10px; right: 10px; transform: rotate(180deg); }
.corner-ticks-light span { border-left-color: rgba(0,0,0,.22); border-top-color: rgba(0,0,0,.22); }

/* ─── Sections ─── */
.section { padding: var(--s-10) 0; }
.ds-section { padding: 128px 0 32px; scroll-margin-top: 80px; }
.ds-cover {
  min-height: 92vh; display: flex; flex-direction: column;
  justify-content: space-between; padding-top: 64px;
}

/* ─── Section Head (Design System page) ─── */
.section-head {
  display: grid; grid-template-columns: min-content 1fr; gap: 24px 32px;
  align-items: baseline; padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.section-head h2 {
  margin: 0; font-family: var(--font-display); font-size: clamp(40px, 6vw, 88px);
  font-weight: 800; letter-spacing: -0.04em; line-height: .94; color: var(--fg);
}
.section-head p {
  margin: 0; font-family: var(--font-body); font-size: 18px; line-height: 1.55;
  color: var(--fg-muted); max-width: 680px;
}

/* ─── Plate ─── */
.plate {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 48px 28px 22px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.plate-content { display: flex; align-items: center; justify-content: center; flex: 1; }
.plate-label { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ─── Cover (DS page) ─── */
.cover-top { display: flex; justify-content: space-between; align-items: center; }
.cover-mid { display: flex; flex-direction: column; gap: 32px; }
.cover-lockup { display: flex; align-items: center; line-height: 1; color: var(--fg); }
.cover-lockup svg { display: block; flex: 0 0 auto; }
.cover-lockup .alis {
  font-family: 'Anybody', sans-serif; font-weight: 800;
  line-height: 1; letter-spacing: -0.02em; margin-left: -0.01em;
}
.cover-desc {
  max-width: 760px; font-family: var(--font-body); font-size: 24px;
  line-height: 1.45; color: var(--fg-muted);
}
.variants-overview { display: flex; gap: 32px; flex-wrap: wrap; }
.variant-dot { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.variant-dot span:first-child { width: 14px; height: 14px; border-radius: 50%; }
.variant-dot:hover .mono-label.fg { color: var(--accent); }
.cover-bottom {
  display: flex; justify-content: space-between; align-items: flex-end;
  border-top: 1px solid var(--border); padding-top: 24px;
}

/* ─── Mark grids (DS page) ─── */
.mark-grid-2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; }
.mark-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.mark-origins-item {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 22px; min-height: 220px;
  display: flex; flex-direction: column; gap: 16px;
}
.mark-origins-lines { display: flex; flex-direction: column; gap: 8px; }

/* ─── Cards ─── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--s-6);
  transition: border-color 0.3s var(--ease-out-expo);
}
.card:hover { border-color: var(--border-hover); }
.card-surface { background: var(--surface2); border-radius: var(--r-sm); padding: var(--s-5); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s-5); }

/* ─── Chips ─── */
.chip {
  display: inline-flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-5); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-full);
  font-family: var(--font-mono); font-size: 12px; color: var(--fg);
  text-decoration: none; transition: all 0.3s var(--ease-out-expo);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* ─── Link Arrow ─── */
.link-arrow {
  display: inline-flex; align-items: center; gap: var(--s-3);
  font-family: var(--font-mono); font-size: 12px;
}
.link-arrow::after { content: '->'; transition: transform 0.3s var(--ease-out-expo); }
.link-arrow:hover::after { transform: translateX(4px); }

/* ─── Labels ─── */
.label {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
.label::before, .label::after {
  content: ''; display: inline-block; width: 4px; height: 4px; border: 1px solid var(--muted);
}

/* ─── Grids ─── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--s-5); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s-5); }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s-5); }

/* ─── Spacing ─── */
.mb-1 { margin-bottom: var(--s-3); }
.mb-2 { margin-bottom: var(--s-5); }
.mb-3 { margin-bottom: var(--s-6); }
.mb-4 { margin-bottom: var(--s-8); }
.mt-1 { margin-top: var(--s-3); }
.mt-2 { margin-top: var(--s-5); }
.mt-3 { margin-top: var(--s-6); }
.mt-4 { margin-top: var(--s-8); }

/* ─── Page / Site headers ─── */
.page-header { padding: var(--s-9) 0 var(--s-8); border-bottom: 1px solid var(--border); }
.page-header .mono { margin-bottom: var(--s-4); display: block; }
.page-header h1 { margin-bottom: var(--s-4); }
.page-header p { max-width: 55ch; }

.site-header { border-bottom: 1px solid var(--border); }

/* ─── Footer ─── */
.site-footer {
  padding: var(--s-10) 0 var(--s-8); border-top: 1px solid var(--border); margin-top: var(--s-10);
}
.site-footer .grid-3 { margin-bottom: var(--s-8); }
.site-footer h4 { font-size: 14px; margin-bottom: var(--s-4); }
.site-footer a { display: block; font-size: 14px; color: var(--muted); margin-bottom: var(--s-3); }
.site-footer a:hover { color: var(--accent); }
.site-footer .copy {
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.ds-footer {
  margin-top: 128px; padding-top: 32px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: baseline;
}

/* ─── Article content ─── */
.article-content { max-width: 720px; }
.article-content h2 { margin-top: var(--s-8); margin-bottom: var(--s-4); }
.article-content h3 { margin-top: var(--s-6); margin-bottom: var(--s-3); font-size: 20px; }
.article-content p { margin-bottom: var(--s-4); line-height: 1.7; }
.article-content ul { list-style: disc; padding-left: var(--s-6); margin-bottom: var(--s-5); }
.article-content ul li { color: var(--muted); margin-bottom: var(--s-3); }
.article-content ul li::marker { color: var(--accent); }
.article-content ol { list-style: decimal; padding-left: var(--s-6); margin-bottom: var(--s-5); }
.article-content ol li { color: var(--muted); margin-bottom: var(--s-3); }
.article-content ol li::marker { color: var(--accent); }
.article-content blockquote {
  border-left: 2px solid var(--accent); padding-left: var(--s-5);
  margin: var(--s-6) 0; font-style: italic; color: var(--fg);
}

/* ─── Tables ─── */
table { width: 100%; border-collapse: collapse; font-size: 14px; margin: var(--s-6) 0; }
th, td { padding: var(--s-4) var(--s-5); text-align: left; border-bottom: 1px solid var(--border); }
th {
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); font-weight: 500;
}
td { color: var(--muted); }
tr:hover td { color: var(--fg); }

/* ─── Divider ─── */
.divider { height: 1px; background: var(--border); margin: var(--s-8) 0; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
::selection { background: var(--accent); color: var(--bg); }

/* ─── Responsive ─── */
/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-5); border-radius: var(--r-md);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em;
  text-transform: uppercase; text-decoration: none; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--fg);
  transition: all 0.3s var(--ease-out-expo);
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); color: var(--bg); }
.btn-secondary { background: transparent; color: var(--fg-muted); }
.btn-secondary:hover { color: var(--fg); border-color: var(--fg-muted); }

/* ─── Mono label (hero / section subtitle) ─── */
.mono-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--fg-muted);
}

/* ─── Section header (listing pages) ─── */
.section-header {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: var(--s-5); margin-bottom: var(--s-8);
}
.section-header h2 { margin: 0; }
.section-desc { max-width: 55ch; color: var(--fg-muted); }

/* ─── Hero ─── */
.hero-section { padding: var(--s-9) 0 var(--s-8); border-bottom: 1px solid var(--border); }
.hero-content { max-width: 720px; }
.hero-subtitle {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--fg-muted); margin-bottom: var(--s-4);
}

/* ─── Main nav / logo (legacy naming) ─── */
.main-nav { display: flex; align-items: center; gap: var(--s-5); flex-wrap: wrap; }
.logo { font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: -0.02em; color: var(--fg); }
.logo span { color: var(--accent); }

/* ─── Chip group ─── */
.chip-group { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-4); }

/* ─── Card parts ─── */
.card-header { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-4); }
.card-body { color: var(--fg-muted); }
.card-footer { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--border); }

/* ─── Status badge ─── */
.status-badge {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-4); border-radius: var(--r-full);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
}
.status-badge-ready { background: rgba(55,225,181,.12); color: var(--signal); border: 1px solid rgba(55,225,181,.2); }
.status-badge-wip { background: rgba(232,162,63,.12); color: var(--warn); border: 1px solid rgba(232,162,63,.2); }
.status-badge-draft { background: rgba(129,129,125,.12); color: var(--fg-dim); border: 1px solid rgba(129,129,125,.2); }
.status-badge-deprecated { background: rgba(255,59,48,.12); color: var(--danger); border: 1px solid rgba(255,59,48,.2); }

/* ─── Search ─── */
.search-input {
  width: 100%; max-width: 480px; padding: var(--s-3) var(--s-5);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  font-family: var(--font-body); font-size: 14px; color: var(--fg);
  outline: none; transition: border-color 0.3s var(--ease-out-expo);
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--fg-dim); }

/* ─── Tag list ─── */
.tag-list { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-4); }
.tag-list a { font-family: var(--font-mono); font-size: 11px; color: var(--fg-muted); text-decoration: none; }
.tag-list a:hover { color: var(--accent); }

/* ─── Article meta ─── */
.article-meta {
  display: flex; gap: var(--s-5); flex-wrap: wrap; align-items: center;
  font-family: var(--font-mono); font-size: 11px; color: var(--fg-muted); margin-bottom: var(--s-6);
}

/* ─── Breadcrumb ─── */
.breadcrumb {
  display: flex; gap: var(--s-3); align-items: center;
  font-family: var(--font-mono); font-size: 11px; color: var(--fg-muted); margin-bottom: var(--s-6);
}
.breadcrumb a { color: var(--fg-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--fg-dim); }

/* ─── Last updated ─── */
.last-updated {
  font-family: var(--font-mono); font-size: 10px; color: var(--fg-dim);
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* ─── Footer grid ─── */
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: var(--s-8); }
.footer-logo { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--fg); }
.footer-logo span { color: var(--accent); }
.footer-about { color: var(--fg-muted); max-width: 30ch; }
.footer-links h4 { font-size: 12px; margin-bottom: var(--s-4); text-transform: uppercase; letter-spacing: 0.08em; }
.footer-link-column { display: flex; flex-direction: column; gap: var(--s-3); }
.footer-link-column a { font-size: 14px; color: var(--fg-muted); }
.footer-link-column a:hover { color: var(--accent); }

/* ─── Status indicator dot ─── */
.status-indicator {
  width: 8px; height: 8px; border-radius: var(--r-full); display: inline-block;
}
.status-indicator.ready { background: var(--signal); }
.status-indicator.wip { background: var(--warn); }
.status-indicator.draft { background: var(--fg-dim); }
.status-indicator.deprecated { background: var(--danger); }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4, .card-grid { grid-template-columns: 1fr; }
  .section { padding: var(--s-8) 0; }
  .site-nav { gap: var(--s-2); }
  .site-nav .chip { padding: var(--s-2) var(--s-3); font-size: 11px; }
  .mark-grid-2 { grid-template-columns: 1fr; }
  .mark-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .ds-footer { flex-direction: column; gap: var(--s-4); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* DS spec utility classes */
.spec-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 48px 28px 22px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  --tick-size: 10px;
  --tick-offset: 8px;
}
.spec-card .corner-tick,
.mini-card .corner-tick {
  position: absolute;
  width: var(--tick-size);
  height: var(--tick-size);
  border-left: 1px solid rgba(255,255,255,0.22);
  border-top: 1px solid rgba(255,255,255,0.22);
}
.corner-tick.tl { top: var(--tick-offset); left: var(--tick-offset); }
.corner-tick.tr { transform: rotate(90deg); top: var(--tick-offset); right: var(--tick-offset); }
.corner-tick.bl { transform: rotate(-90deg); bottom: var(--tick-offset); left: var(--tick-offset); }
.corner-tick.br { transform: rotate(180deg); bottom: var(--tick-offset); right: var(--tick-offset); }

.mini-card {
  width: 160px;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
  --tick-size: 8px;
  --tick-offset: 5px;
}

.spec-card-md {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  --tick-size: 9px;
  --tick-offset: 6px;
}

.flex-center { display: flex; align-items: center; justify-content: center; flex: 1 1 0%; }
.flex-col-center { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.flex-gap-10 { display: flex; gap: 10px; }

.mono-label-xs { font-family: var(--font-mono); font-size: 9px; color: var(--fg-muted); letter-spacing: 0.12em; text-transform: uppercase; }
.mono-label-sm { font-family: var(--font-mono); font-size: 10px; color: var(--fg-muted); letter-spacing: 0.12em; text-transform: uppercase; }
.mono-label-sm.fg { color: var(--fg); }
.mono-label.fg { color: var(--fg); }
.mono-md { font-family: var(--font-mono); font-size: 14px; color: var(--fg); }

.body-sm-muted { font-family: var(--font-body); font-size: 14px; color: var(--fg-muted); }

.spec-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -0.02em; color: var(--fg); }
.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 88px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.section-subtitle {
  margin: 16px 0 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
}
.section-desc {
  margin: 16px 0 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.55;
  color: var(--fg-muted);
  max-width: 680px;
}
.subsection-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.color-row {
  display: grid;
  grid-template-columns: 140px 100px 1fr 120px;
  align-items: center;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.color-row-lg {
  display: grid;
  grid-template-columns: 120px 110px 1fr;
  gap: 32px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.spec-row {
  display: grid;
  grid-template-columns: 120px 80px 1fr;
  gap: 24px;
  align-items: center;
}
.spec-row-lg {
  display: grid;
  grid-template-columns: 120px 110px 1fr;
  gap: 32px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.svg-block { display: block; }
.svg-flex { display: block; flex: 0 0 auto; }

.swatch { width: 14px; height: 14px; border-radius: 50%; }
.color-block {
  height: 48px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.spacing-bar {
  height: 14px;
  background: var(--accent);
  border-radius: 2px;
}

.fg { color: var(--fg); }

.mt-64 { margin-top: 64px; }
.mt-48 { margin-top: 48px; }
.mt-16 { margin-top: 16px; }
.mt-8 { margin-top: 8px; }
.mb-64 { margin-bottom: 64px; }
.mb-48 { margin-bottom: 48px; }
.mb-24 { margin-bottom: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-8 { margin-bottom: 8px; }
.pt-48 { padding-top: 48px; }

.cover-logo {
  font-family: Anybody, var(--font-display);
  font-size: 243px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.9;
  text-transform: uppercase;
}
.footer-logo {
  font-family: Anybody, var(--font-display);
  font-size: 43px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--fg);
}

.logo-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  line-height: 1;
}

.section-heading {
  margin: 80px 0 24px;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.025em;
}
.section-desc-17 {
  margin: 0 0 32px;
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--fg-muted);
  max-width: 680px;
  line-height: 1.55;
}

/* Second-pass utilities */
.input-mono {
  flex: 1 1 0%;
  background: transparent;
  border: 0;
  outline: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--fg);
  padding: 14px 0;
}
.label-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.body-sm-fg {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--fg);
}
.body-xs-muted {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg-muted);
}
.icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  flex: 0 0 auto;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.dot-red {
  background: rgb(220, 74, 54);
  box-shadow: rgb(220, 74, 54) 0 0 6px;
}
.dot-green {
  background: rgb(215, 255, 58);
  box-shadow: rgb(215, 255, 58) 0 0 6px;
}
.color-danger { color: rgb(255, 59, 48); }
.accent-color { color: var(--accent); }
.spec-title-sm {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
}
.min-w-0 { min-width: 0; }
.font-medium { font-weight: 500; }
.gap-14 { gap: 14px; }
.gap-18 { gap: 18px; }
.border-top { border-top: 1px solid var(--border); }

.color-muted { color: var(--fg-muted); }
.fg-dim { color: var(--fg-dim); }
.inline-flex { display: inline-flex; }
.line-height-1 { line-height: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; }
.items-baseline { align-items: baseline; }
.flex-wrap { flex-wrap: wrap; }
.justify-center { justify-content: center; }
.gap-10 { gap: 10px; }
.gap-16 { gap: 16px; }
.mt-12 { margin-top: 6px; }
.pt-14 { padding-top: 14px; }
.pl-14 { padding-left: 14px; }
.border-left { border-left: 1px solid var(--border); }

.display-56 {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.95;
  color: var(--fg);
}
.display-42 {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--fg);
  line-height: 0.95;
}

.spec-card-alt {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px 28px 24px;
}
.spec-card-sm {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.spec-card-md-alt {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.body-p {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
}

.btn-mono {
  appearance: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg);
}
.btn-toggle {
  appearance: none;
  cursor: pointer;
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: var(--accent);
  border: 1px solid var(--accent);
  padding: 0;
  position: relative;
  transition: background 0.15s, border 0.15s;
}
.toggle-knob {
  position: absolute;
  top: 2px;
  left: 20px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-fg);
  transition: left 0.15s;
}
.color-comparison-row {
  display: grid;
  grid-template-columns: 80px 1fr 160px 1fr;
  gap: 16px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.display-24 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.display-80 {
  font-family: var(--font-display);
  font-size: 80px;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.92;
  color: var(--fg);
}

.mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.gap-2 { gap: 2px; }
.py-14 { padding-top: 14px; padding-bottom: 14px; }
.px-8 { padding-left: 8px; padding-right: 8px; }
.border-bottom { border-bottom: 1px solid var(--border); }

.micro-bar {
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--border-strong);
  border-radius: 1px;
  vertical-align: bottom;
}
.dot-blue {
  background: rgb(81, 121, 181);
  box-shadow: rgb(81, 121, 181) 0 0 6px;
}

.btn-outline {
  appearance: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 4px;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
}

@media (max-width: 768px) {
  .color-row { grid-template-columns: 100px 80px 1fr; gap: 12px; }
  .color-row-lg { grid-template-columns: 100px 80px 1fr; gap: 16px; padding: 16px 0; }
  .spec-row { grid-template-columns: 100px 60px 1fr; gap: 12px; }
  .spec-row-lg { grid-template-columns: 100px 80px 1fr; gap: 16px; padding: 16px 0; }
  .cover-logo { font-size: 80px; }
}

/* ---- Round 4: additional utilities from spec ---- */
.fs-13 { font-size: 13px; }

.btn-md {
  appearance: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 14px 22px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-fg);
  border: 1px solid var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.flex-col-start {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.hidden { display: none; }

.flex-between-baseline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.toggle-container {
  position: relative;
  height: 22px;
  display: flex;
  align-items: center;
}

.slider-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
}

.hidden-input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}

.strike-red {
  text-decoration: line-through rgb(255, 59, 48);
}

.fw-row {
  width: 100%;
  padding: 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ---- Round 5: button size variants ---- */
.btn-lg {
  appearance: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 18px 28px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-sm {
  appearance: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  appearance: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-toggle {
  appearance: none;
  cursor: pointer;
  width: 42px;
  height: 24px;
  border-radius: 99px;
  padding: 0;
  position: relative;
}

.input-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 12px;
}

.flex-wrap-center {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.grid-3-margins {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}

.dot-orange {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgb(232, 162, 63);
  box-shadow: rgb(232, 162, 63) 0px 0px 6px;
}

.micro-bar-12 {
  display: inline-block;
  width: 3px;
  height: 12px;
  background: var(--border-strong);
  border-radius: 1px;
  vertical-align: bottom;
}

.btn-sm-06 { letter-spacing: 0.06em; }

/* ---- Round 6: remaining button and dot utilities ---- */
.btn-transparent-muted {
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg-muted);
}

.btn-outline-strong {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border-strong);
  gap: 10px;
}

.dot-red-sm {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgb(255, 59, 48);
}

.input-chip-0 {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0;
}

.ml-tweak { margin-left: -0.01em; }

/* ---- Cross-page utilities extracted from wiki pages ---- */
.text-muted { color: var(--muted); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.max-w-prose { max-width: 640px; }
.section-hero { padding: 64px 0 32px; }
.pt-12 { padding-top: 48px; }
.pb-24 { padding-bottom: 96px; }
.text-center { text-align: center; }

/* ─── Article page layout (wiki pages) ─── */
.article-page { padding: var(--s-8) 0 var(--s-12); }
.article-header { margin-bottom: var(--s-8); }
.article-header h1 {
  font-family: var(--font-display); font-size: 48px; font-weight: 800;
  letter-spacing: -0.03em; line-height: 1; margin: var(--s-4) 0 var(--s-4);
}
.article-summary {
  font-size: 18px; line-height: 1.6; color: var(--fg-muted); max-width: 60ch;
  margin-bottom: var(--s-5);
}
.tags { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.date { font-family: var(--font-mono); font-size: 11px; color: var(--fg-dim); }

/* ---- Missing utilities from index.html cleanup ---- */
.p-12 { padding: 48px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-6 { margin-bottom: 24px; }

/* ---- Round 7: spec-specific utilities ---- */
.chip-rect {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.chip-spec {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--fg);
  border: 1px solid var(--border);
}
.chip-spec-accent {
  background: var(--accent);
  color: var(--accent-fg);
  border: 1px solid var(--accent);
}

.label-warning { color: rgb(232, 162, 63); }
.label-info    { color: rgb(81, 121, 181); }
.label-danger  { color: rgb(220, 74, 54); }
.label-success { color: rgb(215, 255, 58); }

.swatch-lg {
  width: 120px;
  height: 120px;
  border-radius: 8px;
}

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mb-16 { margin-bottom: 64px; }

.section-title-32 {
  margin: 0 0 32px;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.display-72 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 72px;
  line-height: 0.96;
  letter-spacing: -0.035em;
  color: var(--fg);
}

.display-aa {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(64px, 10vw, 130px);
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--fg);
}

.display-aa.font-body {
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.display-aa.font-mono {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(64px, 10vw, 120px);
  letter-spacing: -0.02em;
}

.logo-anybody {
  font-family: Anybody, ui-sans-serif, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-left: -0.01em;
}

/* ---- Round 8: final spec cleanup utilities ---- */
.btn-outline-danger {
  background: transparent;
  color: rgb(255, 59, 48);
  border: 1px solid rgb(255, 59, 48);
}

.gap-32 { gap: 32px; }
.gap-24 { gap: 24px; }
.flex { display: flex; }

.color-swatch {
  height: 48px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(239, 239, 236);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

/* ---- Spacing demo bars ---- */
.spacing-bar {
  height: 14px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---- Min-height utilities for spec cards ---- */
.min-h-140 { min-height: 140px; }
.min-h-170 { min-height: 170px; }
.min-h-200 { min-height: 200px; }
.min-h-220 { min-height: 220px; }
.min-h-240 { min-height: 240px; }
.min-h-260 { min-height: 260px; }
.min-h-280 { min-height: 280px; }
.min-h-300 { min-height: 300px; }
.min-h-420 { min-height: 420px; }

/* ---- Color swatch dark text variant ---- */
.color-swatch-dark {
  color: rgb(10, 10, 10);
}

/* ---- Large color swatch (foundation colors) ---- */
.swatch-lg {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Semantic color dot / chip ---- */
.semantic-dot {
  border-radius: 50%;
  flex: 0 0 auto;
}

/* ---- Contrast check row ---- */
.contrast-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 6px;
}

/* ---- 6-column icon grid ---- */
.grid-6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

/* ---- Inline chip badge ---- */
.chip-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 14px;
}

/* ---- Utility classes for inline style extraction ---- */
.inline-block { display: inline-block; }
.grid { display: grid; }
.items-center { align-items: center; }
.absolute { position: absolute; }
.relative { position: relative; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.uppercase { text-transform: uppercase; }
.pointer-events-none { pointer-events: none; }
.rounded-full { border-radius: 50%; }
.border { border: 1px solid var(--border); }
.text-fg { color: var(--fg); }
.font-mono { font-family: var(--font-mono); }
.font-display { font-family: var(--font-display); }
.font-body { font-family: var(--font-body); }
.shrink-0 { flex: 0 0 auto; }
.v-bottom { vertical-align: bottom; }
.justify-center { justify-content: center; }
