/* Spend Brake website. Same palette as the dashboard (apps/web/src/styles.css), plus a
   "brake" red for the moment a cap stops a request. No JavaScript, no web fonts. */

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #efefeb;
  --text: #1b1b19;
  --muted: #6b6b66;
  --border: #e2e2dc;
  --accent: #1d4ed8;
  --accent-ink: #ffffff;
  --brake: #c92a1f;
  --brake-soft: #fbe9e7;
  --ok: #15803d;
  --code-bg: #1d1d1b;
  --code-text: #ececea;
  --code-muted: #8f8f88;
  --code-ok: #4ade80;
  --code-brake: #ff7a6e;
  --code-key: #9ab8ff;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 12px 32px -16px rgb(0 0 0 / 0.18);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #141413;
    --surface: #1d1d1b;
    --surface-2: #242421;
    --text: #ececea;
    --muted: #9b9b95;
    --border: #33332f;
    --accent: #7aa2ff;
    --accent-ink: #0f1a33;
    --brake: #ff7a6e;
    --brake-soft: #3a1d1a;
    --ok: #4ade80;
    --code-bg: #0e0e0d;
    --code-text: #ececea;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px -16px rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #141413;
  --surface: #1d1d1b;
  --surface-2: #242421;
  --text: #ececea;
  --muted: #9b9b95;
  --border: #33332f;
  --accent: #7aa2ff;
  --accent-ink: #0f1a33;
  --brake: #ff7a6e;
  --brake-soft: #3a1d1a;
  --ok: #4ade80;
  --code-bg: #0e0e0d;
  --code-text: #ececea;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px -16px rgb(0 0 0 / 0.6);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    16px/1.55 system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  text-rendering: optimizeLegibility;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
code,
pre,
kbd,
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}
h1,
h2,
h3 {
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}
p {
  margin: 0 0 1em;
}
img,
svg {
  display: block;
  max-width: 100%;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 720px) {
  .wrap {
    padding: 0 24px;
  }
}

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.top .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 58px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.01em;
}
.brand:hover {
  text-decoration: none;
}
.brand svg {
  width: 26px;
  height: 26px;
}
.top nav {
  display: none;
  gap: 4px;
  flex: 1;
}
.top nav a {
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 15px;
}
.top nav a:hover {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}
.top .cta {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}
/*
 * Narrow screens: the sections fold into a menu, without script (the CSP allows none). "Menu"
 * links to #menu, which opens it (:target); picking a section changes the target, which closes
 * it, and "Close" links to a fragment that matches nothing.
 */
.top .menu {
  order: 3;
}
.top .menu .toggle {
  display: inline-block;
  color: var(--text);
  font-size: 14px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.top .menu .toggle:hover {
  text-decoration: none;
}
.top .menu .close,
.top .menu:target .open {
  display: none;
}
.top .menu:target .close {
  display: inline-block;
  background: var(--surface-2);
}
.top .menu nav {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 58px;
  left: 0;
  right: 0;
  padding: 8px 16px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.top .menu:target nav {
  display: flex;
}
.top .menu nav a {
  padding: 10px;
}
@media (max-width: 419px) {
  .top .cta .ghost {
    display: none;
  }
  /* 320px wide: brand, Menu and Start free on one line. */
  .top .wrap {
    gap: 8px;
  }
  .top .cta .btn {
    padding: 8px 12px;
    font-size: 14px;
  }
}
@media (min-width: 860px) {
  .top nav {
    display: flex;
  }
  .top .cta {
    margin-left: 0;
  }
  .top .menu {
    display: none;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover {
  text-decoration: none;
  border-color: var(--muted);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn.primary:hover {
  filter: brightness(1.08);
}
.btn.lg {
  padding: 12px 22px;
  font-size: 16px;
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.btn.ghost:hover {
  color: var(--text);
  background: var(--surface-2);
}

/* Sections */
section {
  padding: 56px 0;
  border-top: 1px solid var(--border);
  /* Clear of the 58px sticky header when a link jumps here. */
  scroll-margin-top: 64px;
}
@media (min-width: 860px) {
  section {
    padding: 88px 0;
  }
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--brake);
}
.lede {
  font-size: 18px;
  color: var(--muted);
  max-width: 62ch;
  text-wrap: pretty;
}
h2 {
  font-size: clamp(26px, 3.6vw, 38px);
  font-weight: 650;
  margin-bottom: 14px;
  max-width: 24ch;
}

/* Hero */
.hero {
  border-top: 0;
  padding: 56px 0 40px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      60% 50% at 80% 0%,
      color-mix(in srgb, var(--accent) 12%, transparent),
      transparent 70%
    ),
    radial-gradient(
      40% 40% at 10% 100%,
      color-mix(in srgb, var(--brake) 8%, transparent),
      transparent 70%
    );
  pointer-events: none;
}
.hero .wrap {
  position: relative;
  display: grid;
  gap: 40px;
}
@media (min-width: 980px) {
  .hero {
    padding: 96px 0 72px;
  }
  .hero .wrap {
    grid-template-columns: 1.05fr 1fr;
    align-items: center;
    gap: 56px;
  }
}
.hero h1 {
  font-size: clamp(34px, 4.8vw, 54px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
}
.hero h1 em {
  font-style: normal;
  color: var(--brake);
}
.hero .lede {
  font-size: clamp(17px, 1.6vw, 20px);
}
.hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 18px;
}
.hero .fine {
  font-size: 14px;
  color: var(--muted);
}
.hero .fine code {
  color: var(--text);
}

/* Terminal / code cards */
.term {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid color-mix(in srgb, var(--code-text) 10%, transparent);
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
}
.term header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--code-text) 10%, transparent);
  color: var(--code-muted);
  font-size: 12px;
}
.term header i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--code-text) 18%, transparent);
}
.term header span {
  margin-left: 8px;
}
.term pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}
.term .c {
  color: var(--code-muted);
}
.term .ok {
  color: var(--code-ok);
}
.term .brake {
  color: var(--code-brake);
}
.term .k {
  color: var(--code-key);
}
.term .del {
  color: var(--code-brake);
}
.term .add {
  color: var(--code-ok);
}
.term .stop {
  display: block;
  margin: 12px -16px -16px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--code-brake) 12%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--code-brake) 35%, transparent);
}

/* Proof strip */
.proof {
  padding: 0 0 56px;
  border-top: 0;
}
.proof .wrap {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
  max-width: calc(1100px - 32px);
}
@media (min-width: 720px) {
  .proof .wrap {
    grid-template-columns: repeat(3, 1fr);
    max-width: calc(1100px - 48px);
  }
}
.proof div {
  background: var(--surface);
  padding: 20px 22px;
}
.proof b {
  display: block;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.proof span {
  color: var(--muted);
  font-size: 14px;
}

/* How it works */
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  gap: 12px;
}
@media (min-width: 860px) {
  .steps {
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
  }
}
.steps li {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  position: relative;
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--brake);
  letter-spacing: 0.06em;
}
.steps h3 {
  font-size: 16px;
  font-weight: 650;
  margin: 6px 0 6px;
}
.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.flow {
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
}
.flow code {
  color: var(--text);
}

/* Feature grid */
.grid {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}
@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 980px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.card h3 {
  font-size: 17px;
  font-weight: 650;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card h3 svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex: none;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}
.card p + p {
  margin-top: 8px;
}
.card code {
  color: var(--text);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Agents section */
.split {
  display: grid;
  gap: 32px;
  margin-top: 8px;
}
@media (min-width: 980px) {
  .split {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 56px;
  }
}
.split ul {
  padding-left: 0;
  list-style: none;
  margin: 18px 0 0;
  display: grid;
  gap: 10px;
}
.split li {
  padding-left: 26px;
  position: relative;
  color: var(--muted);
}
.split li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 14px;
  height: 2px;
  background: var(--brake);
}
.split li b {
  color: var(--text);
  font-weight: 600;
}

/* Comparison table */
.table-wrap {
  overflow-x: auto;
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 720px;
  font-size: 14px;
}
th,
td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tr:last-child td {
  border-bottom: 0;
}
th {
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
}
th.sb,
td.sb {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  font-weight: 600;
}
th.sb {
  color: var(--accent);
}
td.no {
  color: var(--muted);
}
.tablenote {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}

/* Pricing */
.plans {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}
@media (min-width: 640px) {
  .plans {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1040px) {
  .plans {
    grid-template-columns: repeat(4, 1fr);
  }
}
.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
}
.plan.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.plan h3 {
  font-size: 17px;
  font-weight: 650;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.plan h3 small {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.price {
  margin: 12px 0 4px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.price small {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}
.plan .for {
  color: var(--muted);
  font-size: 14px;
  min-height: 2.8em;
  margin: 0 0 12px;
}
.plan ul {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: grid;
  gap: 7px;
  font-size: 14px;
  flex: 1;
}
.plan li {
  padding-left: 20px;
  position: relative;
}
.plan li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 10px;
  height: 2px;
  background: var(--ok);
}
.plan .btn {
  justify-content: center;
}
.selfhost {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  display: grid;
  gap: 16px;
  padding: 22px 20px;
}
@media (min-width: 860px) {
  .selfhost {
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 24px;
  }
}
.selfhost h3 {
  font-size: 17px;
  font-weight: 650;
  margin-bottom: 6px;
}
.selfhost p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}
.selfhost .price {
  font-size: 24px;
  margin: 6px 0 2px;
}
.pricenote {
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
}

/* Self-hosting */
.selfhosting .split {
  margin-top: 0;
}
.honest {
  margin-top: 28px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brake);
  border-radius: 10px;
  background: var(--surface);
  padding: 18px 20px;
  font-size: 15px;
}
.honest h3 {
  font-size: 15px;
  font-weight: 650;
  margin-bottom: 6px;
}
.honest p {
  margin: 0;
  color: var(--muted);
}

/* Final CTA */
.final {
  text-align: center;
}
.final h2 {
  margin: 0 auto 12px;
}
.final .lede {
  margin: 0 auto;
}
.final .actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 40px;
  font-size: 14px;
  color: var(--muted);
}
footer .wrap {
  display: grid;
  gap: 18px;
}
@media (min-width: 860px) {
  footer .wrap {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
}
footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
footer nav a {
  color: var(--muted);
}
footer nav a:hover {
  color: var(--text);
}
footer .brand {
  margin-bottom: 8px;
  font-size: 15px;
}
footer p {
  margin: 0;
  max-width: 52ch;
}

/* Legal pages */
.legal {
  padding: 40px 0 72px;
  border-top: 0;
}
.legal .wrap {
  max-width: 780px;
}
.legal h1 {
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}
.legal .meta {
  color: var(--muted);
  margin-bottom: 28px;
}
.legal h2 {
  font-size: 22px;
  margin: 40px 0 10px;
  max-width: none;
}
.legal h3 {
  font-size: 17px;
  font-weight: 650;
  margin: 24px 0 8px;
}
.legal p,
.legal li {
  text-wrap: pretty;
}
.legal ul {
  padding-left: 22px;
  margin: 0 0 1em;
}
.legal li {
  margin-bottom: 6px;
}
.legal .caps {
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 0.01em;
  line-height: 1.6;
}
.legal .summary {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--surface);
  padding: 16px 20px;
  margin: 0 0 28px;
  font-size: 15px;
}
.legal .summary h2 {
  font-size: 15px;
  margin: 0 0 8px;
}
.legal .summary ul {
  margin: 0;
}
.legal .todo {
  background: var(--brake-soft);
  color: var(--brake);
  border: 1px dashed var(--brake);
  border-radius: 4px;
  padding: 0 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  white-space: nowrap;
}
.legal table {
  min-width: 0;
  font-size: 14px;
  margin: 8px 0 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.legal .table-wrap {
  margin-top: 8px;
}
.legal .table-wrap table {
  margin: 0;
  border: 0;
  min-width: 520px;
}
.legal .toc {
  columns: 2;
  column-gap: 24px;
  font-size: 14px;
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}
@media (max-width: 560px) {
  .legal .toc {
    columns: 1;
  }
}
.legal .toc li {
  break-inside: avoid;
  margin-bottom: 4px;
}

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