:root {
  --bg: #0a1b33;
  --bg-2: #0d2140;
  --panel: #0f2543;
  --line: #1d3a63;
  --text: #c9dcf3;
  --muted: #8fa9cb;
  --head: #e4f0ff;
  --accent: #7fb2f0;
  --warm: #f09a6b;
  --good: #6ccf9b;
  --radius: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@view-transition { navigation: auto; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Instrument Sans", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  animation: pageIn .6s var(--ease) both;
}
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

h1, h2, h3 {
  font-family: "Bricolage Grotesque", "Instrument Sans", sans-serif;
  color: var(--head);
  line-height: 1.12;
  margin: 0;
}
a { color: inherit; text-decoration: none; }
.icon { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px clamp(20px, 5vw, 64px);
  background: rgba(10, 27, 51, .9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; color: var(--head); }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--panel); border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent); font-size: 17px; }
.nav { display: flex; gap: 6px; }
.nav a { position: relative; padding: 8px 14px; border-radius: 999px; font-size: 15px; color: var(--muted); transition: color .2s, background .2s; }
.nav a:hover { color: var(--head); background: var(--panel); }
.nav a[aria-current="page"] { color: var(--head); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; color: var(--head); width: 42px; height: 42px; cursor: pointer; font-size: 20px; }

@media (max-width: 760px) {
  .nav-toggle { display: grid; place-items: center; }
  .nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; padding: 12px clamp(20px, 5vw, 64px) 18px; background: var(--bg); border-bottom: 1px solid var(--line); display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; }
}

main { max-width: 1040px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 40px); }

/* ---------- reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: inherit; font-weight: 600; font-size: 16px;
  padding: 13px 26px; cursor: pointer;
  color: #07182e; background: var(--accent);
  border: 1px solid var(--accent); border-radius: 12px;
  transition: transform .2s var(--ease), background .2s;
}
.btn:hover { background: #a2c8f5; transform: translateY(-2px); }
.btn .icon { transition: transform .25s var(--ease); }
.btn:hover .icon { transform: translateX(4px); }
.btn.ghost { color: var(--text); background: transparent; border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); background: transparent; }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--head); outline-offset: 3px; }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center;
  padding: clamp(48px, 9vw, 96px) 0 56px;
  position: relative;
}
.hero::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%); z-index: -1;
  background-image: radial-gradient(var(--line) 1px, transparent 1.2px);
  background-size: 28px 28px; opacity: .45;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
}
.eyebrow { margin: 0 0 18px; font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.hero h1 { font-size: clamp(36px, 6vw, 62px); font-weight: 700; }
.lead { margin: 24px 0 0; max-width: 34em; font-size: clamp(18px, 2.2vw, 20px); color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 30px 0 0; }
.tags li { padding: 6px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 14px; }

.hero-art { width: 100%; height: auto; overflow: visible; }
.hero-art .draw { stroke-dasharray: 700; stroke-dashoffset: 700; animation: draw 2.4s .5s var(--ease) forwards; }
.hero-art .area { opacity: 0; animation: fadeIn 1.2s 2s ease forwards; }
.hero-art .dot { opacity: 0; animation: fadeIn .4s 2.6s ease forwards; }
.hero-art .pulse { transform-box: fill-box; transform-origin: center; animation: pulse 2.4s 2.8s ease-out infinite; }
.hero-art .chip { animation: bob 5s ease-in-out infinite; }
.hero-art .chip.c2 { animation-delay: -1.6s; }
.hero-art .chip.c3 { animation-delay: -3.2s; }
.hero-art .drop { animation: bob 6s ease-in-out infinite -2s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes pulse { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(2.6); opacity: 0; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } .hero-art { max-width: 520px; } }

/* ---------- page header (inner pages) ---------- */
.page-head { padding: clamp(44px, 8vw, 84px) 0 30px; max-width: 40em; }
.page-head h1 { font-size: clamp(34px, 5.5vw, 54px); }
.page-head p { margin: 20px 0 0; font-size: clamp(17px, 2vw, 19px); color: var(--muted); }

/* ---------- blocks ---------- */
.block { padding: 60px 0; border-top: 1px solid var(--line); }
.block.first { border-top: 0; padding-top: 24px; }
.block-head { margin-bottom: 34px; max-width: 36em; }
.block-head h2 { font-size: clamp(26px, 4vw, 38px); }
.block-head p { margin: 12px 0 0; color: var(--muted); }

/* ---------- stat strip ---------- */
.stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.stats li { padding: 26px 24px; border-right: 1px solid var(--line); }
.stats li:last-child { border-right: 0; }
.stats strong { display: block; font-family: "Bricolage Grotesque", sans-serif; font-size: clamp(32px, 4.5vw, 46px); line-height: 1.05; color: var(--head); }
.stats span { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } .stats li:nth-child(2) { border-right: 0; } .stats li:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }

/* ---------- link cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; gap: 10px; padding: 26px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .3s var(--ease), border-color .3s;
}
.card:hover { transform: translateY(-6px); border-color: var(--accent); }
.card .ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 24px; color: var(--accent); background: var(--bg); border: 1px solid var(--line); }
.card h3 { font-size: 21px; margin-top: 8px; }
.card p { margin: 0; font-size: 15px; color: var(--muted); flex: 1; }
.card .go { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 14.5px; font-weight: 600; color: var(--accent); }
.card .go .icon { transition: transform .25s var(--ease); }
.card:hover .go .icon { transform: translateX(5px); }

/* ---------- CTA band ---------- */
.cta { margin: 20px 0 80px; padding: clamp(32px, 6vw, 56px); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; position: relative; overflow: hidden; }
.cta::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 1px solid var(--line); box-shadow: 0 0 0 36px rgba(127,178,240,.04), 0 0 0 72px rgba(127,178,240,.03); pointer-events: none; }
.cta h2 { font-size: clamp(24px, 3.6vw, 34px); max-width: 16em; }
.cta p { margin: 10px 0 0; color: var(--muted); max-width: 30em; }
.cta > * { position: relative; z-index: 1; }

/* ---------- predictor ---------- */
.predictor { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
.fields label { display: block; }
.fields label > span { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 14px; font-weight: 600; color: var(--head); }
.fields label > span .icon { color: var(--accent); font-size: 17px; }
.fields em { color: var(--accent); font-style: normal; }
.fields input { width: 100%; padding: 12px 14px; font: inherit; font-size: 16px; color: var(--head); background: var(--panel); border: 1px solid var(--line); border-radius: 11px; transition: border-color .2s, box-shadow .2s; }
.fields input::placeholder { color: #587aa3; }
.fields input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(127,178,240,.14); }
.fields small { display: block; margin-top: 5px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.actions { display: flex; gap: 12px; margin-top: 28px; }
.form-error { margin: 18px 0 0; color: #ffb4a8; font-size: 15px; }

.result { position: sticky; top: 88px; padding: 26px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); animation: rise .5s var(--ease); }
.result[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.result-empty { padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); font-size: 15px; }
.result-empty .icon { font-size: 34px; color: var(--accent); margin-bottom: 10px; animation: bob 4s ease-in-out infinite; }
.result-empty[hidden] { display: none; }
.result-label { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.result-verdict { margin: 0 0 18px; font-family: "Bricolage Grotesque", sans-serif; font-size: 30px; font-weight: 700; line-height: 1.15; }
.result-verdict.pos { color: #ffb08a; }
.result-verdict.neg { color: #8fe0b4; }
.meter { position: relative; height: 12px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.meter-fill { height: 100%; width: 0; border-radius: 999px; transition: width 1s var(--ease); }
.meter-fill.pos { background: var(--warm); }
.meter-fill.neg { background: var(--good); }
.meter-mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--line); }
.result-prob { margin: 10px 0 22px; font-size: 14px; color: var(--muted); }
.result-prob strong { color: var(--head); font-size: 17px; }
.drivers { list-style: none; margin: 0 0 18px; padding: 0; font-size: 14.5px; }
.drivers li { padding: 8px 0 8px 14px; border-left: 3px solid var(--line); margin-bottom: 8px; animation: rise .5s var(--ease) both; }
.drivers li:nth-child(2) { animation-delay: .12s; }
.drivers li:nth-child(3) { animation-delay: .24s; }
.drivers li.up { border-left-color: var(--warm); }
.drivers li.down { border-left-color: var(--good); }
.result-fill { margin: 0 0 14px; font-size: 13.5px; color: var(--muted); }
.result-disclaimer { margin: 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.5; color: var(--muted); }

@media (max-width: 860px) { .predictor { grid-template-columns: 1fr; } .result { position: static; } }
@media (max-width: 440px) { .fields { grid-template-columns: 1fr; } }

/* ---------- feature cards ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; align-items: start; }
.feature { text-align: left; font: inherit; color: inherit; cursor: pointer; padding: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: grid; grid-template-columns: 46px 1fr; gap: 4px 16px; transition: border-color .25s, transform .3s var(--ease); }
.feature:hover { border-color: var(--accent); transform: translateY(-3px); }
.feature .ico { grid-row: span 2; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 24px; color: var(--accent); background: var(--bg); border: 1px solid var(--line); transition: transform .35s var(--ease); }
.feature:hover .ico { transform: rotate(-8deg) scale(1.06); }
.f-name { font-family: "Bricolage Grotesque", sans-serif; font-size: 20px; font-weight: 700; color: var(--head); align-self: end; }
.f-short { font-size: 14.5px; color: var(--muted); }
.f-more { grid-column: 1 / -1; max-height: 0; overflow: hidden; opacity: 0; font-size: 15px; transition: max-height .35s var(--ease), opacity .35s, margin .35s; }
.feature[aria-expanded="true"] { border-color: var(--accent); }
.feature[aria-expanded="true"] .f-more { max-height: 180px; opacity: 1; margin-top: 12px; }

/* ---------- charts ---------- */
.chart-box { padding: clamp(20px, 3vw, 30px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.legend { display: flex; flex-wrap: wrap; gap: 18px; margin: 0 0 22px; font-size: 14px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 8px; vertical-align: -1px; }
.legend .a { background: var(--accent); }
.legend .b { background: var(--warm); }

.pair { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.pair:first-of-type { border-top: 0; }
.pair-name { font-size: 14.5px; color: var(--head); font-weight: 500; }
.bars { display: grid; gap: 6px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-track { flex: 1; height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.bar { height: 100%; width: 0; border-radius: 999px; transition: width 1.1s var(--ease); transition-delay: var(--d, 0s); }
.bar.a { background: var(--accent); }
.bar.b { background: var(--warm); }
.bar.g { background: var(--good); }
.bar.neg { background: #5d7ea8; }
.bar-val { width: 54px; text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .pair { grid-template-columns: 1fr; gap: 8px; } }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.chart-box h3 { font-size: 20px; margin-bottom: 4px; }
.chart-box > p { margin: 0 0 20px; font-size: 14.5px; color: var(--muted); }
.row-bar { display: grid; grid-template-columns: 130px 1fr 56px; gap: 12px; align-items: center; padding: 8px 0; font-size: 14.5px; }
.row-bar .n { color: var(--head); }
.row-bar .v { text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .row-bar { grid-template-columns: 100px 1fr 48px; } }

/* ---------- method timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 27px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.timeline .progress { position: absolute; left: 27px; top: 10px; width: 2px; height: 0; background: var(--accent); transition: height .2s linear; }
.timeline li { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 24px; padding: 0 0 46px; }
.timeline li:last-child { padding-bottom: 0; }
.t-dot { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; color: var(--accent); background: var(--bg); border: 2px solid var(--line); position: relative; z-index: 1; transition: border-color .4s, background .4s; }
.timeline li.in .t-dot { border-color: var(--accent); background: var(--panel); }
.t-body { padding-top: 2px; }
.t-body .num { font-size: 13px; font-weight: 600; letter-spacing: .14em; color: var(--accent); }
.t-body h3 { font-size: 24px; margin: 4px 0 8px; }
.t-body p { margin: 0; max-width: 38em; color: var(--muted); }

/* ---------- results ---------- */
.metrics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.metrics li { padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.metrics strong { display: block; font-family: "Bricolage Grotesque", sans-serif; font-size: 44px; line-height: 1.05; color: var(--head); }
.metrics .m-name { display: block; margin-top: 8px; font-weight: 600; color: var(--head); font-size: 15px; }
.metrics .m-desc { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); }

.roc { width: 100%; height: auto; display: block; }
.roc .grid-l { stroke: var(--line); stroke-width: 1; }
.roc .diag { stroke: var(--muted); stroke-dasharray: 5 6; stroke-width: 1.3; opacity: .6; }
.roc .curve { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.roc .fillarea { fill: var(--accent); opacity: .1; }
.roc text { font-family: "Instrument Sans", sans-serif; font-size: 12px; fill: var(--muted); }

.cm { display: grid; grid-template-columns: auto 1fr 1fr; gap: 8px; align-items: stretch; font-size: 13.5px; }
.cm .h { color: var(--muted); display: grid; place-items: center; padding: 4px 6px; text-align: center; }
.cm .cell { border-radius: 12px; padding: 18px 12px; text-align: center; border: 1px solid var(--line); background: var(--bg); }
.cm .cell strong { display: block; font-family: "Bricolage Grotesque", sans-serif; font-size: 34px; color: var(--head); line-height: 1.1; }
.cm .cell span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.cm .ok { background: rgba(108,207,155,.1); border-color: rgba(108,207,155,.35); }
.cm .bad { background: rgba(240,154,107,.09); border-color: rgba(240,154,107,.35); }
.cm .v { writing-mode: vertical-rl; transform: rotate(180deg); }

.limits { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.limits li { padding: 18px 22px; background: var(--panel); border-left: 3px solid var(--warm); border-radius: 0 12px 12px 0; color: var(--muted); font-size: 15.5px; }
.limits strong { color: var(--head); }

.note { margin: 8px 0 72px; padding: 18px 22px; border-left: 3px solid var(--accent); background: var(--panel); border-radius: 0 10px 10px 0; font-size: 15px; color: var(--muted); }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding: 36px clamp(20px, 5vw, 64px); display: flex; flex-wrap: wrap; gap: 18px 40px; justify-content: space-between; font-size: 14.5px; color: var(--muted); }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
footer a:hover { color: var(--head); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001s !important; animation-delay: 0s !important; transition-duration: .001s !important; transition-delay: 0s !important; }
  .js .reveal { opacity: 1; transform: none; }
  .hero-art .draw { stroke-dashoffset: 0; }
}

/* ---------- hero illustration parts ---------- */
.hero-art .panel { fill: var(--panel); stroke: var(--line); stroke-width: 1.5; }
.hero-art .gl { stroke: var(--line); stroke-width: 1; }
.hero-art .ln { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.hero-art .area { fill: var(--accent); opacity: 0; }
.hero-art .dot-c { fill: var(--accent); }
.hero-art .ring { fill: none; stroke: var(--accent); stroke-width: 2; }
.hero-art .chipbg { fill: var(--bg); stroke: var(--line); stroke-width: 1.2; }
.hero-art .warm-b { stroke: var(--warm); }
.hero-art .warm { fill: var(--warm); }
.hero-art text { font-family: "Instrument Sans", sans-serif; font-size: 12.5px; fill: var(--muted); }
.hero-art text.t-h { fill: var(--head); font-weight: 600; font-size: 14px; }
.hero-art .dropfill { fill: var(--accent); opacity: .92; }

/* ---------- flow (home) ---------- */
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; position: relative; }
.flow::before { content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 34px; border-top: 2px dashed var(--line); }
.flow::after { content: ""; position: absolute; top: 29px; left: 12.5%; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); animation: travel 5s linear infinite; }
@keyframes travel { 0% { left: 12.5%; opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { left: calc(87.5% - 12px); opacity: 0; } }
.flow li { position: relative; text-align: center; padding: 0 6px; }
.flow .node { width: 68px; height: 68px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; color: var(--accent); background: var(--panel); border: 1.5px solid var(--line); position: relative; z-index: 1; transition: transform .3s var(--ease), border-color .3s; }
.flow li:hover .node { transform: scale(1.1); border-color: var(--accent); }
.flow h3 { font-size: 19px; }
.flow p { margin: 6px 0 0; font-size: 14.5px; color: var(--muted); }
@media (max-width: 640px) {
  .flow { grid-template-columns: repeat(2, 1fr); gap: 34px 16px; }
  .flow::before, .flow::after { display: none; }
}
