/* Tokens: light palette on :root, dark redefined for OS-dark and explicit toggle.
   Chart colors are the validated dataviz reference palette (3 categorical slots
   validated all-pairs, blue/red diverging pair validated) - see build notes. */
/* Varve Data: light theme only. Brand = aubergine ("rooty" purple).
   Chart colours: purple / amber / teal categorical set and purple-vs-orange
   buy/sell pair, both validated for colour-vision deficiency (dataviz validator,
   light surface); teal & amber are <3:1 so every chart ships a table view. */
:root {
  color-scheme: light;
  --brand-950: #1e0b25;
  --brand-900: #2a1033;   /* footer, CTA band */
  --brand-800: #3b1748;   /* THE Varve Data colour: logo, headings accents */
  --brand-700: #4e2160;   /* buttons */
  --brand-600: #6a2f7e;   /* links */
  --brand-300: #c9a9d4;
  --brand-200: #e2d0ea;
  --brand-100: #f3ebf6;   /* tint bands */
  --brand-50:  #faf6fb;
  --page: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f2f7;
  --ink: #1b1220;
  --ink-2: #554a5b;
  --muted: #8a8090;
  --grid: #ebe5ee;
  --axis: #cfc5d4;
  --border: rgba(59, 23, 72, 0.12);
  --accent: var(--brand-600);
  --accent-ink: #ffffff;
  --s1: #7b3f96;  /* purple */
  --s2: #e38b2c;  /* amber  */
  --s3: #1f9e8a;  /* teal   */
  --pos: #7b3f96; /* buys / positive */
  --neg: #d97a1e; /* sells / negative */
  --good: #1f7a3a;
  --critical: #b3261e;
  --warning-bg: #fdf1dc;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: Manrope, var(--font);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--ink); font: 15px/1.55 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* header */
.nav { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--border); }
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: inline-flex; align-items: center; }
.brand:hover { text-decoration: none; }
.brand img { height: 34px; display: block; }
.nav nav { display: flex; gap: 6px; align-items: center; }
.nav nav > a, .nav .menu > button { color: var(--ink); font-size: 15px; font-weight: 500; padding: 8px 12px;
  border-radius: 8px; background: none; border: 0; font-family: inherit; cursor: pointer; }
.nav nav > a:hover, .nav .menu > button:hover { background: var(--brand-50); text-decoration: none; color: var(--brand-800); }
.nav nav a.on, .nav .menu.on > button { color: var(--brand-800); font-weight: 650; }
.nav .menu { position: relative; }
.nav .menu .drop { position: absolute; top: calc(100% + 6px); left: 0; width: 340px; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 14px 40px rgba(42, 16, 51, .14);
  padding: 8px; display: none; }
.nav .menu:hover .drop, .nav .menu:focus-within .drop { display: block; }
.nav .drop a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--ink); }
.nav .drop a:hover { background: var(--brand-50); text-decoration: none; }
.nav .drop b { display: block; font-family: var(--display); color: var(--brand-800); font-size: 15px; }
.nav .drop span { font-size: 13px; color: var(--ink-2); }
.nav .spacer { flex: 1; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 999px;
  background: var(--brand-700); color: #fff; font-weight: 600; font-size: 14px; border: 1px solid var(--brand-700); cursor: pointer; }
.btn:hover { text-decoration: none; background: var(--brand-800); }
.btn.ghost { background: transparent; color: var(--brand-800); border: 1px solid var(--brand-300); }
.btn.ghost:hover { background: var(--brand-50); }
.btn.light { background: #fff; color: var(--brand-800); border-color: #fff; }
.btn.light:hover { background: var(--brand-100); }
.btn.outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn[aria-disabled="true"] { opacity: .55; cursor: default; }

/* layout */
section { padding: 28px 0; }
h1 { font-family: var(--display); font-size: clamp(30px, 4.4vw, 52px); line-height: 1.08; letter-spacing: -0.025em;
  margin: 0 0 14px; color: var(--brand-900); font-weight: 800; }
h2 { font-family: var(--display); font-size: 26px; letter-spacing: -0.015em; margin: 0 0 6px; color: var(--brand-900); font-weight: 800; }
h3 { font-size: 15px; margin: 0 0 8px; }
.lede { font-size: 18px; color: var(--ink-2); max-width: 720px; }
.sub { color: var(--ink-2); font-size: 14px; margin: 0 0 14px; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; min-width: 0;
  box-shadow: 0 1px 2px rgba(42, 16, 51, .04); }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: baseline; gap: 10px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 8px; }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.pill.flag { background: var(--warning-bg); color: var(--ink); }

/* stat tiles */
.tile .k { font-size: 13px; color: var(--ink-2); }
.tile .v { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; }
.tile .d { font-size: 12px; color: var(--muted); }

/* filters */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 6px 0 18px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { background: var(--surface); color: var(--ink-2); border: 0; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 12px; font: inherit;
  font-size: 14px; color: var(--ink-2); cursor: pointer; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
input[type=search] { font: inherit; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); width: 100%; }

/* tables */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 8px 10px; border-bottom: 1px solid var(--axis); white-space: nowrap; }
td { padding: 7px 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
td.nw { white-space: nowrap; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.mono { font-family: var(--mono); font-size: 12px; }

/* charts */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .base { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart text { fill: var(--muted); font: 11px var(--font); font-variant-numeric: tabular-nums; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hit:hover + .hl, .chart .hl.on { fill: var(--ink); opacity: .05; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin: 4px 0 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.12);
  white-space: nowrap; z-index: 5; color: var(--ink); }
.tip b { font-weight: 600; }
.tip .row { display: flex; gap: 10px; justify-content: space-between; }
.tip .row i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.toggle-table { background: none; border: 0; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; padding: 0; }

/* misc */
.hero { padding: 56px 0 28px; }
.kbd { font-family: var(--mono); background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.note { font-size: 12px; color: var(--muted); }
.plan { display: flex; flex-direction: column; gap: 10px; }
.plan.hl { outline: 2px solid var(--accent); }
.plan .price { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.plan ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
.plan .btn { align-self: flex-start; margin-top: auto; }
/* footer: the brand colour band */
footer { background: var(--brand-900); color: #d9c9e0; margin-top: 64px; padding: 48px 0 36px; font-size: 14px; }
footer a { color: #fff; }
footer .cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
footer h4 { color: #fff; font-family: var(--display); font-size: 14px; margin: 0 0 10px; letter-spacing: .02em; }
footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
footer .legal { border-top: 1px solid rgba(255,255,255,.14); margin-top: 32px; padding-top: 18px; font-size: 12px; color: #b9a6c2; }
@media (max-width: 760px) { footer .cols { grid-template-columns: 1fr 1fr; } }
.empty { color: var(--muted); font-size: 13px; padding: 12px 0; }
.ac { position: relative; }
.ac ul { position: absolute; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; z-index: 20;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; max-height: 320px; overflow: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.ac li { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; display: flex; gap: 10px; }
.ac li:hover, .ac li.on { background: var(--surface-2); }
.ac li b { min-width: 64px; }
@media (max-width: 640px) { .nav nav { display: none; } }


/* homepage */
.eyebrow { font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-600); margin-bottom: 14px; }
.hero { padding: 72px 0 60px; background: #fff; border-bottom: 1px solid var(--border); }
.hero .logo-h1 { margin: 0 0 26px; line-height: 0; }
.hero .logo-h1 img { height: clamp(56px, 8vw, 92px); width: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hero .promise { font-family: var(--display); font-size: clamp(22px, 2.6vw, 32px); font-weight: 700;
  color: var(--brand-800); margin: 0 0 14px; letter-spacing: -0.015em; }
.hero .lede { max-width: 620px; color: var(--ink-2); }
.hero .ctas { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.usecase h3 { font-family: var(--display); color: var(--brand-900); font-size: 17px; }
.usecase .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-100); display: grid; place-items: center;
  margin-bottom: 12px; color: var(--brand-700); font-weight: 800; font-family: var(--display); }
.note-card .meta { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.note-card h3 { font-family: var(--display); color: var(--brand-900); font-size: 18px; margin: 8px 0; line-height: 1.3; }
.band { background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; margin-top: 18px; }
.product { padding: 28px; display: flex; flex-direction: column; gap: 12px; border-top: 4px solid var(--brand-800); }
.product img { height: 46px; align-self: flex-start; }
.product ul { margin: 0; padding-left: 18px; color: var(--ink-2); display: grid; gap: 4px; }
.product .go { margin-top: auto; font-weight: 650; color: var(--brand-700); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; }
.stat { padding: 30px 20px; border-left: 1px solid var(--grid); }
.stat:first-child { border-left: 0; }
.stat .v { font-family: var(--display); font-size: 34px; font-weight: 800; color: var(--brand-800); letter-spacing: -0.02em; }
.stat .k { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.cta-band { background: var(--brand-800); color: #fff; border-radius: 18px; padding: 44px; display: flex;
  justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin: 0; }
.cta-band p { color: #e6d8ec; margin: 6px 0 0; }
details.faq { border-bottom: 1px solid var(--border); padding: 16px 0; }
details.faq summary { cursor: pointer; font-weight: 650; color: var(--brand-900); list-style: none; display: flex; justify-content: space-between; }
details.faq summary::after { content: "+"; color: var(--brand-600); font-size: 20px; line-height: 1; }
details.faq[open] summary::after { content: "–"; }
details.faq p { color: var(--ink-2); margin: 10px 0 0; max-width: 820px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.page-head { padding: 40px 0 8px; }
.page-head .eyebrow { margin-bottom: 8px; }

.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.demo { padding: 24px; border-color: var(--brand-200); box-shadow: 0 10px 30px rgba(59, 23, 72, .08); }
.demo-co { font-family: var(--display); font-weight: 700; color: var(--brand-900); margin-bottom: 12px; }
.demo-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 0;
  border-top: 1px solid var(--grid); }
.demo-row b { font-family: var(--display); font-size: 22px; color: var(--brand-800); font-variant-numeric: tabular-nums; }
.demo-row .when { color: var(--ink-2); font-size: 13px; }
.muted-row b { color: var(--muted); }
.tag { font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 999px; background: var(--brand-100); color: var(--brand-800); }
.tag-2 { background: var(--surface-2); color: var(--ink-2); }
