:root {
  color-scheme: dark;
  --bg: #05070c;
  --panel: #0c121a;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f7f8fb;
  --muted: rgba(255, 255, 255, 0.62);
  --faint: rgba(255, 255, 255, 0.42);
  --blue: #7eb0ff;
  --green: #7eb0ff;
  --red: #e68189;
  --max: 1200px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}
button, a, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 12, 0.78);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.bar, .docs-top {
  height: 64px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.docs-top { max-width: none; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand span { display: grid; line-height: 1.1; }
.brand b { font-weight: 550; letter-spacing: -0.03em; }
.brand small { color: var(--faint); font-size: 11px; font-weight: 400; }
.brand-mark { height: 26px; width: auto; display: block; }
.topbar nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; }
.topbar nav button, .topbar nav a {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
  transition: color .2s ease, background .2s ease;
}
.topbar nav button:hover, .topbar nav a:hover, .topbar nav button.active { color: #fff; background: rgba(255,255,255,.04); }
.account {
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #05070c;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
}
.lang-switch {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  margin-left: 4px;
}
.lang-switch button {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.4);
  font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
  padding: 6px 8px;
  cursor: pointer;
}
.lang-switch button:hover { color: #fff; }
.lang-switch button.active { color: #fff; }

main { max-width: var(--max); margin: 0 auto; }
.page { display: none; padding: 0 24px 96px; }
.page.active { display: block; }

.eyebrow {
  margin: 0 0 18px;
  color: var(--blue);
  font: 12px/1.4 ui-monospace, SFMono-Regular, monospace;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.stage {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 88vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5,7,12,.25), rgba(5,7,12,.72) 62%, #05070c);
}
.halftone {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: flex-end;
  padding: 0 0 80px;
}
.orb {
  position: absolute;
  left: -80px;
  top: 90px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(37, 99, 235, .2);
  filter: blur(100px);
  animation: drift 14s ease-in-out infinite;
}
.topbar, main, .site-foot { position: relative; z-index: 1; }
@keyframes drift {
  50% { transform: translate3d(18px, -16px, 0) scale(1.06); }
}
.hero-copy { position: relative; z-index: 1; max-width: 820px; }
.hero h1, .block h2, .section-title h2, .docs-hero h1 {
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.05;
  margin: 0;
}
.hero h1 { font-size: clamp(48px, 6vw, 76px); max-width: 14ch; }
.lead, .prose, .section-title p:not(.eyebrow), .docs-hero p {
  max-width: 36rem;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}
.lead { margin: 28px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.primary, .secondary {
  min-height: 46px;
  padding: 0 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 14px;
  transition: transform .45s cubic-bezier(.16,1,.3,1), filter .2s ease, border-color .2s ease, background .2s ease;
}
.primary {
  border: 1px solid rgba(126, 176, 255, 0.7);
  color: #fff;
  background: #0c1422;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.secondary { border: 1px solid rgba(255,255,255,.2); background: transparent; color: rgba(255,255,255,.82); }
.primary:hover, .secondary:hover, .account:hover { transform: translateY(-2px); filter: brightness(1.1); }

.block { padding: 96px 0 8px; }
.block h2, .section-title h2 { font-size: clamp(36px, 4.5vw, 60px); max-width: 16ch; margin-bottom: 18px; }
.pipeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 36px;
}
.pipeline article {
  min-height: 280px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.03);
  transition: transform .45s cubic-bezier(.16,1,.3,1), border-color .2s ease;
}
.pipeline article:hover { transform: translateY(-6px); border-color: rgba(126,176,255,.45); }
.pipeline article > span { float: right; font: 13px ui-monospace, monospace; color: var(--faint); }
.pipeline article > p { margin: 0; color: var(--blue); font: 11px ui-monospace, monospace; letter-spacing: .16em; }
.pipeline h3 { margin: 72px 0 16px; font-size: 28px; font-weight: 500; letter-spacing: -.03em; }
.pipeline ul { list-style: none; margin: 0; padding: 0; color: var(--muted); }
.pipeline li { padding: 6px 0; }
.pipeline li:before { content: ""; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: end; padding-top: 120px; }
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows li { display: flex; justify-content: space-between; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); font-size: 18px; }
.rows span { color: var(--faint); font-size: 14px; }
.close { padding: 120px 0 20px; }

.section-title { padding-top: 72px; max-width: 760px; }
.page-head { margin-bottom: 28px; }
.streams { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.streams article { padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.03); transition: transform .45s cubic-bezier(.16,1,.3,1), border-color .2s ease; }
.streams article:hover { transform: translateY(-6px); border-color: rgba(126,176,255,.45); }
.streams small { color: var(--blue); font: 11px ui-monospace, monospace; letter-spacing: .16em; }
.streams strong { display: block; margin: 18px 0 8px; font-size: 28px; font-weight: 500; }
.streams p { color: var(--muted); margin: 0; }
.status-table { margin-top: 28px; border-top: 1px solid var(--line); font: 13px ui-monospace, monospace; }
.status-table > div { display: grid; grid-template-columns: 2fr 1.2fr 1fr .8fr; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.status-table > div:first-child { color: var(--faint); font-size: 11px; letter-spacing: .14em; }
.status-table em { color: var(--blue); font-style: normal; }

.plans { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.plan-card {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.03);
  transition: transform .45s cubic-bezier(.16,1,.3,1), border-color .2s ease;
}
.plan-card:hover { transform: translateY(-6px); }
.plan-card:not(.featured):hover { border-color: rgba(126,176,255,.45); }
/* Same luminous rim as TreVmS face-shiny CTAs (About TreVmS). */
.plan-card.featured {
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(8, 11, 16, 0.97), rgba(8, 11, 16, 0.97)) padding-box,
    conic-gradient(
      from var(--face-angle, 0deg),
      transparent 0%,
      #3b82f6 12%,
      #dbe7ff 22%,
      transparent 36%
    ) border-box;
  box-shadow: none;
  animation: face-border 2.8s linear infinite;
}
@property --face-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@keyframes face-border {
  to { --face-angle: 360deg; }
}
.plan-card small { color: var(--blue); font: 11px ui-monospace, monospace; letter-spacing: .14em; }
.plan-card h3 { margin: 12px 0 20px; font-size: 22px; font-weight: 500; }
.plan-card strong { font-size: 36px; font-weight: 500; letter-spacing: -.04em; }
.plan-card strong em { font-size: 13px; color: var(--faint); font-style: normal; }
.plan-card ul { list-style: none; margin: 20px 0 auto; padding: 16px 0 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.plan-card li { padding: 6px 0; }
.plan-card li:before { content: "✓ "; color: var(--blue); }
.plan-card .secondary, .plan-card .primary { width: 100%; margin-top: 16px; }

.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 920px; }
.auth-card, .cabinet { border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.03); }
.auth-card { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.auth-card small, .cabinet small, .secret-box small { color: var(--blue); font: 11px ui-monospace, monospace; letter-spacing: .14em; }
.auth-card h3, .cabinet h3 { margin: 6px 0 8px; font-size: 28px; font-weight: 500; letter-spacing: -.03em; }
.auth-card label { display: grid; gap: 6px; color: var(--faint); font-size: 12px; }
.auth-card input, .inline-form input, .inline-form select {
  height: 44px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  color: #fff;
  padding: 0 12px;
  outline: none;
}
.auth-card input:focus, .inline-form input:focus, .inline-form select:focus { border-color: #3b82f6; }
.auth-card .primary { align-self: flex-start; margin-top: 8px; }
.hidden { display: none !important; }
.cabinet { overflow: hidden; }
.cabinet-head, .cabinet-section { padding: 24px 28px; display: flex; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.cabinet-head > div:first-child, .cabinet-section > div { flex: 1; }
.plan-badge { border-left: 1px solid var(--line); padding-left: 20px; display: grid; gap: 6px; }
.plan-badge b { color: var(--blue); }
.usage-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.usage-grid article { padding: 24px 28px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.usage-grid strong { display: block; margin: 12px 0; font-size: 32px; font-weight: 500; }
.usage-grid p { color: var(--faint); margin: 0; font-size: 12px; }
.meter { height: 3px; background: rgba(255,255,255,.08); margin-top: 8px; }
.meter i { display: block; height: 100%; width: 0; background: #3b82f6; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { width: 220px; }
.keys-table { font: 13px ui-monospace, monospace; }
.table-row { display: grid; grid-template-columns: 1fr 1.4fr 1.2fr 90px; align-items: center; padding: 14px 28px; border-bottom: 1px solid var(--line); }
.table-head { color: var(--faint); font-size: 11px; }
.table-row button { border: 0; background: none; color: var(--red); }
.empty, .loading, .error-panel { padding: 28px; color: var(--muted); }
.secret-box { margin: 16px 28px; padding: 16px; border: 1px solid rgba(126,176,255,.35); border-radius: 12px; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.secret-box small { grid-column: 1 / -1; }
.secret-box code { overflow: auto; color: #dbe7ff; }
.form-message { min-height: 20px; color: var(--blue); font: 12px ui-monospace, monospace; }
.form-message.error, .error-panel { color: var(--red); }
.pay-view { display: grid; grid-template-columns: 180px 1fr; gap: 20px; padding: 24px 28px; }
.pay-view img { width: 180px; height: 180px; background: #fff; border-radius: 12px; }
.pay-view code { display: block; margin-top: 8px; word-break: break-all; }
.admin-row { display: grid; grid-template-columns: 1.4fr .7fr .8fr auto; gap: 8px; align-items: center; padding: 12px 28px; border-bottom: 1px solid var(--line); }
pre, code { font-family: ui-monospace, SFMono-Regular, monospace; }
pre { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.03); padding: 16px; color: #d5e4ff; }

.site-foot {
  max-width: none;
  margin: 0;
  padding: 28px max(24px, calc((100% - var(--max)) / 2)) 20px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
  overflow: hidden;
  background: transparent;
}
.site-foot img { height: 28px; }
.site-foot p { color: var(--faint); }
.site-foot nav { display: flex; gap: 18px; align-items: center; }
.site-foot button { border: 0; background: none; color: var(--faint); }
.site-foot a { color: var(--faint); text-decoration: none; }
.site-foot a:hover, .site-foot button:hover { color: #fff; }
.word {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 11vw;
  z-index: 0;
  pointer-events: none;
}
.site-foot > div, .site-foot nav { position: relative; z-index: 1; }
#api-state { margin-left: 10px; }

.docs-hero { max-width: var(--max); margin: 0 auto; padding: 72px 24px 8px; position: relative; z-index: 1; }
.docs-hero h1 { font-size: clamp(40px, 5vw, 68px); max-width: 16ch; }
.docs-shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 24px 80px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  position: relative;
  z-index: 1;
}
main.docs-content { max-width: none; margin: 0; min-width: 0; }
.docs-nav { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; position: sticky; top: 88px; }
.docs-nav b { display: block; margin: 18px 0 0; color: var(--blue); font: 11px ui-monospace, monospace; letter-spacing: .16em; }
.docs-nav a { display: block; color: var(--muted); text-decoration: none; font-size: 14px; line-height: 1.4; }
.docs-nav a:hover { color: #fff; }
.docs-content h2 { font-size: 32px; font-weight: 500; letter-spacing: -.03em; margin: 8px 0 12px; }
.docs-content p { color: var(--muted); margin: 0 0 16px; }
.endpoint { margin: 28px 0; padding-top: 16px; border-top: 1px solid var(--line); position: relative; }
.endpoint header { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 12px; }
.endpoint header i { color: var(--faint); font-style: normal; }
.method { color: var(--blue); font: 12px ui-monospace, monospace; }
.base-url { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 24px; }
.base-url code { color: #dbe7ff; }
pre { position: relative; }
.copy-code, .base-url button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--faint);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: .08em;
}
.doc-table > div { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr .6fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.route-list > div { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }

.vela-word { display: inline-block; white-space: pre; animation: vela-word 640ms cubic-bezier(.16,1,.3,1) both; }
@keyframes vela-word { from { opacity: 0; filter: blur(14px); transform: translateY(8px); } to { opacity: 1; filter: none; transform: none; } }
.vela-fade { animation: vela-word .8s cubic-bezier(.16,1,.3,1) .35s both; }

@media (max-width: 1100px) {
  .plans { grid-template-columns: repeat(2, 1fr); }
  .docs-shell { grid-template-columns: 1fr; }
  .docs-nav { position: static; flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 800px) {
  .bar, .docs-top { height: auto; flex-wrap: wrap; padding: 12px 16px; }
  .topbar nav { order: 3; width: 100%; overflow: auto; }
  .hero, .page { padding-left: 16px; padding-right: 16px; }
  .hero { min-height: auto; padding-top: 64px; }
  .hero h1 { font-size: 42px; }
  .split, .pipeline, .streams, .usage-grid, .auth-grid { grid-template-columns: 1fr; }
  .status-table > div { grid-template-columns: 1.4fr 1fr .7fr; }
  .status-table span:nth-child(3), .status-table b:nth-child(3) { display: none; }
  .cabinet-head, .cabinet-section, .inline-form { flex-direction: column; align-items: stretch; }
  .plan-badge { border: 0; padding: 0; }
  .table-row { grid-template-columns: 1fr 1fr; }
  .plans { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .vela-word, .vela-fade, .primary, .orb, .plan-card.featured { animation: none; }
}
