/* ========================================
   WALL STREET WIKI v2 — Tech-forward finance SDK
   Forest Green + Teal, Sharp Corners
   ======================================== */

/* === LIVE TIER (page-live) === */
.live-header {
  padding: var(--space-12) 0 var(--space-8);
  background: linear-gradient(180deg, var(--color-surface-elevated) 0%, var(--color-bg) 100%);
  border-bottom: 1px solid rgba(4, 30, 21, 0.08);
}
.live-header-eyebrow {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-secondary-dark);
  margin-bottom: var(--space-3);
}
.live-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: var(--space-3);
  color: var(--color-text);
}
.live-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  max-width: 720px;
  margin-bottom: var(--space-6);
}
.live-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-surface-card);
  border: 1px solid rgba(4, 30, 21, 0.18);
  padding: var(--space-2) var(--space-3);
  box-shadow: var(--shadow-sm);
  max-width: 640px;
}
.live-search-icon {
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.live-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  padding: var(--space-2);
}
.live-refresh-btn {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.live-refresh-btn:hover {
  background: var(--color-primary-light);
}
.live-meta-row {
  margin-top: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  min-height: 1em;
}
.live-body {
  padding: var(--space-8) 0 var(--space-16);
}
.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}
.live-card {
  background: var(--color-surface-card);
  border: 1px solid rgba(4, 30, 21, 0.08);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}
.live-card--feed {
  grid-column: 1 / -1;
}
.live-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.live-card-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
.live-card-cadence {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-secondary-dark);
}
.live-feed-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.live-feed-row {
  border-left: 3px solid var(--color-secondary);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-low);
}
.live-feed-row a {
  color: var(--color-secondary-dark);
  text-decoration: none;
  font-weight: 500;
  font-family: var(--font-display);
}
.live-feed-row a:hover { text-decoration: underline; }
.live-feed-row p {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}
.live-feed-row .live-feed-row-meta {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}
.live-status-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.live-status-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-low);
}
.live-status-row-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
}
.live-pill {
  font-family: var(--font-display);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
}
.live-pill.ready { background: var(--color-beginner-bg); color: var(--color-beginner); }
.live-pill.missing { background: var(--color-advanced-bg); color: var(--color-advanced); }
.live-pill.byok { background: var(--color-intermediate-bg); color: var(--color-intermediate); }
.live-status-row-env {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-family: 'Menlo', 'Monaco', monospace;
}
.live-freshness {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}
.live-freshness strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-base);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.live-surface-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.live-surface-list li {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-family: 'Menlo', 'Monaco', monospace;
  padding: var(--space-1) 0;
  border-bottom: 1px dashed rgba(4, 30, 21, 0.08);
}
.live-surface-list li:last-child { border-bottom: none; }
.live-empty {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
}
.live-suggested {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.live-suggested-pill {
  background: var(--color-surface-card);
  border: 1px solid rgba(4, 30, 21, 0.12);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
  color: var(--color-text-secondary);
}
.live-suggested-pill:hover {
  border-color: var(--color-secondary);
  color: var(--color-secondary-dark);
}

/* === BASE RESET === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* === DESIGN TOKENS === */
:root {
  /* Typography */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Work Sans', 'Helvetica Neue', Arial, sans-serif;

  /* Type Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.5rem;
  --text-3xl: 3.75rem;

  /* Spacing (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Sovereign Ledger Palette — Light */
  --color-primary: #041e15;
  --color-primary-container: #1a3329;
  --color-primary-light: #2a4d3d;
  --color-secondary: #3a9e7e;
  --color-secondary-light: #4cbfa0;
  --color-secondary-dark: #2a7d62;
  --color-secondary-faint: rgba(58, 158, 126, 0.12);

  --color-bg: #f9f9f7;
  --color-surface-low: #f4f4f2;
  --color-surface-card: #ffffff;
  --color-surface-elevated: #fafaf8;

  --color-text: #1a1a18;
  --color-text-secondary: #4a4a46;
  --color-text-muted: #7a7a76;
  --color-text-faint: #a0a09c;
  --color-text-inverse: #f9f9f7;

  /* Functional colors */
  --color-beginner: #2d7a4f;
  --color-intermediate: #8b7530;
  --color-advanced: #8b3030;
  --color-beginner-bg: #e8f5ee;
  --color-intermediate-bg: #f5f0e0;
  --color-advanced-bg: #f5e8e8;

  /* Category badge colors */
  --color-cat-bg: rgba(4, 30, 21, 0.06);
  --color-cat-text: #1a3329;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(4, 30, 21, 0.06);
  --shadow-md: 0 4px 16px rgba(4, 30, 21, 0.08);
  --shadow-lg: 0 8px 32px rgba(4, 30, 21, 0.12);
  --shadow-card: 0 1px 4px rgba(4, 30, 21, 0.04);
  --shadow-card-hover: 0 4px 16px rgba(4, 30, 21, 0.1);

  /* Layout */
  --content-max: 1200px;
  --content-narrow: 800px;
  --gutter: clamp(16px, 3vw, 24px);
  --nav-height: 56px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-med: 250ms var(--ease-out);

  /* 0px border radius everywhere */
  --radius: 0px;
}

/* Dark mode */
[data-theme="dark"] {
  --color-primary: #8bbfa8;
  --color-primary-container: #1a3329;
  --color-primary-light: #4a8a6a;
  --color-secondary: #4ecba8;
  --color-secondary-light: #62dab9;
  --color-secondary-dark: #38a988;
  --color-secondary-faint: rgba(78, 203, 168, 0.15);

  --color-bg: #0e1510;
  --color-surface-low: #141c16;
  --color-surface-card: #1a241c;
  --color-surface-elevated: #1e2920;

  --color-text: #dde0dc;
  --color-text-secondary: #a8aca6;
  --color-text-muted: #7a7e78;
  --color-text-faint: #505450;
  --color-text-inverse: #0e1510;

  --color-beginner: #5cb87a;
  --color-intermediate: #c4aa5a;
  --color-advanced: #c46060;
  --color-beginner-bg: rgba(92, 184, 122, 0.12);
  --color-intermediate-bg: rgba(196, 170, 90, 0.12);
  --color-advanced-bg: rgba(196, 96, 96, 0.12);

  --color-cat-bg: rgba(139, 191, 168, 0.1);
  --color-cat-text: #8bbfa8;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.15);
  --shadow-card-hover: 0 4px 16px rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-primary: #8bbfa8;
    --color-primary-container: #1a3329;
    --color-primary-light: #4a8a6a;
    --color-secondary: #4ecba8;
    --color-secondary-light: #62dab9;
    --color-secondary-dark: #38a988;
    --color-secondary-faint: rgba(78, 203, 168, 0.15);
    --color-bg: #0e1510;
    --color-surface-low: #141c16;
    --color-surface-card: #1a241c;
    --color-surface-elevated: #1e2920;
    --color-text: #dde0dc;
    --color-text-secondary: #a8aca6;
    --color-text-muted: #7a7e78;
    --color-text-faint: #505450;
    --color-text-inverse: #0e1510;
    --color-beginner: #5cb87a;
    --color-intermediate: #c4aa5a;
    --color-advanced: #c46060;
    --color-beginner-bg: rgba(92, 184, 122, 0.12);
    --color-intermediate-bg: rgba(196, 170, 90, 0.12);
    --color-advanced-bg: rgba(196, 96, 96, 0.12);
    --color-cat-bg: rgba(139, 191, 168, 0.1);
    --color-cat-text: #8bbfa8;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.15);
    --shadow-card-hover: 0 4px 16px rgba(0, 0, 0, 0.3);
  }
}

/* === BODY === */
body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

/* === SELECTION === */
::selection {
  background: rgba(58, 158, 126, 0.2);
  color: var(--color-text);
}

/* === FOCUS === */
:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

/* === LINKS === */
a {
  color: inherit;
  text-decoration: none;
}

/* === BUTTONS === */
button {
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

/* === SR ONLY === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ========================================
   NAVIGATION
   ======================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(4, 30, 21, 0.96);
  display: flex;
  align-items: center;
  transition: background var(--transition-med), box-shadow var(--transition-med);
}

.nav.scrolled {
  background: rgba(4, 30, 21, 0.98);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.15);
}

.nav-inner {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: #f9f9f7;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
  flex-shrink: 0;
  text-decoration: none;
}

.nav-logo svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.nav-logo span {
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-link {
  color: rgba(249, 249, 247, 0.7);
  font-size: var(--text-sm);
  font-weight: 450;
  padding: var(--space-2) var(--space-3);
  transition: color var(--transition-fast);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: #f9f9f7;
}

.nav-link.active {
  font-weight: 600;
}

.nav-theme-toggle {
  color: rgba(249, 249, 247, 0.7);
  padding: var(--space-2);
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-theme-toggle:hover {
  color: #f9f9f7;
}

/* Mobile nav toggle */
.nav-mobile-toggle {
  display: none;
  color: rgba(249, 249, 247, 0.7);
  padding: var(--space-2);
}

@media (max-width: 640px) {
  :root {
    --text-lg: 1.0625rem;
    --text-xl: 1.375rem;
    --text-2xl: 1.875rem;
    --text-3xl: 2.35rem;
  }

  .nav-mobile-toggle {
    display: flex;
    align-items: center;
  }
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(26, 51, 41, 0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: var(--space-4) var(--gutter);
    gap: var(--space-1);
    transform: translateY(-120%);
    transition: transform var(--transition-med);
    z-index: 999;
  }
  .nav-links.open {
    transform: translateY(0);
  }
  .nav-link {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .install-command,
  .hero-link {
    width: 100%;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ========================================
   LAYOUT
   ======================================== */
.page {
  display: none;
  padding-top: var(--nav-height);
}

.page.active {
  display: block;
}

.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.container--narrow {
  max-width: var(--content-narrow);
}

/* ========================================
   HOME PAGE
   ======================================== */
.hero {
  background:
    repeating-linear-gradient(0deg, rgba(249, 249, 247, 0.035) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, rgba(249, 249, 247, 0.03) 0 1px, transparent 1px 48px),
    #041e15;
  padding: var(--space-20) 0 var(--space-16);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(78, 203, 168, 0.4);
  pointer-events: none;
}

.hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(360px, 0.84fr);
  align-items: start;
  gap: var(--space-12);
}

.hero-content {
  text-align: left;
  max-width: 680px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-secondary-light);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-6);
}

.hero-badge::before,
.hero-badge::after {
  content: none;
  width: 24px;
  height: 1px;
  background: var(--color-secondary);
  opacity: 0.4;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: #f9f9f7;
  line-height: 1.0;
  margin-bottom: var(--space-4);
  letter-spacing: -0.025em;
  font-weight: 600;
  max-width: 760px;
}

.hero-inline-code {
  font-family: ui-monospace, 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85em;
  background: var(--color-secondary-faint);
  color: var(--color-secondary-light);
  padding: 0.05em 0.25em;
  border-radius: 2px;
  font-weight: 400;
}

.hero-tagline {
  color: rgba(249, 249, 247, 0.6);
  font-size: var(--text-lg);
  font-weight: 350;
  margin-bottom: var(--space-6);
  letter-spacing: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.install-command,
.hero-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(249, 249, 247, 0.18);
  color: #f9f9f7;
  font-size: var(--text-sm);
  font-weight: 550;
}

.install-command {
  gap: var(--space-4);
  padding: 0 var(--space-5);
  background: rgba(249, 249, 247, 0.1);
  font-family: ui-monospace, 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--text-base);
  border-color: rgba(78, 203, 168, 0.35);
}

.install-command.copied {
  border-color: var(--color-secondary-light);
  background: rgba(78, 203, 168, 0.1);
}

.install-copy-label {
  color: var(--color-secondary-light);
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: var(--text-xs);
}

.hero-link {
  padding: 0 var(--space-4);
  background: rgba(4, 30, 21, 0.45);
}

.hero-stats {
  display: flex;
  justify-content: flex-start;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}

.hero-stat {
  min-width: 128px;
  padding-top: var(--space-2);
  border-top: 1px solid rgba(78, 203, 168, 0.3);
}

.hero-stat span {
  display: block;
  color: rgba(249, 249, 247, 0.45);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 550;
  margin-bottom: var(--space-1);
}

.hero-stat strong {
  display: block;
  color: #f9f9f7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* Hero search */
.hero-search {
  max-width: 540px;
  margin: 0;
  position: relative;
}

.hero-search input {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  padding-left: var(--space-12);
  font-size: var(--text-base);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  color: #f9f9f7;
  outline: none;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.hero-search input::placeholder {
  color: rgba(249, 249, 247, 0.35);
}

.hero-search input:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(58, 158, 126, 0.45);
}

.hero-search-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: rgba(249, 249, 247, 0.35);
  pointer-events: none;
}

.hero-terminal {
  border: 1px solid rgba(78, 203, 168, 0.3);
  background:
    linear-gradient(180deg, rgba(249, 249, 247, 0.045), transparent 36%),
    rgba(14, 21, 16, 0.92);
  box-shadow: 20px 28px 0 rgba(0, 0, 0, 0.16);
  color: #dfe8df;
  overflow: hidden;
}

.dossier-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid rgba(78, 203, 168, 0.2);
  color: rgba(249, 249, 247, 0.62);
}

.dossier-header span,
.dossier-header strong,
.dossier-grid span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dossier-header strong {
  color: var(--color-secondary-light);
}

.dossier-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.dossier-grid div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid rgba(249, 249, 247, 0.08);
}

.dossier-grid span {
  color: rgba(249, 249, 247, 0.42);
}

.dossier-grid code {
  color: #f9f9f7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.dossier-note {
  padding: var(--space-5);
  color: rgba(223, 232, 223, 0.66);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.terminal-body {
  padding: var(--space-5);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--text-sm);
  line-height: 1.7;
}

.prompt {
  color: var(--color-secondary-light);
  margin-right: var(--space-2);
}

.terminal-output {
  color: rgba(223, 232, 223, 0.58);
  margin: 0 0 var(--space-4) var(--space-5);
}

.sdk-section,
.source-section,
.vertical-section {
  padding: var(--space-16) 0;
}

.sdk-section,
.vertical-section {
  background: var(--color-bg);
}

.source-section {
  background: var(--color-surface-low);
}

.sdk-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-4);
}

.sdk-card {
  background: var(--color-surface-card);
  padding: var(--space-5);
  border-top: 2px solid var(--color-secondary);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 236px;
  grid-column: span 3;
}

.sdk-card h3 {
  font-size: var(--text-lg);
  font-weight: 600;
}

.sdk-card:nth-child(1) {
  grid-column: span 4;
}

.sdk-card:nth-child(2) {
  grid-column: span 5;
}

.sdk-card:nth-child(3) {
  grid-column: span 3;
}

.sdk-card:nth-child(4) {
  grid-column: 3 / span 8;
  min-height: 196px;
}

.sdk-card span {
  color: var(--color-secondary);
  font-size: var(--text-xs);
  font-weight: 700;
}

.sdk-card h3,
.source-layout h2 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.sdk-card h3 {
  font-size: var(--text-lg);
}

.sdk-card p,
.source-layout p,
.source-steps span,
.vertical-grid span {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.sdk-card code {
  margin-top: auto;
  display: block;
  padding: var(--space-3);
  background: var(--color-surface-low);
  color: var(--color-text-secondary);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.source-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: var(--space-10);
  align-items: start;
}

.source-layout h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
}

.source-steps {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid rgba(58, 158, 126, 0.34);
}

.source-steps div,
.vertical-grid article {
  background: var(--color-surface-card);
  padding: var(--space-4);
  box-shadow: none;
}

.source-steps div {
  display: grid;
  grid-template-columns: 56px 128px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: baseline;
  border-bottom: 1px solid rgba(58, 158, 126, 0.16);
}

.source-steps em,
.vertical-grid em {
  color: var(--color-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.source-steps strong,
.vertical-grid strong {
  display: block;
  margin-bottom: var(--space-2);
}

.vertical-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: rgba(58, 158, 126, 0.22);
}

.vertical-grid article {
  min-height: 164px;
}

/* Featured Categories Grid */
.featured-section {
  padding: clamp(var(--space-10), 5vw, var(--space-16)) 0;
}

.section-label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin-bottom: var(--space-6);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
}

.category-card {
  background: var(--color-surface-card);
  padding: var(--space-5) var(--space-5);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.category-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

.category-card-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
  line-height: 1.2;
}

.category-card-count {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 450;
}

/* Quick links */
.quick-links-section {
  padding: 0 0 clamp(var(--space-10), 5vw, var(--space-16));
}

.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.quick-link-card {
  background: var(--color-surface-card);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.quick-link-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

.quick-link-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.quick-link-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ========================================
   GLOSSARY PAGE
   ======================================== */
.glossary-header {
  background: var(--color-surface-low);
  padding: clamp(var(--space-8), 4vw, var(--space-12)) 0 var(--space-6);
}

.glossary-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  margin-bottom: var(--space-6);
  letter-spacing: -0.025em;
  font-weight: 600;
}

/* Glossary search */
.glossary-search {
  position: relative;
  margin-bottom: var(--space-5);
}

.glossary-search input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  padding-left: var(--space-10);
  font-size: var(--text-base);
  background: var(--color-surface-card);
  border: none;
  border-radius: var(--radius);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast);
}

.glossary-search input:focus {
  box-shadow: var(--shadow-md);
}

.glossary-search input::placeholder {
  color: var(--color-text-faint);
}

.glossary-search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-faint);
  pointer-events: none;
}

/* Filters */
.glossary-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.filter-group {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.filter-group label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.filter-select {
  padding: var(--space-2) var(--space-3);
  padding-right: var(--space-8);
  font-size: var(--text-sm);
  background: var(--color-surface-card);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237a7a76' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  min-width: 140px;
}

[data-theme="dark"] .filter-select {
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237a7e78' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.filter-select:focus {
  box-shadow: var(--shadow-md);
}

/* A-Z letter bar */
.letter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: var(--space-3);
}

.letter-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface-card);
  transition: all var(--transition-fast);
}

.letter-btn:hover {
  color: var(--color-text);
  background: var(--color-surface-elevated);
}

.letter-btn.active {
  background: #041e15;
  color: #f9f9f7;
}

[data-theme="dark"] .letter-btn.active {
  background: #8bbfa8;
  color: #0e1510;
}

/* Results info */
.glossary-results-info {
  padding: var(--space-4) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.results-count {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.results-count strong {
  color: var(--color-text);
  font-weight: 600;
}

/* Term cards list */
.glossary-body {
  padding: 0 0 var(--space-12);
}

.term-cards {
  display: grid;
  gap: var(--space-3);
}

.term-card {
  background: var(--color-surface-card);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
  display: grid;
  gap: var(--space-3);
}

.term-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

.term-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.term-card-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 600;
}

.term-card-badges {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-category {
  background: var(--color-cat-bg);
  color: var(--color-cat-text);
}

.badge-beginner {
  background: var(--color-beginner-bg);
  color: var(--color-beginner);
}

.badge-intermediate {
  background: var(--color-intermediate-bg);
  color: var(--color-intermediate);
}

.badge-advanced {
  background: var(--color-advanced-bg);
  color: var(--color-advanced);
}

.badge-basic {
  background: var(--color-beginner-bg);
  color: var(--color-beginner);
}

.term-card-def {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: none;
}

.term-card-meta {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.term-card-meta-item {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-8) 0;
}

.pagination-btn {
  height: 36px;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-surface-card);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  padding: 0 var(--space-3);
}

.pagination-btn:hover:not(:disabled) {
  color: var(--color-text);
  box-shadow: var(--shadow-md);
}

.pagination-btn.active {
  background: #041e15;
  color: #f9f9f7;
}

[data-theme="dark"] .pagination-btn.active {
  background: #8bbfa8;
  color: #0e1510;
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pagination-ellipsis {
  color: var(--color-text-faint);
  font-size: var(--text-sm);
  padding: 0 var(--space-1);
}

/* ========================================
   TERM DETAIL PAGE
   ======================================== */
.term-detail {
  padding: clamp(var(--space-8), 4vw, var(--space-12)) 0 var(--space-16);
}

.term-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
  transition: color var(--transition-fast);
}

.term-back:hover {
  color: var(--color-text);
}

.term-detail-header {
  margin-bottom: var(--space-8);
}

.term-detail-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  letter-spacing: -0.025em;
  margin-bottom: var(--space-4);
  font-weight: 600;
  line-height: 1.1;
}

.term-detail-badges {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* Term sections */
.term-section {
  margin-bottom: var(--space-8);
}

.term-section-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin-bottom: var(--space-3);
}

.term-section p,
.term-section li {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.7;
  max-width: none;
}

.term-section ul {
  list-style: none;
  display: grid;
  gap: var(--space-3);
}

.term-section ul li {
  padding-left: var(--space-5);
  position: relative;
}

.term-section ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 2px;
  background: var(--color-secondary);
}

/* Example box */
.term-example {
  background: var(--color-surface-low);
  padding: var(--space-5) var(--space-6);
  position: relative;
}

.term-example::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-secondary);
}

.term-example p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.7;
  max-width: none;
}

/* Formula box */
.term-formula {
  background: var(--color-surface-card);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-card);
  overflow-x: auto;
}

.term-formula .katex-display {
  margin: 0;
}

/* Calculator */
.term-calculator {
  background: var(--color-surface-low);
  padding: var(--space-6);
}

.term-calculator h4 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-bottom: var(--space-5);
}

.calc-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.calc-field label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calc-field input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-base);
  background: var(--color-surface-card);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: #0000CC;
  font-weight: 500;
  outline: none;
}

[data-theme="dark"] .calc-field input {
  color: #6699ff;
}

.calc-field input:focus {
  box-shadow: 0 0 0 2px rgba(58, 158, 126, 0.35);
}

.calc-result {
  background: var(--color-surface-card);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-card);
}

.calc-result-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
}

.calc-result-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-secondary);
  letter-spacing: -0.02em;
}

/* Cross references */
.cross-refs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.cross-ref-link {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  background: var(--color-surface-low);
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}

.cross-ref-link:hover {
  background: #041e15;
  color: #f9f9f7;
}

[data-theme="dark"] .cross-ref-link:hover {
  background: #8bbfa8;
  color: #0e1510;
}

/* ========================================
   LIVE ENRICHMENT (term detail page)
   ======================================== */
.term-enrichment[hidden] {
  display: none;
}

.term-enrichment {
  border-top: 1px dashed var(--color-text-faint);
  padding-top: var(--space-6);
}

.term-enrichment-caption {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}

.term-enrichment-footer {
  margin-top: var(--space-5);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.enrichment-summary {
  background: var(--color-secondary-faint);
  border-left: 2px solid var(--color-secondary);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
}

.enrichment-summary-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-secondary-dark);
  margin-bottom: var(--space-2);
}

.enrichment-summary p {
  margin: 0;
  color: var(--color-text);
  font-size: var(--text-base);
  line-height: 1.55;
}

.enrichment-block + .enrichment-block {
  margin-top: var(--space-6);
}

.enrichment-block-title {
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-3);
}

.enrichment-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-4);
}

.enrichment-item {
  padding: 0;
  position: static;
}

.enrichment-item::before {
  content: none !important;
}

.enrichment-item-link {
  display: inline-block;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  font-size: var(--text-base);
  line-height: 1.4;
}

.enrichment-item-link:hover {
  text-decoration: underline;
  color: var(--color-secondary-dark);
}

.enrichment-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-top: 2px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.enrichment-item-domain {
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.enrichment-item-date {
  font-variant-numeric: tabular-nums;
}

.enrichment-item-snippet {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* ========================================
   MEDIA DIRECTORY PAGE
   ======================================== */
.media-header {
  background: var(--color-surface-low);
  padding: clamp(var(--space-8), 4vw, var(--space-12)) 0 var(--space-6);
}

.media-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  letter-spacing: -0.025em;
  margin-bottom: var(--space-4);
  font-weight: 600;
}

.media-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  max-width: 600px;
}

/* Media tabs */
.media-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.media-tabs::-webkit-scrollbar {
  display: none;
}

.media-tab {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 450;
  color: var(--color-text-muted);
  white-space: nowrap;
  transition: all var(--transition-fast);
  position: relative;
}

.media-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--space-4);
  right: var(--space-4);
  height: 2px;
  background: transparent;
  transition: background var(--transition-fast);
}

.media-tab:hover {
  color: var(--color-text);
}

.media-tab.active {
  color: var(--color-text);
  font-weight: 600;
}

.media-tab.active::after {
  background: var(--color-secondary);
}

.media-tab-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-faint);
  margin-left: var(--space-1);
}

/* Media search */
.media-search {
  position: relative;
  margin-top: var(--space-5);
}

.media-search input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  padding-left: var(--space-10);
  font-size: var(--text-base);
  background: var(--color-surface-card);
  border: none;
  border-radius: var(--radius);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast);
}

.media-search input:focus {
  box-shadow: var(--shadow-md);
}

.media-search input::placeholder {
  color: var(--color-text-faint);
}

.media-search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-faint);
  pointer-events: none;
}

/* Media cards */
.media-body {
  padding: var(--space-6) 0 var(--space-12);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-4);
}

.media-card {
  background: var(--color-surface-card);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.media-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

.media-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.media-card-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.media-card-link {
  flex-shrink: 0;
  color: var(--color-text-faint);
  transition: color var(--transition-fast);
}

.media-card-link:hover {
  color: var(--color-secondary);
}

.media-card-author {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 450;
}

.media-card-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: none;
}

.media-card-meta {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: auto;
}

.media-card-tag {
  font-size: 10px;
  font-weight: 550;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-2);
  background: var(--color-cat-bg);
  color: var(--color-cat-text);
}

/* ========================================
   ABOUT PAGE
   ======================================== */
.about-content {
  padding: clamp(var(--space-10), 5vw, var(--space-16)) 0;
}

.about-content h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  letter-spacing: -0.025em;
  margin-bottom: var(--space-6);
  font-weight: 600;
}

.about-content h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  letter-spacing: -0.015em;
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
  font-weight: 600;
}

.about-content p {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-4);
  max-width: 65ch;
}

.about-content a {
  color: var(--color-secondary);
  text-decoration: none;
  border-bottom: 1px solid rgba(58, 158, 126, 0.35);
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.about-content a:hover {
  color: var(--color-secondary-light);
  border-bottom-color: var(--color-secondary-light);
}

/* Quickstart code block */
.quickstart-block {
  background: rgba(14, 21, 16, 0.9);
  border: 1px solid rgba(58, 158, 126, 0.3);
  padding: var(--space-5) var(--space-6);
  margin: var(--space-6) 0;
  font-family: ui-monospace, 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--text-sm);
  line-height: 2;
}

.quickstart-block .qs-line {
  display: flex;
  gap: var(--space-2);
  color: #dfe8df;
}

.quickstart-block .qs-prompt {
  color: var(--color-secondary);
  user-select: none;
  flex-shrink: 0;
}

.quickstart-block .qs-comment {
  color: rgba(223, 232, 223, 0.4);
  font-size: var(--text-xs);
  margin-left: var(--space-2);
  align-self: center;
}

.about-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-4);
  margin: var(--space-6) 0;
}

.about-stat-card {
  background: var(--color-surface-card);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
}

.about-stat-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-secondary);
  letter-spacing: -0.025em;
  font-weight: 600;
}

.about-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 450;
  margin-top: var(--space-1);
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  background: #041e15;
  padding: var(--space-8) 0;
  color: rgba(249, 249, 247, 0.5);
  font-size: var(--text-xs);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-links {
  display: flex;
  gap: var(--space-4);
}

.footer-links a {
  color: rgba(249, 249, 247, 0.5);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: rgba(249, 249, 247, 0.8);
}

/* ========================================
   LOADING STATES
   ======================================== */
.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) 0;
  gap: var(--space-4);
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--color-surface-low);
  border-top-color: var(--color-secondary);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-16) 0;
  color: var(--color-text-muted);
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

.empty-state p {
  max-width: 400px;
  margin: 0 auto;
}

/* ========================================
   SCROLL TO TOP
   ======================================== */
.scroll-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #041e15;
  color: #f9f9f7;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: 100;
}

[data-theme="dark"] .scroll-top {
  background: #8bbfa8;
  color: #0e1510;
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-top:hover {
  transform: translateY(-2px);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .hero {
    padding: var(--space-16) 0 var(--space-12);
  }

  .hero-layout,
  .source-layout {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .sdk-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sdk-card,
  .sdk-card:nth-child(1),
  .sdk-card:nth-child(2),
  .sdk-card:nth-child(3),
  .sdk-card:nth-child(4) {
    grid-column: auto;
  }

  .source-steps,
  .vertical-grid {
    grid-template-columns: 1fr;
  }

  .source-steps div {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .media-grid {
    grid-template-columns: 1fr;
  }
  
  .quick-links-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-stats {
    gap: var(--space-4);
  }
  
  .calc-inputs {
    grid-template-columns: 1fr;
  }
  
  .about-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .sdk-grid {
    grid-template-columns: 1fr;
  }

  .categories-grid {
    grid-template-columns: 1fr;
  }
  
  .letter-bar {
    gap: 1px;
  }
  
  .letter-btn {
    width: 28px;
    height: 28px;
    font-size: 10px;
  }
  
  .about-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .glossary-filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-select {
    width: 100%;
  }
  
  .term-card-header {
    flex-direction: column;
  }
}

/* ========================================
   ENHANCED TERM DETAIL — FORMULAS
   ======================================== */

/* Formula container with step-by-step accordion */
.formula-block {
  background: var(--color-surface-card);
  border: 1px solid rgba(58, 158, 126, 0.2);
  overflow: hidden;
}

.formula-display {
  padding: var(--space-6);
  overflow-x: auto;
  border-bottom: 1px solid rgba(58, 158, 126, 0.15);
}

.formula-display .katex-display {
  margin: 0;
}

.formula-steps-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface-low);
  font-size: var(--text-sm);
  font-weight: 550;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  border: none;
  text-align: left;
  letter-spacing: 0.02em;
}

.formula-steps-toggle:hover {
  background: var(--color-surface-elevated);
  color: var(--color-text);
}

.formula-steps-toggle.open {
  color: var(--color-secondary);
  background: rgba(58, 158, 126, 0.06);
}

.formula-steps-toggle svg {
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.formula-steps-toggle.open svg {
  transform: rotate(180deg);
}

.formula-steps-toggle-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.formula-steps-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-secondary);
  color: white;
  font-size: 10px;
  font-weight: 700;
}

.formula-steps-body {
  display: none;
  border-top: 1px solid rgba(58, 158, 126, 0.12);
}

.formula-steps-body.open {
  display: block;
}

.formula-step {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-surface-low);
  align-items: start;
}

.formula-step:last-child {
  border-bottom: none;
}

.formula-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--color-secondary);
  color: white;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
  border-radius: 50%;
  margin-top: 2px;
}

.formula-step-content h5 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
  line-height: 1.3;
}

.formula-step-content p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.65;
  margin-bottom: var(--space-2);
}

.formula-step-content p:last-child {
  margin-bottom: 0;
}

.formula-step-math {
  background: var(--color-surface-low);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  overflow-x: auto;
}

.formula-variables {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid rgba(58, 158, 126, 0.12);
  background: rgba(58, 158, 126, 0.04);
}

.formula-variables-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-secondary);
  margin-bottom: var(--space-3);
}

.formula-variables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-2);
}

.formula-variable-item {
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
}

.formula-variable-sym {
  font-family: ui-monospace, monospace;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-secondary);
  flex-shrink: 0;
  min-width: 28px;
}

.formula-variable-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* ========================================
   ENHANCED EXAMPLE SECTION
   ======================================== */

.example-block {
  background: var(--color-surface-card);
  border: 1px solid rgba(58, 158, 126, 0.15);
  overflow: hidden;
}

.example-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: linear-gradient(135deg, rgba(58, 158, 126, 0.08) 0%, rgba(58, 158, 126, 0.03) 100%);
  border-bottom: 1px solid rgba(58, 158, 126, 0.12);
}

.example-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--color-secondary);
  color: white;
  flex-shrink: 0;
}

.example-header-text h4 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.2;
}

.example-header-text p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.example-body {
  padding: var(--space-5) var(--space-6);
}

.example-body p {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

.example-body p:last-child {
  margin-bottom: 0;
}

/* Numbered steps within examples */
.example-numbered {
  counter-reset: example-step;
  display: grid;
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.example-step {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  background: var(--color-surface-low);
  padding: var(--space-4) var(--space-5);
}

.example-step-badge {
  counter-increment: example-step;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--color-secondary);
  color: white;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
  border-radius: 50%;
}

.example-step-content {
  flex: 1;
}

.example-step-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.example-step-detail {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.example-step-calc {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-surface-card);
  padding: var(--space-1) var(--space-3);
  margin-top: var(--space-2);
  font-family: ui-monospace, monospace;
  font-size: var(--text-sm);
  color: var(--color-secondary);
  font-weight: 600;
}

/* Scenario data table */
.example-data-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-4) 0;
  font-size: var(--text-sm);
}

.example-data-table th {
  background: var(--color-primary);
  color: #f9f9f7;
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

[data-theme="dark"] .example-data-table th {
  background: var(--color-primary-container);
}

.example-data-table td {
  padding: var(--space-3) var(--space-4);
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-surface-low);
}

.example-data-table tr:last-child td {
  border-bottom: none;
}

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

.example-result-row td {
  background: rgba(58, 158, 126, 0.06) !important;
  color: var(--color-secondary) !important;
  font-weight: 600;
  border-top: 2px solid rgba(58, 158, 126, 0.3) !important;
}

/* Example conclusion box */
.example-conclusion {
  background: rgba(58, 158, 126, 0.06);
  border-left: 3px solid var(--color-secondary);
  padding: var(--space-4) var(--space-5);
  margin-top: var(--space-4);
}

.example-conclusion-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-secondary);
  margin-bottom: var(--space-2);
}

.example-conclusion p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* ========================================
   ENHANCED CALCULATOR
   ======================================== */

.calc-block {
  background: var(--color-surface-card);
  border: 2px solid var(--color-secondary);
  overflow: hidden;
  position: relative;
}

.calc-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-secondary), var(--color-secondary-light), var(--color-secondary));
  background-size: 200% 100%;
  animation: shimmer-calc 3s linear infinite;
}

@keyframes shimmer-calc {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

.calc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  background: linear-gradient(135deg, rgba(58, 158, 126, 0.12), rgba(58, 158, 126, 0.04));
  border-bottom: 1px solid rgba(58, 158, 126, 0.2);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.calc-header-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.calc-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--color-secondary);
  color: white;
}

.calc-title-text h4 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.calc-title-text span {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.calc-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-low);
  border: 1px solid rgba(58, 158, 126, 0.2);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.calc-reset-btn:hover {
  background: var(--color-secondary);
  color: white;
  border-color: var(--color-secondary);
}

.calc-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

@media (max-width: 700px) {
  .calc-body {
    grid-template-columns: 1fr;
  }
}

.calc-inputs-panel {
  padding: var(--space-5);
  border-right: 1px solid var(--color-surface-low);
}

@media (max-width: 700px) {
  .calc-inputs-panel {
    border-right: none;
    border-bottom: 1px solid var(--color-surface-low);
  }
}

.calc-inputs-panel h5 {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.calc-results-panel {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.calc-results-panel h5 {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

/* Slider-style inputs */
.calc-slider-field {
  margin-bottom: var(--space-4);
}

.calc-slider-field:last-child {
  margin-bottom: 0;
}

.calc-slider-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.calc-slider-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calc-slider-value {
  font-family: ui-monospace, monospace;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-secondary);
}

input[type="range"].calc-slider {
  width: 100%;
  height: 4px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--color-surface-low);
  outline: none;
  cursor: pointer;
  margin: var(--space-1) 0;
}

input[type="range"].calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-secondary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform var(--transition-fast);
}

input[type="range"].calc-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type="range"].calc-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-secondary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.calc-number-input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  background: var(--color-surface-low);
  border: 1px solid rgba(58, 158, 126, 0.15);
  color: var(--color-text);
  font-weight: 500;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  margin-top: var(--space-2);
}

.calc-number-input:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(58, 158, 126, 0.15);
}

/* Primary result display */
.calc-primary-result {
  background: linear-gradient(135deg, rgba(58, 158, 126, 0.1), rgba(58, 158, 126, 0.04));
  border: 1px solid rgba(58, 158, 126, 0.3);
  padding: var(--space-5);
  text-align: center;
}

.calc-result-label-new {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.calc-result-big {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--color-secondary);
  letter-spacing: -0.03em;
  line-height: 1;
  transition: all var(--transition-fast);
}

.calc-result-big.updated {
  animation: result-pulse 0.4s ease-out;
}

@keyframes result-pulse {
  0% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Secondary metrics */
.calc-secondary-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.calc-metric {
  background: var(--color-surface-low);
  padding: var(--space-3) var(--space-4);
  text-align: center;
}

.calc-metric-value {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
  margin-bottom: 2px;
}

.calc-metric-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

/* Chart inside calculator */
.calc-chart-container {
  position: relative;
  height: 180px;
  margin-top: var(--space-3);
}

.calc-breakdown-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--color-surface-low);
  border-top: 1px solid rgba(58, 158, 126, 0.1);
  font-size: var(--text-xs);
  font-weight: 550;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  text-align: center;
  letter-spacing: 0.02em;
}

.calc-breakdown-toggle:hover {
  color: var(--color-secondary);
  background: rgba(58, 158, 126, 0.06);
}

.calc-breakdown {
  display: none;
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-surface-low);
  background: var(--color-surface-low);
}

.calc-breakdown.open {
  display: block;
}

.calc-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.calc-breakdown-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid rgba(58, 158, 126, 0.08);
  color: var(--color-text-secondary);
}

.calc-breakdown-table td:first-child {
  font-weight: 500;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calc-breakdown-table td:last-child {
  text-align: right;
  font-family: ui-monospace, monospace;
  font-weight: 600;
  color: var(--color-text);
}

.calc-breakdown-table tr:last-child td {
  border-bottom: none;
  color: var(--color-secondary);
  font-size: var(--text-base);
}

/* ========================================
   VIDEO SECTION
   ======================================== */

.videos-section {
  margin-bottom: var(--space-8);
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.video-card {
  background: var(--color-surface-card);
  border: 1px solid rgba(58, 158, 126, 0.12);
  overflow: hidden;
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.video-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.video-embed-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: #000;
}

.video-embed-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-thumbnail-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: #111;
  cursor: pointer;
}

.video-thumbnail-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.video-thumbnail-wrapper:hover .video-thumbnail-img {
  transform: scale(1.04);
}

.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(255, 50, 50, 0.92);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
  pointer-events: none;
}

.video-thumbnail-wrapper:hover .video-play-btn {
  transform: translate(-50%, -50%) scale(1.1);
  background: rgba(255, 50, 50, 1);
}

.video-play-btn svg {
  margin-left: 4px;
}

.video-card-info {
  padding: var(--space-4) var(--space-4);
}

.video-card-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
  margin-bottom: var(--space-1);
}

.video-card-channel {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Visual Charts Section */
.term-visual {
  background: var(--color-surface-card);
  border: 1px solid rgba(58, 158, 126, 0.15);
  padding: var(--space-5);
  overflow: hidden;
}

.term-visual-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-secondary);
  margin-bottom: var(--space-4);
}

.term-visual canvas {
  max-height: 280px;
  width: 100% !important;
}

/* Key takeaway upgrade with icons */
.takeaways-grid {
  display: grid;
  gap: var(--space-3);
}

.takeaway-item {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  background: var(--color-surface-low);
  padding: var(--space-4) var(--space-5);
  border-left: 3px solid transparent;
  transition: border-color var(--transition-fast);
}

.takeaway-item:hover {
  border-left-color: var(--color-secondary);
}

.takeaway-num {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-secondary);
  opacity: 0.5;
  flex-shrink: 0;
  line-height: 1.2;
  min-width: 24px;
}

.takeaway-text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.65;
  flex: 1;
}

/* Detailed explanation upgrade */
.explanation-block {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.75;
}

.explanation-block p {
  margin-bottom: var(--space-4);
}

.explanation-block p:last-child {
  margin-bottom: 0;
}

/* Definition box enhancement */
.definition-box {
  background: var(--color-surface-card);
  border-left: 4px solid var(--color-secondary);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-sm);
}

.definition-box p {
  font-size: var(--text-lg);
  line-height: 1.65;
  color: var(--color-text);
  font-weight: 400;
}

/* ========================================
   CHART SECTION
   ======================================== */

.term-chart-section {
  margin-bottom: var(--space-8);
}

.chart-card {
  background: var(--color-surface-card);
  border: 1px solid rgba(58, 158, 126, 0.15);
  overflow: hidden;
}

.chart-card-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid rgba(58, 158, 126, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.chart-card-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
}

.chart-card-subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.chart-period-tabs {
  display: flex;
  gap: 2px;
}

.chart-period-btn {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 550;
  color: var(--color-text-muted);
  background: var(--color-surface-low);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

.chart-period-btn.active {
  background: var(--color-secondary);
  color: white;
}

.chart-period-btn:hover:not(.active) {
  color: var(--color-text);
}

.chart-card-body {
  padding: var(--space-5);
  position: relative;
}

.chart-canvas-wrapper {
  position: relative;
  height: 240px;
}

.chart-canvas-wrapper canvas {
  width: 100% !important;
}

/* ========================================
   SCENARIO COMPARISON
   ======================================== */

.scenarios-block {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.scenario-card {
  background: var(--color-surface-low);
  padding: var(--space-4);
  border-top: 3px solid var(--color-surface-elevated);
  text-align: center;
}

.scenario-card.scenario-best {
  border-top-color: #2d7a4f;
}

.scenario-card.scenario-base {
  border-top-color: var(--color-secondary);
}

.scenario-card.scenario-worst {
  border-top-color: #8b3030;
}

.scenario-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.scenario-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: var(--space-1);
}

.scenario-card.scenario-best .scenario-value {
  color: #2d7a4f;
}

.scenario-card.scenario-worst .scenario-value {
  color: #8b3030;
}

.scenario-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.4;
}

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

/* Print */
@media print {
  .nav, .footer, .scroll-top, .pagination, .glossary-filters, .letter-bar {
    display: none !important;
  }
  .page { padding-top: 0 !important; }
}
