:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --text: #171a17;
  --muted: #5b625b;
  --border: #e2e4dd;
  --accent: #1f7a4d;
  --accent-text: #ffffff;
  --accent-soft: #e3f1e8;
  --code-bg: #eff1eb;
  --danger: #b42318;
  --chart-grey: #a3a9a2;
  --radius: 14px;
  --max: 1080px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111311;
    --surface: #191c19;
    --text: #eceee9;
    --muted: #a3aaa2;
    --border: #2a2f2a;
    --accent: #4cc38a;
    --accent-text: #0b1a12;
    --accent-soft: #16291f;
    --code-bg: #0c0e0c;
    --danger: #f97066;
    --chart-grey: #5f675f;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.6rem); max-width: 17ch; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: 20px; }
main > section + section { margin-top: clamp(64px, 10vw, 112px); }

/* Navigation */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.brand svg { color: var(--accent); }
.nav nav { display: flex; align-items: center; gap: 20px; }
.nav nav a:not(.button) { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.nav nav a:not(.button):hover { color: var(--text); }
@media (max-width: 640px) {
  .nav nav a:not(.button) { display: none; }
}

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 22px; border: 1px solid var(--accent); border-radius: 999px;
  background: var(--accent); color: var(--accent-text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: filter 0.15s ease;
}
.button:hover { filter: brightness(1.08); }
.button:disabled { opacity: 0.6; cursor: progress; }
.button-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.button-ghost:hover { border-color: var(--accent); filter: none; }
.button-small { min-height: 38px; padding: 0 16px; font-size: 0.92rem; }

/* Hero */
.hero { padding-top: clamp(40px, 8vw, 88px); }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 0.95rem; margin-bottom: 14px; }
.lede { font-size: clamp(1.08rem, 2.2vw, 1.25rem); color: var(--muted); max-width: 58ch; }
.section-lede { color: var(--muted); max-width: 64ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Grids and cards */
.grid { display: grid; gap: 18px; margin-top: 24px; }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.two { grid-template-columns: 1fr; gap: 28px 40px; }
@media (min-width: 720px) { .grid.two { grid-template-columns: 1fr 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card p:last-child, .feature p:last-child { margin-bottom: 0; }
.card p, .feature p { color: var(--muted); }

.finding .stat { font-size: 2.6rem; font-weight: 750; letter-spacing: -0.03em; line-height: 1; color: var(--accent); margin-bottom: 12px; }
.more { margin-top: 22px; font-weight: 600; }

.feature { border-left: 3px solid var(--accent); padding-left: 18px; }

/* Design partner form */
.partner { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 880px) { .partner { grid-template-columns: 1fr 1.15fr; align-items: start; } }
.partner-copy p { color: var(--muted); max-width: 46ch; }

.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
label { font-weight: 600; font-size: 0.95rem; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 13px; min-height: 46px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 0; min-height: 1.6em; font-weight: 600; }
.form-status.ok { color: var(--accent); }
.form-status.error { color: var(--danger); }
.form-note { margin: 0; color: var(--muted); font-size: 0.88rem; }

/* Tool */
.tool { display: grid; gap: 24px; align-items: end; }
@media (min-width: 880px) { .tool { grid-template-columns: minmax(0, 1fr) auto; } }
.tool > div { min-width: 0; }
.tool p { color: var(--muted); max-width: 62ch; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; overflow-x: auto; margin: 0; line-height: 1.5; }

/* Article */
.prose { max-width: 760px; padding-top: clamp(32px, 6vw, 64px); }
.prose h1 { font-size: clamp(1.9rem, 4.6vw, 2.8rem); max-width: none; }
.prose h2 { margin-top: 2.2em; }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.5em; }
.prose li::marker { color: var(--muted); }
.prose :not(pre) > code { background: var(--code-bg); border: 1px solid var(--border); border-radius: 6px; padding: 0.05em 0.35em; overflow-wrap: anywhere; }
.prose .actions { margin-top: 24px; }
.article-header { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.byline { color: var(--muted); margin: 0; }

.checklist { list-style: none; padding-left: 0; }
.checklist li { position: relative; padding-left: 1.9em; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 0.3em;
  width: 1.05em; height: 1.05em; border: 2px solid var(--accent); border-radius: 4px;
}

/* Placeholders that must be resolved before launch */
mark.todo { background: #ffe24a; color: #1a1400; outline: 2px dashed #b45309; outline-offset: 1px; border-radius: 4px; padding: 0.05em 0.3em; font-weight: 600; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* Chart and table */
.chart-figure { margin: 24px 0 1.6em; }
.chart { display: block; overflow: visible; margin-bottom: 20px; }
.chart text { fill: var(--text); font-family: inherit; font-size: 14px; }
.chart .chart-title { font-size: 16px; font-weight: 700; }
.chart .chart-legend { fill: var(--muted); font-size: 13px; }
.chart .chart-value { font-weight: 700; }
.chart .chart-axis { stroke: var(--border); stroke-width: 1; }
.bar-revenium { fill: var(--accent); }
.bar-litellm { fill: var(--chart-grey); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; background: var(--surface); }
caption { text-align: left; font-weight: 600; padding: 12px 14px 4px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: 0; }
td:last-child, th:last-child { text-align: right; }
td:last-child { white-space: nowrap; }
figcaption { color: var(--muted); font-size: 0.9rem; font-style: italic; margin-top: 10px; }

/* Footer */
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 64px; padding-bottom: 40px; color: var(--muted); font-size: 0.9rem; }
.footer p { margin: 0; }
.footer a { color: inherit; }
