/* ═══════════════════════════════════════════════════════════════
  RLAlphaLabs — Stylesheet v3 (dual-theme)
   Design philosophy: institutional trust > hype.
   Less glow, more precision. Specificity = credibility.

  ── HOW TO MODIFY ────────────────────────────────────────────────
  · ALL colors live in the token blocks below (:root = dark,
    [data-theme="light"] = light). To re-skin the whole site, edit
    tokens only — components reference var(--token) everywhere.
  · Layout sections are numbered; jump via the banner comments.
  · Add a new card? Reuse .feat-card / .prob-card / .mcard patterns.
  ═══════════════════════════════════════════════════════════════ */

/* ─── 1. TOKENS ────────────────────────────────────────────────── */
:root {
  color-scheme: dark;

  /* Background layers — deep navy, not pure black */
  --bg0: #02060f;
  --bg1: #060d1c;
  --bg2: #0a1428;
  --bg3: #0f1c34;
  --bg4: rgba(255, 255, 255, 0.03);

  /* Surfaces (cards, nav, forms) */
  --surface:      rgba(255, 255, 255, 0.02);
  --surface-hi:   rgba(255, 255, 255, 0.045);
  --nav-bg:       rgba(2, 6, 15, 0.82);
  --tooltip-bg:   rgba(6, 13, 28, 0.95);
  --shadow:       0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-sm:    0 2px 10px rgba(0, 0, 0, 0.25);

  /* Borders */
  --border:    rgba(255, 255, 255, 0.07);
  --border-md: rgba(255, 255, 255, 0.12);
  --border-hi: rgba(255, 255, 255, 0.20);

  /* Accents */
  --cyan:    #00c8f0;
  --cyan-d:  rgba(0, 200, 240, 0.10);
  --cyan-dd: rgba(0, 200, 240, 0.06);
  --blue:    #6ea8fe;
  --blue-d:  rgba(110, 168, 254, 0.10);
  --green:   #2dd4a0;
  --green-d: rgba(45, 212, 160, 0.10);
  --amber:   #f0b429;
  --amber-d: rgba(240, 180, 41, 0.10);
  --red:     #fb7185;
  --red-d:   rgba(251, 113, 133, 0.10);

  /* Status */
  --done:    #2dd4a0;
  --active:  #6ea8fe;
  --planned: #4a5d7a;

  /* Text */
  --t0: #f0f4ff;   /* headings */
  --t1: #c5d0e8;   /* body */
  --t2: #7a92b4;   /* secondary */
  --t3: #6d84a6;   /* muted (WCAG AA on dark) */
  --t4: #566d90;   /* faintest */

  /* Chart palette (read by JS via getComputedStyle) */
  --chart-line:     #00c8f0;
  --chart-bench:    #3d526e;
  --chart-grid:     rgba(255, 255, 255, 0.04);
  --chart-tick:     #3d526e;
  --chart-fill-a:   rgba(0, 200, 240, 0.22);
  --chart-fill-b:   rgba(0, 200, 240, 0);
  --particle-a:     0.35;   /* particle max alpha */
  --dot-grid:       rgba(255, 255, 255, 0.028);

  /* Type */
  --sans: 'Inter', system-ui, sans-serif;
  --head: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Radii */
  --r:  10px;
  --rl: 16px;
  --rx: 24px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t: 0.25s var(--ease);
}

[data-theme="light"] {
  color-scheme: light;

  --bg0: #f7f8f6;
  --bg1: #eef1ee;
  --bg2: #ffffff;
  --bg3: #e4e9e6;
  --bg4: rgba(15, 23, 42, 0.03);

  --surface:    #ffffff;
  --surface-hi: #f4f7f5;
  --nav-bg:     rgba(247, 248, 246, 0.85);
  --tooltip-bg: rgba(15, 23, 42, 0.94);
  --shadow:     0 10px 34px rgba(15, 23, 42, 0.10);
  --shadow-sm:  0 2px 10px rgba(15, 23, 42, 0.07);

  --border:    rgba(15, 23, 42, 0.09);
  --border-md: rgba(15, 23, 42, 0.14);
  --border-hi: rgba(15, 23, 42, 0.22);

  /* Accents — deepened for WCAG AA on light surfaces */
  --cyan:    #0e8ba8;
  --cyan-d:  rgba(14, 139, 168, 0.10);
  --cyan-dd: rgba(14, 139, 168, 0.06);
  --blue:    #3164d4;
  --blue-d:  rgba(49, 100, 212, 0.09);
  --green:   #0d9668;
  --green-d: rgba(13, 150, 104, 0.10);
  --amber:   #a96e08;
  --amber-d: rgba(169, 110, 8, 0.10);
  --red:     #d43a55;
  --red-d:   rgba(212, 58, 85, 0.09);

  --done:    #0d9668;
  --active:  #3164d4;
  --planned: #94a3b8;

  --t0: #0e1626;
  --t1: #2b3a52;
  --t2: #54677f;
  --t3: #5f7289;
  --t4: #8593a6;

  --chart-line:   #0899bd;
  --chart-bench:  #9aa9bd;
  --chart-grid:   rgba(15, 23, 42, 0.06);
  --chart-tick:   #8a97ab;
  --chart-fill-a: rgba(8, 153, 189, 0.16);
  --chart-fill-b: rgba(8, 153, 189, 0);
  --particle-a:   0.22;
  --dot-grid:     rgba(15, 23, 42, 0.05);
}

/* ─── 2. RESET & BASE ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg0);
  color: var(--t1);
  font-family: var(--sans);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Theme cross-fade on structural surfaces only (skipped on first paint).
   Scoped deliberately: a blanket `div` rule would override component
   transitions (hover lifts, scroll reveals) — theme switching on small
   cards is instant instead, which is imperceptible. */
body:not(.no-transitions),
body:not(.no-transitions) section,
body:not(.no-transitions) nav,
body:not(.no-transitions) footer,
body:not(.no-transitions) #ticker {
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}

/* Subtle dot-grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, var(--dot-grid) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

::selection { background: var(--cyan-d); color: var(--t0); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg1); }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }

a { color: var(--cyan); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img, canvas, svg { max-width: 100%; }

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

.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 300;
  background: var(--cyan); color: var(--bg0);
  padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: 14px;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ─── 3. UTILITIES ─────────────────────────────────────────────── */
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

.grad {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.sec-label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 16px;
  opacity: 0.9;
}

.sec-h2 {
  font-family: var(--head);
  font-size: clamp(30px, 4.5vw, 50px);
  font-weight: 800;
  line-height: 1.12;
  color: var(--t0);
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.sec-p { max-width: 720px; color: var(--t2); font-size: 17px; margin-bottom: 48px; }
.sec-p .fine { display: block; font-size: 13px; color: var(--t4); margin-top: 10px; font-style: italic; }

section { padding: 110px 0; position: relative; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }

/* ─── 4. CHROME — progress, ticker, nav, dots, back-to-top ────── */

/* Scroll progress bar */
#scrollProgress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  z-index: 210; pointer-events: none;
  transition: width 0.08s linear;
}

/* Ticker strip */
#ticker {
  position: relative;
  background: var(--bg1);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  z-index: 2;
}
.ticker-inner { display: flex; align-items: center; height: 36px; }
.ticker-label {
  flex-shrink: 0;
  font-family: var(--mono); font-size: 9px; letter-spacing: 2px;
  color: var(--t4); padding: 0 14px; border-right: 1px solid var(--border);
  height: 100%; display: flex; align-items: center;
  background: var(--bg1); z-index: 2;
}
.ticker-track {
  display: flex; gap: 34px; white-space: nowrap;
  animation: tick 60s linear infinite;
  padding-left: 20px;
}
#ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(-50%); } }
.ticker-item { font-family: var(--mono); font-size: 11px; color: var(--t3); display: inline-flex; gap: 7px; align-items: center; }
.tick-sym { color: var(--t2); font-weight: 500; }
.tick-up { color: var(--green); }
.tick-dn { color: var(--red); }

/* Nav */
#navbar {
  position: sticky; top: 0; z-index: 200;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t), box-shadow var(--t);
}
#navbar.scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.nav-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.nav-logo {
  font-family: var(--head); font-weight: 700; font-size: 18px;
  color: var(--t0); display: flex; align-items: center; gap: 9px;
}
.logo-mark { color: var(--cyan); font-size: 20px; }
.nav-links { display: flex; list-style: none; gap: 4px; align-items: center; margin-left: auto; }
.nav-links a {
  color: var(--t2); font-size: 13.5px; font-weight: 500;
  padding: 7px 11px; border-radius: 8px;
  transition: color var(--t), background var(--t);
}
.nav-links a:hover { color: var(--t0); background: var(--surface-hi); }
.nav-links a.nav-on { color: var(--cyan); background: var(--cyan-dd); }
.nav-links a.nav-cta {
  color: var(--bg0); background: var(--cyan);
  font-weight: 600; margin-left: 8px; padding: 8px 16px;
}
.nav-links a.nav-cta:hover { background: var(--t0); color: var(--bg0); }

/* Theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin-left: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; color: var(--t2);
  transition: color var(--t), border-color var(--t), transform var(--t);
}
.theme-toggle:hover { color: var(--cyan); border-color: var(--cyan); transform: rotate(15deg); }
.theme-toggle svg { width: 16px; height: 16px; }
[data-theme="dark"]  .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }

/* Hamburger / mobile menu */
.hamburger { display: none; background: none; border: none; flex-direction: column; gap: 5px; padding: 8px; }
.hamburger span { width: 20px; height: 2px; background: var(--t1); border-radius: 2px; transition: var(--t); }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-menu {
  display: none; flex-direction: column; gap: 2px;
  padding: 12px 24px 18px;
  background: var(--nav-bg); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.mobile-menu a { color: var(--t2); padding: 10px 8px; border-radius: 8px; font-size: 15px; }
.mobile-menu a:hover { color: var(--t0); background: var(--surface-hi); }
.mobile-menu a.nav-cta { color: var(--cyan); font-weight: 600; }
.mobile-menu.open { display: flex; }
.mobile-menu .mm-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px; color: var(--t3); font-size: 13px; }

/* Section dots (home, desktop) */
#sectionDots {
  position: fixed; right: 18px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 10px; z-index: 150;
}
#sectionDots a {
  position: relative; width: 8px; height: 8px; border-radius: 50%;
  background: var(--bg3); border: 1px solid var(--border-md);
  transition: var(--t);
}
#sectionDots a:hover { background: var(--cyan-dd); border-color: var(--cyan); }
#sectionDots a.on { background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 10px var(--cyan-d); }
#sectionDots a::after {
  content: attr(data-label);
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  background: var(--tooltip-bg); color: #c5d0e8;
  font-family: var(--mono); font-size: 10px; letter-spacing: 1px;
  padding: 4px 10px; border-radius: 6px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity var(--t);
}
#sectionDots a:hover::after { opacity: 1; }

/* Back to top */
#backTop {
  position: fixed; right: 20px; bottom: 22px; z-index: 150;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border-md);
  color: var(--t2); font-size: 17px;
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity var(--t), transform var(--t), color var(--t), border-color var(--t);
}
#backTop.show { opacity: 1; pointer-events: auto; transform: none; }
#backTop:hover { color: var(--cyan); border-color: var(--cyan); }

/* ─── 5. BUTTONS / PILLS / TAGS / SHARED CARDS ─────────────────── */
.btn-primary {
  display: inline-block;
  background: var(--cyan); color: var(--bg0);
  font-weight: 600; font-size: 15px;
  padding: 13px 28px; border-radius: 12px; border: none;
  transition: transform var(--t), box-shadow var(--t), background var(--t);
  box-shadow: 0 4px 20px var(--cyan-d);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px var(--cyan-d); background: var(--t0); }
.btn-primary.full { width: 100%; text-align: center; }

.btn-ghost {
  display: inline-block;
  color: var(--t1); font-weight: 500; font-size: 15px;
  padding: 13px 26px; border-radius: 12px;
  border: 1px solid var(--border-md);
  transition: var(--t);
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-dd); }

.pill {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 1px; padding: 6px 14px; border-radius: 100px;
  border: 1px solid var(--border-md);
}
.pill-stage { color: var(--green); border-color: var(--green); background: var(--green-d); }
.pill-market { color: var(--t2); }

.mono-tag {
  font-family: var(--mono); font-size: 10.5px;
  color: var(--t3); background: var(--bg4);
  border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 6px;
}
.mono-real { color: var(--green); border-color: var(--green-d); background: var(--green-d); }

.tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--cyan); background: var(--cyan-dd); border: 1px solid var(--cyan-d);
  padding: 3px 9px; border-radius: 5px;
}

/* ─── 6. HOME SECTIONS ─────────────────────────────────────────── */

/* Hero */
#hero {
  min-height: calc(100vh - 100px);
  display: flex; flex-direction: column; justify-content: center;
  padding: 60px 0 80px;
  background: radial-gradient(ellipse 80% 55% at 65% 30%, var(--cyan-dd), transparent 65%);
}
#heroParticles { position: absolute; inset: 0; pointer-events: none; }
.hero-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 60px; align-items: center;
}
.hero-pills { display: flex; gap: 10px; margin-bottom: 26px; flex-wrap: wrap; }
.hero-h1 {
  font-family: var(--head);
  font-size: clamp(40px, 5.6vw, 66px);
  font-weight: 800; line-height: 1.06; letter-spacing: -1.5px;
  color: var(--t0); margin-bottom: 22px;
}
.hero-p { font-size: 17.5px; color: var(--t2); max-width: 520px; margin-bottom: 34px; }
.hero-stats { display: flex; align-items: center; gap: 22px; margin-bottom: 38px; flex-wrap: wrap; }
.hstat { display: flex; flex-direction: column; gap: 2px; }
.hstat-val { font-size: 26px; font-weight: 600; color: var(--t0); }
.hstat-lbl { font-size: 11px; color: var(--t3); letter-spacing: 0.5px; text-transform: uppercase; }
.hstat-sep { width: 1px; height: 34px; background: var(--border-md); }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

.chart-shell {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--rl); overflow: hidden; box-shadow: var(--shadow);
}
.chart-shell-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg4);
}
.shell-dots { display: flex; gap: 6px; }
.shell-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--bg3); border: 1px solid var(--border-md); }
.shell-title { font-family: var(--mono); font-size: 11px; color: var(--t3); letter-spacing: 0.5px; }
#heroChart { padding: 14px 12px 6px; }
.chart-note { padding: 10px 16px 14px; font-size: 11.5px; color: var(--t4); line-height: 1.5; }

.scroll-cue {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  color: var(--t4); font-size: 18px; animation: cue 2.2s ease-in-out infinite;
}
@keyframes cue { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* Problem */
#problem { background: var(--bg1); }
.prob-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.prob-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--rl); padding: 28px 26px;
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
}
.prob-card:hover { transform: translateY(-4px); border-color: var(--red); box-shadow: var(--shadow-sm); }
.prob-num { font-family: var(--mono); font-size: 12px; color: var(--red); margin-bottom: 14px; letter-spacing: 2px; }
.prob-card h3 { font-family: var(--head); color: var(--t0); font-size: 19px; margin-bottom: 10px; }
.prob-card p { font-size: 14.5px; color: var(--t2); }

/* Features */
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.feat-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--rl); padding: 30px 28px;
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
  overflow: hidden;
}
.feat-card::before {
  content: ''; position: absolute; inset: 0 auto auto 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--ac, var(--cyan)), transparent);
  opacity: 0; transition: opacity var(--t);
}
.feat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--border-md); }
.feat-card:hover::before { opacity: 1; }
.feat-card[data-color="cyan"]  { --ac: var(--cyan); }
.feat-card[data-color="blue"]  { --ac: var(--blue); }
.feat-card[data-color="green"] { --ac: var(--green); }
.feat-card[data-color="amber"] { --ac: var(--amber); }
.feat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.cyan-bg  { color: var(--cyan);  background: var(--cyan-d); }
.blue-bg  { color: var(--blue);  background: var(--blue-d); }
.green-bg { color: var(--green); background: var(--green-d); }
.amber-bg { color: var(--amber); background: var(--amber-d); }
.feat-card h3 { font-family: var(--head); color: var(--t0); font-size: 19px; margin-bottom: 10px; }
.feat-card p { font-size: 14.5px; color: var(--t2); margin-bottom: 18px; }
.feat-meta { display: flex; gap: 8px; flex-wrap: wrap; }

/* Portfolio sample */
#portfolio-sample { background: var(--bg1); }
.psample-wrap {
  display: grid; grid-template-columns: 1fr 1fr; gap: 54px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--rx); padding: 48px;
}
.psample-left h3 { font-family: var(--head); color: var(--t0); font-size: 26px; margin: 8px 0 12px; }
.psample-left p { color: var(--t2); font-size: 15px; margin-bottom: 28px; }
.psample-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.pstat { display: flex; flex-direction: column; }
.pstat .mono { font-size: 24px; font-weight: 600; color: var(--cyan); }
.pstat span:last-child { font-size: 11.5px; color: var(--t3); text-transform: uppercase; letter-spacing: 0.5px; }
.stock-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.stock-chip {
  font-family: var(--mono); font-size: 11px; color: var(--t2);
  background: var(--bg4); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 7px;
  transition: var(--t);
}
.stock-chip:hover { color: var(--cyan); border-color: var(--cyan); transform: translateY(-2px); }

/* Pipeline */
.pipeline { max-width: 760px; }
.pipe-step { display: flex; gap: 22px; }
.pipe-left { display: flex; flex-direction: column; align-items: center; }
.pipe-status {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; border: 1px solid var(--border-md);
  background: var(--surface);
}
.pipe-status.done    { color: var(--done);    border-color: var(--done);    background: var(--green-d); }
.pipe-status.active  { color: var(--active);  border-color: var(--active);  background: var(--blue-d); animation: pulse 2.4s ease-in-out infinite; }
.pipe-status.planned { color: var(--planned); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--blue-d); } 50% { box-shadow: 0 0 0 7px transparent; } }
.pipe-line { width: 1px; flex: 1; background: var(--border-md); margin: 6px 0; }
.pipe-body { padding-bottom: 36px; }
.pipe-step:last-child .pipe-body { padding-bottom: 0; }
.pipe-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.pipe-id { font-family: var(--mono); font-size: 11px; color: var(--t4); letter-spacing: 2px; }
.pipe-state { font-family: var(--mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; }
.done-tag    { color: var(--done);    background: var(--green-d); }
.active-tag  { color: var(--active);  background: var(--blue-d); }
.planned-tag { color: var(--planned); background: var(--bg4); }
.pipe-body h3 { font-family: var(--head); color: var(--t0); font-size: 20px; margin-bottom: 8px; }
.pipe-body p { font-size: 14.5px; color: var(--t2); max-width: 620px; }

/* Performance */
#performance { background: var(--bg1); }
.metric-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 44px; }
.mcard {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--rl); padding: 24px;
  transition: transform var(--t), border-color var(--t);
}
.mcard:hover { transform: translateY(-3px); border-color: var(--border-hi); }
.mcard-label { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--t3); margin-bottom: 8px; }
.mcard-val { font-size: 34px; font-weight: 600; line-height: 1.1; margin-bottom: 8px; }
.mcard-val.cyan { color: var(--cyan); } .mcard-val.green { color: var(--green); }
.mcard-val.blue { color: var(--blue); } .mcard-val.amber { color: var(--amber); }
.mcard-sub { font-size: 12.5px; color: var(--t3); line-height: 1.5; }

.perf-chart-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--rl); padding: 26px;
}
.perf-chart-hdr { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.perf-chart-hdr h3 { font-family: var(--head); color: var(--t0); font-size: 18px; margin-bottom: 4px; }
.perf-chart-hdr p { font-size: 13px; color: var(--t3); }
.chart-legend { display: flex; gap: 16px; font-size: 12px; }
.leg.cyan-leg { color: var(--cyan); }
.leg.muted-leg { color: var(--t3); }
.chart-disc { margin-top: 14px; font-size: 12px; color: var(--t4); line-height: 1.6; }

/* Stage */
.stage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-bottom: 26px; }
.stage-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--rl); padding: 28px; }
.stage-card ul { list-style: none; }
.stage-card li { font-size: 14px; color: var(--t2); padding: 7px 0 7px 20px; position: relative; border-bottom: 1px solid var(--border); }
.stage-card li:last-child { border-bottom: none; }
.stage-card li::before { content: '·'; position: absolute; left: 6px; color: var(--t4); }
.stage-card h3 { font-family: var(--head); color: var(--t0); font-size: 19px; margin-bottom: 14px; }
.stage-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; font-size: 15px; }
.done-icon { color: var(--done); background: var(--green-d); }
.prog-icon { color: var(--active); background: var(--blue-d); }
.plan-icon { color: var(--planned); background: var(--bg4); }
.done-card { border-top: 2px solid var(--done); }
.prog-card { border-top: 2px solid var(--active); }
.plan-card { border-top: 2px solid var(--planned); }
.stage-note {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--cyan-dd); border: 1px solid var(--cyan-d);
  border-radius: var(--rl); padding: 20px 24px;
}
.stage-note-icon { color: var(--cyan); font-size: 18px; }
.stage-note p { font-size: 14px; color: var(--t1); }

/* Research log (home) */
.exp-note { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--cyan); border-radius: 0 var(--r) var(--r) 0; padding: 16px 22px; margin-bottom: 30px; }
.exp-note p { font-size: 14px; color: var(--t2); }
.progression { background: var(--surface); border: 1px solid var(--border); border-radius: var(--rl); padding: 26px 28px; }
.progression h3 { font-family: var(--head); color: var(--t0); font-size: 17px; margin-bottom: 16px; }
.prog-items { display: flex; flex-direction: column; gap: 12px; }
.prog-item { display: flex; gap: 16px; align-items: baseline; }
.prog-label { flex-shrink: 0; font-family: var(--mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--green); background: var(--green-d); padding: 3px 9px; border-radius: 5px; min-width: 70px; text-align: center; }
.prog-item:last-child .prog-label { color: var(--planned); background: var(--bg4); }
.prog-plan { font-size: 14px; color: var(--t2); }

/* Experiment table */
.exp-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--rl); background: var(--surface); }
.exp-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 780px; }
.exp-table th {
  font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--t3); text-align: left; padding: 14px 16px;
  border-bottom: 1px solid var(--border-md); background: var(--bg4);
}
.exp-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--t1); font-family: var(--mono); font-size: 12.5px; }
.exp-table tr:last-child td { border-bottom: none; }
.exp-table tr:hover td { background: var(--surface-hi); }
.run-id { color: var(--cyan); }
.val-good { color: var(--green); }
.val-ok { color: var(--amber); }
.status-done { color: var(--done); }

/* Technology */
.tech-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.tech-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--rl); padding: 18px 20px;
  transition: transform var(--t), border-color var(--t);
}
.tech-card:hover { transform: translateY(-3px); border-color: var(--border-hi); }
.tech-badge {
  width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
}
.tech-badge.py   { color: var(--blue);  background: var(--blue-d); }
.tech-badge.jax  { color: var(--cyan);  background: var(--cyan-d); }
.tech-badge.pt   { color: var(--red);   background: var(--red-d); }
.tech-badge.gym  { color: var(--green); background: var(--green-d); }
.tech-badge.kite { color: var(--amber); background: var(--amber-d); }
.tech-badge.st   { color: var(--blue);  background: var(--blue-d); }
.tech-badge.cu   { color: var(--green); background: var(--green-d); }
.tech-badge.pq   { color: var(--cyan);  background: var(--cyan-d); }
.tech-card b { display: block; color: var(--t0); font-size: 14.5px; font-family: var(--head); }
.tech-card span { font-size: 12px; color: var(--t3); }

/* About */
#about { background: var(--bg1); }
.about-wrap { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 24px; }
.about-card {
  display: flex; gap: 26px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--rx); padding: 36px;
}
.about-avatar {
  width: 84px; height: 84px; border-radius: 22px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--cyan-dd), var(--blue-d));
  border: 1px solid var(--border-md);
  display: flex; align-items: center; justify-content: center;
}
.avatar-placeholder { font-size: 34px; color: var(--cyan); }
.about-name { font-family: var(--head); color: var(--t0); font-size: 21px; }
.about-role { font-family: var(--mono); font-size: 12px; color: var(--cyan); margin: 4px 0 14px; }
.about-desc { font-size: 14.5px; color: var(--t2); margin-bottom: 18px; }
.about-links { display: flex; gap: 10px; }
.about-link {
  font-size: 13px; font-weight: 500; color: var(--t2);
  border: 1px solid var(--border-md); border-radius: 8px; padding: 7px 14px;
  transition: var(--t);
}
.about-link:hover { color: var(--cyan); border-color: var(--cyan); }
.about-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fact-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--rl); padding: 22px;
  display: flex; flex-direction: column; justify-content: center;
}
.fact-num { font-size: 24px; font-weight: 600; color: var(--t0); }
.fact-lbl { font-size: 11.5px; color: var(--t3); margin-top: 4px; line-height: 1.4; }

/* Use cases */
.uc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.uc-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--rl); padding: 28px 26px;
  transition: transform var(--t), border-color var(--t);
}
.uc-card:hover { transform: translateY(-4px); border-color: var(--cyan); }
.uc-n { font-family: var(--mono); font-size: 12px; color: var(--cyan); letter-spacing: 2px; margin-bottom: 14px; }
.uc-card h3 { font-family: var(--head); color: var(--t0); font-size: 19px; margin-bottom: 10px; }
.uc-card p { font-size: 14px; color: var(--t2); margin-bottom: 16px; }
.uc-ask { font-size: 13px; color: var(--cyan); font-weight: 500; }

/* Contact */
#contact { background: var(--bg1); }
.contact-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.contact-left p { color: var(--t2); font-size: 15.5px; margin-bottom: 30px; max-width: 440px; }
.contact-items { display: flex; flex-direction: column; gap: 20px; }
.citem { display: flex; gap: 16px; align-items: flex-start; }
.citem-icon {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.citem-icon.cyan { color: var(--cyan); background: var(--cyan-d); }
.citem-icon.blue { color: var(--blue); background: var(--blue-d); }
.citem-icon.green { color: var(--green); background: var(--green-d); }
.citem b { display: block; color: var(--t0); font-size: 15px; font-family: var(--head); }
.citem span { font-size: 13.5px; color: var(--t3); }
.cform {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--rx); padding: 32px;
  display: flex; flex-direction: column; gap: 18px;
}
.cform-group { display: flex; flex-direction: column; gap: 7px; }
.cform-group label { font-size: 12px; font-weight: 600; color: var(--t2); letter-spacing: 0.5px; text-transform: uppercase; }
.cform-group input, .cform-group select, .cform-group textarea {
  background: var(--bg0); border: 1px solid var(--border-md);
  border-radius: 10px; padding: 12px 14px;
  color: var(--t0); font-family: var(--sans); font-size: 14.5px;
  transition: border-color var(--t);
}
.cform-group input:focus, .cform-group select:focus, .cform-group textarea:focus {
  outline: none; border-color: var(--cyan);
}
.cform-group textarea { resize: vertical; }
.cform-note { font-size: 12px; color: var(--t4); text-align: center; }
.cform-success {
  background: var(--green-d); border: 1px solid var(--green);
  border-radius: var(--rx); padding: 40px 32px; text-align: center;
}
.success-check {
  width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 18px;
  background: var(--green); color: var(--bg0);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.cform-success h3 { font-family: var(--head); color: var(--t0); margin-bottom: 10px; }
.cform-success p { font-size: 14px; color: var(--t2); }

/* ─── 7. FOOTER ────────────────────────────────────────────────── */
footer { border-top: 1px solid var(--border); background: var(--bg1); padding: 60px 0 34px; position: relative; z-index: 1; }
.footer-top { display: grid; grid-template-columns: 1.2fr 2fr; gap: 50px; margin-bottom: 44px; }
.footer-brand p { font-size: 13.5px; color: var(--t3); margin-top: 14px; }
.footer-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.fnav-col { display: flex; flex-direction: column; gap: 9px; }
.fnav-col b { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--t4); margin-bottom: 5px; font-family: var(--mono); font-weight: 500; }
.fnav-col a { font-size: 13.5px; color: var(--t2); transition: color var(--t); }
.fnav-col a:hover { color: var(--cyan); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 26px; }
.footer-bottom p { font-size: 12.5px; color: var(--t3); }
.footer-disc { margin-top: 8px; color: var(--t4) !important; line-height: 1.6; }

/* ─── 8. SUBPAGES — headers, cards, articles, TOC ─────────────── */
.page-header { padding: 90px 0 46px; background: var(--bg1); border-bottom: 1px solid var(--border); }
.page-header p { max-width: 760px; color: var(--t2); font-size: 16.5px; }
.page-header .lead { font-size: 18px; color: var(--t1); }
.breadcrumbs { font-family: var(--mono); font-size: 11.5px; color: var(--t4); margin-bottom: 22px; letter-spacing: 0.5px; }
.breadcrumbs a { color: var(--t3); }
.breadcrumbs a:hover { color: var(--cyan); }
.breadcrumbs span { margin: 0 6px; }

.page-content { padding: 64px 0 100px; }

.card-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.content-card {
  display: block;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--rl); padding: 28px;
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
}
.content-card:hover { transform: translateY(-4px); border-color: var(--cyan); box-shadow: var(--shadow-sm); }
.card-meta { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; font-family: var(--mono); font-size: 11px; color: var(--t4); }
.content-card h3 { font-family: var(--head); color: var(--t0); font-size: 20px; margin-bottom: 10px; }
.content-card p { font-size: 14px; color: var(--t2); }

/* Article layout: prose + optional TOC sidebar */
.research-layout { display: grid; grid-template-columns: 220px 1fr; gap: 56px; align-items: start; }
.research-layout.no-toc { grid-template-columns: 1fr; max-width: 780px; }
.research-sidebar { position: sticky; top: 96px; }
.research-sidebar .toc-title {
  font-family: var(--mono); font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--t4); margin-bottom: 12px;
}
#tocList { list-style: none; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--border); }
#tocList a {
  display: block; font-size: 12.5px; color: var(--t3);
  padding: 5px 0 5px 14px; margin-left: -1px;
  border-left: 1px solid transparent;
  transition: color var(--t), border-color var(--t);
  line-height: 1.45;
}
#tocList a:hover { color: var(--t0); }
#tocList a.on { color: var(--cyan); border-left-color: var(--cyan); }
#tocList a.toc-h3 { padding-left: 28px; font-size: 12px; }
.toc-reading-time { font-family: var(--mono); font-size: 10.5px; color: var(--t4); margin-top: 16px; letter-spacing: 0.5px; }

.article-prose { max-width: 780px; }
.article-prose h2 {
  font-family: var(--head); color: var(--t0);
  font-size: 26px; font-weight: 700; letter-spacing: -0.3px;
  margin: 44px 0 16px; scroll-margin-top: 92px;
}
.article-prose h3 {
  font-family: var(--head); color: var(--t0);
  font-size: 19px; font-weight: 600;
  margin: 32px 0 12px; scroll-margin-top: 92px;
}
.article-prose h2:first-child, .article-prose h3:first-child { margin-top: 0; }
.article-prose p { font-size: 15.5px; color: var(--t1); margin-bottom: 16px; }
.article-prose ul, .article-prose ol { margin: 0 0 16px 22px; color: var(--t1); font-size: 15px; }
.article-prose li { margin-bottom: 7px; }
.article-prose strong { color: var(--t0); }
.article-prose a { border-bottom: 1px solid var(--cyan-d); }
.article-prose a:hover { border-bottom-color: var(--cyan); }
.article-prose code {
  font-family: var(--mono); font-size: 13px;
  background: var(--bg4); border: 1px solid var(--border);
  padding: 2px 7px; border-radius: 5px; color: var(--cyan);
}
.article-prose blockquote {
  border-left: 3px solid var(--cyan);
  background: var(--cyan-dd);
  padding: 14px 20px; margin: 0 0 18px;
  border-radius: 0 var(--r) var(--r) 0;
  color: var(--t1); font-size: 14.5px;
}
/* Heading anchor links (added by JS) */
.anchor-link {
  margin-left: 9px; font-size: 0.75em; color: var(--t4);
  opacity: 0; transition: opacity var(--t); border-bottom: none !important;
}
h2:hover .anchor-link, h3:hover .anchor-link { opacity: 1; }
.anchor-link:hover { color: var(--cyan); }

.callout {
  border: 1px solid var(--border-md); border-left: 3px solid var(--cyan);
  background: var(--surface); border-radius: 0 var(--r) var(--r) 0;
  padding: 16px 22px; margin: 0 0 20px; font-size: 14.5px; color: var(--t1);
}
.callout.warn { border-left-color: var(--amber); background: var(--amber-d); }
.callout.info { border-left-color: var(--blue); background: var(--blue-d); }

.exp-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 22px 0; }
.exp-metric {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 16px;
}
.exp-metric .val { font-family: var(--mono); font-size: 21px; font-weight: 600; color: var(--cyan); }
.exp-metric .lbl { font-size: 11px; color: var(--t3); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 3px; }

.cta-bar {
  margin-top: 48px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--rx); padding: 36px;
  display: flex; align-items: center; justify-content: space-between; gap: 26px; flex-wrap: wrap;
}
.cta-bar h3 { font-family: var(--head); color: var(--t0); font-size: 21px; margin-bottom: 6px; }
.cta-bar p { color: var(--t2); font-size: 14.5px; max-width: 520px; }

/* ─── 9. RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 1240px) {
  #sectionDots { display: none; }
}
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 44px; }
  .psample-wrap { grid-template-columns: 1fr; padding: 34px; }
  .about-wrap, .contact-wrap { grid-template-columns: 1fr; }
  .research-layout { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 34px; }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .theme-toggle { margin-left: auto; }
  .about-card { flex-direction: column; }
}
@media (max-width: 560px) {
  .cform, .cta-bar { padding: 24px; }
  .footer-nav { grid-template-columns: 1fr 1fr; }
  .metric-row { grid-template-columns: 1fr 1fr; }
}

/* ─── 10. REDUCED MOTION ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .ticker-track { animation: none; }
  .scroll-cue, .pipe-status.active { animation: none; }
  #heroParticles { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   11. MOBILE UX ENGINEERING (≤860px / touch)
   Desktop styles above are untouched — everything here only
   activates on small screens or touch devices.
   ═══════════════════════════════════════════════════════════════ */

/* Touch devices: kill sticky-hover lifts, show anchors, kill tap flash */
@media (hover: none) {
  body { -webkit-tap-highlight-color: transparent; }
  .prob-card:hover, .feat-card:hover, .mcard:hover, .tech-card:hover,
  .uc-card:hover, .content-card:hover, .stock-chip:hover, .stage-card:hover {
    transform: none; box-shadow: none;
  }
  .anchor-link { opacity: 0.6; }
  #sectionDots { display: none; }
}

@media (max-width: 860px) {
  body { line-height: 1.65; }
  section { padding: 72px 0; }
  .container { padding: 0 20px; }
  .sec-p { font-size: 16px; margin-bottom: 38px; }

  /* Ticker slimmer */
  .ticker-inner { height: 32px; }
  .ticker-label { font-size: 8px; padding: 0 10px; letter-spacing: 1px; }

  /* Hero — svh so mobile browser chrome doesn't jump the layout */
  #hero { min-height: calc(100svh - 96px); padding: 44px 0 72px; }
  .hero-inner { gap: 38px; }
  .hero-h1 { font-size: clamp(34px, 9.6vw, 46px); letter-spacing: -1px; margin-bottom: 16px; }
  .hero-p { font-size: 16px; margin-bottom: 28px; }
  .hero-pills { margin-bottom: 20px; }
  .hero-ctas { flex-direction: column; gap: 12px; }
  .hero-ctas .btn-primary, .hero-ctas .btn-ghost { width: 100%; text-align: center; padding: 15px 28px; font-size: 16px; }
  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 18px; margin-bottom: 30px; }
  .hstat-sep { display: none; }
  .hstat-val { font-size: 24px; }
  .scroll-cue { display: none; }

  /* Touch targets ≥ 40px */
  .theme-toggle { width: 40px; height: 40px; }
  .hamburger { padding: 12px 10px; margin-right: -10px; }

  /* Mobile menu — animated collapse, 48px targets */
  .mobile-menu {
    display: flex;
    max-height: 0; overflow: hidden;
    padding: 0 24px;
    border-bottom: 1px solid transparent;
    transition: max-height 0.32s var(--ease), padding 0.32s var(--ease), border-color 0.32s var(--ease);
  }
  .mobile-menu.open { max-height: 520px; padding: 8px 24px 16px; border-bottom-color: var(--border); }
  .mobile-menu a { min-height: 48px; display: flex; align-items: center; font-size: 16px; }

  /* Menu backdrop (element created by JS) */
  .menu-backdrop {
    position: fixed; inset: 0; z-index: 190;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s var(--ease);
  }
  .menu-backdrop.show { opacity: 1; pointer-events: auto; }

  /* Cards & grids breathe on small screens */
  .feat-grid, .prob-grid, .uc-grid, .stage-grid { gap: 14px; }
  .feat-card, .prob-card, .uc-card, .stage-card { padding: 24px 22px; }
  .psample-wrap { padding: 28px 22px; gap: 32px; }
  .mcard { padding: 20px; }
  .mcard-val { font-size: 27px; }
  .tech-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tech-card { padding: 14px; gap: 10px; }
  .tech-badge { width: 38px; height: 38px; font-size: 11px; }
  .about-card, .cform { padding: 26px 22px; }
  .about-facts { gap: 10px; }
  .fact-card { padding: 16px; }
  .fact-num { font-size: 19px; }
  .pipe-step { gap: 16px; }
  .perf-chart-wrap { padding: 18px 14px; }

  /* iOS: inputs < 16px trigger focus zoom — prevent it */
  .cform-group input, .cform-group select, .cform-group textarea { font-size: 16px; }

  /* Tables scroll smoothly on touch */
  .exp-table-wrap { -webkit-overflow-scrolling: touch; }

  /* Article TOC — collapsed panel above the prose */
  .research-sidebar {
    position: static; order: -1; margin: 0 0 30px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--rl); padding: 14px 18px;
  }
  .research-sidebar .toc-title {
    cursor: pointer; margin-bottom: 0; padding: 6px 0;
    display: flex; justify-content: space-between; align-items: center;
    user-select: none;
  }
  .research-sidebar .toc-title::after { content: '+'; font-size: 15px; color: var(--t3); }
  .research-sidebar.toc-open .toc-title::after { content: '–'; }
  #tocList {
    max-height: 0; overflow: hidden; border-left: none;
    transition: max-height 0.3s var(--ease), margin 0.3s var(--ease);
    margin-top: 0;
  }
  .research-sidebar.toc-open #tocList { max-height: 640px; margin-top: 8px; }
  .toc-reading-time { margin-top: 10px; }

  /* Fixed chrome respects notches / home indicator */
  #backTop {
    width: 44px; height: 44px; right: 16px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }

  /* Sticky bottom CTA (home only, injected by JS) */
  #mobileCta {
    position: fixed; left: 14px; right: 14px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 180;
    transform: translateY(140%);
    transition: transform 0.35s var(--ease);
  }
  #mobileCta.show { transform: none; }
  #mobileCta .btn-primary {
    display: block; width: 100%; text-align: center;
    padding: 15px; font-size: 16px; border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  }

  /* Footer bottom padding so the sticky CTA never covers the disclaimer */
  footer { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 560px) {
  .hero-h1 { letter-spacing: -0.8px; }
  .psample-stats { gap: 14px; }
  .pstat .mono { font-size: 20px; }
  .stock-chip { font-size: 10.5px; padding: 5px 10px; }
  .cta-bar { flex-direction: column; align-items: stretch; text-align: center; }
  .cta-bar .btn-primary { width: 100%; }
}
