:root {
  --navy: #0b1533;
  --navy-2: #142350;
  --ink: #0f172a;
  --body: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-alt: #f6f8fc;
  --accent: #4f46e5;
  --accent-2: #06b6d4;
  --good: #059669;
  --good-bg: #ecfdf5;
  --bad: #dc2626;
  --bad-bg: #fef2f2;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; color: var(--body); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); font-weight: 400; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12.5px; }
.fine { font-size: 13px; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: #fff; border: 1px solid var(--accent); padding: 12px 20px; border-radius: 10px; font-weight: 600; font-size: 15px; cursor: pointer; font-family: inherit; transition: transform .1s, box-shadow .2s; }
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(79, 70, 229, .3); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-ghost:hover { box-shadow: none; }
.btn-sm { padding: 7px 14px; font-size: 13.5px; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(11, 21, 51, .92); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { color: #fff; font-weight: 700; font-size: 16px; display: flex; gap: 8px; align-items: center; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: #cbd5e1; font-size: 14px; font-weight: 500; }
.nav-links a.btn { color: #fff; }
.nav-links a:hover { color: #fff; text-decoration: none; }

/* ---------- Hero ---------- */
.hero { background: radial-gradient(1200px 500px at 85% -10%, rgba(79, 70, 229, .45), transparent 60%), radial-gradient(800px 400px at 0% 100%, rgba(6, 182, 212, .18), transparent 60%), var(--navy); color: #cbd5e1; padding: 88px 0 96px; }
.hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 56px; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(36px, 5vw, 58px); font-weight: 800; letter-spacing: -.02em; }
.hero .accent { background: linear-gradient(90deg, #a5b4fc, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: 18.5px; max-width: 600px; color: #cbd5e1; }
.lede strong { color: #fff; }
.eyebrow { display: inline-block; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #a5b4fc; background: rgba(165, 180, 252, .1); border: 1px solid rgba(165, 180, 252, .25); padding: 5px 12px; border-radius: 99px; margin-bottom: 20px; }
.hero-cta { display: flex; gap: 12px; margin: 28px 0 18px; flex-wrap: wrap; }
.hero-cta .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .35); }
.hero .fine { color: #94a3b8; }
.hero-card { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: 18px; padding: 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.hero-card-title { color: #fff; font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.hero-card-title .muted { color: #94a3b8; }
.hero-stat { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-top: 1px solid rgba(255, 255, 255, .08); gap: 12px; }
.hs-label { font-size: 14px; }
.hs-val { color: #fff; font-size: 18px; font-weight: 600; white-space: nowrap; }
.hs-val b { color: #6ee7b7; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 780px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -.015em; }
.section-sub { font-size: 17px; }
.step-tag { display: inline-block; font-weight: 700; font-size: 13px; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 12px; }

.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 28px; }
.cards-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin: 28px 0; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card h3 { font-size: 18px; }
.card p { margin: 0; }
.card.mini h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.pain-icon { font-size: 26px; margin-bottom: 12px; }

.persona { display: flex; gap: 18px; align-items: flex-start; background: #fff; border-left: 4px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; padding: 22px 26px; margin: 8px 0 28px; box-shadow: var(--shadow); }
.persona-avatar { flex: 0 0 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; display: grid; place-items: center; }
.quote { font-size: 18px; color: var(--ink); font-style: italic; margin: 0 0 8px; }
.persona-meta { margin: 0; font-size: 13.5px; color: var(--muted); }

.problem-statement { background: var(--navy); color: #e2e8f0; border-radius: var(--radius); padding: 28px 32px; margin-bottom: 28px; }
.problem-statement p { font-size: 20px; margin: 0; line-height: 1.5; }
.problem-statement strong { color: #fff; }
.ps-label, .insight-label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #a5b4fc; margin-bottom: 8px; }

.two-sided { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; }
.side { border-radius: var(--radius); padding: 20px 24px; }
.side ul { margin: 0; padding-left: 18px; }
.side-bad { background: var(--bad-bg); border: 1px solid #fecaca; }
.side-bad h4 { color: var(--bad); }
.side-warn { background: var(--warn-bg); border: 1px solid #fde68a; }
.side-warn h4 { color: var(--warn); }
.side-vs { font-weight: 800; color: var(--muted); }

/* ---------- Approach ---------- */
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 32px; position: relative; }
.tl-step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.tl-step p { margin: 0; font-size: 14.5px; }
.tl-num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; margin-bottom: 12px; }

.flow { display: grid; grid-template-columns: 1.3fr auto 1fr auto 1.2fr; gap: 14px; align-items: stretch; margin-bottom: 28px; }
.flow-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.flow-title { width: 100%; font-weight: 700; color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.flow-mono { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: var(--muted); width: 100%; }
.flow-out { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px 10px; }
.flow-out .flow-mono { width: auto; }
.flow-arrow { display: grid; place-items: center; font-size: 22px; color: var(--accent); }
.chip { font-size: 12.5px; background: #eef2ff; color: #3730a3; padding: 3px 9px; border-radius: 99px; font-weight: 500; }

.insight { background: linear-gradient(135deg, #eef2ff, #ecfeff); border: 1px solid #c7d2fe; border-radius: var(--radius); padding: 24px 28px; margin-bottom: 28px; }
.insight .insight-label { color: var(--accent); }
.insight p { margin: 0; font-size: 17px; color: var(--ink); }

/* ---------- Decisions & pills ---------- */
.dec { display: inline-block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 9px; border-radius: 6px; }
.dec-allow { background: var(--good-bg); color: var(--good); }
.dec-review { background: var(--warn-bg); color: var(--warn); }
.dec-block { background: var(--bad-bg); color: var(--bad); }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.pill-good { background: var(--good-bg); color: var(--good); }
.pill-ok { background: #eff6ff; color: #2563eb; }
.pill-bad { background: var(--bad-bg); color: var(--bad); }
.pill-muted { background: #f1f5f9; color: var(--muted); }

/* ---------- Playground ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.presets { display: flex; gap: 10px; flex-wrap: wrap; }
.preset { display: flex; flex-direction: column; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; cursor: pointer; font-family: inherit; text-align: left; transition: border-color .15s, box-shadow .15s; }
.preset:hover { border-color: #a5b4fc; }
.preset.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
.preset.custom { cursor: default; }
.preset-name { font-weight: 700; color: var(--ink); font-size: 14px; }
.preset-tag { font-size: 12px; color: var(--muted); }
.toolbar .btn-ghost { color: var(--accent); }

.outputs { min-width: 0; }
.playground { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.panel-title { font-weight: 700; color: var(--ink); font-size: 14.5px; margin-bottom: 14px; }
.panel-title .muted { font-size: 13px; }
.controls { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; }

.threshold { margin-bottom: 14px; }
.threshold label { font-size: 13.5px; display: block; margin-bottom: 4px; }
.threshold b { color: var(--accent); }
input[type=range] { width: 100%; accent-color: var(--accent); }

.rule { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; transition: opacity .15s, background .15s; }
.rule.off { opacity: .55; background: #f8fafc; }
.rule.off .rule-body { display: none; }
.rule-head { display: flex; gap: 12px; align-items: flex-start; }
.rule-name { font-weight: 600; color: var(--ink); font-size: 14px; }
.rule-desc { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.rule-body { margin-top: 10px; }
.rule-row { display: flex; justify-content: space-between; font-size: 12.5px; margin-top: 4px; }
.rule-row b { color: var(--ink); }

.switch { position: relative; flex: 0 0 36px; height: 20px; margin-top: 2px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 99px; cursor: pointer; transition: background .15s; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(16px); }

.assumptions { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 13.5px; }
.assumptions summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.cost-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; font-size: 12.5px; }
.cost-row input { width: 76px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; font-family: inherit; text-align: right; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi-primary { background: var(--navy); border-color: var(--navy); }
.kpi-primary .kpi-label, .kpi-primary .kpi-sub { color: #94a3b8; }
.kpi-primary .kpi-value { color: #fff; }
.kpi-label { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-size: 28px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; margin: 2px 0; }
.kpi-sub { font-size: 12.5px; color: var(--muted); }
.delta { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.delta.good { background: var(--good-bg); color: var(--good); }
.delta.bad { background: var(--bad-bg); color: var(--bad); }
.delta.flat { background: #f1f5f9; color: var(--muted); }
.kpi-primary .delta.good { background: rgba(16, 185, 129, .18); color: #6ee7b7; }
.kpi-primary .delta.bad { background: rgba(239, 68, 68, .2); color: #fca5a5; }

.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #eef2f7; }
.chart .axis { font-size: 11px; fill: var(--muted); }
.chart .axis-title { font-size: 12px; fill: var(--body); font-weight: 600; }
.chart .curve { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.chart .curve-area { fill: rgba(79, 70, 229, .08); }
.chart .pt-you { fill: var(--accent); stroke: #fff; stroke-width: 3; }
.chart .pt-legacy { fill: var(--bad); stroke: #fff; stroke-width: 3; }
.chart .pt-label { font-size: 11.5px; fill: var(--bad); font-weight: 600; }
.chart .pt-label-you { fill: var(--accent); }
.legend { display: flex; gap: 18px; font-size: 12.5px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.lg-curve { background: rgba(79, 70, 229, .3); border-radius: 2px; }
.lg-you, .lg-fill { background: var(--accent); }
.lg-legacy { background: var(--bad); }
.lg-base { background: #fca5a5; }

.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.tbl .r { text-align: right; }
.tbl-tx td { font-size: 13px; }
.tbl-tx td.mono { white-space: nowrap; }
.tbl-tx .muted { font-size: 11.5px; }
.reasons { min-width: 180px; }
.tbl-tx td.truth { white-space: nowrap; }
.reason { display: inline-block; font-size: 11.5px; background: #f1f5f9; color: var(--body); padding: 2px 7px; border-radius: 6px; margin: 0 4px 4px 0; }
.reason b { color: var(--accent); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filter { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 13px; font-size: 13px; cursor: pointer; font-family: inherit; color: var(--body); }
.filter span { color: var(--muted); font-weight: 600; margin-left: 4px; }
.filter.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.filter.active span { color: #cbd5e1; }

.type-bars { display: grid; gap: 14px; }
.tb-head { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 5px; }
.tb-track { position: relative; height: 10px; background: #f1f5f9; border-radius: 99px; overflow: hidden; }
.tb-fill, .tb-base { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; transition: width .25s; }
.tb-base { background: #fca5a5; top: 6px; }
.tb-fill { background: linear-gradient(90deg, var(--accent), var(--accent-2)); bottom: 4px; }

/* ---------- Results ---------- */
.result-big { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.rb { background: var(--navy); border-radius: var(--radius); padding: 24px; }
.rb-val { color: #fff; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.rb-label { color: #94a3b8; font-size: 14px; }
.tbl-results td, .tbl-results th { padding: 13px 12px; font-size: 14.5px; }
.ticks, .crosses { list-style: none; padding: 0; margin: 0; }
.ticks li, .crosses li { padding: 8px 0 8px 28px; position: relative; }
.ticks li::before { content: '✓'; position: absolute; left: 0; color: var(--good); font-weight: 800; }
.crosses li::before { content: '!'; position: absolute; left: 4px; color: var(--warn); font-weight: 800; }
.roadmap h3 { font-size: 20px; }
.rm-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.rm { background: #fff; border: 1px dashed #c7d2fe; border-radius: var(--radius); padding: 18px; }
.rm h4 { font-size: 15.5px; margin-top: 8px; }
.rm p { margin: 0; font-size: 14px; }
.rm-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--accent); background: #eef2ff; padding: 2px 8px; border-radius: 6px; }

/* ---------- Footer & toast ---------- */
.footer { background: var(--navy); color: #94a3b8; padding: 36px 0; font-size: 14px; }
.footer strong { color: #fff; }
.footer a { color: #a5b4fc; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 18px; }
.footer .fine { max-width: 640px; color: #64748b; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-grid, .playground { grid-template-columns: 1fr; }
  .controls { position: static; max-height: none; }
  .timeline, .rm-grid, .result-big { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); }
}
@media (max-width: 720px) {
  .nav-links a:not(.btn) { display: none; }
  .cards-3, .cards-2, .kpis, .two-sided, .timeline, .rm-grid, .result-big { grid-template-columns: 1fr; }
  .side-vs { text-align: center; }
  .section { padding: 64px 0; }
}
