:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --bg-soft: #11161d;
  --bg-sunken: #0a0e13;
  --fg: #e6edf3;
  --fg-muted: #8b949e;
  --line: #21262d;
  --accent: #4c8dff;
  --accent-dark: #3b78e0;
  --good: #3fb950;
  --danger: #ff7b72;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 28px rgba(0, 0, 0, .45);
  --header-bg: rgba(11, 15, 20, .82);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.55;
}

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

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); letter-spacing: -.01em; }
p { margin: 0 0 1em; }

code, pre { font-family: var(--mono); font-size: .9em; }
pre {
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  overflow: auto;
}
code:not(pre code) {
  background: var(--bg-sunken);
  padding: .12em .4em;
  border-radius: 5px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 5vw, 3rem);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  z-index: 20;
}
.brand { font-weight: 800; font-size: 1.25rem; color: var(--fg); }
.brand span { color: var(--accent); }
.site-header nav { display: flex; align-items: center; gap: 1.1rem; }
.site-header nav a { color: var(--fg-muted); }
.site-header nav a:hover { color: var(--fg); }
.inline { display: inline; margin: 0; }
.linklike {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--fg-muted); font: inherit;
}
.linklike:hover { color: var(--fg); text-decoration: underline; }

.cta, button.primary, .btn-primary {
  background: var(--accent);
  color: #fff !important;
  padding: .5rem .9rem;
  border-radius: 8px;
  border: 0;
  font: inherit;
  cursor: pointer;
}
.cta:hover, .btn-primary:hover { background: var(--accent-dark); text-decoration: none; }
.btn {
  display: inline-block;
  padding: .5rem .9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
}
.btn:hover { background: var(--bg-soft); text-decoration: none; }
.range-btns { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.range-btns .btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

main { min-height: 60vh; }
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 2.5rem clamp(1rem, 5vw, 3rem);
  border-top: 1px solid var(--line);
  color: var(--fg-muted);
  font-size: .9rem;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 clamp(1rem, 5vw, 3rem); }
.narrow { max-width: 460px; }

/* Hero / marketing */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 3rem; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}
.hero-art { position: relative; }
.hero-art::before {
  content: "";
  position: absolute;
  inset: -12% -10% -12% -10%;
  background: radial-gradient(60% 60% at 60% 40%,
    color-mix(in srgb, var(--accent) 28%, transparent), transparent 70%);
  filter: blur(30px);
  z-index: 0;
  pointer-events: none;
}
.hero-art img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.hero .eyebrow {
  display: inline-block;
  background: var(--bg-sunken);
  color: var(--fg-muted);
  padding: .25rem .7rem;
  border-radius: 999px;
  font-size: .8rem;
  margin-bottom: 1rem;
}
.hero p.lead { font-size: 1.2rem; color: var(--fg-muted); max-width: 40ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.grid { display: grid; gap: 1.2rem; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem;
  background: var(--bg);
}
.feature { box-shadow: var(--shadow); }
.feature h3 { margin-bottom: .35rem; }
.feature p { color: var(--fg-muted); margin: 0; }

.section { padding: 3rem 0; }
.muted { color: var(--fg-muted); }

/* Forms */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .9rem; }
.field input {
  width: 100%;
  padding: .6rem .7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: var(--bg);
}
.field input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.help { color: var(--fg-muted); font-size: .85rem; }
.error { color: var(--danger); font-size: .9rem; margin-bottom: 1rem; }

/* Dashboard */
.dash {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  min-height: calc(100vh - 130px);
}
.dash-side {
  border-right: 1px solid var(--line);
  padding: 1.2rem;
  background: var(--bg-soft);
}
.dash-side ul { list-style: none; margin: 0; padding: 0; }
.dash-side li { margin: .15rem 0; }
.dash-side a { display: block; padding: .4rem .6rem; border-radius: 7px; color: var(--fg-muted); }
.dash-side a.active, .dash-side a:hover { background: var(--bg); color: var(--fg); text-decoration: none; }
.dash-main { padding: 1.4rem clamp(1rem, 3vw, 2rem); min-width: 0; }
.dash-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--bg);
}
.stat .label { color: var(--fg-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 1.8rem; font-weight: 700; margin-top: .25rem; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; margin-bottom: 1.2rem; background: var(--bg); }
.panel h3 { margin: 0 0 .8rem; font-size: 1rem; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.2rem; }

.bar-row { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: center; padding: .3rem 0; position: relative; }
.bar-row .bar {
  position: absolute; inset: 0 auto 0 0;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 5px; z-index: 0;
}
.bar-row > * { position: relative; z-index: 1; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .count { color: var(--fg-muted); font-variant-numeric: tabular-nums; }

.snippet {
  display: flex; gap: .5rem; align-items: flex-start;
}
.snippet pre { flex: 1; margin: 0; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--line); }
.table th { color: var(--fg-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }

.toast-host { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; z-index: 50; }
.toast { background: #161c24; color: var(--fg); border: 1px solid var(--line); padding: .6rem .9rem; border-radius: 8px; box-shadow: var(--shadow); }

.pill { display: inline-block; padding: .15rem .55rem; border-radius: 999px; background: var(--bg-sunken); font-size: .78rem; color: var(--fg-muted); }

.site-card { display: block; color: var(--fg); }
.site-card:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}
.site-metrics { display: flex; gap: 1.8rem; }
.site-metrics .label {
  display: block;
  color: var(--fg-muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.site-metrics strong { font-size: 1.35rem; }

.dash-head h1.dash-title { margin: 0; font-size: 1.8rem; }
.dash-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; }
.site-row { display: grid; gap: 1rem; margin-bottom: 1.2rem; color: var(--fg); text-decoration: none; }
.site-row:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  text-decoration: none;
}
.site-top { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: .8rem 1.6rem; }
.site-title { color: var(--fg); text-decoration: none; }
.site-title h3 { margin: 0; display: flex; flex-wrap: nowrap; align-items: baseline; gap: .5rem; font-size: 1.3rem; }
.site-code { color: var(--fg-muted); font-size: .8rem; font-weight: 500; }
.site-stats { display: flex; flex-wrap: nowrap; align-items: center; gap: 1.6rem; white-space: nowrap; }
.site-stat .label {
  display: block;
  color: var(--fg-muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.site-stat strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.site-chart { display: block; }
.chart-wrap { position: relative; }
.chart-tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  padding: .3rem .55rem;
  border-radius: 6px;
  background: #161c24;
  color: var(--fg);
  border: 1px solid var(--line);
  font-size: .78rem;
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.chart-tip[hidden] { display: none; }
.chart-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4c8dff;
  box-shadow: 0 0 0 5px rgba(76, 141, 255, .18);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}
.chart-dot.hover { background: #9b6bff; box-shadow: 0 0 0 5px rgba(155, 107, 255, .2); }
.chart-dot[hidden] { display: none; }

@media (max-width: 860px) {
  .hero { padding-top: 2.5rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 560px; }
}

@media (max-width: 760px) {
  .dash { grid-template-columns: 1fr; }
  .dash-side { border-right: 0; border-bottom: 1px solid var(--line); }
  .dash-side ul { display: flex; flex-wrap: wrap; gap: .3rem; }
  .dash-side a { padding: .35rem .6rem; }
}

/* ---------- Marketing redesign ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(3.5rem, 9vw, 7rem) 0 3.5rem; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(45% 55% at 12% 18%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(40% 50% at 88% 12%, color-mix(in srgb, #6ee7a0 9%, transparent), transparent 70%);
  pointer-events: none;
}
.hero-grid { position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .45rem;
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-sunken));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent);
  padding: .32rem .8rem; border-radius: 999px;
  font-size: .76rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.hero h1 { font-size: clamp(2.2rem, 5.2vw, 3.5rem); line-height: 1.07; }
.hero p.lead { font-size: 1.15rem; color: var(--fg-muted); max-width: 46ch; margin: 1.1rem 0 0; }
.trust-list {
  display: flex; flex-wrap: wrap; gap: .4rem 1.5rem;
  margin: 1.4rem 0 0; padding: 0; list-style: none;
  color: var(--fg-muted); font-size: .9rem;
}
.trust-list li::before { content: "✓ "; color: var(--good); font-weight: 800; }

.strip {
  padding: 1.15rem 0; text-align: center;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  color: var(--fg-muted); font-size: .92rem; letter-spacing: .01em;
}
.strip strong { color: var(--fg); }

.section-head { max-width: 640px; margin-bottom: 2.2rem; }
.section-head h2 { margin-bottom: .45rem; }
.section-head p { color: var(--fg-muted); margin: 0; font-size: 1.02rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; counter-reset: step; }
.step { position: relative; padding-left: 3.1rem; }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  width: 2.3rem; height: 2.3rem; display: grid; place-items: center;
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent); font-weight: 800; font-size: .95rem;
}
.step h3 { margin-bottom: .35rem; font-size: 1.02rem; }
.step p { color: var(--fg-muted); margin: 0; font-size: .93rem; }

.feature .ico {
  display: inline-flex; width: 2.3rem; height: 2.3rem; padding: .5rem;
  margin-bottom: .85rem; border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.feature .ico svg { width: 100%; height: 100%; }
.card.feature:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  transition: border-color .15s ease;
}

.ingest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.ingest-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .4rem; }
.ingest-head h3 { margin: 0; }
.card-sub { color: var(--fg-muted); margin: 0 0 1rem; font-size: .95rem; }
.badge {
  display: inline-block; flex: none;
  padding: .18rem .55rem; border-radius: 999px;
  font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.badge.pub { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.badge.auth { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.small { font-size: .85rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 1.2rem; }
.section-flush { padding-top: 0; }

.table-wrap { overflow-x: auto; }
.table.compare th:first-child, .table.compare td:first-child { padding-left: 0; }
.table.compare td.ok::before { content: "✓ "; color: var(--good); font-weight: 800; }
.table.compare td.no::before { content: "✕ "; color: var(--danger); font-weight: 800; }

.narrowish { max-width: 720px; margin: 0 auto; }
.faq details {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); padding: .95rem 1.15rem; margin-bottom: .85rem;
}
.faq summary { cursor: pointer; font-weight: 600; }
.faq summary:hover { color: var(--accent); }
.faq details p { margin: .65rem 0 0; color: var(--fg-muted); font-size: .95rem; }

.cta-band {
  position: relative; overflow: hidden; text-align: center;
  border: 1px solid var(--line); border-radius: 20px;
  padding: 3.5rem 2rem;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 13%, var(--bg)) 0%, var(--bg) 62%);
}
.cta-band::before {
  content: ""; position: absolute; inset: -40%;
  background: radial-gradient(45% 45% at 50% 0%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%);
  pointer-events: none;
}
.cta-band h2, .cta-band p { position: relative; }
.cta-band p { max-width: 46ch; margin: .5rem auto 0; }
.cta-band .hero-actions { justify-content: center; position: relative; }

/* ---------- Footer ---------- */
.site-footer {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 2rem; align-items: start;
  padding: 3rem clamp(1rem, 5vw, 3rem);
  border-top: 1px solid var(--line); color: var(--fg-muted); font-size: .9rem;
}
.footer-brand strong { display: block; color: var(--fg); font-size: 1.1rem; margin-bottom: .35rem; }
.footer-brand span { display: block; max-width: 34ch; }
.footer-col { display: grid; gap: .4rem; align-content: start; }
.footer-label {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--fg-muted); margin-bottom: .3rem;
}
.footer-col a { color: var(--fg-muted); }
.footer-col a:hover { color: var(--fg); }

/* ---------- Docs ---------- */
.page-head { max-width: 720px; margin-bottom: 1.2rem; }
.page-head p.lead { color: var(--fg-muted); font-size: 1.05rem; }
.doc-layout { display: grid; grid-template-columns: 230px 1fr; gap: 2.75rem; align-items: start; padding: 1.2rem 0 4rem; }
.doc-nav {
  position: sticky; top: 90px;
  display: grid; gap: .15rem; align-content: start;
  border-left: 1px solid var(--line); padding-left: 1rem;
}
.doc-nav a { color: var(--fg-muted); font-size: .92rem; padding: .32rem .55rem; border-radius: 6px; }
.doc-nav a:hover, .doc-nav a.is-active { color: var(--fg); background: var(--bg-soft); text-decoration: none; }
.doc-content { max-width: 780px; min-width: 0; }
.doc-content h2 {
  scroll-margin-top: 92px; margin-top: 2.6rem; padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}
.doc-content h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.doc-content h3 { scroll-margin-top: 92px; margin-top: 1.6rem; }
.doc-content p { color: var(--fg); }
.callout {
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); background: var(--bg-soft);
  padding: .9rem 1.1rem; margin: 1.2rem 0; color: var(--fg-muted);
}
.callout strong { color: var(--fg); }
.codehead {
  display: flex; justify-content: space-between; align-items: center;
  padding: .4rem .95rem; margin-top: .6rem;
  background: var(--bg-soft); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 8px 8px 0 0;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--fg-muted);
}
pre.code { border-radius: 0 0 8px 8px; margin: 0 0 1.3rem; }

/* ---------- Pricing ---------- */
.plans { display: grid; place-items: center; margin: 2.2rem 0 1.4rem; }
.plan-card { width: min(480px, 100%); padding: 2.2rem; }
.plan-price { font-size: 3.1rem; font-weight: 800; margin: .5rem 0 .3rem; letter-spacing: -.02em; }
.plan-price span { font-size: 1rem; color: var(--fg-muted); font-weight: 600; margin-left: .45rem; letter-spacing: 0; }
.plan-list { list-style: none; padding: 0; margin: 1.5rem 0 1.8rem; display: grid; gap: .65rem; }
.plan-list li::before { content: "✓"; color: var(--good); font-weight: 800; margin-right: .6rem; }
.plan-card .cta { display: block; width: 100%; text-align: center; }
.center-note { text-align: center; margin-top: 1.2rem; }

/* ---------- Legal pages ---------- */
.legal { max-width: 800px; }
.legal h2 { scroll-margin-top: 92px; margin-top: 2.2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: 1.25rem; }
.legal p { color: var(--fg-muted); }
.legal ul { padding-left: 1.25rem; color: var(--fg-muted); }
.legal-meta { color: var(--fg-muted); font-size: .9rem; margin-bottom: 2rem; }

@media (max-width: 900px) {
  .doc-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .doc-nav { position: static; display: flex; flex-wrap: wrap; gap: .3rem; border-left: 0; padding-left: 0; }
  .ingest-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .site-footer { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .site-footer { grid-template-columns: 1fr; }
}
