/* ==========================================================================
   taylererbe.com — site design system
   One stylesheet for every page. Tokens first, then base, then components.
   Documentation: DESIGN_SYSTEM.md. Mechanical check: tools/check_style.py
   Rule: pages never define their own hex colours or font families; they use
   the tokens below (var(--...)). Add a token here before using a new colour.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;800&family=DM+Mono:wght@300;400;500&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,700;1,9..40,300;1,9..40,400&display=swap");

/* ---------- 1. Tokens ---------------------------------------------------- */
:root {
  /* Surfaces and lines (dark theme only; the site has no light theme) */
  --bg: #080b10;
  --surface: #0f1318;
  --surface2: #161c24;
  --surface3: #1f2230;            /* hover state of a raised card */
  --border: #1e2530;
  --nav-bg: rgba(8, 11, 16, 0.88);

  /* Text */
  --white: #eef3f8;               /* headings, emphasised figures */
  --text: #d8e2ed;                /* body text on dark */
  --muted: #6b7c91;               /* secondary text, prose paragraphs */
  --muted2: #3a4556;              /* tertiary: captions, step numbers */
  --ink: #0b0c0f;                 /* text on an accent-filled button */

  /* Brand accents */
  --accent: #5bc8dc;              /* primary: links, figures, active states */
  --accent-hover: #82d9e8;
  --accent2: #3a8fc4;             /* secondary: tags, eyebrows, section tags */
  --accent3: #c07a6e;             /* warm: caution, challenger, personal */
  --accent-dim: rgba(91, 200, 220, 0.12);
  --accent-faint: rgba(91, 200, 220, 0.08);

  /* Status and semantic colours */
  --green: #5dbf8a;               /* active, pass, winner */
  --green-bg: rgba(93, 191, 138, 0.12);
  --blue: #3a8fc4;                /* = accent2, used as a status hue */
  --blue-bg: rgba(58, 143, 196, 0.12);
  --coral: #c07a6e;               /* = accent3, used as a status hue */
  --coral-bg: rgba(192, 122, 110, 0.12);
  --warm: #e07a3d;                /* personal-project highlight */
  --gold: #d4a840;
  --slate: #8a9ab0;
  --violet: #9b8dc4;
  --lilac: #a78bdc;

  /* Data-visualisation palette: charts and diagrams only, never UI chrome */
  --viz-green: #2ecc71;
  --viz-green-dark: #27ae60;
  --viz-green-soft: #7fd87f;
  --viz-green-muted: #6aaa7a;
  --viz-green-alt: #4caf50;
  --viz-orange: #e67e22;
  --viz-amber: #f39c12;
  --viz-yellow: #f1c40f;
  --viz-blue: #3498db;
  --viz-red: #e74c3c;
  --viz-red-muted: #c75555;
  --viz-red-dark: #a53939;
  --viz-red-deep: #6e1f1f;
  --viz-purple: #9b59b6;
  --viz-light: #f5f5f5;
  --viz-teal-deep: #1e5f7a;
  --viz-sky: #7ab8c8;
  --viz-forest: #2a7a5a;
  --viz-emerald: #3dba84;
  --viz-steel: #6b9ab8;
  --viz-olive: #8ab870;

  /* Illustration colours (the Legacy app preview card) */
  --paper: #faf6ef;
  --navy: #0a1628;
  --rust: #c8541a;

  /* Type families */
  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;  /* h1, section titles, figures */
  --font-body: 'DM Sans', system-ui, sans-serif;                    /* paragraphs, UI text */
  --font-mono: 'DM Mono', ui-monospace, monospace;                  /* labels, tags, code, data */
  --font-heading: var(--font-display);  /* card and entry titles; switch here to change all of them */

  /* Type scale */
  --text-2xs: 0.65rem;   /* tags, meta labels */
  --text-xs: 0.72rem;    /* section tags, eyebrows, mono labels */
  --text-sm: 0.85rem;    /* card body, table cells */
  --text-base: 0.95rem;  /* prose paragraphs */
  --text-md: 1.05rem;    /* hero description, lede */
  --text-lg: 1.3rem;     /* card titles */
  --text-xl: clamp(1.6rem, 2.5vw, 2.4rem);   /* section titles */
  --text-2xl: clamp(2.8rem, 5vw, 5rem);      /* page title (h1) */
  --leading-tight: 1.0;
  --leading-normal: 1.6;
  --leading-prose: 1.8;
  --tracking-label: 0.08em;
  --tracking-eyebrow: 0.15em;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --gutter: 3rem;                 /* page side padding, desktop */
  --gutter-mobile: 1.25rem;       /* page side padding, phones */
  --nav-h: 4.25rem;
  --content-max: 1080px;          /* reading width for .wrap pages */
  --measure: 60ch;                /* body-text line length: about 75 characters of DM Sans (measured median 74) */

  /* Radii: the look is square-cornered */
  --radius: 0;                    /* cards, tiles, buttons, tables */
  --radius-sm: 2px;               /* code, small pills */
  --radius-round: 50%;            /* dots, avatars */

  /* Shadows and focus */
  --shadow-glow: 0 0 6px currentColor;
  --focus-ring: 2px solid var(--accent);

  /* Motion */
  --dur: 0.2s;
}

/* ---------- 2. Base ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 1rem); }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: var(--leading-normal);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
/* film-grain overlay, part of the look */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}
img, svg, video { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--white); line-height: 1.15; }
a { color: var(--accent); text-decoration: none; transition: color var(--dur); }
a:hover { color: var(--accent-hover); }
strong, b { font-weight: 500; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: var(--focus-ring); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Text helpers */
.link { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-dim); text-underline-offset: 3px; }
.link:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
.prose a:not([class]) { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-dim); text-underline-offset: 3px; }
.prose a:not([class]):hover { text-decoration-color: currentColor; }
.mono { font-family: var(--font-mono); }
.label { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent2); margin-bottom: var(--space-3); }
.text-accent { color: var(--accent); }
.text-accent2 { color: var(--accent2); }
.text-warm { color: var(--accent3); }
.text-white { color: var(--white); }
.text-body { color: var(--text); }
.text-muted { color: var(--muted); }
.text-green { color: var(--green); }
.text-coral { color: var(--coral); }

/* ---------- 3. Layout ---------------------------------------------------- */
section { padding: var(--space-8) var(--gutter); border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: none; }
.wrap { max-width: var(--content-max); margin: 0 auto; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-7); align-items: start; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-6); }
.two-col > *, .three-col > *, .method-grid > *, .insight-grid > * { min-width: 0; }  /* let wide children scroll instead of widening the grid */
[style*="display:grid"] > *, [style*="display: grid"] > * { min-width: 0; }  /* same for older inline grids */

/* ---------- 4. Site navigation ------------------------------------------ */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-5);
  padding: 0 var(--gutter);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: var(--tracking-label); color: var(--accent); text-decoration: none; white-space: nowrap; }
.nav-logo:hover { color: var(--accent-hover); }
.site-nav-links { display: flex; align-items: center; gap: var(--space-6); list-style: none; }
.site-nav-links a { font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); text-decoration: none; white-space: nowrap; transition: color var(--dur); }
.site-nav-links a:hover, .site-nav-links a[aria-current="page"] { color: var(--text); }
.site-nav-links a[aria-current="page"] { border-bottom: 1px solid var(--accent); padding-bottom: 2px; }

/* Page sub-navigation: in-page section links or page status, under the site nav */
.subnav {
  position: sticky; top: var(--nav-h); z-index: 90;
  display: flex; align-items: center; gap: var(--space-5);
  padding: var(--space-3) var(--gutter);
  margin-top: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav ul { display: flex; gap: var(--space-5); list-style: none; }
.subnav a { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.subnav a:hover { color: var(--text); }
.subnav + .hero { padding-top: var(--space-8); }

/* ---------- 5. Page header (hero) --------------------------------------- */
.hero {
  padding: calc(var(--nav-h) + 4.75rem) var(--gutter) 5rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute; top: -30%; right: -5%;
  width: 50vw; height: 50vw;
  background: radial-gradient(ellipse at center, rgba(91, 200, 220, 0.04) 0%, transparent 65%);
  pointer-events: none;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem; letter-spacing: var(--tracking-eyebrow); text-transform: uppercase;
  color: var(--accent2); margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: var(--space-3);
}
.hero-eyebrow::before { content: ''; display: block; flex: none; width: 2rem; height: 1px; background: var(--accent2); }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 800; font-size: var(--text-2xl);
  line-height: var(--leading-tight); color: var(--white);
  letter-spacing: 0.01em; text-transform: uppercase;
  margin-bottom: var(--space-5);
  overflow-wrap: break-word;
}
.hero h1 span, .hero h1 em { font-style: normal; color: var(--accent); }
.hero-desc { font-size: var(--text-md); color: var(--muted); max-width: 64ch; line-height: 1.75; margin-bottom: var(--space-6); }
.hero-desc strong, .hero-desc b { color: var(--text); font-weight: 500; }
.hero-meta { display: flex; flex-wrap: wrap; gap: var(--space-6); margin-top: var(--space-6); }
.meta-label { font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted2); margin-bottom: 0.3rem; }
.meta-value { font-size: 0.9rem; color: var(--text); }
.meta-value a { color: var(--accent); }
.hero-ctas { display: flex; gap: var(--space-4); flex-wrap: wrap; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.hero-eyebrow { animation: fadeUp 0.5s ease 0.1s both; }
.hero h1 { animation: fadeUp 0.5s ease 0.22s both; }
.hero-desc { animation: fadeUp 0.5s ease 0.36s both; }
.hero-meta, .hero-stats { animation: fadeUp 0.5s ease 0.48s both; }

/* Table of contents under a page header */
.toc { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); margin: var(--space-6) 0 0; }
.toc a { background: var(--surface); padding: var(--space-4) 1.1rem; text-decoration: none; display: block; transition: background var(--dur); }
.toc a:hover { background: var(--surface2); }
.toc-num { font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--accent2); letter-spacing: 0.1em; display: block; margin-bottom: 0.35rem; }
.toc-name { font-size: 0.86rem; color: var(--text); }

/* ---------- 6. Section header ------------------------------------------- */
.section-header { display: flex; align-items: baseline; gap: var(--space-5); margin-bottom: var(--space-7); }
.section-tag { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent2); white-space: nowrap; }
.section-title { font-family: var(--font-display); font-weight: 800; font-size: var(--text-xl); color: var(--white); text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.1; }
.section-title em, .section-title span { font-style: normal; color: var(--accent); }
.section-line { flex: 1; height: 1px; background: var(--border); }
.section-lede { font-size: var(--text-base); color: var(--muted); max-width: 72ch; line-height: 1.75; margin: calc(var(--space-5) * -1) 0 var(--space-6); }
.section-lede strong, .section-lede b { color: var(--text); font-weight: 500; }
.subhead { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--white); text-transform: uppercase; letter-spacing: 0.02em; margin: var(--space-6) 0 var(--space-3); }

/* ---------- 7. Prose ---------------------------------------------------- */
/* Body text never runs wider than --measure; tables, charts, code and grids keep their full width. */
section p, section li, .hero p, .step-body, .stage-body, .warn, .takeaway { max-width: var(--measure); }
.prose p { font-size: var(--text-base); color: var(--muted); line-height: var(--leading-prose); margin-bottom: var(--space-4); }
.prose p:last-child { margin-bottom: 0; }
.prose p strong, .prose p b { color: var(--text); font-weight: 500; }
.prose ul, .prose ol { margin: 0 0 var(--space-4) 1.25rem; color: var(--muted); font-size: var(--text-base); line-height: 1.7; }

/* ---------- 8. Metric tiles -------------------------------------------- */
/* 8a. Stat strip: a full-width row of figures under a page header */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stat-strip-5 { grid-template-columns: repeat(5, 1fr); }
.stat-item { background: var(--surface); padding: 1.75rem var(--space-6); transition: background var(--dur); }
.stat-item:hover { background: var(--surface2); }
.stat-big { font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; color: var(--accent); line-height: 1; margin-bottom: 0.3rem; }
.stat-desc { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--muted); }

/* 8b. Stat cards: a grid of labelled tiles (home page hero, evaluation pages) */
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); }
.hero-stats-4 { grid-template-columns: repeat(4, 1fr); max-width: 900px; }
.stat-card { background: var(--surface); padding: var(--space-6); transition: background var(--dur); }
.stat-card:hover { background: var(--surface2); }
.stat-icon { font-size: 0.6rem; color: var(--accent); margin-bottom: var(--space-3); }
.stat-num { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--accent); line-height: 1; margin-bottom: 0.3rem; }
.hero-stats-figures .stat-num { font-weight: 800; font-size: 2rem; }
.stat-label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); margin-bottom: 0.4rem; }
.stat-sub { font-size: 0.78rem; color: var(--muted); line-height: 1.4; }

/* 8c. Results strip: figures inside a section */
.results-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); margin-top: var(--space-6); }
.results-strip-4 { grid-template-columns: repeat(4, 1fr); }
.result-cell { background: var(--surface2); padding: var(--space-5); }
.result-num { font-family: var(--font-display); font-weight: 800; font-size: 2rem; color: var(--accent); line-height: 1; margin-bottom: var(--space-1); }
.result-label { font-family: var(--font-mono); font-size: 0.67rem; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--muted); }

/* ---------- 9. Cards ---------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-5); }
.card p { font-size: var(--text-sm); color: var(--muted); line-height: 1.65; }
.card p + p { margin-top: var(--space-2); }
.card strong, .card b { color: var(--text); }
.insight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); margin-top: var(--space-5); }
.insight-box { background: var(--surface2); border: 1px solid var(--border); padding: 1.25rem; }
.insight-box-title { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent2); margin-bottom: var(--space-2); }
.insight-box p { font-size: 0.83rem; color: var(--muted); line-height: 1.6; }
.insight-box p + p { margin-top: var(--space-2); }
.insight-box p strong { color: var(--text); font-weight: 500; }

/* Comparison cards */
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.method-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.method-card { background: var(--surface); border: 1px solid var(--border); padding: var(--space-6); }
.method-card.winner { border-color: var(--accent); border-top: 3px solid var(--accent); }
.method-card.challenger { border-top: 3px solid var(--accent3); }
.method-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.25rem; flex-wrap: wrap; gap: var(--space-2); }
.method-name { font-family: var(--font-display); font-weight: 800; font-size: var(--text-lg); color: var(--white); text-transform: uppercase; }
.metric-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.metric-row:last-child { border-bottom: none; }
.metric-label { font-size: 0.82rem; color: var(--muted); }
.metric-value { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--text); }
.metric-value.good { color: var(--accent); }
.metric-value.warn { color: var(--accent3); }
.metric-value.neutral { color: var(--text); }

/* ---------- 10. Callouts ------------------------------------------------ */
.callout { background: var(--surface2); border: 1px solid var(--border); border-left: 3px solid var(--accent); padding: var(--space-5) 1.75rem; margin-top: var(--space-5); }
.callout-label { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: var(--space-2); }
.callout p { font-size: 0.88rem; color: var(--muted); line-height: 1.65; }
.callout p + p { margin-top: var(--space-2); }
.callout p strong, .callout p b { color: var(--text); font-weight: 500; }
.callout.callout-good { border-left-color: var(--green); }
.callout.callout-good .callout-label { color: var(--green); }
.callout.callout-warn { border-left-color: var(--coral); }
.callout.callout-warn .callout-label { color: var(--coral); }
.callout.callout-info { border-left-color: var(--accent2); }
.callout.callout-info .callout-label { color: var(--accent2); }
.warn { border-left: 2px solid var(--accent3); background: rgba(192, 122, 110, 0.06); padding: var(--space-4) 1.25rem; margin: var(--space-5) 0; font-size: 0.9rem; color: var(--muted); line-height: 1.7; }
.warn strong { color: var(--accent3); font-weight: 500; }
.takeaway { display: flex; gap: var(--space-3); align-items: flex-start; background: var(--surface2); border-left: 3px solid var(--accent); padding: 0.9rem 1.1rem; margin-top: var(--space-4); font-size: 0.82rem; color: var(--muted); line-height: 1.6; }
.takeaway::before { content: '\2192'; color: var(--accent); font-family: var(--font-mono); flex-shrink: 0; font-size: 0.9rem; margin-top: 0.05rem; }
.takeaway strong { color: var(--text); }

/* ---------- 11. Steps, stages and key-value lists ----------------------- */
.pipeline { display: flex; flex-direction: column; }
.pipeline-step { display: grid; grid-template-columns: 48px 1fr; gap: var(--space-5); padding: var(--space-5) 0; border-bottom: 1px solid var(--border); align-items: start; }
.pipeline-step:last-child { border-bottom: none; }
.step-num { font-family: var(--font-display); font-weight: 800; font-size: 1.8rem; color: var(--muted2); line-height: 1; padding-top: 0.1rem; }
.step-title { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent2); margin-bottom: 0.4rem; }
.step-body { font-size: 0.88rem; color: var(--muted); line-height: 1.65; }
.step-body strong { color: var(--text); font-weight: 500; }
.stage { border: 1px solid var(--border); background: var(--surface); margin: var(--space-4) 0; }
.stage-head { display: flex; align-items: baseline; gap: var(--space-4); padding: var(--space-4) 1.25rem; border-bottom: 1px solid var(--border); background: var(--surface2); flex-wrap: wrap; }
.stage-id { font-family: var(--font-mono); font-size: 0.7rem; color: var(--accent); letter-spacing: 0.1em; }
.stage-name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--white); text-transform: uppercase; letter-spacing: 0.02em; }
.stage-body { padding: 1.15rem 1.25rem; font-size: 0.92rem; color: var(--muted); line-height: 1.7; }
.stage-body strong { color: var(--text); font-weight: 500; }
.kv { display: grid; grid-template-columns: minmax(160px, 220px) 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); margin: 1.25rem 0; }
.kv > div { background: var(--surface); padding: 0.7rem var(--space-4); font-size: 0.86rem; }
.kv .k { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.kv .v { color: var(--text); }

/* ---------- 12. Tags, pills and badges ---------------------------------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: var(--space-3); }
.tag { display: inline-block; font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: 0.06em; text-transform: uppercase; padding: var(--space-1) 0.6rem; border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); }
.tag-accent { border-color: var(--accent2); color: var(--accent2); }
.tag-warm { border-color: var(--accent3); color: var(--accent3); }
.tag-green { border-color: var(--green); color: var(--green); }
.method-badge, .badge { display: inline-block; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: var(--tracking-label); text-transform: uppercase; padding: 0.2rem 0.6rem; border: 1px solid var(--border); color: var(--muted); }
.badge-green { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }
.badge-warn { background: var(--coral-bg); color: var(--accent3); border: 1px solid var(--accent3); }
.badge-blue { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent); }
.status { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: var(--tracking-label); text-transform: uppercase; }
.status-dot { width: 6px; height: 6px; border-radius: var(--radius-round); background: currentColor; }

/* ---------- 13. Tables -------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.25rem 0; }
.cat-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.cat-table th { font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--muted); padding: 0.6rem var(--space-4); border-bottom: 1px solid var(--border); text-align: left; font-weight: 500; }
.cat-table td { padding: 0.7rem var(--space-4); border-bottom: 1px solid var(--border); color: var(--muted); font-size: 0.83rem; vertical-align: top; }
.cat-table td:first-child { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--accent2); white-space: nowrap; }
.cat-table tr:last-child td { border-bottom: none; }
table.dt { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: 0.86rem; }
table.dt th { text-align: left; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--accent2); font-weight: 500; }
table.dt td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: top; }
table.dt td.num { font-family: var(--font-mono); color: var(--accent); white-space: nowrap; }

/* ---------- 14. Code ---------------------------------------------------- */
code { font-family: var(--font-mono); font-size: 0.85em; color: var(--accent); background: var(--accent-faint); padding: 0.1rem 0.35rem; border-radius: var(--radius-sm); }
code.inline { color: var(--accent2); background: none; padding: 0; }
pre { font-family: var(--font-mono); }
.code-block { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent2); padding: 1.25rem var(--space-5); margin: var(--space-5) 0; overflow-x: auto; }
.code-block pre { font-size: 0.78rem; line-height: 1.7; color: var(--text); white-space: pre; }
.code-block code { background: none; padding: 0; color: inherit; }
.code-comment { color: var(--muted2); }
.code-keyword { color: var(--accent); }

/* ---------- 15. Figures and charts -------------------------------------- */
.chart-wrap { background: var(--surface2); border: 1px solid var(--border); padding: 1.25rem; margin-top: var(--space-5); overflow-x: auto; }
.chart-wrap img, .chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-caption { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--muted2); margin-top: var(--space-3); }
figure.shot { margin: var(--space-6) 0; border: 1px solid var(--border); background: var(--surface); }
figure.shot img { width: 100%; display: block; }
figure.shot figcaption { padding: 0.85rem 1.1rem; font-size: 0.8rem; color: var(--muted); border-top: 1px solid var(--border); font-family: var(--font-mono); letter-spacing: 0.03em; }
svg text { font-family: var(--font-mono); }

/* ---------- 16. Buttons ------------------------------------------------- */
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.85rem 1.75rem; text-decoration: none; border-radius: var(--radius);
}
.btn-primary { background: var(--accent); color: var(--ink); font-weight: 500; border: 1px solid var(--accent); transition: background var(--dur), transform 0.15s; }
.btn-primary:hover { background: var(--accent-hover); color: var(--ink); transform: translateY(-1px); }
.btn-ghost { border: 1px solid var(--border); color: var(--muted); transition: border-color var(--dur), color var(--dur); }
.btn-ghost:hover { border-color: var(--accent2); color: var(--accent2); }

/* ---------- 17. Back link ---------------------------------------------- */
.back-section { padding: var(--space-7) var(--gutter); text-align: center; display: flex; justify-content: center; gap: var(--space-4); flex-wrap: wrap; border-top: 1px solid var(--border); }
.back-link {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  border: 1px solid var(--border); padding: 0.85rem var(--space-6);
  transition: border-color var(--dur), color var(--dur);
}
.back-link:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 18. Site footer -------------------------------------------- */
.site-footer {
  padding: var(--space-6) var(--gutter);
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-5); flex-wrap: wrap;
}
.site-footer-meta { display: flex; flex-direction: column; gap: 0.35rem; max-width: 70ch; }
.site-footer-meta p { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.06em; color: var(--muted2); line-height: 1.6; }
.site-footer-meta a { color: var(--muted); }
.site-footer-meta a:hover { color: var(--accent); }
.site-footer-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); list-style: none; }
.site-footer-links a { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.site-footer-links a:hover { color: var(--accent); }

/* ---------- 19. Responsive --------------------------------------------- */
@media (max-width: 900px) {
  .site-nav { padding: 0 var(--space-5); }
  .site-nav-links { gap: var(--space-5); }
  .site-nav-links .nav-secondary { display: none; }
  .hero-stats-4 { grid-template-columns: 1fr 1fr; }
  .results-strip-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  :root { --gutter: 1.5rem; }
  .hero { padding-top: calc(var(--nav-h) + 2.75rem); padding-bottom: var(--space-7); }
  section { padding: var(--space-7) var(--gutter); }
  .stat-strip, .stat-strip-5 { grid-template-columns: 1fr 1fr; }
  .two-col, .three-col, .method-grid, .method-grid-3, .insight-grid, .results-strip { grid-template-columns: 1fr; }
  .back-section { padding: var(--space-6) var(--gutter); }
}
@media (max-width: 760px) {
  .section-header { flex-wrap: wrap; gap: var(--space-2); }
  .section-header .section-title { flex: 1 1 100%; }
  .section-line { display: none; }
  .section-lede { margin-top: 0; }
  .kv { grid-template-columns: 1fr; }
  .toc { grid-template-columns: 1fr 1fr; }
  /* wide tables scroll inside their own box instead of widening the page */
  table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .site-footer { flex-direction: column; }
}
@media (max-width: 480px) {
  :root { --gutter: var(--gutter-mobile); --nav-h: 3.5rem; }
  .site-nav { padding: 0 var(--gutter); gap: var(--space-3); }
  .site-nav-links { gap: var(--space-4); }
  .site-nav-links a { font-size: 0.7rem; letter-spacing: 0.04em; }
  .nav-logo { font-size: 0.78rem; }
  .hero h1 { font-size: 2.4rem; }
  .stat-strip, .stat-strip-5, .hero-stats, .hero-stats-4, .results-strip-4 { grid-template-columns: 1fr; }
  .toc { grid-template-columns: 1fr; }
  .stat-item, .stat-card { padding: 1.25rem; }
  .pipeline-step { grid-template-columns: 36px 1fr; gap: var(--space-4); }
  .back-link { padding: 0.75rem 1.25rem; }
}
