/* ============================================================
   RL·Trader — site styles
   One accent (volt) on calm neutral surfaces, system type with tabular
   figures for data, monospace reserved for code. Surfaces are separated by
   tone rather than outlines; nothing glows or gradients without a reason.
   ============================================================ */

:root {
  --bg:        #0a0b0c;
  --bg-soft:   #111214;
  --surface:   #151618;
  --surface-2: #1c1d20;
  --border:    rgba(255, 255, 255, 0.07);
  --border-2:  rgba(255, 255, 255, 0.13);
  --text:      #eef0f2;
  --muted:     #9ba2ab;
  --faint:     #7c838c;

  --volt:   #d4ff3f;   /* athletic / terminal accent */
  --cyan:   #36e0ff;   /* fintech accent */
  --pos:    #5df2a0;
  --neg:    #ff6b6b;

  /* Was a cyan→volt gradient on headlines, buttons, numbers and chips. One
     solid accent reads as deliberate; the gradient read as decoration. */
  --grad: var(--volt);
  --on-volt: #10140a;
  --radius: 14px;
  --maxw: 1180px;

  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-data: var(--font-body);   /* numbers: the UI face with tabular figures */
  --font-mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;   /* code only */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* ── Ambient background ─────────────────────────────────── */
.bg-grid {
  position: fixed; inset: 0; z-index: -2;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 75%);
}
.bg-glow {
  position: fixed; z-index: -1; top: -240px; left: 50%;
  width: 900px; height: 600px; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(54,224,255,0.16), transparent 60%),
              radial-gradient(ellipse at 70% 40%, rgba(212,255,63,0.10), transparent 55%);
  filter: blur(20px); pointer-events: none;
}

/* ── Layout helpers ─────────────────────────────────────── */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 96px 24px;
}
.section-head { max-width: 720px; margin-bottom: 56px; }
.kicker {
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--cyan); margin-bottom: 16px; font-variant-numeric: tabular-nums;
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700; line-height: 1.1; letter-spacing: -0.02em;
}
.section-head p { color: var(--muted); margin-top: 16px; font-size: 18px; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  padding: 12px 22px; border-radius: 999px;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn-primary {
  background: var(--grad); color: #06210f;
  box-shadow: 0 0 0 0 rgba(212,255,63,0.5);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -8px rgba(54,224,255,0.5); }
.btn-ghost {
  background: rgba(255,255,255,0.03); color: var(--text);
  border-color: var(--border-2);
}
.btn-ghost:hover { border-color: var(--volt); color: var(--volt); transform: translateY(-2px); }

/* ── Accessibility: skip link + keyboard focus rings ────── */
.skip-link {
  position: absolute; left: 12px; top: -52px; z-index: 100;
  background: var(--volt); color: #06210f; font-weight: 700;
  padding: 10px 16px; border-radius: 10px; text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.chip:focus-visible, .navtab:focus-visible, .btn:focus-visible, .tg:focus-visible {
  outline: 2px solid var(--cyan); outline-offset: 3px;
}

/* ── Nav ────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  max-width: var(--maxw); margin: 0 auto;
  padding: 18px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; }
.brand-text {
  font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--text);
}
.dot { color: var(--volt); }
.nav-links { display: flex; gap: 28px; margin-left: auto; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500;
  transition: color .15s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-cta { padding: 9px 16px; font-size: 14px; }

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: 72px 24px 56px;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-data); font-size: 12px;
  color: var(--muted);
  padding: 7px 13px; border: 1px solid var(--border); border-radius: 999px;
  background: rgba(255,255,255,0.02); margin-bottom: 24px; font-variant-numeric: tabular-nums;
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--volt);
  box-shadow: 0 0 0 0 rgba(212,255,63,0.7); animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(212,255,63,0.6); }
  70% { box-shadow: 0 0 0 9px rgba(212,255,63,0); }
  100% { box-shadow: 0 0 0 0 rgba(212,255,63,0); }
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(38px, 6vw, 66px);
  font-weight: 700; line-height: 1.02; letter-spacing: -0.03em;
}
.grad {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lede { color: var(--muted); font-size: 18px; margin: 22px 0 18px; max-width: 540px; }
.lede strong { color: var(--text); }
.lede-sub { font-size: 15px; margin-bottom: 30px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-tags {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px;
}
.hero-tags span {
  font-family: var(--font-data); font-size: 12px; color: var(--faint);
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px; font-variant-numeric: tabular-nums;
}

/* ── Hero chart card ────────────────────────────────────── */
.hero-visual { display: flex; justify-content: center; }
.chart-card {
  width: 100%; max-width: 560px;
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border-2); border-radius: var(--radius);
  padding: 20px; box-shadow: 0 30px 80px -30px rgba(0,0,0,0.8);
  position: relative; overflow: hidden;
}
.chart-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  padding: 1px; background: var(--grad); opacity: .35;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 8px; }
.chart-title { min-width: 0; }
.live {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-data); font-size: 12px; color: var(--volt); font-variant-numeric: tabular-nums;
}
.chart-badge {
  display: inline-block;
  font-family: var(--font-data); font-size: 11px;
  color: var(--cyan); border: 1px solid rgba(54, 224, 255, 0.35);
  border-radius: 6px; padding: 3px 9px; font-variant-numeric: tabular-nums;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--volt); animation: pulse 1.6s infinite; }
.chart-sub { display: block; font-size: 11px; color: var(--faint); margin-top: 4px; font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.chart-legend { display: flex; gap: 14px; flex: 0 0 auto; white-space: nowrap; }
.lg { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.lg::before { content: ""; width: 14px; height: 3px; border-radius: 2px; }
.lg-agent::before { background: var(--volt); }
.lg-bench::before { background: var(--faint); }
.lg-insample::before { background: #ff6b6b; }
#equityChart { width: 100%; height: auto; display: block; }
.chart-foot {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.chart-foot .stat { display: flex; flex-direction: column; }
.chart-foot .k { font-size: 11px; color: var(--faint); font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.chart-foot .v { font-size: 18px; font-weight: 700; font-family: var(--font-display); color: var(--volt); }
/* Only a gain gets the agent's volt; a drawdown is a loss and reads as one. */
.chart-foot .v.is-neutral { color: var(--text); }
.chart-foot .v.is-neg { color: var(--neg); }

/* ── "What this is" band ────────────────────────────────── */
.purpose-section { padding-top: 8px; padding-bottom: 8px; }
.purpose-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.purpose-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px;
}
.purpose-card h3 {
  font-family: var(--font-display); font-size: 15px; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 9px; margin-bottom: 10px;
}
.purpose-card p { color: var(--muted); font-size: 14.5px; line-height: 1.62; }
.purpose-card b { color: var(--text); font-weight: 600; }
.purpose-icon { font-size: 12px; color: var(--cyan); }
.purpose-not .purpose-icon { color: var(--neg); }
.purpose-data .purpose-icon { color: var(--volt); }
.purpose-foot {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 13px !important; color: var(--faint) !important;
}
#purpose-freshness { display: block; margin-top: 8px; font-family: var(--font-data); font-size: 12.5px; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .purpose-grid { grid-template-columns: 1fr; } }

/* ── Stats strip ────────────────────────────────────────── */
.stats {
  max-width: var(--maxw); margin: 0 auto; padding: 8px 24px 24px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.stat-cell {
  text-align: center; padding: 26px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.stat-cell .num {
  font-family: var(--font-display); font-weight: 700; font-size: 42px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  line-height: 1;
}
.stat-cell .pct { -webkit-text-fill-color: initial; }
.stat-cell .lbl { color: var(--muted); font-size: 14px; margin-top: 8px; }

/* ── Feature grid ───────────────────────────────────────── */
.grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-2); background: var(--surface-2); }
.card-icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  font-size: 22px; margin-bottom: 18px;
  background: rgba(54,224,255,0.08); border: 1px solid var(--border);
}
.card h3 { font-family: var(--font-display); font-size: 19px; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 15px; }
.card p b { color: var(--text); }
.card code, .lede code { font-family: var(--font-mono); font-size: 13px; color: var(--volt); }
.card-tag {
  display: inline-block; font-family: var(--font-data); font-size: 10px; color: var(--cyan); margin-bottom: 12px;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border-2);
  background: rgba(54,224,255,0.06); font-variant-numeric: tabular-nums;
}

/* ── Architecture ───────────────────────────────────────── */
.arch { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.arch-node {
  width: 100%; max-width: 560px; text-align: center;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 14px;
  padding: 20px 24px;
}
.arch-node .tag {
  font-family: var(--font-data); font-size: 11px; color: var(--cyan);
  display: block; margin-bottom: 6px; font-variant-numeric: tabular-nums;
}
.arch-node strong { font-family: var(--font-display); font-size: 18px; display: block; }
.arch-node small { color: var(--faint); font-size: 13px; }
.arch-node.agent { border-color: rgba(212,255,63,0.4); box-shadow: 0 0 40px -16px rgba(212,255,63,0.4); }
.arch-flow {
  display: flex; gap: 40px; font-family: var(--font-data); font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums;
}
.arch-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; max-width: 560px; }
.arch-split .arch-node { max-width: none; }
.arch-node.stock { border-color: rgba(54,224,255,0.35); }
.arch-node.crypto { border-color: rgba(212,255,63,0.35); }

/* ── Steps ──────────────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; position: relative;
}
.step-n {
  font-family: var(--font-data); font-weight: 700; font-size: 13px;
  color: var(--bg); background: var(--volt); width: 38px; height: 28px;
  display: grid; place-items: center; border-radius: 7px; margin-bottom: 16px; font-variant-numeric: tabular-nums;
}
.step h3 { font-family: var(--font-display); font-size: 17px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 14px; }

/* ── Terminal ───────────────────────────────────────────── */
.terminal {
  background: #06080c; border: 1px solid var(--border-2); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 30px 70px -30px rgba(0,0,0,0.9);
}
.term-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.term-bar span { width: 12px; height: 12px; border-radius: 50%; background: #2a323e; }
.term-bar span:nth-child(1) { background: #ff5f57; }
.term-bar span:nth-child(2) { background: #febc2e; }
.term-bar span:nth-child(3) { background: #28c840; }
.term-bar em { margin-left: 12px; color: var(--faint); font-family: var(--font-data); font-size: 12px; font-style: normal; font-variant-numeric: tabular-nums; }
.term-body {
  padding: 22px; overflow-x: auto;
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.7; color: #cdd6e0;
}
.c-prompt { color: var(--volt); }
.c-dim { color: var(--faint); }
.c-key { color: var(--cyan); font-weight: 700; }
.c-pos { color: var(--pos); font-weight: 700; }
.c-neg { color: var(--neg); font-weight: 700; }
.c-val { color: var(--text); font-weight: 600; }

/* ── Results dashboard ──────────────────────────────────── */
.data-note { display: block; margin-top: 10px; font-family: var(--font-data); font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.honest-note {
  background: rgba(54, 224, 255, 0.06);
  border: 1px solid rgba(54, 224, 255, 0.22);
  border-left: 3px solid var(--cyan);
  border-radius: 12px; padding: 16px 20px; margin-bottom: 26px;
  color: var(--muted); font-size: 14.5px; line-height: 1.65;
}
.honest-note strong { color: var(--text); }
.honest-note a { color: var(--cyan); text-decoration: none; border-bottom: 1px solid rgba(54,224,255,0.4); }
.honest-note a:hover { color: var(--volt); }
.dash-toggle { display: inline-flex; gap: 6px; padding: 5px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
.tg {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  color: var(--muted); background: transparent; border: 0; cursor: pointer;
  padding: 9px 20px; border-radius: 999px; transition: all .15s ease;
}
.tg:hover { color: var(--text); }
.tg.active { background: var(--grad); color: #06210f; }

.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.panel-head h3 { font-family: var(--font-display); font-size: 15px; display: flex; align-items: center; gap: 8px; }
.badge-live {
  font-family: var(--font-data); font-size: 9px;
  color: #06210f; background: var(--volt); padding: 2px 7px; border-radius: 5px; font-variant-numeric: tabular-nums;
}
.muted-sub, .sc-cols { font-family: var(--font-data); font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.panel canvas { width: 100%; height: auto; display: block; }

.scorecard { display: flex; flex-direction: column; gap: 2px; }
.sc-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: baseline;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.sc-row:last-child { border-bottom: 0; }
.sc-k { color: var(--muted); font-size: 13px; }
.sc-a { font-family: var(--font-display); font-weight: 700; font-size: 17px; text-align: right; color: var(--text); }
.sc-a.win { color: var(--pos); }
.sc-a.lose { color: var(--neg); }
.sc-b { font-family: var(--font-data); font-size: 13px; color: var(--faint); text-align: right; min-width: 64px; font-variant-numeric: tabular-nums; }
.dash-foot { margin-top: 16px; color: var(--faint); font-size: 13px; }
.dash-foot code { font-family: var(--font-mono); color: var(--cyan); }

/* ── Live inference widget ──────────────────────────────── */
.live-card { padding: 22px 24px; }
.live-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.live-select {
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  color: var(--text); background: var(--bg-soft); border: 1px solid var(--border-2);
  border-radius: 10px; padding: 10px 14px; cursor: pointer;
}
.live-select:focus { outline: none; border-color: var(--volt); }
.live-input { cursor: text; min-width: 240px; }
.live-input::placeholder { color: var(--faint); }
.spinner {
  width: 16px; height: 16px; border-radius: 50%; display: inline-block;
  border: 2px solid rgba(212,255,63,0.25); border-top-color: var(--volt);
  animation: spin 0.7s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
.live-signal { font-family: var(--font-display); font-size: 20px; color: var(--muted); margin: 6px 0 4px; min-height: 26px; }
.sig-long { color: var(--volt); font-weight: 700; }
.sig-short { color: var(--neg); font-weight: 700; }
.sig-flat { color: var(--faint); font-weight: 700; }
#live-chart { width: 100%; height: auto; display: block; }
.live-card .scorecard { margin-top: 12px; max-width: 420px; }

/* ── About ──────────────────────────────────────────────── */
.about { max-width: 760px; }
.about p { color: var(--muted); font-size: 17px; line-height: 1.7; margin-bottom: 18px; }
.about strong { color: var(--text); }
.about em { color: var(--volt); font-style: normal; }

/* ── Top-level views (Home / Stocks / Crypto tabs) ──────── */
.view { display: none; }
.view.active { display: block; animation: view-in .28s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.navtab { cursor: pointer; }
.navtab.active { color: var(--volt); }
.brand { cursor: pointer; }

/* ── Markets explorer ───────────────────────────────────── */
/* big primary market tabs */
.market-tabs { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.mtab {
  flex: 1; min-width: 200px; display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; cursor: pointer; text-align: left;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 14px;
  color: var(--muted); font-family: var(--font-display); font-size: 20px; font-weight: 600;
  transition: border-color .15s ease, color .15s ease, transform .15s ease;
}
.mtab:hover { color: var(--text); transform: translateY(-2px); }
.mtab.active { color: var(--text); border-color: transparent;
  box-shadow: inset 0 0 0 2px var(--volt), 0 8px 30px rgba(212,255,63,0.08); }
.mtab-emoji { font-size: 24px; }
.mtab-sub { margin-left: auto; font-family: var(--font-data); font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }

/* clickable basket of named tickers */
.basket { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip {
  font-family: var(--font-data); font-size: 13px; font-weight: 500;
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border-2); color: var(--muted);
  transition: color .12s ease, border-color .12s ease, background .12s ease; font-variant-numeric: tabular-nums;
}
.chip:hover { color: var(--text); border-color: var(--cyan); }
.chip.active { color: #06210f; background: var(--grad); border-color: transparent; font-weight: 700; }

/* "watch the agent act" scrubber */
.scrub-range { width: 100%; margin: 12px 0 6px; accent-color: var(--volt); cursor: pointer; }
.scrub-readout { font-family: var(--font-data); font-size: 13px; color: var(--muted); min-height: 20px; font-variant-numeric: tabular-nums; }
.scrub-readout b { color: var(--text); }

/* date axis labels (start · note · end) under charts */
.axis-dates {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-data); font-size: 11px; color: var(--faint);
  margin-top: 6px; letter-spacing: 0.02em; font-variant-numeric: tabular-nums;
}
/* Full --muted, no extra fade: at opacity .7 this 11px label was 4.1:1. */
.axis-dates span:nth-child(2) { color: var(--muted); }
/* period + behaviour readouts in the scorecard panel */
.period { font-family: var(--font-data); font-size: 12px; color: var(--muted); margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.period b { color: var(--text); }
.behavior { color: var(--muted); font-size: 13px; line-height: 1.6; margin-top: 14px;
  border-top: 1px solid var(--border); padding-top: 12px; }
.behavior b { color: var(--volt); }
.lg-long::before { background: var(--volt); }
.lg-short::before { background: var(--neg); }
.lg-flat::before { background: var(--faint); }

/* "what the agent learned" insight callout */
.insight {
  margin-top: 22px; padding: 18px 20px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(212,255,63,0.06), rgba(212,255,63,0.02));
  border: 1px solid rgba(212,255,63,0.25); border-left: 3px solid var(--volt);
  color: var(--text); font-size: 15px; line-height: 1.65;
}
.insight b { color: var(--volt); font-family: var(--font-data); font-variant-numeric: tabular-nums; }

/* learning-curve caption + live widget spacing */
#live { margin-top: 22px; }
.lab-caption {
  color: var(--muted); font-size: 14px; line-height: 1.6; margin-top: 14px;
  max-width: 760px;
}
.lab-caption b { color: var(--volt); font-family: var(--font-data); font-variant-numeric: tabular-nums; }

/* ── full-basket results table ───────────────────────────── */
.table-scroll { overflow-x: auto; }
.restable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.restable th, .restable td {
  padding: 9px 12px; text-align: right; white-space: nowrap;
}
.restable thead th {
  color: var(--muted); cursor: pointer; user-select: none;
  border-bottom: 1px solid var(--border-2);
  font-family: var(--font-data); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.restable th.num-l, .restable td.num-l { text-align: left; }
.restable th.num-l { font-weight: 700; }
.restable thead th:hover { color: var(--text); }
.restable thead th.sorted { color: var(--volt); }
.restable thead th.sorted::after { content: " \25BE"; }
.restable thead th.sorted[aria-sort="ascending"]::after { content: " \25B4"; }
.restable td.num-l { font-family: var(--font-data); color: var(--text); font-variant-numeric: tabular-nums; }
.restable tbody tr { cursor: pointer; border-bottom: 1px solid var(--border); }
.restable tbody tr:hover { background: rgba(255,255,255,0.035); }
.restable tbody tr.sel { background: rgba(212,255,63,0.08); }
.restable td.win { color: var(--volt); }
.restable td.lose { color: #ff6b6b; }
.restable td.muted-cell { color: var(--muted); font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.restable.ablation tbody tr { cursor: default; }
.restable.ablation tbody tr:hover { background: none; }
.restable .pill {
  font-family: var(--font-data); font-size: 10px; letter-spacing: 0.03em;
  padding: 2px 8px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.restable .pill.win { color: var(--volt); background: rgba(212,255,63,0.12); }
.restable .pill.lose { color: #ff6b6b; background: rgba(255,107,107,0.12); }

/* ── CTA ────────────────────────────────────────────────── */
.cta {
  max-width: 860px; margin: 40px auto 96px; padding: 64px 32px; text-align: center;
  background: radial-gradient(ellipse at top, rgba(54,224,255,0.10), transparent 70%), var(--surface);
  border: 1px solid var(--border-2); border-radius: 24px;
}
.cta h2 { font-size: clamp(26px, 4vw, 40px); }
.cta p { color: var(--muted); margin: 14px 0 28px; font-size: 18px; }
.cta-row { margin-bottom: 26px; }
.cta-code {
  display: inline-block; text-align: left; background: #06080c;
  border: 1px solid var(--border); border-radius: 12px; padding: 18px 22px;
  font-family: var(--font-mono); font-size: 13.5px; color: var(--volt); line-height: 1.8;
  /* The longest command is wider than a phone screen — scroll it inside its own
     box rather than letting it widen the page. */
  max-width: 100%; overflow-x: auto;
}

/* ── Footer ─────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  max-width: var(--maxw); margin: 0 auto; padding: 32px 24px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  color: var(--muted); font-size: 14px;
}
.foot-brand { font-family: var(--font-display); font-weight: 700; }
.foot-meta { margin-right: auto; }
/* Underlined: inside a text block, colour alone doesn't distinguish a link. */
.footer a { color: var(--cyan); text-decoration: underline; text-underline-offset: 2px; }
.footer a:hover { color: var(--volt); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  /* Stacked: the question comes first, then the chart that answers it. */
  .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 40px; }
  /* nav-links are the primary Home/Stocks/Crypto tabs — keep them visible,
     just tighten spacing and drop the secondary GitHub button to make room. */
  .nav { gap: 14px; flex-wrap: wrap; }
  .nav-links { gap: 16px; font-size: 14px; }
  .nav-cta { display: none; }
  .grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid, .steps, .stats, .arch-split { grid-template-columns: 1fr; }
  .section { padding: 56px 18px; }
  .foot-meta { margin-right: 0; width: 100%; }
  .chart-foot { gap: 6px; }
  .chart-foot .v { font-size: 15px; }
  h1 { font-size: clamp(30px, 8vw, 40px); }
  .basket { gap: 6px; }
  .chip { padding: 6px 11px; font-size: 12px; }
  .hero-cta { flex-wrap: wrap; }
}

/* Respect users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
  html { scroll-behavior: auto; }
}

/* ── THE RESULT: the generalization gap, rendered from the ablation artifact ── */
.result-section { padding-top: 8px; }
.result-section .section-head h2 { max-width: 20ch; }

.rs-toolbar {
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap; margin: 4px 0 18px;
}
.rs-meta { color: var(--faint); font-family: var(--font-data); font-size: 12px; font-variant-numeric: tabular-nums; }

.rs-arms { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.rs-arm {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 20px 18px;
}
/* the arm's verdict is carried by a rail, not by the text colour alone */
.rs-arm::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
}
.rs-bad::before  { background: var(--neg); }
.rs-good::before { background: var(--pos); }

.rs-arm-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.rs-arm-head h3 { font-size: 16px; margin: 0; letter-spacing: -0.01em; }
.rs-badge {
  font-family: var(--font-data); font-size: 10px; padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--border-2); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.rs-bad  .rs-badge { color: var(--neg); border-color: rgba(255, 107, 107, 0.35); }
.rs-good .rs-badge { color: var(--pos); border-color: rgba(93, 242, 160, 0.35); }

.rs-row { display: grid; gap: 2px; padding: 12px 0; border-top: 1px solid var(--border); }
.rs-row-key { background: linear-gradient(90deg, rgba(255,255,255,0.025), transparent); }
.rs-k {
  font-size: 12px; color: var(--muted); font-weight: 600;
}
.rs-k small { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--faint); }
.rs-k small::before { content: " · "; }
.rs-v { font-family: var(--font-data); font-size: clamp(22px, 3.4vw, 30px); font-weight: 700; font-variant-numeric: tabular-nums; }
.rs-train { color: var(--muted); }
.rs-win  { color: var(--pos); }
.rs-lose { color: var(--neg); }
.rs-sub { font-size: 12px; color: var(--faint); font-family: var(--font-data); font-variant-numeric: tabular-nums; }

/* one dot per training seed, on an axis shared by both arms */
.rs-track {
  position: relative; height: 26px; margin: 6px 0 2px;
  border-radius: 6px; background: var(--bg-soft); border: 1px solid var(--border);
}
.rs-zero {
  position: absolute; top: 3px; bottom: 3px; width: 1px;
  background: var(--border-2); transform: translateX(-0.5px);
}
.rs-dot {
  position: absolute; top: 50%; width: 9px; height: 9px; border-radius: 50%;
  transform: translate(-50%, -50%); border: 1px solid var(--bg);
}
.rs-dot.pos { background: var(--pos); }
.rs-dot.neg { background: var(--neg); }

.rs-note { margin: 10px 0 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
.rs-missing { color: var(--muted); font-size: 14px; }

@media (max-width: 820px) {
  .rs-arms { grid-template-columns: minmax(0, 1fr); }
}

/* ── anchored sections must clear the sticky header ── */
.view section[id], .view div[id] { scroll-margin-top: 88px; }

/* ── WHAT I GOT WRONG: the research timeline ── */
.wrong-section .section-head h2 { max-width: 22ch; }

.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl-step { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 20px; }
/* the rail is drawn by each step so it stops cleanly at the last one */
.tl-step::before {
  content: ""; position: absolute; left: 27px; top: 34px; bottom: 0;
  width: 1px; background: var(--border);
}
.tl-last::before { display: none; }

.tl-n {
  width: 56px; height: 34px; display: flex; align-items: center;
  justify-content: center; font-family: var(--font-data); font-size: 13px;
  font-weight: 700; color: var(--faint);
  border: 1px solid var(--border-2); border-radius: 999px;
  background: var(--bg); position: relative; z-index: 1; font-variant-numeric: tabular-nums;
}
.tl-body { padding-bottom: 30px; min-width: 0; }
.tl-body h3 { margin: 5px 0 8px; font-size: 18px; letter-spacing: -0.015em; }
.tl-body p { margin: 0 0 8px; color: var(--muted); line-height: 1.7; max-width: 68ch; }

.tl-fig {
  font-family: var(--font-data); font-weight: 700; color: var(--text);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.tl-fig.pos { color: var(--pos); }
.tl-fig.neg { color: var(--neg); }

.tl-src { font-size: 12px; color: var(--faint); font-family: var(--font-mono); }
.tl-src a { color: var(--faint); text-decoration: none; border-bottom: 1px solid var(--border-2); }
.tl-src a:hover, .tl-src a:focus-visible { color: var(--cyan); border-bottom-color: var(--cyan); }

/* ── REPRODUCE ── */
.repro-grid {
  display: grid; gap: 18px;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start;
}

.repro-steps { margin: 0; padding: 0; list-style: none; counter-reset: rp; }
.repro-steps, .repro-side { min-width: 0; }
.repro-steps li { min-width: 0; }
.repro-steps li {
  counter-increment: rp; position: relative;
  padding: 14px 0 14px 40px; border-top: 1px solid var(--border);
}
.repro-steps li:first-child { border-top: 0; padding-top: 0; }
.repro-steps li::before {
  content: counter(rp, decimal-leading-zero);
  position: absolute; left: 0; top: 15px;
  font-family: var(--font-data); font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums;
}
.repro-steps li:first-child::before { top: 1px; }
.repro-steps li > code {
  display: block; font-family: var(--font-mono); font-size: 13px;
  color: var(--volt); background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 11px; margin-bottom: 7px;
  overflow-x: auto; white-space: pre;
}
.repro-steps li > span { display: block; font-size: 13px; color: var(--muted); line-height: 1.6; }
.repro-steps li > span code {
  font-family: var(--font-mono); font-size: 12px; color: var(--text);
  background: none; border: 0; padding: 0;
}
/* Underlined at rest: these links sit inside sentences, so colour alone does not mark them. */
.repro-steps a, .repro-check a { color: var(--cyan); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.repro-steps a:hover, .repro-check a:hover,
.repro-steps a:focus-visible, .repro-check a:focus-visible { text-decoration: underline; }

.repro-side {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.repro-side h3 { margin: 0 0 14px; font-size: 15px; }
.repro-check { list-style: none; margin: 0; padding: 0; }
.repro-check li { padding: 9px 0 9px 24px; position: relative; border-top: 1px solid var(--border); }
.repro-check li:first-child { border-top: 0; }
/* a glyph, not just a colour, so the checklist reads without colour vision */
.repro-check li::before {
  content: "\2713"; position: absolute; left: 0; top: 9px;
  color: var(--pos); font-weight: 700; font-size: 13px;
}
.repro-check b { display: block; font-size: 13px; margin-bottom: 2px; }
.repro-check span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.6; }

.repro-warn {
  margin: 16px 0 0; padding: 12px 14px; border-radius: 10px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-left: 3px solid var(--volt);
  font-size: 12.5px; color: var(--muted); line-height: 1.65;
}
.repro-warn b { color: var(--text); }

@media (max-width: 820px) {
  .repro-grid { grid-template-columns: minmax(0, 1fr); }
  .tl-step { grid-template-columns: 40px 1fr; gap: 14px; }
  .tl-step::before { left: 19px; }
  .tl-n { width: 40px; height: 28px; font-size: 11px; }
  .tl-body h3 { font-size: 16px; }
}

/* ── WHAT I LEARNED ── */
.learned-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.learned-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.learned-n {
  font-family: var(--font-data); font-size: 11px; color: var(--faint); margin-bottom: 10px; font-variant-numeric: tabular-nums;
}
.learned-card h3 {
  margin: 0 0 10px; font-size: 17px; line-height: 1.35; letter-spacing: -0.015em;
}
.learned-card p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--muted); }
.lr-fig { font-family: var(--font-data); font-weight: 700; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lr-fig.pos { color: var(--pos); }
.lr-fig.neg { color: var(--neg); }

@media (max-width: 820px) { .learned-grid { grid-template-columns: minmax(0, 1fr); } }

/* the out-of-distribution probe states what it is before it runs */
.ood-note {
  margin: 4px 0 12px; padding: 12px 14px; border-radius: 10px;
  background: var(--bg-soft); border: 1px solid var(--border);
  font-size: 13px; line-height: 1.65; color: var(--muted); max-width: 80ch;
}
.ood-note b { color: var(--text); }

/* ============================================================
   Surfaces, controls and type — calm-surface pass
   ============================================================ */

/* Decorative grid and colour glow behind every page: removed. */
.bg-grid, .bg-glow { display: none; }

body { -moz-osx-font-smoothing: grayscale; }
h1, h2, h3 { color: var(--text); text-wrap: balance; }

/* Sticky nav reads as a translucent bar over the content */
.nav {
  background: rgba(10, 11, 12, 0.74);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  padding-top: 14px; padding-bottom: 14px;
}
.nav-links a { font-size: 14px; }
.navtab.active { color: var(--text); }

/* Section labels: a quiet line of accent text, not tracked capitals */
.kicker { font-size: 15px; font-weight: 600; color: var(--volt); margin-bottom: 12px; }
.eyebrow {
  border: 0; background: none; padding: 0;
  font-size: 15px; font-weight: 500; color: var(--muted);
}
.pulse { animation: none; box-shadow: none; }

/* Buttons: solid accent for the primary action, a quiet fill for the rest */
.btn { transition: background .15s var(--ease), color .15s var(--ease), transform .12s var(--ease); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--volt); color: var(--on-volt); box-shadow: none; }
.btn-primary:hover { transform: none; box-shadow: none; background: #e0ff70; }
.btn-ghost { background: var(--surface-2); border-color: transparent; }
.btn-ghost:hover { transform: none; color: var(--text); border-color: transparent; background: #25272b; }
.skip-link { color: var(--on-volt); }

/* Hero */
.hero h1 { letter-spacing: -0.035em; }
.hero-tags { gap: 6px 18px; }
.hero-tags span { border: 0; padding: 0; color: var(--faint); font-size: 13px; }
.chart-card { background: var(--surface); border-color: transparent; box-shadow: 0 30px 80px -30px rgba(0,0,0,0.75); }
.chart-card::before { display: none; }
.chart-badge { border: 0; padding: 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.chart-foot .v { font-family: var(--font-data); font-variant-numeric: tabular-nums; }

/* Cards and panels: separated by tone, no outline, no hover lift */
.card, .panel, .purpose-card, .step, .stat-cell, .learned-card, .repro-side,
.rs-arm, .arch-node, .mtab { border-color: transparent; }
.card:hover { transform: none; border-color: transparent; background: var(--surface); }
.card-icon { background: var(--surface-2); border: 0; }
.card-tag { border: 0; padding: 0; background: none; font-size: 12px; font-weight: 600; }
.arch-node.agent { box-shadow: inset 0 0 0 1px rgba(212,255,63,0.35); }
.arch-node.stock, .arch-node.crypto { border-color: transparent; }
.step-n { width: 28px; height: 28px; border-radius: 50%; font-family: var(--font-data); }

/* Figures read in the text colour; the accent is kept for selection and action */
.stat-cell .num { background: none; -webkit-text-fill-color: currentColor; color: var(--text); letter-spacing: -0.03em; }
.grad { -webkit-text-fill-color: currentColor; background: none; color: var(--volt); }

/* Toggles, chips and market tabs: solid accent when selected */
.dash-toggle { border: 0; background: var(--surface-2); }
.tg.active, .chip.active { background: var(--volt); color: var(--on-volt); }
.chip { background: var(--surface-2); border-color: transparent; }
.chip:hover { border-color: transparent; background: #25272b; }
.mtab:hover { transform: none; }
.mtab.active { box-shadow: inset 0 0 0 2px var(--volt); }

/* Callouts: a tint and a rail, no outline */
.honest-note { border: 0; border-left: 3px solid var(--cyan); background: rgba(54, 224, 255, 0.05); }
.insight { border: 0; border-left: 3px solid var(--volt); background: rgba(212, 255, 63, 0.05); }
.insight b, .lab-caption b { font-family: var(--font-data); }
.repro-warn, .ood-note { border-color: transparent; }

/* Terminal: neutral window controls instead of traffic-light colours */
.terminal { border-color: transparent; background: #08090a; }
.term-bar span, .term-bar span:nth-child(n) { background: #2c2e32; }

/* Closing call to action */
.cta { background: var(--surface); border-color: transparent; }
.cta-code { border-color: transparent; background: #08090a; }

/* Timeline numbers */
.tl-n { border-color: transparent; background: var(--surface-2); color: var(--muted); }

/* Tables */
.restable thead th { font-size: 12px; font-weight: 500; }
.restable td.num-l { font-family: var(--font-data); font-weight: 600; }

/* Narrow screens: chart legends wrap under their title instead of running
   past the edge (the legend was nowrap and widened the page to 404px). */
@media (max-width: 560px) {
  .panel-head { flex-wrap: wrap; gap: 6px 12px; }
  .chart-legend { flex-wrap: wrap; white-space: normal; gap: 6px 12px; }
}

/* Visible only to screen readers (keeps the heading outline unbroken). */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Links inside section prose had no styling and rendered as the browser's
   default dark blue on near-black (2.1:1). */
.section-head p a { color: var(--cyan); text-decoration: underline; text-underline-offset: 2px; }
