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

 :root {
 --bg: #faf7f5;
 --bg-panel: #ffffff;
 --border: #ede0d8;
 --border-strong: #c8c8c2;
 --text: #1a1a18;
 --text-subtle: #4b5563;
 --text-xsubtle: #6b7280;
 --accent: #6F5A7E;
 --tag-bg: #ece5ea;
 --tag-text: #5a5160;
 --nav-width: 220px;
 --font-sans: 'Geologica', system-ui, sans-serif;
 --font-mono: 'JetBrains Mono', monospace;
 }

 html { font-size: 14px; }
 body {
 font-family: var(--font-sans);
 background: var(--bg);
 color: var(--text);
 display: flex;
 min-height: 100vh;
 }

 /* ── Nav ── */
 nav {
 width: var(--nav-width);
 flex-shrink: 0;
 position: fixed;
 top: 0; left: 0; bottom: 0;
 background: var(--bg-panel);
 border-right: 1px solid var(--border);
 overflow-y: auto;
 padding: 24px 0 40px;
 z-index: 10;
 }
 .nav-logo {
 padding: 0 20px 24px;
 border-bottom: 1px solid var(--border);
 margin-bottom: 16px;
 }
 .nav-logo-mark { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
 .nav-logo-sub { font-size: 11px; color: var(--text-xsubtle); margin-top: 2px; font-family: var(--font-mono); }
 .nav-section { padding: 0 20px; margin-bottom: 4px; }
 .nav-section-label {
 font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
 text-transform: uppercase; color: var(--text-xsubtle);
 padding: 12px 0 6px;
 }
 nav a {
 display: block; padding: 5px 8px; border-radius: 4px;
 text-decoration: none; color: var(--text-subtle);
 font-size: 14px; transition: all 0.1s;
 }
 nav a:hover { background: var(--tag-bg); color: var(--text); }
 nav a.active { background: var(--accent); color: #fff; }

 /* ── Main ── */
 main {
 margin-left: var(--nav-width);
 flex: 1;
 padding: 48px 56px;
 max-width: 1100px;
 }

 .page-header { margin-bottom: 48px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
 .page-header h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; }
 .page-header p { color: var(--text-subtle); margin-top: 6px; line-height: 1.6; font-size: 14px; }

 /* ── Sections ── */
 .section { margin-bottom: 64px; scroll-margin-top: 32px; }
 .section-header {
 display: flex; align-items: baseline; gap: 12px;
 margin-bottom: 20px; padding-bottom: 12px;
 border-bottom: 1px solid var(--border);
 }
 .section-header h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
 .section-header .section-count {
 font-family: var(--font-mono); font-size: 12px;
 color: var(--text-xsubtle); background: var(--tag-bg);
 padding: 2px 7px; border-radius: 99px;
 }
 .subsection { margin-bottom: 36px; }
 .subsection-label {
 font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
 text-transform: uppercase; color: var(--text-xsubtle);
 margin-bottom: 10px;
 }

 /* ── Token Table ── */
 .token-table { width: 100%; border-collapse: collapse; }
 .token-table th {
 text-align: left; font-size: 11px; font-weight: 600;
 letter-spacing: 0.06em; text-transform: uppercase;
 color: var(--text-xsubtle); padding: 0 12px 8px;
 border-bottom: 1px solid var(--border);
 }
 .token-table td {
 padding: 10px 12px; border-bottom: 1px solid var(--border);
 vertical-align: middle; font-size: 13px;
 }
 .token-table tr:last-child td { border-bottom: none; }
 .token-table tr:hover td { background: #ffffff; }

 .token-name {
 font-family: var(--font-mono); font-size: 12px;
 background: var(--tag-bg); color: var(--tag-text);
 padding: 2px 7px; border-radius: 4px;
 white-space: nowrap; display: inline-block;
 }
 .token-value {
 font-family: var(--font-mono); font-size: 12px;
 color: var(--text-subtle);
 }
 .token-ref {
 font-family: var(--font-mono); font-size: 11px;
 color: var(--text-xsubtle);
 }
 .token-desc { color: var(--text-subtle); font-size: 14px; }
 .star { color: #d4a017; margin-right: 3px; }

 /* ── Color Swatch ── */
 .swatch-wrap { display: flex; align-items: center; gap: 10px; }
 .swatch {
 width: 32px; height: 32px; border-radius: 4px; flex-shrink: 0;
 border: 1px solid rgba(0,0,0,0.08);
 box-shadow: 0 1px 2px rgba(0,0,0,0.06);
 }
 .swatch-hex { font-family: var(--font-mono); font-size: 12px; color: var(--text-subtle); }

 /* ── Color Palette Grid ── */
 .palette-grid { display: flex; flex-direction: column; gap: 12px; }
 .palette-row { display: flex; gap: 0; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
 .palette-cell {
 flex: 1; height: 56px; position: relative;
 display: flex; flex-direction: column;
 justify-content: flex-end; padding: 4px 6px;
 }
 .palette-cell-label {
 font-family: var(--font-mono); font-size: 9px;
 opacity: 0.7; line-height: 1.3;
 }
 .palette-row-label {
 font-size: 11px; font-weight: 600; text-transform: uppercase;
 letter-spacing: 0.05em; color: var(--text-xsubtle);
 margin-bottom: 6px; width: 60px; display: flex;
 align-items: center;
 }
 .palette-row-wrap { display: flex; align-items: center; gap: 10px; }

 /* ── Spacing Visual ── */
 .spacing-bar-wrap { display: flex; align-items: center; gap: 12px; }
 .spacing-bar {
 background: #1a1a18; height: 8px; border-radius: 2px;
 flex-shrink: 0; min-width: 1px;
 }

 /* ── Radius Visual ── */
 .radius-box {
 width: 40px; height: 40px;
 background: var(--tag-bg); border: 2px solid var(--border-strong);
 }

 /* ── Shadow Visual ── */
 .shadow-box {
 width: 56px; height: 36px; border-radius: 8px;
 background: white; border: 1px solid var(--border);
 }

 /* ── Type Scale ── */
 .type-sample { line-height: 1.2; color: var(--text); font-family: var(--font-sans); }

 /* ── Motion ── */
.motion-cell { width: 140px; }

.motion-track {
  width: 112px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  position: relative;
  margin: 10px 0;
  /* clip so the dot can't escape the cell, but allow slight overshoot visually */
  overflow: visible;
}

.motion-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  top: -5px;
  left: 0;
  transition-property: transform;
  transition-timing-function: var(--demo-easing, ease);
  transition-duration: var(--demo-dur, 200ms);
}

.motion-track:hover .motion-dot {
  transform: translateX(98px);
}

 /* ── Theme comparison table ── */
 .theme-compare { width: 100%; border-collapse: collapse; }
 .theme-compare th {
 text-align: left; font-size: 11px; font-weight: 600;
 letter-spacing: 0.06em; text-transform: uppercase;
 color: var(--text-xsubtle); padding: 0 12px 8px;
 border-bottom: 1px solid var(--border);
 }
 .theme-compare td {
 padding: 8px 12px; border-bottom: 1px solid var(--border);
 vertical-align: middle; font-size: 12px;
 }
 .theme-compare tr:last-child td { border-bottom: none; }
 .theme-swatch-group { display: flex; gap: 4px; }
 .theme-swatch {
 width: 36px; height: 36px; border-radius: 4px;
 border: 1px solid rgba(0,0,0,0.1);
 flex-shrink: 0;
 }