/* ACTUARAIL design system — dark slate + indigo. Visual-first, low-text. */
:root {
  --bg: #0b1220;
  --surface: #111827;
  --surface-2: #0f1729;
  --ink: #f1f5f9;
  --ink-soft: #cbd5e1;
  --ink-faint: #94a3b8;
  --border: #1f2937;
  --border-strong: #374151;
  --accent: #818cf8;        /* indigo-400 */
  --accent-soft: #312e81;
  --brand-ai: #22d3ee;      /* cyan-400 — AI letters in wordmark */
  --green: #34d399;
  --red: #fb7185;
  --amber: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1040px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; gap: 28px;
  padding: 16px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: rgba(11,18,32,0.85);
  backdrop-filter: blur(8px); z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px;
  background: var(--accent); color: #0b1220; font-family: var(--mono);
  font-weight: 700; border-radius: 8px; font-size: 18px;
}
.brand-word { font-family: var(--mono); font-weight: 700; letter-spacing: 0.5px; }
.brand-word .brand-ai { color: var(--brand-ai); }
.section-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.section-nav a {
  color: var(--ink-soft); text-decoration: none; font-size: 14px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid transparent;
}
.section-nav a:hover { color: var(--ink); background: var(--surface); }
.section-nav a.active { color: var(--ink); border-color: var(--border-strong); background: var(--surface); }

/* ---------- Layout ---------- */
.app { max-width: var(--maxw); margin: 0 auto; padding: clamp(20px, 4vw, 40px); min-height: 60vh; }
.site-footer {
  max-width: var(--maxw); margin: 40px auto 0; padding: 24px clamp(16px,4vw,40px);
  border-top: 1px solid var(--border); color: var(--ink-faint); font-size: 13px;
  display: flex; flex-direction: column; gap: 12px;
}
.site-footer .footer-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.site-footer .footer-version {
  text-align: center; font-size: 12px; color: var(--ink-faint);
  font-family: var(--mono); padding-top: 12px; border-top: 1px solid var(--border);
  letter-spacing: 0.3px;
}
.site-footer .footer-version .brand-ai { color: var(--brand-ai); }

/* ---------- Home hero ---------- */
.hero { margin-bottom: 36px; }
.hero h1 { font-size: clamp(28px, 5vw, 42px); margin: 0 0 10px; letter-spacing: -0.5px; }
.hero p { color: var(--ink-soft); font-size: 17px; max-width: 60ch; margin: 0; }

/* ---------- Section + module cards ---------- */
.section-block { margin-bottom: 40px; }
.section-block > h2 { font-size: 20px; margin: 0 0 4px; }
.section-block > .section-blurb { color: var(--ink-faint); margin: 0 0 16px; font-size: 14px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.mod-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; transition: border-color .15s, transform .15s;
}
.mod-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.mod-card.soon { opacity: .55; pointer-events: none; }
.mod-card h3 { margin: 0 0 6px; font-size: 16px; }
.mod-card p { margin: 0; color: var(--ink-faint); font-size: 13.5px; }
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; margin-bottom: 10px; }
.tag.live { background: rgba(52,211,153,.12); color: var(--green); }
.tag.soon { background: rgba(148,163,184,.12); color: var(--ink-faint); }

/* ---------- Module page ---------- */
.module-head { margin-bottom: 18px; }
.module-head a.back { color: var(--ink-faint); text-decoration: none; font-size: 13px; }
.module-head h1 { font-size: clamp(22px, 4vw, 32px); margin: 8px 0 4px; }
.module-head .sub { color: var(--ink-soft); margin: 0; font-size: 15px; }

.chart-shell { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.chart { width: 100%; height: 420px; }

.controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 14px; }
.controls input[type="range"] { flex: 1; min-width: 200px; accent-color: var(--accent); }
.readout { font-family: var(--mono); font-size: 14px; color: var(--ink-soft); }
.badge { font-family: var(--mono); font-size: 13px; padding: 4px 10px; border-radius: 999px; }
.badge.green { background: rgba(52,211,153,.14); color: var(--green); }
.badge.red { background: rgba(251,113,133,.14); color: var(--red); }

/* ---------- Multi-curve panel (yield curve module) ---------- */
.curves-panel { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.curves-list { display: flex; flex-direction: column; gap: 8px; }
.curve-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.curve-swatch {
  flex: 0 0 auto; width: 12px; height: 12px; border-radius: 3px;
  display: inline-block;
}
.curve-label {
  flex: 0 0 auto; font-family: var(--mono); font-size: 13px;
  color: var(--ink-soft); min-width: 110px;
}
.curve-slider {
  flex: 1; min-width: 120px; accent-color: var(--accent);
}
.curve-remove {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  background: transparent; color: var(--ink-faint);
  border: 1px solid var(--border-strong); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 0;
  display: grid; place-items: center;
}
.curve-remove:hover { color: var(--ink); border-color: var(--red); background: rgba(251,113,133,.08); }
.btn-add-curve {
  align-self: flex-start;
  background: transparent; color: var(--accent);
  border: 1px dashed var(--accent); border-radius: var(--radius-sm);
  padding: 8px 14px; font-size: 13px; cursor: pointer;
  font-family: var(--sans);
}
.btn-add-curve:hover:not(:disabled) { background: rgba(129,140,248,.08); }
.btn-add-curve:disabled { color: var(--ink-faint); border-color: var(--border-strong); cursor: not-allowed; opacity: 0.6; }
.curves-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.curves-summary .badge { display: inline-flex; align-items: center; }

/* Mobile: stack the row contents so the slider gets full width. */
@media (max-width: 560px) {
  .curve-row { flex-wrap: wrap; }
  .curve-label { flex: 1 1 auto; min-width: 0; }
  .curve-slider { flex: 1 1 100%; min-width: 0; order: 3; }
  .curve-remove { order: 2; }
}

/* ---------- Explainer (visual-first: short, expandable) ---------- */
.explainer { margin-top: 26px; max-width: 68ch; }
.explainer .why { font-size: 16px; color: var(--ink); }
.explainer .analogy {
  margin: 14px 0; padding: 14px 16px; border-left: 3px solid var(--accent);
  background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink-soft);
}
.explainer details { margin-top: 12px; }
.explainer summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.explainer details[open] summary { margin-bottom: 8px; }
.explainer p { color: var(--ink-soft); }

.placeholder { color: var(--ink-faint); background: var(--surface); border: 1px dashed var(--border-strong);
  border-radius: var(--radius); padding: 40px; text-align: center; }
