/* ============================================================
   Ruth Ogubuike — Applied AI Lab
   Editorial "field manual" design system.
   A warm, calm, premium theme with a quiet engineering motif.
   ============================================================ */

:root {
  /* --- Color: warm editorial palette --- */
  --paper: #faf8f3;          /* page background, warm off-white */
  --paper-tint: #f3f0e8;     /* alternating section band */
  --surface: #ffffff;        /* cards / raised surfaces */
  --surface-soft: #f4f2ec;   /* subtle fills */
  --ink: #18191d;            /* primary text */
  --ink-soft: #474c54;       /* secondary text */
  --ink-faint: #828892;      /* tertiary / meta */
  --line: #e7e3d9;           /* hairline borders */
  --line-strong: #d2cdc0;
  --grid-line: rgba(24, 25, 29, 0.035); /* graph-paper motif */

  /* Dark surface (footer, accent bands) */
  --ink-deep: #15161a;
  --ink-deep-soft: #a6abb4;
  --ink-deep-line: rgba(255, 255, 255, 0.12);

  /* Single restrained accent: a deep, calm teal-green */
  --accent: #0f6b5f;
  --accent-ink: #0a4f46;
  --accent-bright: #14897a;
  --accent-wash: #ecf3f0;

  /* --- Typography --- */
  --font-serif: "Spectral", "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  /* --- Layout --- */
  --maxw: 1140px;
  --maxw-prose: 690px;
  --maxw-wide: 1280px;
  --radius: 5px;
  --radius-lg: 10px;
  --shadow-card: 0 1px 2px rgba(24, 25, 29, 0.04),
    0 12px 28px -16px rgba(24, 25, 29, 0.18);

  /* --- Motion --- */
  --ease: 240ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Dark theme overrides --- */
[data-theme="dark"] {
  --paper: #131419;
  --paper-tint: #181a20;
  --surface: #1c1e26;
  --surface-soft: #21242d;
  --ink: #ede9e0;
  --ink-soft: #b4b9c2;
  --ink-faint: #7e8590;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.20);
  --grid-line: rgba(255, 255, 255, 0.04);

  --ink-deep: #0e0f13;
  --ink-deep-soft: #9aa0aa;
  --ink-deep-line: rgba(255, 255, 255, 0.10);

  --accent: #34b3a1;
  --accent-ink: #55c6b6;
  --accent-bright: #3dc0ad;
  --accent-wash: rgba(52, 179, 161, 0.14);

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3),
    0 16px 34px -18px rgba(0, 0, 0, 0.7);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--paper);
  /* Faint graph-paper grid: the lab/notebook motif */
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 30px 30px;
  background-position: -1px -1px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.62;
  font-feature-settings: "cv05" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 300ms ease, color 300ms ease;
}

img { max-width: 100%; display: block; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--ease);
}
a:hover { color: var(--accent-ink); }

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

::selection { background: var(--accent-wash); }

strong { font-weight: 600; }

/* --------------------------- Layout ----------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 28px;
}
.container--wide { max-width: var(--maxw-wide); }

.section { padding-block: clamp(64px, 9vw, 104px); }
.section--tight { padding-block: clamp(44px, 6vw, 64px); }
.section--tint { background: var(--paper-tint); }

.rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ------------------------- Typography --------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1.5px;
  background: currentColor;
  display: inline-block;
}
.eyebrow--muted { color: var(--ink-faint); }
.eyebrow--plain::before { display: none; }

h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.display {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 6vw, 4.3rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
}

.h-section {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 0 0 20px;
}

.lead {
  font-size: clamp(1.12rem, 2.1vw, 1.36rem);
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
  max-width: 38ch;
}
.lead--wide { max-width: 64ch; }

.measure { max-width: var(--maxw-prose); }

.text-soft { color: var(--ink-soft); }
.text-faint { color: var(--ink-faint); }

/* ----------------------------- Header --------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 22px;
  height: 74px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 600;
  margin-right: auto;
}
.brand:hover { color: var(--ink); }
.brand:hover .lab-mark { border-color: var(--accent); color: var(--accent); }
.brand-text { display: inline-flex; flex-direction: column; line-height: 1.1; }
.brand .brand-name {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  letter-spacing: -0.01em;
}
.brand .brand-tag {
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
}

/* Monogram "lab" mark */
.lab-mark {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  position: relative;
  transition: var(--ease);
  flex-shrink: 0;
}
.lab-mark::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
  order: 1;
}
.nav-links a {
  color: var(--ink-soft);
  font-size: 0.94rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1.5px;
  text-decoration-color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  width: 44px;
  height: 40px;
  cursor: pointer;
  color: var(--ink);
  padding: 0;
  order: 3;
}

/* Theme toggle */
.theme-toggle {
  order: 2;
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: var(--ease);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
.theme-toggle .icon { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  margin-inline: auto;
  position: relative;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

/* --------------------------- Buttons ---------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--ease);
  white-space: nowrap;
}
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover {
  background: var(--accent-ink);
  color: #fff;
  transform: translateY(-1px);
}
[data-theme="dark"] .btn--primary:hover { background: var(--accent); color: #07241f; }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn--ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--surface);
}
.btn .icon { width: 17px; height: 17px; }
.btn .arrow { transition: transform var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

.textlink {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  color: var(--accent);
}
.textlink .arrow { transition: transform var(--ease); }
.textlink:hover .arrow { transform: translateX(4px); }

/* ----------------------------- Tags ----------------------------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tag {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: 999px;
}

/* ---------------------------- Hero ------------------------------ */
.hero { padding-block: clamp(64px, 11vw, 124px) clamp(48px, 7vw, 84px); }
.hero .display { max-width: 17ch; }
.hero .lead { margin-top: 8px; }
.hero-note {
  margin-top: 18px;
  font-size: 0.92rem;
  color: var(--ink-faint);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.hero-note .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 0 4px var(--accent-wash);
  flex-shrink: 0;
}

/* ----------------------- Intersection triad -------------------- */
.triad {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, 1fr);
}
.triad-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  position: relative;
  overflow: hidden;
}
.triad-card .num {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.triad-card h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.35rem;
  margin: 14px 0 10px;
  letter-spacing: -0.01em;
}
.triad-card p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }

/* --------------------- Two-column section ----------------------- */
.split {
  display: grid;
  gap: clamp(32px, 6vw, 80px);
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: start;
}
.split--even { grid-template-columns: 1fr 1fr; }
.sticky-head { position: sticky; top: 110px; }

/* ------------------------- Principle list ----------------------- */
.principles { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.principle {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 20px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.principle:last-child { border-bottom: 1px solid var(--line); }
.principle .idx {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--accent);
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
}
.principle h3 { font-size: 1.2rem; margin: 0 0 8px; }
.principle p { margin: 0; color: var(--ink-soft); font-size: 1rem; }

/* ----------------- Impressions strip (home) -------------------- */
.impressions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 48px;
}
.impressions li {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.02rem;
}
.impressions li .mark {
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

/* --------------------- Index / listing rows --------------------- */
.entry-list { display: grid; gap: 0; }
.entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 36px 0;
  border-top: 1px solid var(--line);
  transition: var(--ease);
}
.entry:last-child { border-bottom: 1px solid var(--line); }
.entry:hover {
  background: linear-gradient(90deg, transparent, var(--surface-soft) 50%, transparent);
}
.entry__meta {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  margin: 0 0 12px;
}
.entry h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 12px;
  letter-spacing: -0.015em;
}
.entry h3 a { color: var(--ink); }
.entry h3 a:hover { color: var(--accent); }
.entry p { margin: 0 0 16px; color: var(--ink-soft); max-width: 64ch; }
.entry__cta { flex-shrink: 0; align-self: center; }
.entry__num {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* ------------------------- Feature card ------------------------- */
.feature {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.feature__body {
  padding: clamp(28px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.feature__label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.feature h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0;
  letter-spacing: -0.015em;
}
.feature p { margin: 0; color: var(--ink-soft); }
.feature__media {
  background: linear-gradient(135deg, var(--accent-wash), var(--surface-soft));
  border-left: 1px solid var(--line);
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 260px;
  padding: clamp(20px, 3vw, 32px);
}
.feature__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feature__media video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.feature__media .placeholder {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--ink-faint);
  text-align: center;
}

/* ------------------------- Stat figures ------------------------- */
.stat-row {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.stat .figure {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat .figure .unit { color: var(--accent); }
.stat .label { margin-top: 12px; font-size: 0.95rem; color: var(--ink-soft); }

/* ==================  ARTICLE / CASE STUDY  ====================== */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 60;
  transition: width 80ms linear;
}

.article-head { padding-block: clamp(48px, 8vw, 88px) 40px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-faint);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 32px;
}
.back-link:hover { color: var(--ink); }

.article-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.3rem, 5.5vw, 3.6rem);
  letter-spacing: -0.02em;
  line-height: 1.04;
  margin: 16px 0 20px;
  max-width: 18ch;
}
.article-standfirst {
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0 0 28px;
}
.article-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--ink-faint);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.article-byline strong { color: var(--ink); font-weight: 600; }

/* Layout: prose with a sticky table of contents */
.article-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}
.toc { position: sticky; top: 110px; font-size: 0.9rem; }
.toc p {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  margin: 0 0 16px;
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
  display: grid;
  gap: 12px;
}
.toc li { counter-increment: toc; }
.toc a { color: var(--ink-soft); display: flex; gap: 10px; }
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.toc a:hover { color: var(--accent); }

/* Prose */
.prose { max-width: var(--maxw-prose); font-size: 1.12rem; line-height: 1.7; }
.prose > section { scroll-margin-top: 100px; }
.prose section + section { margin-top: 64px; }
.prose h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}
.prose .section-kicker {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
  font-variant-numeric: tabular-nums;
}
.prose h3 { font-size: 1.2rem; margin: 36px 0 8px; }
.prose p { margin: 0 0 20px; color: var(--ink-soft); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { color: var(--ink-soft); padding-left: 24px; margin: 0 0 20px; }
.prose li { margin-bottom: 10px; }
.prose li::marker { color: var(--accent); }
.prose blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 24px;
  border-left: 2px solid var(--accent);
  font-family: var(--font-serif);
  font-size: 1.3rem;
  line-height: 1.45;
  color: var(--ink);
  font-style: italic;
}
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.prose a:hover { text-decoration-color: var(--accent); }

/* Executive summary block */
.exec-summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 40px);
  margin-bottom: 8px;
  box-shadow: var(--shadow-card);
}
.exec-summary .eyebrow { margin-bottom: 14px; }
.exec-summary p:last-child { margin-bottom: 0; }

/* Callout */
.callout {
  background: var(--accent-wash);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 28px 0;
}
.callout p { margin: 0; color: var(--ink); }
.callout ul { margin: 0; }

/* Definition grid (e.g. stakeholders, components) */
.def-grid { display: grid; gap: 0; margin: 8px 0 24px; }
.def-grid > div {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.def-grid > div:last-child { border-bottom: 1px solid var(--line); }
.def-grid dt { font-weight: 600; color: var(--ink); margin: 0; }
.def-grid dd { margin: 0; color: var(--ink-soft); }

/* Comparison / decision table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 24px;
  font-size: 0.98rem;
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.data-table thead th {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
}
.data-table td:first-child { color: var(--ink); font-weight: 600; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Architecture diagram */
.diagram {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 36px);
  margin: 8px 0 16px;
}
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
  justify-content: center;
}
.flow-node {
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.flow-node .sub {
  display: block;
  font-size: 0.76rem;
  color: var(--ink-faint);
  font-weight: 400;
  margin-top: 3px;
}
.flow-node--accent { border-color: var(--accent); background: var(--accent-wash); }
.flow-arrow { color: var(--accent); align-self: center; font-size: 1.1rem; }
.diagram-caption {
  text-align: center;
  font-size: 0.86rem;
  color: var(--ink-faint);
  margin: 18px 0 0;
}

.img-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}
.video-frame { margin: 8px 0 0; }
.video-frame video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
}
.video-frame .figcaption { margin-top: 10px; }

.img-placeholder {
  aspect-ratio: 16 / 9;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--ink-faint);
  background: var(--surface);
  font-size: 0.92rem;
  padding: 24px;
}
.figcaption { font-size: 0.86rem; color: var(--ink-faint); margin-top: 10px; }

/* CTA band */
.cta-band {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: clamp(32px, 6vw, 64px);
  text-align: center;
  box-shadow: var(--shadow-card);
}
.cta-band h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  letter-spacing: -0.015em;
  margin: 0 0 14px;
}
.cta-band p { color: var(--ink-soft); margin: 0 auto 28px; max-width: 48ch; }
.cta-band .btn-row { justify-content: center; }

/* ---------------------------- Footer ---------------------------- */
.site-footer {
  background: var(--ink-deep);
  color: var(--ink-deep-soft);
  border-top: 1px solid var(--ink-deep-line);
  padding-block: 72px 44px;
  margin-top: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px;
}
.footer-brand .brand-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: #fff;
}
.footer-brand p {
  margin: 14px 0 0;
  color: var(--ink-deep-soft);
  max-width: 34ch;
  font-size: 0.95rem;
}
.footer-col h4 {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  margin: 0 0 16px;
  font-weight: 600;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.footer-col a { color: var(--ink-deep-soft); font-size: 0.95rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--ink-deep-line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

/* --------------------------- 404 page --------------------------- */
.error-page {
  min-height: 64vh;
  display: grid;
  place-items: center;
  text-align: center;
}
.error-page .code {
  font-family: var(--font-serif);
  font-size: clamp(4rem, 16vw, 8rem);
  color: var(--accent);
  line-height: 1;
  margin: 0 0 8px;
}

/* --------------------------- Responsive ------------------------- */
@media (max-width: 900px) {
  .split, .feature, .article-layout { grid-template-columns: 1fr; }
  .toc { display: none; }
  .triad { grid-template-columns: 1fr; }
  .impressions { grid-template-columns: 1fr; }
  .feature__media {
    border-left: none;
    border-top: 1px solid var(--line);
    min-height: 0;
    padding: 0;
    background: none;
  }
  .feature__media video { border: none; border-radius: 0; }
  .sticky-head { position: static; }
}

@media (max-width: 680px) {
  body { font-size: 17px; }
  .nav-toggle { display: inline-grid; place-items: center; }

  .nav-links {
    position: absolute;
    top: 74px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 8px 28px 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--ease);
  }
  .nav-links.open { max-height: 360px; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 13px 0; border-bottom: 1px solid var(--line); width: 100%; }

  .entry { grid-template-columns: 1fr; gap: 16px; }
  .principle { grid-template-columns: 40px 1fr; gap: 14px; }
  .def-grid > div { grid-template-columns: 1fr; gap: 4px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .flow { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
