:root {
  color-scheme: dark;
  --bg: #0c1013;
  --surface: #11171b;
  --line: #252d33;
  --line-strong: #2a343b;
  --text: #e4e9eb;
  --muted: #7e8b95;
  --dim: #8a99a4;
  --green: #51d3a5;
  --green-light: #7ce1bc;
  --red: #f47f87;
  --blue: #5b9bd5;
  --blue-hover: #7fb8e8;
  --gold: #edb86a;
  --gold-bright: #f0b955;
  --gold-dim: #c2a56d;
  --hover-bg: #242e34;
  --hover-text: #f4f6f7;
  --active-bg: #273831;
  --active-text: #7ce1bc;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --maxw: 1200px;
  --section-gap: 80px;
  --radius-card: 15px;
  --radius-pill: 6px;
  --bloom: radial-gradient(ellipse 70% 55% at 50% 0%, rgba(237, 184, 106, 0.10), rgba(81, 211, 165, 0.05) 55%, transparent 75%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); }
/* links inside body copy get a quiet underline; pills and icon buttons stay clean */
main a:not(.pill):not(.tip-btn) {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 55%, transparent);
}
main a:not(.pill):not(.tip-btn):hover { text-decoration-color: currentColor; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--green); color: #0c1013; font-weight: 600;
  padding: 10px 18px; border-radius: var(--radius-pill);
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- header ---------- */
.site-header {
  position: relative; z-index: 10;
  display: flex; align-items: center; gap: 32px;
  position: sticky; top: 0; z-index: 50;
  max-width: none; margin: 0 auto;
  padding: 20px max(24px, calc((100% - var(--maxw)) / 2 + 24px));
  border-bottom: 1px solid transparent;
  transition: background-color .25s ease, border-color .25s ease, padding .25s ease;
}
.site-header.scrolled {
  padding-block: 12px;
  background: rgba(12, 16, 19, .82);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
.brand { display: flex; align-items: center; font-weight: 700; font-size: 18px; letter-spacing: -0.4px; color: var(--text); }
.brand .brand-dim { font-weight: 400; color: #b5bfc5; }
.brand:hover { color: var(--active-text); }
.brand-mark {
  width: 28px; height: 28px; display: grid; place-items: center;
  background: #f0b955; color: #0c1013; border-radius: 5px;
  font-size: 15px; font-weight: 700; margin-right: 10px;
}
.site-nav { display: flex; gap: 24px; margin-left: auto; }
.site-nav a { color: var(--dim); font-size: 14px; padding: 10px 6px; border-radius: 5px; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); border-bottom: 2px solid var(--green); }
.site-nav a[aria-current="page"]:hover { color: var(--hover-text); }

/* ---------- buttons ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 12px 24px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong); border-bottom-width: 2px;
  font-size: 15px; font-weight: 600; letter-spacing: -0.1px;
  cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}
.pill.primary { background: transparent; color: var(--text); border-color: var(--gold-dim); }
.pill.primary:hover { color: var(--gold-bright); border-bottom-color: var(--gold); background: rgba(237,184,106,.08); box-shadow: 0 6px 18px rgba(237,184,106,.25); transform: translateY(-1px); }
.pill.ghost {
  background: transparent; color: var(--dim);
}
.pill.ghost:hover { color: var(--hover-text); border-bottom-color: var(--green); transform: translateY(-1px) scale(1.04); }
.pill.primary:active, .pill.ghost:active { transform: translateY(0) scale(.97); }
.pill:focus-visible { outline: 2px solid var(--green-light); outline-offset: 2px; }
.pill.small { min-height: 44px; padding: 8px 18px; font-size: 14px; }

/* ---------- hero ---------- */
body::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 620px; z-index: -1;
  background: var(--bloom);
  pointer-events: none;
}
.hero {
  position: relative;
  padding: 28px 0 8px;
  text-align: center;
}
.hero h1 {
  margin: 0 auto; max-width: 40ch;
  font-size: clamp(26px, 3.4vw, 44px);
  font-weight: 700; line-height: 1.1; letter-spacing: -0.026em;
}
.hero h1 .hl { color: var(--gold); }

/* ---------- demo frame ---------- */
.demo-frame {
  position: relative;
  border: 1px solid var(--line); border-radius: var(--radius-card);
  background: var(--surface); overflow: hidden;
}
.demo-frame canvas { display: block; width: 100%; height: 100%; }
.demo-video, .demo-img { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--bg); }
.demo-video { cursor: pointer; }
.demo-cap {
  padding: 10px 16px; border-top: 1px solid var(--line);
  color: var(--dim); font-size: 13px; text-align: left;
}

/* ---------- sections ---------- */
section.block { padding: 40px 0 0; scroll-margin-top: 24px; }
section.block.stats-block { padding-top: 20px; }
#main { scroll-margin-top: 0; }
.details-panel { scroll-margin-top: 24px; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.eyebrow {
  display: block; margin-bottom: 12px;
  color: var(--dim); font-size: 12px; font-weight: 600;
  letter-spacing: 1.6px; text-transform: uppercase;
}
.section-head h2 { margin: 0; font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.section-head h2.shaded { color: var(--dim); font-weight: 600; }
.section-head h2.feat-h { font-size: clamp(18px, 2.4vw, 26px); }
.section-head p { margin: 14px 0 0; color: var(--muted); font-size: 17px; }

/* ---------- stat strip ---------- */
.stats {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius-card); overflow: hidden;
}
.stat { background: var(--surface); padding: 18px 12px; text-align: center; }
.stat b { display: block; font-size: clamp(21px, 2.4vw, 29px); font-weight: 700; letter-spacing: -0.02em; color: var(--gold-bright); font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.4; }

/* ---------- tabs ---------- */
.tablist {
  display: flex; flex-wrap: wrap; gap: 4px 18px;
  border-bottom: 1px solid var(--line); padding-bottom: 16px;
}
.tablist [role="tab"] {
  min-height: 44px; padding: 10px 6px;
  border-radius: 5px; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--dim);
  font-size: 14px; cursor: pointer;
}
.tablist [role="tab"]:hover { background: transparent; color: var(--hover-text); }
.tablist [role="tab"][aria-selected="true"] {
  background: none; color: var(--text); border-bottom-color: var(--green);
}
.tablist [role="tab"][aria-selected="true"]:hover,
.details-tabs [role="tab"][aria-selected="true"]:hover { color: var(--hover-text); }
.tablist [role="tab"][aria-selected="true"]::after { content: none; }
.tablist [role="tab"]:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.tablist [role="tab"]:active { color: var(--active-text); }
.details-tabs [role="tab"]:active { color: var(--active-text); }

.tabpanel { padding-top: 40px; }
.tabpanel[hidden] { display: none; }
.panel-grid {
  display: grid; grid-template-columns: minmax(280px, 4fr) minmax(0, 7fr);
  gap: 40px; align-items: start;
}
.panel-copy h3 { margin: 0 0 14px; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.panel-copy p { margin: 0 0 14px; color: var(--muted); }
.panel-copy .not {
  margin-top: 20px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 10px;
  color: var(--dim); font-size: 14px;
}
.panel-copy .not b { color: var(--text); font-weight: 600; }
.panel-demo .demo-frame { aspect-ratio: 16 / 9; }

/* ---------- sources table ---------- */
.sources { width: 100%; border-collapse: collapse; font-size: 13px; }
.sources th, .sources td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: center; }
.sources th { color: var(--dim); font-size: 12px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; background: var(--surface); }
.sources th:first-child, .sources td:first-child { text-align: left; white-space: nowrap; }
.sources td { color: #c3ccd2; }
.sources td small { display: block; color: var(--dim); font-size: 11px; }
.sources tbody tr:last-child td { border-bottom: 0; }
.sources .yes { color: var(--green-light); }
.sources .no { color: var(--dim); }

/* ---------- roadmap ---------- */
.roadmap { display: flex; flex-direction: column; gap: 0; }
.road-row {
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: baseline;
  padding: 20px 0; border-top: 1px solid var(--line);
}
.road-row:first-child { border-top: 0; }
.road-row h3 { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.road-row p { margin: 0; color: var(--muted); font-size: 14px; max-width: 70ch; }
.road-row .state { font-size: 13px; color: var(--dim); border: 1px solid var(--line-strong); border-radius: var(--radius-pill); padding: 4px 12px; white-space: nowrap; }
.road-row .state.wip { color: var(--green-light); border-color: #7ce1bc55; }
.road-ops { margin-top: 24px; color: var(--dim); font-size: 14px; }

/* ---------- about ---------- */
.about { max-width: 72ch; color: var(--muted); font-size: 16px; line-height: 1.6; }
.about a { color: var(--text); }

/* ---------- support ---------- */
.support { text-align: center; }
.support p { max-width: 60ch; margin: 0 auto 28px; color: var(--muted); }
.support .actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.tip-rows { margin: 10px auto 20px; }
.tip-btns { display: flex; align-items: center; justify-content: center; gap: 24px; flex-wrap: wrap; }
.tip-btn { display: inline-flex; align-items: center; transition: transform .12s ease; }
.tip-btn:hover { transform: translateY(-1px) scale(1.04); }
.tip-btn:active { transform: scale(.97); }
.tip-btn img { display: block; height: 52px; width: auto; }
.tip-panel { margin-top: 14px; display: flex; justify-content: center; }
.tip-panel[hidden] { display: none; }
.tip-panel iframe { display: block; width: min(420px, 100%); height: 640px; border: 0; border-radius: 10px; }
.support .tip-facts { margin-bottom: 14px; }
.details-panel blockquote {
  margin: 22px 0; padding: 4px 18px; max-width: 72ch;
  border-left: 3px solid var(--gold);
  color: var(--text); font-style: italic;
}
.details-panel ul { max-width: 72ch; padding-left: 1.4em; margin: 0 0 14px; }
.support .tip-contact { font-size: 13px; color: var(--dim); margin-top: 26px; }
.support .support-lead { color: var(--text); font-size: 16px; }


/* ---------- footer ---------- */
.site-footer {
  margin-top: var(--section-gap);
  border-top: 1px solid var(--line);
  padding: 32px 24px 36px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  color: var(--dim); font-size: 10.5px; text-align: center;
}
.foot-legal { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; }
.foot-legal a { color: var(--dim); padding: 3px 4px; }
.foot-legal a:hover { color: var(--text); }
.foot-copy { color: var(--dim); }
.foot-copy a, .foot-note a { color: var(--dim); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 55%, transparent); }
.foot-copy a:hover, .foot-note a:hover { color: var(--text); text-decoration-color: currentColor; }

/* ---------- details page ---------- */
.details-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; padding: 48px 0 0; align-items: start; }
/* Grid tracks are minmax(auto,1fr) by default: a wide table inside a
   .table-scroll would stretch the column instead of scrolling, blowing the
   whole page out past the viewport on phones. */
.details-layout > * { min-width: 0; }
.details-tabs {
  position: sticky; top: 24px;
  display: flex; flex-direction: column; gap: 4px;
}
.details-tabs [role="tab"] {
  text-align: left; min-height: 44px; padding: 12px 16px;
  border: 0; border-bottom: 2px solid transparent; border-radius: 5px;
  background: transparent; color: var(--dim); font-size: 15px; cursor: pointer;
}
.details-tabs [role="tab"]:hover { background: transparent; color: var(--hover-text); }
.details-tabs [role="tab"][aria-selected="true"] {
  background: none; border-bottom-color: var(--green);
  color: var(--text); font-weight: 600;
}
.details-link {
  display: block; text-align: left; min-height: 44px; padding: 12px 16px;
  margin-top: 8px; border-top: 1px solid var(--line); border-radius: 5px;
  color: var(--gold-dim); font-size: 15px; text-decoration: none;
}
.details-link:hover { color: var(--gold-bright); text-decoration: none; }
.details-panel h2 { margin: 0 0 20px; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.details-panel h3 { margin: 32px 0 12px; font-size: 19px; font-weight: 600; }
.details-panel p, .details-panel li { color: var(--muted); max-width: 72ch; }
.details-panel p { margin: 0 0 14px; }
.details-panel table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  display: table;
}
.details-panel th, .details-panel td {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.details-panel th { color: var(--dim); font-size: 12px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; background: var(--surface); }
.details-panel td { color: #c3ccd2; }
.details-panel tr:last-child td { border-bottom: 0; }
.details-panel code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; color: #d5dde2; }
.table-scroll {
  overflow-x: auto; border-radius: 10px;
  background:
    linear-gradient(to right, var(--bg) 40%, transparent) local,
    linear-gradient(to left, var(--bg) 40%, transparent) local,
    linear-gradient(to right, rgba(0,0,0,.4), transparent 26%) scroll,
    linear-gradient(to left, rgba(0,0,0,.4), transparent 26%) scroll;
  background-color: var(--bg);
}
.table-scroll:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.metric {
  border: 1px solid var(--line); border-radius: var(--radius-card);
  background: var(--surface); padding: 22px 24px; margin-bottom: 16px;
}
.metric h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.metric .formula {
  margin: 10px 0; padding: 10px 14px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px; color: #d5dde2;
}
.metric .not { color: var(--dim); font-size: 14px; margin-top: 10px; }
.metric .not b { color: var(--text); }
.metric .metric-media { margin: 12px 0 4px; max-width: min(100%, 560px); }
.metric .metric-media .demo-video, .metric .metric-media .demo-img { aspect-ratio: 16 / 9; }
.chip {
  display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; border: 1px solid var(--line-strong); color: var(--dim);
}
.chip.buy { color: var(--green-light); border-color: #2c4a3e; }
.chip.sell { color: var(--red); border-color: #4a2c30; }
.chip.mid { color: var(--gold-bright); border-color: #4a4028; }
.chip.gray { color: var(--dim); border-color: var(--line-strong); }

/* ---------- responsive ---------- */
.muted { color: var(--muted); font-size: 14px; }

/* Install page */
.install-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 4px 0 28px; }
.install-cta .muted { max-width: 52ch; margin: 0; }
.install-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.install-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.install-card h3 { margin: 0 0 12px; font-size: 17px; }
.install-card ol { margin: 0 0 12px; padding-left: 20px; }
.install-card li { margin-bottom: 6px; }
.install-card .muted { font-size: 13px; margin: 0; }
.install-card code { color: var(--dim); }

/* Report form + stats page */
.report-form { max-width: 560px; display: flex; flex-direction: column; gap: 14px; }
.report-row { display: flex; flex-direction: column; gap: 6px; }
.report-label { color: var(--dim); font-size: 12px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; display: flex; justify-content: space-between; }
.report-label small { text-transform: none; letter-spacing: 0; color: var(--muted); }
.report-form select, .report-form textarea {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  font: inherit; font-size: 14px; padding: 10px 12px;
}
.report-form textarea { resize: vertical; min-height: 110px; }
.report-form select { width: 220px; }
.report-form select:focus-visible, .report-form textarea:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.report-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.report-actions { display: flex; align-items: center; gap: 14px; }
.report-status { color: var(--muted); font-size: 14px; }
#usage-cards { margin-bottom: 40px; }
#usage-cards { grid-template-columns: repeat(4, 1fr); }
#usage-cards .stat b { font-variant-numeric: tabular-nums; }

/* Page-requests chart */
.usage-chart { margin: 4px 0 8px; }
.usage-chart svg { display: block; width: 100%; height: auto; }
.usage-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 18px; font-size: 12px; color: var(--muted); }
.usage-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }

@media (max-width: 800px) {
  .site-header { gap: 14px; padding-block: 14px; }
  .brand { font-size: 15px; }
  .brand-mark { width: 24px; height: 24px; font-size: 13px; margin-right: 7px; }
  .site-nav { gap: 12px; }
  .site-nav a { font-size: 13px; padding: 8px 4px; }
  .pill.small { min-height: 36px; padding: 6px 14px; font-size: 13px; }
  .hero { padding: 24px 0 8px; }
  .stats, #usage-cards { grid-template-columns: repeat(2, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
  .panel-demo .demo-frame { aspect-ratio: 4 / 3; }
  .tablist { flex-wrap: wrap; }
  .details-layout { grid-template-columns: minmax(0, 1fr); }
  .details-tabs { position: static; flex-direction: row; flex-wrap: wrap; }
  .details-tabs [role="tab"] { text-align: left; min-height: 0; padding: 8px 12px; }
  .sources th, .sources td { padding: 8px 7px; }
  .panel-demo .demo-frame:has(.demo-video), .panel-demo .demo-frame:has(.demo-img) { aspect-ratio: 16 / 9; }
  .road-row { grid-template-columns: 1fr; gap: 6px; }
  .road-row .state { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 14px; }
  .sources { font-size: 11.5px; }
  .sources th { font-size: 10px; letter-spacing: 0.2px; }
  .sources th, .sources td { padding: 7px 2px; }
  .sources td:first-child { font-size: 10.5px; }
  .sources td small { font-size: 9.5px; }
}

@media (max-width: 480px) {
  .site-header { gap: 8px; padding-inline: 12px; }
  .brand { font-size: 13px; letter-spacing: -0.2px; }
  .brand-mark { width: 22px; height: 22px; font-size: 12px; margin-right: 5px; }
  .site-nav { gap: 8px; }
  .site-nav a { font-size: 12px; padding: 6px 3px; }
  .pill.small { min-height: 32px; padding: 4px 10px; font-size: 12px; }
}

@media (max-width: 360px) {
  .site-header { gap: 6px; padding-inline: 8px; }
  .brand { font-size: 12px; }
  .brand-mark { width: 20px; height: 20px; font-size: 11px; margin-right: 4px; }
  .site-nav a { font-size: 11px; padding: 5px 2px; }
  .pill.small { min-height: 30px; padding: 3px 8px; font-size: 11px; }
}
