:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f4f8f6;
  --surface: #ffffff;
  --border: #dfe7e3;
  --text: #15201c;
  --text-2: #4d5c56;
  --text-3: #74827c;
  --brand: #0f5e45;
  --brand-2: #138a69;
  --brand-soft: #e3f3ec;
  --on-brand: #ffffff;
  --red: #b42323;
  --red-soft: #fbe9e9;
  --amber: #925400;
  --amber-soft: #fdf1df;
  --term-bg: #0d1714;
  --term-text: #d6e5df;
  --term-dim: #7f948c;
  --term-green: #5ed6aa;
  --term-red: #ff7b72;
  --term-amber: #f2c46d;
  --radius: 14px;
  --max: 1120px;
  --shadow: 0 1px 2px rgb(16 40 32 / 6%), 0 8px 24px rgb(16 40 32 / 6%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1210;
    --bg-soft: #101a17;
    --surface: #13201c;
    --border: #22332d;
    --text: #e6efeb;
    --text-2: #a9bbb4;
    --text-3: #7f948c;
    --brand: #5ed6aa;
    --brand-2: #3fbf92;
    --brand-soft: #143128;
    --on-brand: #06231a;
    --red: #ff8a80;
    --red-soft: #3a1a1a;
    --amber: #f2c46d;
    --amber-soft: #33270f;
    --term-bg: #060c0a;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1210;
  --bg-soft: #101a17;
  --surface: #13201c;
  --border: #22332d;
  --text: #e6efeb;
  --text-2: #a9bbb4;
  --text-3: #7f948c;
  --brand: #5ed6aa;
  --brand-2: #3fbf92;
  --brand-soft: #143128;
  --on-brand: #06231a;
  --red: #ff8a80;
  --red-soft: #3a1a1a;
  --amber: #f2c46d;
  --amber-soft: #33270f;
  --term-bg: #060c0a;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
}

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

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

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

img { max-width: 100%; height: auto; }

a { color: var(--brand-2); text-underline-offset: 3px; }
a:hover { color: var(--brand); }

code, pre, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
:not(pre) > code { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 6px; padding: 0.05em 0.35em; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

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

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(150%) blur(10px); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: -0.02em; font-size: 1.08rem; }
.brand img { width: 30px; height: 30px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--text-2); text-decoration: none; font-size: 0.95rem; padding: 6px 10px; border-radius: 8px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--bg-soft); }
.nav .btn { margin-left: 6px; }
@media (max-width: 640px) {
  .nav a.nav-link { display: none; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 650; font-size: 0.98rem; text-decoration: none; border-radius: 10px; padding: 11px 18px; border: 1px solid transparent; transition: background 0.15s, border-color 0.15s; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-2); color: var(--on-brand); }
.btn-ghost { border-color: var(--border); color: var(--text); background: var(--surface); }
.btn-ghost:hover { border-color: var(--brand-2); color: var(--text); }
.nav .btn { padding: 7px 14px; font-size: 0.92rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Hero */
.hero { padding: 72px 0 56px; background: radial-gradient(1000px 420px at 85% -10%, var(--brand-soft), transparent 70%); }
.hero .wrap { display: grid; gap: 48px; align-items: center; }
@media (min-width: 960px) { .hero .wrap { grid-template-columns: 1.05fr 1fr; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 650; color: var(--brand-2); background: var(--brand-soft); border-radius: 999px; padding: 4px 12px; margin-bottom: 18px; }
.lede { font-size: 1.2rem; color: var(--text-2); max-width: 36em; }
.fine { font-size: 0.88rem; color: var(--text-3); margin-top: 14px; }

/* Terminal */
.term { background: var(--term-bg); color: var(--term-text); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border: 1px solid rgb(255 255 255 / 6%); min-width: 0; }
.term-bar { display: flex; gap: 7px; padding: 12px 14px; border-bottom: 1px solid rgb(255 255 255 / 6%); }
.term-bar span { width: 11px; height: 11px; border-radius: 50%; background: #2c3a35; }
.term pre { margin: 0; padding: 18px 20px 22px; font-size: 0.84rem; line-height: 1.7; overflow-x: auto; white-space: pre; }
.t-dim { color: var(--term-dim); }
.t-ok { color: var(--term-green); }
.t-bad { color: var(--term-red); }
.t-warn { color: var(--term-amber); }

/* Sections */
section { padding: 72px 0; }
.alt { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 46em; margin-bottom: 36px; }
.section-head p { color: var(--text-2); font-size: 1.08rem; }

.grid { display: grid; gap: 18px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card p { color: var(--text-2); margin: 0; }
.card p + p { margin-top: 0.7em; }
.icon { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-2); display: grid; place-items: center; margin-bottom: 14px; }
.icon svg { width: 22px; height: 22px; }

/* Steps */
.steps { counter-reset: step; display: grid; gap: 18px; }
@media (min-width: 880px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step { position: relative; padding-top: 52px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; top: 20px; left: 24px; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-weight: 750; font-size: 0.85rem; display: grid; place-items: center; }

/* Tool chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { font-size: 0.86rem; font-weight: 600; border: 1px solid var(--border); background: var(--bg); border-radius: 999px; padding: 3px 11px; color: var(--text-2); }

/* Status badges */
.badge { display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; border-radius: 999px; padding: 2px 9px; margin-left: 6px; vertical-align: 2px; }
.badge-ok { background: var(--brand-soft); color: var(--brand-2); }
.badge-wip { background: var(--amber-soft); color: var(--amber); }
.badge-plan { background: var(--bg-soft); color: var(--text-3); border: 1px solid var(--border); }

/* Lists */
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 28px; color: var(--text-2); }
.checks li::before { content: ""; position: absolute; left: 0; top: 0.42em; width: 16px; height: 16px; border-radius: 50%; background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-4.8' fill='none' stroke='%23138a69' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }
.checks.limits li::before { background: var(--amber-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 4.5v4.2M8 11.3v.2' fill='none' stroke='%23925400' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/16px no-repeat; }

/* Compare table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 0.95rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 650; }
td { color: var(--text-2); }

/* FAQ */
.faq { display: grid; gap: 10px; max-width: 52em; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 20px; }
.faq summary { cursor: pointer; font-weight: 650; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-3); font-weight: 400; font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--text-2); }

/* CTA band */
.cta { text-align: center; }
.cta .lede { margin: 0 auto; }
.cta .actions { justify-content: center; }

/* Prose pages */
.page-hero { padding: 64px 0 24px; }
.prose { max-width: 46em; }
.prose h2 { margin-top: 1.6em; font-size: 1.6rem; }
.prose p, .prose li { color: var(--text-2); }
.prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: 0.4em; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0; color: var(--text-3); font-size: 0.92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

.more { margin-top: 24px; }
.center { align-items: center; }
.nav a.btn-primary, .nav a.btn-primary:hover { color: var(--on-brand); background: var(--brand); }
.nav a.btn-primary:hover { background: var(--brand-2); }
.checks.card { padding: 24px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand img { filter: brightness(1.7) saturate(1.1); } }
:root[data-theme="dark"] .brand img { filter: brightness(1.7) saturate(1.1); }
