/* ==========================================================================
   Intuition First - Core Design System & Styling
   Minimal, Modern, Precision Scientific Aesthetic
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400&family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   MONOGRAPH THEME: LIGHT & DARK MODES
   ========================================================================== */

/* 1. MONOGRAPH - LIGHT (Default: Warm Archival Parchment / Editorial Serif) */
:root,
[data-theme="light"] {
  color-scheme: light;

  /* Surfaces */
  --bg-space: #faf8f5;              /* Warm natural parchment */
  --bg-card: #ffffff;               /* Pure white card surface */
  --bg-card-subtle: #f4f1ea;        /* Archival plate tint */
  --bg-surface-elevated: #ede8de;   /* Elevated archival pill */

  /* Hairlines & Borders */
  --border-subtle: #e5e0d5;
  --border-medium: #d1cac0;
  --border-active: #1d4ed8;

  /* Typography */
  --text-primary: #18191b;          /* Carbon Ink */
  --text-secondary: #4a4e57;
  --text-prose: #24272c;
  --text-emphasis: #18191b;
  --text-muted: #646872;
  --text-faint: #989ba4;

  /* Physics Semantic Palette (Calibrated Classical Contrast) */
  --color-time: #1d4ed8;            /* Academic Royal Cobalt */
  --color-time-glow: rgba(29, 78, 216, 0.12);
  --color-space: #c2410c;           /* Terracotta Rust */
  --color-space-glow: rgba(194, 65, 12, 0.12);
  --color-invariant: #6d28d9;       /* Royal Amethyst */
  --color-photon: #b45309;          /* Warm Amber */
  --color-emerald: #0f766e;         /* Verdigris */
  --color-danger: #b91c1c;          /* Crimson */

  /* Chrome & UI Elements */
  --nav-bg: rgba(250, 248, 245, 0.94);
  --bg-canvas-outer: #ffffff;
  --bg-canvas: #ffffff;
  --border-canvas: #e5e0d5;
  --shadow-canvas: none;
  --slider-track: #e5e0d5;
  --chip-bg: #ede8de;
  --chip-hover: #e2dcd0;
  --btn-secondary-bg: #ede8de;
  --btn-secondary-hover: #e2dcd0;
  --math-badge-bg: #f4f1ea;
  --bg-footer: #f4f1ea;
  --shadow-artifact: 0 2px 12px -2px rgba(24, 25, 27, 0.05), 0 1px 3px rgba(24, 25, 27, 0.03);
  --shadow-card: 0 1px 3px rgba(24, 25, 27, 0.04);

  /* Fonts & Sizing */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-body: var(--font-serif);
  --body-font-size: 18px;
  --body-line-height: 1.72;
}

/* 2. MONOGRAPH - DARK (Scholarly Archive / Warm Deep Umber) */
[data-theme="dark"] {
  color-scheme: dark;

  /* Surfaces */
  --bg-space: #141311;              /* Warm deep scholarly umber */
  --bg-card: #1c1a17;               /* Archival dark card */
  --bg-card-subtle: #181613;
  --bg-surface-elevated: #24221e;

  /* Hairlines & Borders */
  --border-subtle: rgba(232, 228, 218, 0.1);
  --border-medium: rgba(232, 228, 218, 0.2);
  --border-active: #60a5fa;

  /* Typography */
  --text-primary: #f4f1ea;          /* Aged Paper White */
  --text-secondary: #d4cebf;
  --text-prose: #e8e4da;
  --text-emphasis: #ffffff;
  --text-muted: #9e998e;
  --text-faint: #736f66;

  /* Physics Semantic Palette */
  --color-time: #60a5fa;            /* Soft Archival Blue */
  --color-time-glow: rgba(96, 165, 250, 0.18);
  --color-space: #fb923c;           /* Warm Ochre-Coral */
  --color-space-glow: rgba(251, 146, 60, 0.18);
  --color-invariant: #c084fc;       /* Muted Violet */
  --color-photon: #fbbf24;          /* Aged Gold */
  --color-emerald: #34d399;         /* Verdigris Mint */
  --color-danger: #f87171;

  /* Chrome & UI Elements */
  --nav-bg: rgba(20, 19, 17, 0.94);
  --bg-canvas-outer: #181613;
  --bg-canvas: #181613;
  --border-canvas: rgba(232, 228, 218, 0.1);
  --shadow-canvas: none;
  --slider-track: #24221e;
  --chip-bg: #24221e;
  --chip-hover: #2e2b26;
  --btn-secondary-bg: #24221e;
  --btn-secondary-hover: #2e2b26;
  --math-badge-bg: #181613;
  --bg-footer: #0e0d0c;
  --shadow-artifact: 0 12px 30px -6px rgba(0, 0, 0, 0.6);
  --shadow-card: 0 4px 16px -2px rgba(0, 0, 0, 0.4);

  /* Fonts & Sizing */
  --font-body: var(--font-serif);
  --body-font-size: 18px;
  --body-line-height: 1.72;
}

/* Fallback media query when theme is not yet set via JS */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    /* Surfaces */
    --bg-space: #141311;
    --bg-card: #1c1a17;
    --bg-card-subtle: #181613;
    --bg-surface-elevated: #24221e;

    /* Hairlines & Borders */
    --border-subtle: rgba(232, 228, 218, 0.1);
    --border-medium: rgba(232, 228, 218, 0.2);
    --border-active: #60a5fa;

    /* Typography */
    --text-primary: #f4f1ea;
    --text-secondary: #d4cebf;
    --text-prose: #e8e4da;
    --text-emphasis: #ffffff;
    --text-muted: #9e998e;
    --text-faint: #736f66;

    /* Physics Semantic Palette */
    --color-time: #60a5fa;
    --color-time-glow: rgba(96, 165, 250, 0.18);
    --color-space: #fb923c;
    --color-space-glow: rgba(251, 146, 60, 0.18);
    --color-invariant: #c084fc;
    --color-photon: #fbbf24;
    --color-emerald: #34d399;
    --color-danger: #f87171;

    /* Chrome & UI Elements */
    --nav-bg: rgba(20, 19, 17, 0.94);
    --bg-canvas-outer: #181613;
    --bg-canvas: #181613;
    --border-canvas: rgba(232, 228, 218, 0.1);
    --shadow-canvas: none;
    --slider-track: #24221e;
    --chip-bg: #24221e;
    --chip-hover: #2e2b26;
    --btn-secondary-bg: #24221e;
    --btn-secondary-hover: #2e2b26;
    --math-badge-bg: #181613;
    --bg-footer: #0e0d0c;
    --shadow-artifact: 0 12px 30px -6px rgba(0, 0, 0, 0.6);
    --shadow-card: 0 4px 16px -2px rgba(0, 0, 0, 0.4);

    /* Fonts & Sizing */
    --font-body: var(--font-serif);
    --body-font-size: 18px;
    --body-line-height: 1.72;
  }
}

/* Base Reset & Document Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-space);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: var(--body-font-size, 18px);
  line-height: var(--body-line-height, 1.72);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.25s ease;
}

::selection {
  background: var(--color-time);
  color: #ffffff;
}

/* Reading Progress Bar (Fixed Top hairline) */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2.5px;
  width: 0%;
  background: linear-gradient(90deg, var(--color-time), var(--color-invariant));
  z-index: 100;
  pointer-events: none;
  transition: width 0.1s linear;
}

/* Masthead Navigation */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.site-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 3.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: opacity 0.2s ease;
}

.brand-link:hover {
  opacity: 0.85;
}

.brand-badge {
  width: 2rem;
  height: 2rem;
  border-radius: 0.35rem;
  background: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--bg-space);
  font-size: 0.8rem;
  letter-spacing: -0.01em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-medium);
}

[data-theme="dark"] .brand-badge {
  background: #ffffff;
  color: #090b10;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

.brand-title {
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.brand-tag {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface-elevated);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
  font-weight: 550;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-time);
}

/* Top Navbar Articles Trigger Button */
.nav-link-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 550;
  transition: color 0.15s ease;
}

.nav-link-btn:hover {
  color: var(--color-time);
}

.nav-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

/* Layout Containers */
.reading-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 6rem;
}

.wide-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* Editorial Typography */
.article-header {
  margin-bottom: 2.75rem;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-time);
  background: rgba(2, 132, 199, 0.08);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(2, 132, 199, 0.2);
  margin-bottom: 1.25rem;
}

[data-theme="dark"] .category-tag {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.25);
}

.article-title {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.article-subtitle {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-faint);
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.25rem;
}

/* Editorial Prose */
.editorial-prose p,
.editorial-prose ul,
.editorial-prose ol,
.editorial-prose li,
.editorial-prose blockquote,
.editorial-prose dl,
.editorial-prose dt,
.editorial-prose dd {
  font-family: var(--font-body);
  font-optical-sizing: auto;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

.article-title {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.015em;
}

.article-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
}

.editorial-prose h2,
.editorial-prose h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.editorial-prose p {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-prose);
  margin-bottom: 1.15rem;
  letter-spacing: -0.003em;
}

.editorial-prose ul,
.editorial-prose ol {
  margin: 0 0 1.15rem 0;
  padding-left: 1.75rem;
}

.editorial-prose li {
  font-size: 1.15rem;
  line-height: 1.68;
  color: var(--text-prose);
  margin-bottom: 0.45rem;
  letter-spacing: -0.003em;
}

.editorial-prose li::marker {
  color: var(--color-time);
  font-weight: 600;
}

.editorial-prose ul ul,
.editorial-prose ol ol,
.editorial-prose ul ol,
.editorial-prose ol ul {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
}

.editorial-prose blockquote {
  border-left: 3px solid var(--color-time);
  background: var(--bg-card-subtle);
  padding: 1.125rem 1.5rem;
  margin: 2rem 0;
  border-radius: 0 0.625rem 0.625rem 0;
  font-style: italic;
  color: var(--text-primary);
}

.editorial-prose blockquote p:last-child {
  margin-bottom: 0;
}

.editorial-prose strong {
  color: var(--text-primary);
  font-weight: 650;
}

.editorial-prose em {
  color: var(--text-emphasis);
}

.editorial-prose h2 {
  font-family: var(--font-sans);
  font-size: 1.65rem;
  font-weight: 750;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-top: 3.5rem;
  margin-bottom: 1.25rem;
  padding-top: 0.5rem;
  line-height: 1.25;
}

.editorial-prose h3 {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.editorial-prose h4 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

/* Insight Callout */
.insight-callout {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--color-invariant);
  border-radius: 0 0.875rem 0.875rem 0;
  padding: 1.35rem 1.6rem;
  margin: 2.25rem 0;
  box-shadow: var(--shadow-card);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.insight-callout h4 {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 750;
  color: var(--text-primary);
  margin: 0 0 0.75rem 0;
  letter-spacing: -0.015em;
}

.insight-callout p {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  line-height: 1.72;
  color: var(--text-prose);
  margin-bottom: 0.85rem;
}

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

/* Formula & Math Display Cards */
.formula-card,
.math-display-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3.5px solid var(--color-time);
  border-radius: 0.75rem;
  margin: 2.25rem 0;
  box-shadow: var(--shadow-card);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

.formula-card:hover,
.math-display-card:hover {
  border-color: var(--border-medium);
}

.math-display-card {
  border-left-color: var(--color-invariant);
}

.formula-card-header {
  padding: 0.85rem 1.4rem 0.35rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.formula-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-time);
}

.math-display-card .formula-tag {
  color: var(--color-invariant);
}

.formula-body,
.formula-expression,
.formula-card > div:first-child:not(.formula-note):not(.formula-card-header),
.math-display-card > div:first-child:not(.formula-note):not(.formula-card-header) {
  padding: 1.15rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.6;
  letter-spacing: 0.015em;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.formula-card-header + .formula-body,
.formula-card-header + .formula-expression {
  padding-top: 0.25rem;
}

.formula-card strong,
.math-display-card strong {
  color: var(--text-primary);
  font-weight: 700;
}

.math-display-card > div:first-child:not(.formula-note):not(.formula-card-header),
.formula-card.text-center > div:first-child:not(.formula-note):not(.formula-card-header),
.formula-expression.text-center {
  text-align: center;
}

.formula-card .formula-note,
.math-display-card .formula-note {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.62;
  text-align: left;
  background: var(--bg-card-subtle);
  border-top: 1px solid var(--border-subtle);
  padding: 0.85rem 1.4rem;
  margin: 0;
  transition: background 0.25s ease;
}

.formula-card .formula-note strong,
.math-display-card .formula-note strong {
  color: var(--text-primary);
}

.formula-card .formula-note em,
.math-display-card .formula-note em {
  color: var(--text-primary);
  font-style: italic;
}

/* Interactive Explorable Card Container (Unibody Design) */
.interactive-artifact {
  margin: 2.75rem 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-artifact);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.25s ease;
}

.interactive-artifact:hover {
  border-color: var(--border-medium);
}

/* Desktop Breakout: Gives canvas diagrams generous breathing space */
@media (min-width: 840px) {
  .reading-container .editorial-prose .interactive-artifact {
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: 820px;
  }
}

.artifact-header {
  padding: 1.125rem 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.artifact-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-time);
  background: rgba(2, 132, 199, 0.08);
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid rgba(2, 132, 199, 0.2);
}

[data-theme="dark"] .artifact-badge {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.25);
}

.artifact-title {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-top: 0.25rem;
}

.artifact-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  line-height: 1.45;
}

/* Canvas Viewport */
.canvas-viewport {
  position: relative;
  background: var(--bg-canvas);
  padding: 0.875rem 1.25rem;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.25s ease;
}

.canvas-viewport canvas {
  width: 100%;
  max-width: 100%;
  height: 380px;
  border-radius: 0.625rem;
  background: var(--bg-canvas);
  border: 1px solid var(--border-canvas);
  transition: background 0.25s ease, border-color 0.25s ease;
}

/* Clocks Display (Precision Telemetry Layout) */
.twin-clocks-panel {
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

.clock-card {
  padding: 0.875rem 1.125rem;
  border-radius: 0.625rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.clock-card.cyan {
  border-color: var(--border-subtle);
  border-left: 3px solid var(--color-time);
}

.clock-card.amber {
  border-color: var(--border-subtle);
  border-left: 3px solid var(--color-space);
}

.clock-card.danger {
  border-color: var(--border-subtle);
  border-left: 3px solid var(--color-danger);
}

.clock-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.clock-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.clock-card.cyan .clock-label { color: var(--color-time); }
.clock-card.amber .clock-label { color: var(--color-space); }
.clock-card.danger .clock-label { color: var(--color-danger); }

.clock-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 0.25rem;
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
}

.clock-time {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.clock-time span {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

.clock-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Artifact Controls Panel */
.artifact-controls {
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

/* Single-row controls strip: clock + slider + play button on one line.
   Falls back to stacked column on mobile (≤ 640px). */
.controls-strip {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1.25rem;
}

.controls-strip .clock-card {
  margin: 0;
  padding: 0.4rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.controls-strip .clock-card .clock-label {
  font-size: 0.68rem;
}

.controls-strip .clock-card .clock-time {
  font-size: 1.1rem;
  line-height: 1;
}

.controls-strip .control-item {
  flex: 1;
  min-width: 160px;
}

.controls-strip .btn-play,
.controls-strip button[class*="btn-play"],
.controls-strip .btn-auto-age,
.controls-strip .btn-primary {
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .controls-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .controls-strip .clock-card {
    width: 100%;
    justify-content: space-between;
  }

  .controls-strip .control-item {
    width: 100%;
  }

  .controls-strip .btn-play,
  .controls-strip button[class*="btn-play"],
  .controls-strip .btn-auto-age,
  .controls-strip .btn-primary {
    width: 100%;
    justify-content: center;
    min-height: 40px;
    align-self: stretch;
  }
}

.control-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.control-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.control-val {
  font-family: var(--font-mono);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.control-val.cyan { color: var(--color-time); }
.control-val.amber { color: var(--color-space); }

/* Range Slider Styling */
.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  background: var(--slider-track);
  border-radius: 9999px;
  border: none;
  outline: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--color-time);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04);
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18), 0 0 0 4px var(--color-time-glow);
}

.range-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.08);
}

.range-slider.amber::-webkit-slider-thumb {
  border-color: var(--color-space);
}

.range-slider.amber::-webkit-slider-thumb:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18), 0 0 0 4px var(--color-space-glow);
}

.range-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--color-time);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  cursor: grab;
}

.range-slider.amber::-moz-range-thumb {
  border-color: var(--color-space);
}

/* Presets & Buttons (Segmented Aesthetics) */
.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.3rem 0.65rem;
  border-radius: 0.375rem;
  background: var(--chip-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chip-btn:hover {
  background: var(--chip-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.chip-btn.active,
.chip-btn.is-active {
  background: rgba(2, 132, 199, 0.1);
  border-color: var(--color-time);
  color: var(--color-time);
  font-weight: 600;
}

[data-theme="dark"] .chip-btn.active,
[data-theme="dark"] .chip-btn.is-active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--color-time);
  color: var(--color-time);
}

.toolbar-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.75rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  background: var(--color-time);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-play {
  min-width: 7.5rem;
  justify-content: center;
}

[data-theme="dark"] .btn-primary {
  color: #070a12;
  font-weight: 700;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--color-time-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  background: var(--btn-secondary-bg);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: var(--btn-secondary-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.btn-hero-read {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1.1rem;
  border-radius: 9999px;
  background: var(--text-primary);
  color: var(--bg-card);
  font-weight: 600;
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-hero-read:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.math-badge {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 550;
  padding: 0.25rem 0.65rem;
  border-radius: 0.375rem;
  background: var(--math-badge-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
  font-variant-numeric: tabular-nums;
  display: inline-block;
  vertical-align: baseline;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.math-badge strong {
  color: var(--color-time);
}

/* Subtle styling for inline math inside editorial prose (paragraphs, lists, callouts, quotes) */
.editorial-prose .math-badge,
.insight-callout .math-badge {
  font-size: 0.85em;
  padding: 0.12rem 0.42rem;
  margin: 0 0.15rem;
  border-radius: 0.28rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  vertical-align: baseline;
  line-height: normal;
  display: inline-block;
}

/* Series Hub Cards */
.series-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.series-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0.875rem;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.series-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background-color 0.25s ease;
}

.series-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-3px);
  box-shadow: var(--shadow-artifact);
}

.series-card.coming-soon {
  opacity: 0.8;
  cursor: default;
  border-style: dashed;
  background: var(--bg-card-subtle);
}

.series-card.coming-soon:hover {
  border-color: var(--border-subtle);
  transform: none;
  box-shadow: var(--shadow-card);
}

.series-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.card-num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-time {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

.card-title {
  font-size: 1.28rem;
  font-weight: 750;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
  line-height: 1.32;
  letter-spacing: -0.02em;
}

.card-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.card-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: default;
  letter-spacing: 0.02em;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.series-card:hover .card-tag {
  border-color: var(--border-medium);
  color: var(--text-secondary);
}

.card-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 0.2s ease;
}

.series-card:hover .card-cta {
  transform: translateX(3px);
}

/* Series Pager Navigation */
.series-pager {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.series-pager a {
  text-decoration: none;
}

.series-pager .btn-primary,
.series-pager .btn-secondary {
  padding: 0.65rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 650;
}

/* Article Author Bio */
.article-author {
  margin-top: 3rem;
  padding: 1.5rem;
  border-radius: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  gap: 1.25rem;
  align-items: center;
  box-shadow: var(--shadow-card);
}

.article-author .brand-badge {
  width: 3.25rem;
  height: 3.25rem;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.article-author h4 {
  font-family: var(--font-sans);
  margin: 0 0 0.35rem 0;
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--text-primary);
}

.article-author p {
  font-family: var(--font-sans);
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-footer);
  padding: 3rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: background 0.25s ease;
}

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

.site-footer a:hover {
  color: var(--color-time);
}

/* ==========================================================================
   Hero & Hub Layout Classes
   ========================================================================== */
/* ==========================================================================
   Hero & Hub Layout Classes ("Intuition First")
   ========================================================================== */
.hero-header {
  padding: 3.5rem 1.5rem 1.25rem;
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
}

.hero-title {
  font-size: 3.25rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero-title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--text-primary);
}

.hero-subtitle {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 640px;
  margin: 0 auto;
}

/* Series Hub Layout */
.series-section {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.series-group {
  margin-bottom: 3.25rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.series-group:first-of-type {
  border-top: none;
  padding-top: 0;
}

.series-group-header {
  margin-bottom: 1.25rem;
}

.series-group-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}

.series-group-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.series-group-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.2;
}

/* Series 1 Palette: Relativity (Cobalt & Indigo) */
.series-theme-relativity .series-group-tag {
  color: var(--color-time);
}
.series-theme-relativity .card-num {
  color: var(--color-time);
}
.series-theme-relativity .series-card:hover {
  border-color: rgba(9, 105, 218, 0.4);
}
.series-theme-relativity .series-card::before {
  background: var(--color-time);
}
.series-theme-relativity .card-cta {
  color: var(--color-time);
}

/* Series 2 Palette: Information and Entropy (Verdigris & Phosphor Mint) */
.series-theme-entropy .series-group-tag {
  color: var(--color-emerald);
}
.series-theme-entropy .card-num {
  color: var(--color-emerald);
}
.series-theme-entropy .series-card:hover {
  border-color: rgba(15, 118, 110, 0.4);
}
.series-theme-entropy .series-card::before {
  background: var(--color-emerald);
}
.series-theme-entropy .card-tag.accent-entropy {
  color: var(--color-emerald);
  border-color: rgba(15, 118, 110, 0.2);
}
.series-theme-entropy .card-cta {
  color: var(--color-emerald);
}

.card-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.card-status-badge.live {
  color: var(--color-emerald);
}

.card-status-badge.live::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-emerald);
}

.card-status-badge.soon {
  color: var(--text-muted);
}

.card-status-badge.soon::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-faint);
}

.philosophy-section {
  padding-top: 0;
  padding-bottom: 3.5rem;
}

.philosophy-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 2.5rem;
  max-width: 820px;
  margin: 0 auto;
  box-shadow: var(--shadow-card);
}

.philosophy-card h3 {
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
  letter-spacing: -0.02em;
}

.philosophy-card p {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1.15rem;
}

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

/* ==========================================================================
   Responsive Breakpoints & Mobile Optimization
   ========================================================================== */

/* Tablets and below (<= 768px) */
@media (max-width: 768px) {
  .canvas-viewport canvas {
    height: 300px;
  }
  .article-title {
    font-size: 2.25rem;
  }
}

/* Mobile Devices (<= 640px) */
@media (max-width: 640px) {
  /* Navigation Bar */
  .site-nav-inner {
    height: 3.25rem;
    padding: 0 1rem;
  }
  .brand-badge {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.85rem;
    border-radius: 0.375rem;
  }
  .brand-link {
    gap: 0.5rem;
  }
  .brand-title {
    font-size: 0.82rem;
    max-width: 155px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .brand-tag {
    display: none;
  }
  .nav-links {
    gap: 0.75rem;
    font-size: 0.8rem;
  }
  .nav-link-secondary {
    display: none;
  }
  /* Page Layout Containers */
  .reading-container {
    padding: 1.5rem 1rem 3.5rem;
  }
  .wide-container {
    padding: 1.5rem 1rem;
  }

  /* Hero & Hub Typography */
  .hero-header {
    padding: 2rem 0.5rem 0.75rem;
  }
  .hero-title {
    font-size: 2.15rem;
    line-height: 1.15;
    margin-bottom: 0.75rem;
  }
  .hero-subtitle {
    font-size: 1.05rem;
    line-height: 1.55;
    margin-bottom: 0;
  }
  .series-section {
    padding-top: 1rem;
  }
  .series-group {
    margin-bottom: 2.5rem;
    padding-top: 1.75rem;
  }
  .series-group:first-of-type {
    padding-top: 0;
  }
  .series-group-header {
    margin-bottom: 1rem;
  }
  .series-group-title {
    font-size: 1.5rem;
  }
  .series-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
  }
  .series-card {
    padding: 1.25rem;
  }
  .philosophy-section {
    padding-top: 1.5rem;
    padding-bottom: 2.5rem;
  }
  .philosophy-card {
    padding: 1.25rem;
    border-radius: 0.875rem;
  }

  /* Editorial Content & Headings */
  .article-header {
    margin-bottom: 1.5rem;
  }
  .category-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.65rem;
    margin-bottom: 0.85rem;
  }
  .article-title {
    font-size: 1.85rem;
    line-height: 1.2;
    margin-bottom: 0.75rem;
  }
  .article-subtitle {
    font-size: 1.05rem;
    line-height: 1.5;
    margin-bottom: 1rem;
  }
  .article-meta {
    padding-top: 0.875rem;
    font-size: 0.75rem;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  .editorial-prose p {
    font-size: 1.05rem;
    line-height: 1.65;
    margin-bottom: 1.125rem;
  }
  .editorial-prose ul,
  .editorial-prose ol {
    padding-left: 1.35rem;
    margin-bottom: 1.125rem;
  }
  .editorial-prose li {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
  }
  .editorial-prose h2 {
    font-size: 1.35rem;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    padding-top: 0;
  }
  .editorial-prose h3 {
    font-size: 1.15rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
  }
  .editorial-prose h4 {
    font-size: 1.02rem;
    margin-top: 1.15rem;
    margin-bottom: 0.4rem;
  }
  .editorial-prose blockquote {
    padding: 0.75rem 1rem;
    margin: 1.25rem 0;
    font-size: 1.02rem;
  }
  .insight-callout {
    padding: 1rem 1.15rem;
    margin: 1.5rem 0;
    border-radius: 0 0.625rem 0.625rem 0;
  }
  .insight-callout h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }
  .insight-callout p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0.65rem;
  }
  .formula-card,
  .math-display-card {
    padding: 0;
    margin: 1.35rem 0;
    border-radius: 0.625rem;
  }
  .formula-card-header {
    padding: 0.65rem 1rem 0.2rem 1rem;
  }
  .formula-body,
  .formula-expression,
  .formula-card > div:first-child:not(.formula-note):not(.formula-card-header),
  .math-display-card > div:first-child:not(.formula-note):not(.formula-card-header) {
    padding: 0.85rem 1rem;
    font-size: 0.92rem;
    line-height: 1.5;
  }
  .formula-card .formula-note,
  .math-display-card .formula-note {
    padding: 0.7rem 1rem;
    font-size: 0.8rem;
    line-height: 1.55;
  }
  .series-pager {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
  }
  .series-pager a {
    text-align: center;
    justify-content: center;
  }
  .article-author {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
    padding: 1.125rem;
    margin-top: 2rem;
  }

  /* Interactive Artifact Card */
  .interactive-artifact {
    margin: 1.25rem 0;
    border-radius: 0.875rem;
  }
  .artifact-header {
    padding: 0.75rem 1rem;
    gap: 0.4rem;
  }
  .artifact-badge {
    font-size: 0.68rem;
    padding: 0.18rem 0.5rem;
  }
  .artifact-title {
    font-size: 0.85rem;
    line-height: 1.3;
  }
  .artifact-desc {
    font-size: 0.72rem;
    line-height: 1.4;
    margin-top: 0.1rem;
  }

  /* Canvas Viewport */
  .canvas-viewport {
    padding: 0.5rem;
  }
  .canvas-viewport canvas {
    height: 240px;
    border-radius: 0.5rem;
  }

  /* Twin Clocks: Side-by-side comparison preserved on mobile */
  .twin-clocks-panel {
    padding: 0.625rem 0.75rem;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .clock-card {
    padding: 0.5rem 0.625rem;
    border-radius: 0.5rem;
  }
  .clock-meta {
    margin-bottom: 0.2rem;
    gap: 0.25rem;
  }
  .clock-label {
    font-size: 0.62rem;
    line-height: 1.2;
  }
  .clock-badge {
    font-size: 0.6rem;
    padding: 0.1rem 0.35rem;
  }
  .clock-time {
    font-size: 1.25rem;
    letter-spacing: -0.01em;
  }
  .clock-time span {
    font-size: 0.65rem;
  }
  .clock-subtext {
    font-size: 0.65rem;
    margin-top: 0.15rem;
    line-height: 1.25;
  }

  /* Controls Panel */
  .artifact-controls {
    padding: 0.75rem 0.875rem;
    gap: 0.625rem;
  }
  .control-item {
    gap: 0.35rem;
  }
  .control-header {
    font-size: 0.75rem;
  }
  .control-val {
    font-size: 0.75rem;
  }
  .range-slider {
    height: 4px;
  }
  .range-slider::-webkit-slider-thumb {
    width: 15px;
    height: 15px;
  }
  .preset-chips {
    gap: 0.35rem;
  }
  .chip-btn {
    font-size: 0.66rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.3rem;
  }
  .toolbar-bottom {
    gap: 0.5rem;
    padding-top: 0.5rem;
  }
  .btn-primary, .btn-secondary, .btn-hero-read {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }
  .toolbar-bottom .math-badge {
    font-size: 0.72rem;
    padding: 0.35rem 0.65rem;
    width: 100%;
    text-align: center;
    border-radius: 0.375rem;
  }
  .editorial-prose .math-badge {
    width: auto;
    display: inline-block;
  }

  /* Footer */
  .site-footer {
    padding: 2rem 1rem;
    font-size: 0.8rem;
  }
}

/* Extra-small screens (<= 380px) */
@media (max-width: 380px) {
  .brand-title {
    max-width: 125px;
    font-size: 0.78rem;
  }
  .nav-links {
    gap: 0.5rem;
  }
  .canvas-viewport canvas {
    height: 220px;
  }
  .clock-time {
    font-size: 1.15rem;
  }
  .clock-label {
    font-size: 0.58rem;
  }
  .reading-container, .wide-container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* ==========================================================================
   Wide Reading Container & Desktop Layout System
   Balanced Editorial Grid + Split-Screen Sim Panels (Option A)
   ========================================================================== */
.wide-reading-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 3.5rem 2rem 6rem;
}

.wide-reading-container .article-header {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 3rem;
}

.wide-reading-container .editorial-prose {
  width: 100%;
}

.wide-reading-container .editorial-prose > p {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  font-size: 1.16rem;
  line-height: 1.72;
  letter-spacing: -0.002em;
  margin-bottom: 1.15rem;
}

.wide-reading-container .editorial-prose > ul,
.wide-reading-container .editorial-prose > ol {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  font-size: 1.15rem;
  line-height: 1.7;
  margin-bottom: 1.15rem;
  padding-left: 1.85rem;
}

.wide-reading-container .editorial-prose > li {
  margin-bottom: 0.45rem;
}

.wide-reading-container .editorial-prose > h2 {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  font-size: 1.75rem;
  font-weight: 750;
  letter-spacing: -0.025em;
  margin-top: 3.5rem;
  margin-bottom: 1.25rem;
  padding-top: 0.5rem;
}

.wide-reading-container .editorial-prose > h3 {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin-top: 2.25rem;
  margin-bottom: 0.85rem;
}

.wide-reading-container .editorial-prose > h4 {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  font-size: 1.05rem;
  font-weight: 650;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.wide-reading-container .editorial-prose > blockquote {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.wide-reading-container .editorial-prose > .formula-card,
.wide-reading-container .editorial-prose > .math-display-card {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.wide-reading-container .editorial-prose > .insight-callout {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  margin-top: 2.25rem;
  margin-bottom: 2.25rem;
}

.wide-reading-container .editorial-prose > .article-author,
.wide-reading-container .editorial-prose > .series-pager {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.wide-reading-container .interactive-artifact {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  margin-top: 2.75rem;
  margin-bottom: 3.25rem;
}

/* --- Comparison Grid (Simulation 01 Dual View) --- */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-canvas-outer);
}

@media (max-width: 880px) {
  .comparison-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0.75rem;
  }
}

@media (max-width: 640px) {
  .comparison-grid {
    gap: 0.75rem;
    padding: 0.5rem 0.65rem;
  }
}

.canvas-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.canvas-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 0.2rem 0.5rem;
}

.artifact-controls-deck {
  padding: 0.65rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.artifact-controls-deck .controls-strip {
  padding: 0;
  gap: 0.85rem;
  width: 100%;
}

.controls-preset-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.45rem;
}

.controls-preset-row .preset-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .artifact-controls-deck {
    padding: 0.65rem 0.75rem !important;
    gap: 0.65rem;
  }

  .controls-preset-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
}

.canvas-col-tag {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.canvas-col canvas {
  width: 100%;
  height: 380px;
  border-radius: 0.625rem;
  background: var(--bg-canvas);
  border: 1px solid var(--border-canvas);
  display: block;
}

@media (max-width: 640px) {
  .canvas-col canvas {
    height: 250px;
  }
  .wide-reading-container {
    padding: 1.5rem 1rem 3.5rem;
  }
}

/* --- Split-Screen Desktop Layout (Simulations 02 & 03) --- */
.artifact-split {
  display: grid;
  grid-template-columns: 1.32fr 1fr;
  background: var(--bg-canvas-outer);
}

@media (max-width: 900px) {
  .artifact-split {
    grid-template-columns: 1fr;
  }
}

.split-canvas-col {
  position: relative;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--bg-canvas);
  min-width: 0;
}

.split-canvas-col canvas {
  width: 100%;
  height: 420px;
  border-radius: 0.625rem;
  background: var(--bg-canvas);
  border: 1px solid var(--border-canvas);
  display: block;
  touch-action: none;
}

@media (max-width: 900px) {
  .split-canvas-col canvas {
    height: 340px;
  }
}

@media (max-width: 640px) {
  .split-canvas-col canvas {
    height: 260px;
  }
  .split-canvas-col {
    padding: 0.625rem;
  }
}

.split-controls-col {
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.125rem;
  min-width: 0;
}

@media (max-width: 900px) {
  .split-controls-col {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
    padding: 1rem 1.25rem;
  }
}

@media (max-width: 640px) {
  .split-controls-col {
    padding: 0.85rem 1rem;
    gap: 0.85rem;
  }
}

.split-controls-col .artifact-controls,
.split-controls-col .twin-clocks-panel {
  padding: 0;
  background: transparent;
  border: none;
}

/* Telemetry display rows */
.telemetry-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: var(--bg-card-subtle);
  border-top: 1px solid var(--border-subtle);
}

.telemetry-item {
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.telemetry-item .label {
  color: var(--text-muted);
  font-size: 0.68rem;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.telemetry-item .value {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

/* Multi-Panel & 2x2 Comparative Grids (Disciplined Responsive Layout)
   - Desktop / Tablet (> 720px): 2x2 matrix (grid-template-columns: 1fr 1fr)
   - Mobile (<= 720px): Single-column stack (grid-template-columns: 1fr) to preserve canvas legibility
*/
.multi-panel-grid,
.synthesis-grid,
.expanding-circles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
  width: 100%;
}

.expanding-circles-grid canvas {
  width: 100% !important;
  height: 200px !important;
  display: block;
}

.synthesis-panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-canvas);
  border-radius: 0.625rem;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.synthesis-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
}

.synthesis-panel-title {
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.synthesis-panel-tag {
  font-size: 0.68rem;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
}

.synthesis-canvas-wrap {
  width: 100%;
  height: 220px;
  position: relative;
  background: var(--bg-canvas);
  border-radius: 0.5rem;
  overflow: hidden;
}

.synthesis-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.synthesis-panel-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  padding-top: 0.25rem;
}

.synthesis-panel-footer span strong {
  color: var(--text-primary);
}

.orbit-sliders-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.viewpoint-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 720px) {
  .multi-panel-grid,
  .synthesis-grid {
    grid-template-columns: 1fr;
    gap: 0.875rem;
  }
  .synthesis-canvas-wrap {
    height: 210px;
  }
  .expanding-circles-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .expanding-circles-grid canvas {
    height: 140px !important;
  }
}

@media (max-width: 640px) {
  .orbit-sliders-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .viewpoint-bar .preset-chips {
    width: 100%;
    justify-content: flex-start;
  }
  .viewpoint-bar .btn-reset-view {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .expanding-circles-grid canvas {
    height: 125px !important;
  }
}

/* ==========================================================================
   Article Navigation Left Tab & Sidebar Drawer System
   Seamless, expandable navigation for all articles across the series
   ========================================================================== */

/* Left Floating Tab Trigger */
.article-nav-tab {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem 0.65rem 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--color-time);
  border-radius: 0 0.75rem 0.75rem 0;
  box-shadow: 0 4px 18px -2px rgba(15, 23, 42, 0.12), 0 2px 6px -1px rgba(15, 23, 42, 0.06);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  outline: none;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s, box-shadow 0.2s, border-color 0.2s;
  user-select: none;
}

[data-theme="dark"] .article-nav-tab {
  box-shadow: 0 6px 24px -4px rgba(0, 0, 0, 0.55), 0 2px 8px -2px rgba(0, 0, 0, 0.4);
}

.article-nav-tab:hover {
  transform: translateY(-50%) translateX(4px);
  background: var(--bg-card-subtle);
  border-color: var(--border-medium);
  border-left-color: var(--color-time);
}

.article-nav-tab:focus-visible {
  box-shadow: 0 0 0 2px var(--color-time);
}

.article-nav-tab.is-active {
  background: var(--bg-surface-elevated);
  border-left-color: var(--color-time);
}

.article-nav-tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-time);
}

.article-nav-tab-label {
  letter-spacing: -0.01em;
}

.article-nav-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 9999px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Nav Backdrop */
.article-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 11, 16, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 110;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.article-nav-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Nav Drawer */
.article-nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 360px;
  max-width: 86vw;
  background: var(--bg-card);
  border-right: 1px solid var(--border-subtle);
  z-index: 120;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .article-nav-drawer {
  box-shadow: 0 24px 48px -10px rgba(0, 0, 0, 0.8);
}

.article-nav-drawer.is-open {
  transform: translateX(0);
}

body.drawer-open-lock {
  overflow: hidden;
}

/* Drawer Header */
.drawer-header {
  padding: 1.25rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card-subtle);
}

.drawer-header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.drawer-brand-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-primary);
}

.drawer-brand-title {
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  line-height: 1.2;
}

.drawer-brand-sub {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
}

.drawer-close-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
}

.drawer-close-btn:hover {
  background: var(--chip-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* Drawer Body & Article List */
.drawer-scroll-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.15rem 1.5rem;
}

.drawer-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.5rem 0.25rem 0.75rem;
}

.drawer-count {
  color: var(--color-time);
}

.drawer-articles-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.drawer-article-item {
  border-radius: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.drawer-article-item:hover {
  border-color: var(--border-medium);
  background: var(--bg-card-subtle);
  transform: translateY(-1px);
}

.drawer-article-item.is-active {
  border-color: var(--color-time);
  border-left: 3.5px solid var(--color-time);
  background: var(--bg-card-subtle);
}

[data-theme="dark"] .drawer-article-item.is-active {
  background: rgba(56, 189, 248, 0.07);
}

.drawer-article-item.is-coming-soon {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

.drawer-article-item.is-coming-soon:hover {
  border-color: var(--border-subtle);
  background: var(--bg-card);
  transform: none;
}

.drawer-article-link {
  display: block;
  padding: 0.875rem 1rem;
  text-decoration: none;
  color: inherit;
}

.drawer-article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.drawer-part-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-time);
}

.drawer-time-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-faint);
}

.drawer-article-title {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin: 0 0 0.3rem 0;
}

.drawer-article-sub {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.drawer-active-pill {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: var(--color-time);
  color: #ffffff;
}

/* Drawer Footer */
.drawer-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card-subtle);
}

.drawer-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  transition: color 0.15s ease;
}

.drawer-footer-link:hover {
  color: var(--color-time);
}

/* Mobile Adjustments for Left Tab */
@media (max-width: 640px) {
  .article-nav-tab {
    top: auto;
    bottom: 1.25rem;
    transform: none;
    padding: 0.55rem 0.75rem 0.55rem 0.55rem;
  }
  .article-nav-tab:hover {
    transform: translateX(3px);
  }
  .article-nav-tab-label {
    display: none;
  }
}

/* --- Entropy Series Interactive Widgets Spacing & Layout --- */
.household-sliders-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: 0.5rem;
}

.household-room-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.household-room-row:hover {
  border-color: var(--border-medium);
}

.household-room-label {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 650;
  width: 105px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-primary);
}

.household-room-slider {
  flex: 1;
  min-width: 0;
}

.household-room-val {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  width: 50px;
  flex-shrink: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--color-time);
}

@media (max-width: 480px) {
  .household-room-row {
    gap: 0.5rem;
    padding: 0.3rem 0.4rem;
  }
  .household-room-label {
    width: 88px;
    font-size: 0.72rem;
  }
  .household-room-val {
    width: 44px;
    font-size: 0.7rem;
  }
}
