:root {
  --bg: #0b1020;
  --panel: #151b2e;
  --panel-2: #0f1626;
  --line: #263045;
  --text: #e6ebf5;
  --muted: #8b97ad;
  --accent: #38bdf8;
  --in: #22c55e;
  --out: #f59e0b;
  --danger: #ef4444;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scrollbar-gutter: stable; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.wrap { width: min(1120px, calc(100vw - 32px)); margin: 0 auto; }
.narrow { width: min(760px, calc(100vw - 32px)); margin: 0 auto; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 16, 32, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__inner { display: flex; align-items: center; gap: 22px; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: linear-gradient(140deg, var(--accent), #6366f1);
  display: grid; place-items: center; font-size: 15px;
}
.nav__links { display: flex; gap: 18px; margin-left: auto; align-items: center; font-size: 14px; }
.nav__links a { color: var(--muted); }
.nav__links a:hover { color: var(--text); text-decoration: none; }

.btn {
  display: inline-block; padding: 10px 18px; border-radius: 9px; font-size: 15px; font-weight: 600;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer;
  font-family: inherit; text-align: center;
}
.btn:hover { text-decoration: none; border-color: #35415e; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #04121c; }
.btn--primary:hover { background: #5ecbfa; border-color: #5ecbfa; }
.btn--ghost { background: none; }
.btn--sm { padding: 7px 13px; font-size: 14px; }
.btn--block { display: block; width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- hero ---------- */
.hero { padding: 84px 0 64px; text-align: center; }
.eyebrow {
  display: inline-block; padding: 5px 13px; border-radius: 999px; font-size: 13px;
  border: 1px solid rgba(56, 189, 248, 0.35); color: var(--accent); background: rgba(56, 189, 248, 0.07);
  margin-bottom: 22px;
}
h1 { font-size: clamp(34px, 5.6vw, 58px); line-height: 1.08; margin: 0 0 20px; letter-spacing: -0.025em; }
.hero p.lede { font-size: clamp(17px, 2.1vw, 20px); color: var(--muted); max-width: 62ch; margin: 0 auto 32px; }
.hero__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero__note { margin-top: 16px; font-size: 13px; color: var(--muted); }

/* ---------- sections ---------- */
section { padding: 64px 0; }
h2 { font-size: clamp(25px, 3.4vw, 34px); margin: 0 0 12px; letter-spacing: -0.02em; }
h3 { font-size: 17px; margin: 0 0 8px; }
.section__lede { color: var(--muted); max-width: 66ch; margin: 0 0 36px; }
.centered { text-align: center; }
.centered .section__lede { margin-inline: auto; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; }
.card {
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 22px;
}
.card p { color: var(--muted); margin: 0; font-size: 15px; }
.card__icon { font-size: 22px; margin-bottom: 12px; display: block; }

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 40px; align-items: center; }

/* ---------- pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; align-items: start; }
.plan { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 24px; display: flex; flex-direction: column; height: 100%; }
.plan--featured { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.3); position: relative; }
.plan__tag {
  position: absolute; top: -11px; left: 24px; background: var(--accent); color: #04121c;
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; letter-spacing: 0.04em;
}
.plan__name { font-size: 15px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.plan__price { font-size: 38px; font-weight: 600; letter-spacing: -0.02em; margin: 10px 0 2px; }
.plan__price small { font-size: 14px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.plan__blurb { color: var(--muted); font-size: 14px; min-height: 42px; margin: 0 0 16px; }
.plan ul { list-style: none; margin: 0 0 22px; padding: 0; font-size: 14px; display: flex; flex-direction: column; gap: 9px; }
.plan li { display: flex; gap: 9px; align-items: flex-start; color: var(--muted); }
.plan li::before { content: "✓"; color: var(--in); flex: none; font-weight: 700; }
.plan .btn { margin-top: auto; }

/* ---------- forms ---------- */
.formcard {
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  padding: 30px; width: min(460px, calc(100vw - 32px)); margin: 56px auto;
}
.formcard h1 { font-size: 25px; margin-bottom: 6px; }
.formcard .sub { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.field { display: block; margin-bottom: 15px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select {
  width: 100%; padding: 11px 13px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font: inherit;
}
.field input:focus, .field select:focus { outline: 2px solid rgba(56, 189, 248, 0.5); outline-offset: 1px; }
.field__hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.field__hint--bad { color: #ff9b9b; }
.field__hint--good { color: #86efac; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); margin: 18px 0; }
.check input { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.formcard .btn { margin-top: 6px; }
.formcard .alt { text-align: center; font-size: 14px; color: var(--muted); margin: 18px 0 0; }

.alert { border-radius: 9px; padding: 11px 13px; font-size: 14px; margin-bottom: 16px; }
.alert--bad { border: 1px solid rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.09); color: #ffb4b4; }
.alert--ok { border: 1px solid rgba(34, 197, 94, 0.5); background: rgba(34, 197, 94, 0.09); color: #a7f3c0; }
.alert--warn { border: 1px solid rgba(245, 158, 11, 0.5); background: rgba(245, 158, 11, 0.09); color: #fcd88f; }
[hidden] { display: none !important; }

/* ---------- prose (legal pages) ---------- */
.prose { padding: 48px 0 80px; }
.prose h1 { font-size: 34px; margin-bottom: 8px; }
.prose .updated { color: var(--muted); font-size: 14px; margin: 0 0 36px; }
.prose h2 { font-size: 21px; margin: 36px 0 10px; }
.prose h3 { font-size: 16px; margin: 22px 0 6px; }
.prose p, .prose li { color: #c3cbdb; }
.prose ul { padding-left: 20px; }
.prose li { margin: 6px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.prose th, .prose td { text-align: left; padding: 9px 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- billing ---------- */
.stat { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 16px 18px; }
.stat__label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.stat__value { font-size: 26px; font-weight: 600; line-height: 1.25; }
.stat__note { font-size: 13px; color: var(--muted); }
.meter { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); margin-top: 9px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.meter i.over { background: var(--danger); }
.tokenbox {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; overflow-wrap: anywhere; margin: 8px 0;
}

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding: 40px 0; margin-top: 40px; }
.foot { display: flex; gap: 30px; flex-wrap: wrap; justify-content: space-between; font-size: 14px; color: var(--muted); }
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--text); }
.foot__legal { font-size: 13px; color: var(--muted); margin-top: 28px; }

@media (max-width: 640px) {
  .nav__links a:not(.btn) { display: none; }
  .hero { padding: 56px 0 44px; }
}

/* ---------- help assistant ---------- */
/* Scrolls internally rather than growing the page: the question box must stay
   reachable after a few answers without hunting for it. */
.botlog {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 22rem;
  overflow-y: auto;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.15);
}
.bubble {
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 46rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.bubble--you { align-self: flex-end; background: var(--accent); color: #04121c; }
.bubble--bot { align-self: flex-start; background: rgba(255, 255, 255, 0.06); }
.bubble__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; font-size: 13px; }
.bubble__links a { opacity: 0.85; }

#botForm { display: flex; gap: 10px; align-items: flex-end; }
#botForm .field { flex: 1; }

/* Present for screen readers, absent for everyone else. */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
