/* =========================================================================
   browse.itisyou.app — "Technical Precision" design system
   Tokens from design/inventory/design-tokens.json + DESIGN.md.
   Rules: no gradients, no blurred shadows. Depth = 1px borders + hard
   2px offset shadows. 4px baseline grid. Inter + JetBrains Mono, self-hosted.
   ========================================================================= */

/* ---- Fonts (self-hosted, SIL OFL 1.1 — see /assets/fonts/LICENSE.txt) ---- */
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---- Design tokens ---- */
:root {
  /* brand */
  --bone: #FBFAF8;
  --deep-slate: #0B0C0E;
  --slate-technical: #2C333A;
  --surface-tier: #E9E6E0;
  --surface-low: #F4F3F1;
  --surface-lowest: #FFFFFF;
  --border-subtle: #D1D5DB;
  --outline: #76777B;

  /* text */
  --text: var(--deep-slate);
  --text-secondary: #45474A;
  --text-muted: #5B5C60; /* >= 4.5:1 on bone */

  /* accents */
  --emerald: #10B981;        /* security accents, non-text */
  --emerald-text: #067647;   /* emerald for text (contrast-safe) */
  --emerald-tint: rgba(16, 185, 129, 0.10);
  --amber: #F59E0B;          /* warnings, non-text */
  --amber-text: #92400E;     /* amber for text (contrast-safe) */
  --amber-tint: rgba(245, 158, 11, 0.12);
  --focus-blue: #3B82F6;     /* keyboard focus ONLY */
  --error: #BA1A1A;
  --error-tint: rgba(186, 26, 26, 0.08);

  /* structure */
  --radius: 4px;
  --radius-lg: 8px;
  --hard-shadow: 2px 2px 0 0 var(--deep-slate);
  --hard-shadow-sm: 0 2px 0 0 var(--deep-slate);
  --container: 1200px;
  --gutter: 24px;

  /* type */
  --font-sans: "Inter", ui-sans-serif, system-ui, "Segoe UI", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

/* ---- Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bone);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

h1, h2, h3, h4 {
  margin: 0 0 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-wrap: balance;
}

h1 { font-size: clamp(28px, 5vw, 40px); }
h2 { font-size: clamp(22px, 3.5vw, 28px); }
h3 { font-size: 20px; letter-spacing: -0.01em; }
h4 { font-size: 16px; letter-spacing: -0.01em; }

p {
  margin: 0 0 16px;
}

p, li {
  max-width: 72ch;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

ul, ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

code, kbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-low);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1px 5px;
}

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

img {
  max-width: 100%;
  height: auto;
}

/* ---- Focus (focus-blue is reserved for exactly this) ---- */
:focus {
  outline: none;
}

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

::selection {
  background: rgba(59, 130, 246, 0.25);
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 200;
  background: var(--deep-slate);
  color: var(--bone);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: top 120ms ease;
}

.skip-link:focus {
  top: 16px;
  outline: 2px solid var(--focus-blue);
  outline-offset: 2px;
}

/* ---- Utility ---- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.mono-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.mono {
  font-family: var(--font-mono);
  font-size: 13px;
}

.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================================
   Header
   ========================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface-tier);
  border-bottom: 1px solid var(--border-subtle);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
}

.wordmark {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark:hover { text-decoration: none; }

.site-nav {
  display: none;
  flex: 1;
  justify-content: center;
}

.site-nav ul {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: inline-block;
  padding: 6px 12px;
  font-size: 14px;
  text-decoration: none;
  border-radius: var(--radius);
  border-top: 2px solid transparent;
  color: var(--text-secondary);
}

.site-nav a:hover {
  color: var(--text);
  background: var(--surface-low);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  border-top-color: var(--deep-slate);
}

.header-status {
  display: none;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  background: var(--bone);
  border-radius: var(--radius);
  padding: 5px 10px;
  white-space: nowrap;
}

.header-status:hover {
  border-color: var(--slate-technical);
  color: var(--text);
  text-decoration: none;
}

.header-status .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  margin-right: 6px;
  vertical-align: 1px;
}

.nav-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
}

.nav-toggle:hover {
  border-color: var(--slate-technical);
}

.nav-toggle .bars {
  display: inline-block;
  width: 16px;
  height: 12px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  position: relative;
}

.nav-toggle .bars::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 3px;
  border-top: 2px solid currentColor;
}

@media (min-width: 900px) {
  .site-nav { display: flex; }
  .header-status { display: inline-block; }
  .nav-toggle { display: none; }
}

/* ---- Mobile drawer (per website_mobile_navigation design) ---- */
.mobile-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--bone);
  overflow-y: auto;
}

.mobile-drawer.open {
  display: block;
}

body.drawer-open {
  overflow: hidden;
}

.mobile-drawer .drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-tier);
}

.drawer-close {
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text);
}

.mobile-drawer .drawer-section {
  padding: 16px var(--gutter) 0;
}

.mobile-drawer .drawer-section > .mono-label {
  display: block;
  margin-bottom: 8px;
}

.mobile-drawer ul {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.mobile-drawer li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--surface-lowest);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

.mobile-drawer li a::after {
  content: "\2192"; /* → */
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.mobile-drawer li a[aria-current="page"] {
  border-left: 3px solid var(--deep-slate);
  font-weight: 700;
}

.mobile-drawer .drawer-foot {
  padding: 24px var(--gutter) 40px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 16px;
}

.mobile-drawer .drawer-foot .mono {
  color: var(--text-muted);
  font-size: 12px;
}

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--radius);
  padding: 12px 20px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 80ms ease, box-shadow 80ms ease, background-color 120ms ease;
}

.btn-primary {
  background: var(--deep-slate);
  color: var(--bone);
  box-shadow: var(--hard-shadow);
  border-color: var(--deep-slate);
}

.btn-primary:hover {
  background: var(--slate-technical);
}

.btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--slate-technical);
}

.btn-secondary:hover {
  background: var(--surface-low);
}

/* =========================================================================
   Status badges — text label always present, never color-only
   ========================================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius);
  padding: 3px 8px;
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.badge-available {
  color: var(--emerald-text);
  background: var(--emerald-tint);
  border-color: rgba(16, 185, 129, 0.35);
}

.badge-indev {
  color: var(--bone);
  background: var(--slate-technical);
  border-color: var(--slate-technical);
}

.badge-indev::before {
  background: var(--amber);
}

.badge-planned {
  color: var(--text-muted);
  background: var(--surface-low);
  border-style: dashed;
}

.badge-planned::before {
  background: var(--outline);
}

.badge-experimental {
  color: var(--amber-text);
  background: var(--amber-tint);
  border-color: rgba(245, 158, 11, 0.45);
}

/* =========================================================================
   Page scaffolding
   ========================================================================= */
.page-hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border-subtle);
}

.page-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.page-hero p.dek {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 62ch;
  margin-bottom: 0;
}

.section {
  padding: 48px 0;
}

.section + .section {
  border-top: 1px solid var(--border-subtle);
}

.section-head {
  margin-bottom: 24px;
}

.section-head .mono-label {
  display: block;
  margin-bottom: 8px;
}

.section-head p {
  color: var(--text-secondary);
}

/* =========================================================================
   Cards & bento grids
   ========================================================================= */
.card {
  background: var(--surface-lowest);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card:hover {
  border-color: var(--slate-technical);
}

.card h3 {
  margin-bottom: 8px;
}

.card > :last-child {
  margin-bottom: 0;
}

.card .card-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card-emphasis {
  border-color: var(--deep-slate);
  box-shadow: var(--hard-shadow);
}

.card-dark {
  background: var(--deep-slate);
  color: var(--bone);
  border-color: var(--deep-slate);
}

.card-dark .mono-label { color: #A9ADB3; }
.card-dark a { color: var(--bone); }

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr 1fr; }

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .span-2 { grid-column: span 2; }
}

/* =========================================================================
   Homepage hero
   ========================================================================= */
.home-hero {
  padding: 72px 0 64px;
  border-bottom: 1px solid var(--border-subtle);
}

.home-hero .container {
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 960px) {
  .home-hero .container {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  }
}

.home-hero h1 {
  font-size: clamp(32px, 5.5vw, 48px);
  margin-bottom: 20px;
}

.home-hero .dek {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.hero-note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  max-width: 52ch;
}

/* Browser-chrome mockup */
.hero-mock {
  position: relative;
}

.hero-mock::before {
  content: "";
  position: absolute;
  inset: 12px -12px -12px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transform: rotate(1.2deg);
  z-index: 0;
}

.browser-mock {
  position: relative;
  z-index: 1;
  background: var(--surface-lowest);
  border: 1px solid var(--deep-slate);
  border-radius: var(--radius-lg);
  box-shadow: var(--hard-shadow);
  overflow: hidden;
}

.browser-mock .mock-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-tier);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 14px;
}

.browser-mock .mock-dots {
  display: flex;
  gap: 5px;
  flex: none;
}

.browser-mock .mock-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--outline);
  background: var(--surface-low);
}

.browser-mock .mock-url {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bone);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  padding: 5px 10px;
  overflow: hidden;
  white-space: nowrap;
}

.browser-mock .mock-lock {
  color: var(--emerald-text);
  font-weight: 700;
}

.browser-mock .mock-body {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.9;
}

.browser-mock .mock-body .ln { display: block; white-space: pre-wrap; }
.browser-mock .mock-body .ok { color: var(--emerald-text); }
.browser-mock .mock-body .warn { color: var(--amber-text); }
.browser-mock .mock-body .dim { color: var(--text-muted); }

/* =========================================================================
   Definition / spec lists (mono key-value)
   ========================================================================= */
.spec-list {
  margin: 0;
}

.spec-list > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.spec-list > div:last-child {
  border-bottom: 0;
}

.spec-list dt {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex: none;
}

.spec-list dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: right;
}

/* =========================================================================
   Code / terminal blocks
   ========================================================================= */
.terminal {
  background: var(--deep-slate);
  color: #D7DBDF;
  border-radius: var(--radius-lg);
  border: 1px solid var(--deep-slate);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  padding: 16px 20px;
  overflow-x: auto;
}

.terminal .ok { color: #34D399; }
.terminal .warn { color: #FBBF24; }
.terminal .dim { color: #8B9096; }

pre.codeblock {
  background: var(--surface-low);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 16px;
  overflow-x: auto;
}

/* =========================================================================
   Tables
   ========================================================================= */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-lowest);
}

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

.data-table caption {
  text-align: left;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.data-table thead th {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--surface-low);
  white-space: nowrap;
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: var(--surface-low);
}

/* Comparison table */
.compare-table {
  min-width: 1500px;
}

.compare-table td {
  font-size: 13px;
  min-width: 150px;
}

.compare-table th[scope="row"] {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--surface-low);
  min-width: 140px;
  position: sticky;
  left: 0;
  z-index: 1;
  border-right: 1px solid var(--border-subtle);
}

.compare-table .col-itisyou {
  background: var(--surface-tier);
  border-left: 2px solid var(--deep-slate);
  border-right: 2px solid var(--deep-slate);
}

.compare-table thead .col-itisyou {
  border-top: 2px solid var(--deep-slate);
}

.compare-table tbody tr:last-child .col-itisyou {
  border-bottom: 2px solid var(--deep-slate);
}

.compare-table .cell-badge {
  display: block;
  margin-top: 6px;
}

/* =========================================================================
   Timeline (progress events / story)
   ========================================================================= */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 20px;
  border-left: 1px solid var(--border-subtle);
}

.timeline > li {
  position: relative;
  padding: 0 0 28px 20px;
  max-width: none;
}

.timeline > li::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bone);
  border: 2px solid var(--slate-technical);
}

.timeline > li.tl-latest::before {
  background: var(--emerald);
  border-color: var(--emerald);
}

.timeline .tl-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.timeline time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.timeline .tl-desc {
  margin: 0;
  color: var(--text-secondary);
}

.timeline .tl-evidence {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* Event-type chips */
.chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--surface-low);
  color: var(--text-secondary);
  padding: 2px 7px;
}

.chip-completed, .chip-decision {
  border-color: rgba(16, 185, 129, 0.4);
  background: var(--emerald-tint);
  color: var(--emerald-text);
}

/* =========================================================================
   Milestone list (progress page)
   ========================================================================= */
.milestone-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.milestone-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
  max-width: none;
}

.milestone-list li:last-child {
  border-bottom: 0;
}

.milestone-list .m-name {
  min-width: 0;
}

.milestone-list .m-id {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* Stat tiles */
.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (min-width: 720px) {
  .stat-row { grid-template-columns: repeat(4, 1fr); }
}

.stat-tile {
  background: var(--surface-lowest);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}

.stat-tile .stat-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-tile .mono-label {
  display: block;
  margin-bottom: 6px;
}

.stat-tile .stat-caption {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* =========================================================================
   Architecture explorer
   ========================================================================= */
.explorer {
  display: grid;
  gap: 24px;
  align-items: start;
}

@media (min-width: 960px) {
  .explorer {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  }
  .explorer-detail {
    position: sticky;
    top: 88px;
  }
}

.explorer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background-color: var(--surface-lowest);
  background-image: radial-gradient(circle, rgba(11, 12, 14, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
}

@media (min-width: 640px) {
  .explorer-grid { grid-template-columns: repeat(3, 1fr); }
}

.arch-node {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  background: var(--bone);
  border: 1px solid var(--slate-technical);
  border-radius: var(--radius);
  padding: 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: transform 100ms ease, box-shadow 100ms ease;
}

.arch-node .mono-label {
  font-size: 10px;
  color: var(--text-muted);
}

.arch-node:hover {
  transform: translateY(-2px);
  box-shadow: var(--hard-shadow);
}

.arch-node[aria-pressed="true"] {
  background: var(--deep-slate);
  color: var(--bone);
  box-shadow: var(--hard-shadow);
}

.arch-node[aria-pressed="true"] .mono-label {
  color: #A9ADB3;
}

.explorer-detail {
  background: var(--surface-lowest);
  border: 1px solid var(--deep-slate);
  border-radius: var(--radius-lg);
  box-shadow: var(--hard-shadow);
  padding: 24px;
}

.explorer-detail h3 {
  margin-bottom: 4px;
}

.explorer-detail .detail-status {
  margin-bottom: 16px;
}

.explorer-detail .detail-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.explorer-detail .detail-block > .mono-label {
  display: block;
  margin-bottom: 8px;
}

.explorer-detail ul.iface-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.explorer-detail ul.iface-list li {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-subtle);
  max-width: none;
}

.explorer-detail ul.iface-list li:last-child {
  border-bottom: 0;
}

.explorer-detail .boundary {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 0;
}

/* =========================================================================
   FAQ accordion
   ========================================================================= */
.faq-layout {
  display: grid;
  gap: 32px;
  align-items: start;
}

@media (min-width: 960px) {
  .faq-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .faq-toc {
    position: sticky;
    top: 88px;
  }
}

.faq-toc ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.faq-toc a {
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  text-decoration: none;
  border-left: 2px solid var(--border-subtle);
  color: var(--text-secondary);
}

.faq-toc a:hover {
  color: var(--text);
  border-left-color: var(--deep-slate);
}

details.faq-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--surface-lowest);
  margin-bottom: 12px;
}

details.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 15px;
}

details.faq-item summary::-webkit-details-marker {
  display: none;
}

details.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--text-muted);
  flex: none;
}

details.faq-item[open] summary::after {
  content: "\2212"; /* − */
}

details.faq-item[open] summary {
  border-bottom: 1px solid var(--border-subtle);
}

details.faq-item .faq-answer {
  padding: 16px 20px;
  color: var(--text-secondary);
  font-size: 14.5px;
}

details.faq-item .faq-answer > :last-child {
  margin-bottom: 0;
}

.faq-group {
  margin-bottom: 40px;
  scroll-margin-top: 96px;
}

/* =========================================================================
   Callouts
   ========================================================================= */
.callout {
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--slate-technical);
  border-radius: var(--radius);
  background: var(--surface-low);
  padding: 16px 20px;
  margin: 24px 0;
}

.callout > :last-child { margin-bottom: 0; }

.callout .mono-label {
  display: block;
  margin-bottom: 8px;
}

.callout-warn {
  border-left-color: var(--amber);
  background: var(--amber-tint);
}

.callout-good {
  border-left-color: var(--emerald);
  background: var(--emerald-tint);
}

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  margin-top: 64px;
  background: var(--surface-tier);
  border-top: 1px solid var(--border-subtle);
  padding: 48px 0 32px;
  font-size: 14px;
}

.footer-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
  margin-bottom: 32px;
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.site-footer .wordmark {
  display: inline-block;
  margin-bottom: 12px;
}

.site-footer .footer-tag {
  color: var(--text-secondary);
  max-width: 36ch;
}

.site-footer h2.footer-h {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin-bottom: 8px;
}

.site-footer a {
  text-decoration: none;
  color: var(--text-secondary);
}

.site-footer a:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-meta {
  border-top: 1px solid var(--border-subtle);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

@media (min-width: 720px) {
  .footer-meta {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
  }
}

/* =========================================================================
   Prose (story page / markdown output)
   ========================================================================= */
.prose h2 {
  margin-top: 40px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.prose h3 {
  margin-top: 28px;
}

.prose ul li {
  margin-bottom: 6px;
}

/* =========================================================================
   404
   ========================================================================= */
.notfound {
  padding: 96px 0;
  text-align: center;
}

.notfound .code {
  font-family: var(--font-mono);
  font-size: 72px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 16px;
}

.notfound p {
  margin-left: auto;
  margin-right: auto;
}

.notfound .cta-row {
  justify-content: center;
}

/* =========================================================================
   Motion
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
