/* tokenscope — landing page
   Visual identity is the product's own thesis: two proportions you must read
   together. TOKEN = cool cyan, COST = warm amber. Everything else is quiet
   around that one pairing. Self-contained: no CDN, no web fonts, hand-written
   SVG — same rule the tool itself lives by. */

/* ---------- tokens: dark is the default (developer surface) ---------- */
:root {
  --bg:        #0a0d13;
  --bg-grid:   #0d111a;
  --panel:     #10151e;
  --panel-2:   #151b27;
  --border:    #212836;
  --border-2:  #2f3a4d;
  --fg:        #e8ebf2;
  --fg-strong: #ffffff;
  --muted:     #9aa3b7;
  --faint:     #6b7589;

  --cool:      #5cc8f5;   /* TOKEN */
  --cool-ink:  #bfe8fb;
  --warm:      #ffb454;   /* COST */
  --warm-ink:  #ffd9a3;
  --ok:        #4bd6a0;
  --danger:    #ff6f6f;

  --accent:    var(--cool);
  --shadow:    0 1px 0 rgba(255,255,255,.02), 0 20px 50px -30px rgba(0,0,0,.8);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui,
          Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", "Cascadia Code", Menlo,
          Consolas, "Liberation Mono", "PingFang SC", monospace;

  --wrap: 1120px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg:        #ffffff;
  --bg-grid:   #f7f9fc;
  --panel:     #ffffff;
  --panel-2:   #f4f7fb;
  --border:    #e4e9f1;
  --border-2:  #cfd7e3;
  --fg:        #131a27;
  --fg-strong: #0a0f18;
  --muted:     #55607a;
  --faint:     #8993a8;

  --cool:      #0b8ecb;
  --cool-ink:  #075d86;
  --warm:      #b8710a;
  --warm-ink:  #7d4c00;
  --ok:        #0f9d63;
  --danger:    #d23b3b;

  --shadow:    0 1px 2px rgba(16,24,40,.04), 0 24px 48px -32px rgba(16,24,40,.22);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* faint instrument grid in the background — a scope's graticule */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 100% 64px,
    linear-gradient(90deg, var(--border) 1px, transparent 1px) 0 0 / 64px 100%,
    var(--bg-grid);
  opacity: .35;
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 62%);
          mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 62%);
}

a { color: var(--cool); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 22px; }

/* ---------- typography ---------- */
h1, h2, h3 { color: var(--fg-strong); text-wrap: balance; letter-spacing: -.02em; margin: 0; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); line-height: 1.04; font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); line-height: 1.1; font-weight: 750; }
h3 { font-size: 1.14rem; font-weight: 700; letter-spacing: -.01em; }
p  { margin: 0; }
.mono { font-family: var(--mono); }

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0;
}

.lead { color: var(--muted); font-size: clamp(1.02rem, 1.6vw, 1.2rem); max-width: 60ch; }

.tok { color: var(--cool); font-weight: 600; }
.cost { color: var(--warm); font-weight: 600; }

/* ---------- announcement bar ---------- */
.topbar { background: color-mix(in srgb, var(--cool) 15%, var(--bg)); border-bottom: 1px solid var(--border); }
.topbar-in { display: flex; gap: 8px 14px; align-items: center; justify-content: center; flex-wrap: wrap;
             padding-block: 9px; text-align: center; font-size: .85rem; }
.topbar span { color: var(--fg); }
.topbar a { font-weight: 700; white-space: nowrap; }

/* ---------- logo ---------- */
.brand-logo { display: block; border-radius: 7px; flex: none; }

/* ---------- nav ---------- */
header.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(1.4) blur(12px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-in { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em;
         color: var(--fg-strong); font-size: 1.06rem; }
.brand svg { display: block; }
.nav-links { display: flex; gap: 22px; margin-left: 8px; }
.nav-links a { color: var(--muted); font-size: .92rem; font-weight: 500; }
.nav-links a:hover { color: var(--fg); text-decoration: none; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  line-height: 1;
  transition: color .15s, border-color .15s, background .15s;
}
.icon-btn:hover { color: var(--fg); border-color: var(--cool); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 650; font-size: .95rem;
  padding: 12px 20px; border-radius: 11px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, box-shadow .2s, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--cool) 88%, #fff 12%), var(--cool));
  color: #04212e;
  box-shadow: 0 8px 22px -10px color-mix(in srgb, var(--cool) 70%, transparent);
}
.btn-ghost { background: var(--panel); color: var(--fg); border-color: var(--border-2); }
.btn-ghost:hover { border-color: var(--cool); }
.nav-cta { padding: 8px 15px; font-size: .86rem; border-radius: 9px; }
.email-btn { font-family: var(--mono); font-size: clamp(.9rem, 2.4vw, 1.12rem); margin-top: 6px; word-break: break-word; }
.trial-band { text-align: center; }
.trial-band .eyebrow { color: var(--warm); }
.email-btn.copied { background: var(--ok); color: #04231a; }
.trial-hint { margin-top: 12px; color: var(--faint); font-size: .84rem; }
.trial-sub { margin-top: 12px; color: var(--muted); font-family: var(--mono); font-size: .82rem; }
.js-email { cursor: pointer; }

/* ---------- sections ---------- */
section { padding-block: clamp(56px, 8vw, 104px); }
.section-head { max-width: 64ch; margin-bottom: 40px; }
.section-head h2 { margin-top: 10px; }
.section-head p { margin-top: 14px; }

/* ---------- hero ---------- */
.hero { padding-top: clamp(48px, 7vw, 84px); padding-bottom: clamp(40px, 6vw, 72px); }
.hero-grid { display: grid; grid-template-columns: 1.04fr .96fr; gap: clamp(28px, 4vw, 56px); align-items: center; }
.hero h1 { margin-top: 16px; }
.hero .lead { margin-top: 20px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 26px; }
.hero-meta span { font-family: var(--mono); font-size: .78rem; color: var(--faint); display: inline-flex; align-items: center; gap: 7px; }
.hero-meta span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cool); box-shadow: 0 0 8px var(--cool); }

/* readout panel (the hero instrument) */
.readout {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border-2);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.readout-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.readout-top .k { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.readout-top .v { font-family: var(--mono); font-size: .8rem; color: var(--muted); }

.stackbar { display: flex; height: 30px; border-radius: 7px; overflow: hidden; border: 1px solid var(--border); background: var(--bg); }
.stackbar > span { display: block; height: 100%; width: 0; transition: width 1.1s cubic-bezier(.2,.7,.2,1); }
.stackbar.animate > span { width: var(--w); }
.legend-inline { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-family: var(--mono); font-size: .74rem; color: var(--muted); }
.legend-inline i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

.readout-table { width: 100%; border-collapse: collapse; margin-top: 18px; font-family: var(--mono); font-size: .78rem; }
.readout-table th { text-align: right; color: var(--faint); font-weight: 500; padding: 5px 6px; border-bottom: 1px solid var(--border); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.readout-table th:first-child { text-align: left; }
.readout-table td { padding: 6px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.readout-table td:first-child { text-align: left; color: var(--fg); }
.readout-table tr:last-child td { border-bottom: none; }
.readout-table .em { color: var(--warm); }
.readout-table .num-tok { color: var(--cool-ink); }
.readout-caption { font-size: .74rem; color: var(--faint); margin-top: 12px; font-family: var(--mono); }

/* ---------- findings (the three) ---------- */
.findings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.card .num { font-family: var(--mono); font-size: .72rem; color: var(--faint); letter-spacing: .12em; }
.card h3 { margin: 12px 0 8px; }
.card p { color: var(--muted); font-size: .95rem; }
.card .big { font-family: var(--mono); font-weight: 800; letter-spacing: -.02em;
             font-size: clamp(1.5rem, 3vw, 2rem); color: var(--fg-strong); margin: 4px 0 2px; }
.card .big small { font-size: .5em; color: var(--faint); font-weight: 500; }
.card-accent-top { height: 3px; border-radius: 3px; margin-bottom: 18px; }
.punch {
  margin-top: 22px; padding: 20px 22px; border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--warm) 32%, var(--border));
  background: color-mix(in srgb, var(--warm) 8%, var(--panel));
}
.punch b { color: var(--warm-ink); }

/* ---------- proxy explainer ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 48px); align-items: center; }
.pipe {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 22px;
  font-family: var(--mono); font-size: .82rem;
}
.pipe-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.pipe-node { flex: 1; text-align: center; padding: 12px 8px; border-radius: 10px; border: 1px dashed var(--border-2); color: var(--muted); }
.pipe-node.scope { border-style: solid; border-color: var(--cool); color: var(--cool-ink);
                   background: color-mix(in srgb, var(--cool) 10%, transparent); font-weight: 700; }
.pipe-arrow { color: var(--faint); }
.pipe-note { font-size: .74rem; color: var(--faint); margin-top: 10px; line-height: 1.7; }
.checklist { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.checklist li { display: flex; gap: 12px; color: var(--muted); font-size: .96rem; }
.checklist svg { flex: none; margin-top: 3px; }
.checklist b { color: var(--fg); font-weight: 650; }

/* ---------- comparison table ---------- */
.cmp-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
table.cmp { width: 100%; border-collapse: collapse; min-width: 640px; }
table.cmp th, table.cmp td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
table.cmp thead th { font-size: .82rem; letter-spacing: .02em; color: var(--muted); background: var(--panel-2); position: sticky; top: 0; }
table.cmp thead th.us { color: var(--cool-ink); }
table.cmp thead th.us .tag { display: block; font-family: var(--mono); font-size: .66rem; color: var(--faint); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; margin-top: 2px; }
table.cmp tbody td { font-size: .92rem; }
table.cmp td.dim { color: var(--faint); }
table.cmp td.dim { width: 30%; font-weight: 600; color: var(--fg); }
table.cmp td.them { color: var(--muted); width: 35%; }
table.cmp td.us { color: var(--fg); width: 35%; background: color-mix(in srgb, var(--cool) 5%, transparent); }
table.cmp tr:last-child td { border-bottom: none; }
.mark { font-family: var(--mono); font-weight: 700; }
.mark.no { color: var(--danger); }
.mark.yes { color: var(--ok); }
.fair-note { margin-top: 18px; color: var(--muted); font-size: .92rem; font-style: italic; max-width: 70ch; }
.fair-note b { color: var(--fg); font-style: normal; }

/* ---------- features grid ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feat { background: var(--panel); border: 1px solid var(--border); border-radius: 13px; padding: 22px; }
.feat .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
            background: color-mix(in srgb, var(--cool) 12%, transparent);
            border: 1px solid color-mix(in srgb, var(--cool) 30%, var(--border)); margin-bottom: 14px; }
.feat h3 { font-size: 1.02rem; }
.feat p { color: var(--muted); font-size: .9rem; margin-top: 7px; }

/* ---------- quickstart ---------- */
.terminal {
  background: #06090e; border: 1px solid var(--border-2); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow);
}
:root[data-theme="light"] .terminal { background: #0b0f16; }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid #1a1f2b; }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2a3240; }
.term-bar .t { margin-left: 10px; font-family: var(--mono); font-size: .74rem; color: #6b7589; }
.term-body { padding: 20px 20px 24px; font-family: var(--mono); font-size: .86rem; line-height: 1.85;
             color: #cdd6e4; overflow-x: auto; white-space: pre-wrap; word-break: break-word; tab-size: 2; }
.term-body .c { color: #5b6675; }             /* comment */
.term-body .p { color: #4bd6a0; }             /* prompt $ */
.term-body .cmd { color: #e8ebf2; }
.term-body .fl { color: var(--warm); }        /* flags */
.term-body .out { color: #7d8798; }
.qs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 10px; }
.qs-note { color: var(--muted); font-size: .92rem; margin-top: 16px; }
.qs-note code { font-family: var(--mono); background: var(--panel-2); border: 1px solid var(--border);
                padding: 1px 6px; border-radius: 5px; font-size: .85em; color: var(--cool-ink); }

/* ---------- guide / cta band ---------- */
.band { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--border-2);
        border-radius: 18px; padding: clamp(28px, 4vw, 46px); text-align: center; }
.band h2 { margin-bottom: 12px; }
.band .lead { margin: 0 auto 24px; }
.band-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--border); padding-block: 40px; color: var(--muted); }
.foot-in { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.foot-links { display: flex; flex-wrap: wrap; gap: 20px; font-size: .9rem; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--fg); }
.foot-note { width: 100%; font-size: .8rem; color: var(--faint); margin-top: 10px; line-height: 1.7; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .stackbar > span { transition: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .split, .qs-grid { grid-template-columns: 1fr; }
  .findings, .features { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 620px) {
  .findings, .features { grid-template-columns: 1fr; }
  body { font-size: 15px; }
  .hero-cta .btn { flex: 1 1 auto; justify-content: center; }
  .nav-cta { display: none; }
}

:focus-visible { outline: 2px solid var(--cool); outline-offset: 2px; border-radius: 4px; }
