:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --text: #141821;
  --muted: #5a6270;
  --line: #e4e0d8;
  --accent: #b7791f;
  --accent-strong: #8c5a10;
  --accent-soft: #f6ead3;
  --ok: #17785f;
  --ok-soft: #dff3ec;
  --warn: #9a5b00;
  --warn-soft: #fbedd6;
  --code-bg: #141821;
  --code-text: #e8e6e1;
  --btn-bg: #8c5a10;
  --btn-bg-hover: #6f460b;
  --btn-text: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 24, 33, .06), 0 8px 24px rgba(20, 24, 33, .06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0f15;
    --surface: #131823;
    --surface-2: #1a2030;
    --text: #e9e7e2;
    --muted: #a3abb8;
    --line: #262d3d;
    --accent: #e3b05a;
    --accent-strong: #f0c77f;
    --accent-soft: #2b2416;
    --ok: #5cc9a7;
    --ok-soft: #12291f;
    --warn: #f0b45c;
    --warn-soft: #2c2213;
    --code-bg: #090b10;
    --code-text: #e8e6e1;
    --btn-bg: #e3b05a;
    --btn-bg-hover: #f0c77f;
    --btn-text: #1b1408;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0c0f15;
  --surface: #131823;
  --surface-2: #1a2030;
  --text: #e9e7e2;
  --muted: #a3abb8;
  --line: #262d3d;
  --accent: #e3b05a;
  --accent-strong: #f0c77f;
  --accent-soft: #2b2416;
  --ok: #5cc9a7;
  --ok-soft: #12291f;
  --warn: #f0b45c;
  --warn-soft: #2c2213;
  --code-bg: #090b10;
  --code-text: #e8e6e1;
  --btn-bg: #e3b05a;
  --btn-bg-hover: #f0c77f;
  --btn-text: #1b1408;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--accent-strong); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
code, pre { font-family: var(--mono); font-size: .9em; }
:not(pre) > code { background: var(--surface-2); border: 1px solid var(--line); padding: .1em .35em; border-radius: 6px; }

.wrap { width: 100%; max-width: 1120px; 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; 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: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand svg { width: 28px; height: 28px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: .95rem; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 6px 10px; font: inherit; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .nav.open { display: flex; }
  .nav .btn { margin-top: 8px; text-align: center; }
}

.btn { display: inline-block; border-radius: 10px; padding: 10px 18px; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer; font: inherit; font-weight: 600; }
.btn-primary, .btn-primary:hover { color: var(--btn-text); }
.btn-primary { background: var(--btn-bg); }
.btn-primary:hover { background: var(--btn-bg-hover); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-ghost { border-color: var(--line); color: var(--text); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.nav a.btn-primary { padding: 8px 14px; color: var(--btn-text); background: var(--btn-bg); }
.nav a.btn-primary:hover { color: var(--btn-text); background: var(--btn-bg-hover); }

/* hero */
.hero { padding: 72px 0 40px; }
.hero .wrap { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero .wrap { grid-template-columns: 1.05fr .95fr; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 4px 12px; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.08; letter-spacing: -.025em; margin: 18px 0 16px; }
h1 em { font-style: normal; color: var(--accent); }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 40ch; margin: 0 0 28px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }

.terminal { background: var(--code-bg); color: var(--code-text); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line); }
.terminal .bar { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.terminal .bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a404d; display: block; }
.terminal pre { margin: 0; padding: 18px 20px 22px; overflow-x: auto; line-height: 1.75; font-size: .86rem; }
.terminal .c { color: #8f96a3; }
.terminal .p { color: #e3b05a; }
.terminal .ok { color: #5cc9a7; }

/* sections */
section { padding: 64px 0; }
section.alt { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.02em; line-height: 1.15; margin: 0 0 12px; }
h3 { font-size: 1.1rem; margin: 0 0 6px; letter-spacing: -.01em; }
.section-lede { color: var(--muted); max-width: 62ch; margin: 0 0 36px; font-size: 1.05rem; }

.steps { display: grid; gap: 20px; counter-reset: step; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; position: relative; }
.step::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; margin-bottom: 14px; }
.step p { margin: 0; color: var(--muted); }

.grid { display: grid; gap: 20px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid.three { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card p { margin: 0; color: var(--muted); }
.card .icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); margin-bottom: 14px; }
.card .icon svg { width: 20px; height: 20px; }

.split { display: grid; gap: 32px; align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.checklist li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; }
.checklist li::before { content: ""; width: 20px; height: 20px; margin-top: 3px; border-radius: 50%; background: var(--ok-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3 3 7-7' fill='none' stroke='%2317785f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }
.checklist strong { display: block; }
.checklist span { color: var(--muted); }

.note { border-left: 3px solid var(--accent); background: var(--surface); padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; color: var(--muted); }
.note strong { color: var(--text); }

/* status table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); }
.pill { display: inline-block; font-size: .8rem; font-weight: 600; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.wip { background: var(--warn-soft); color: var(--warn); }
.pill.plan { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* form */
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field-row { display: grid; gap: 16px; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }
label, legend { font-weight: 600; font-size: .92rem; }
.optional { color: var(--muted); font-weight: 400; }
input[type="email"], input[type="text"], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 6px; }
.choices label { font-weight: 400; display: inline-flex; gap: 6px; align-items: center; }
.consent { display: grid; grid-template-columns: 20px 1fr; gap: 10px; font-weight: 400; font-size: .9rem; color: var(--muted); margin: 8px 0 20px; }
.consent input { margin-top: 4px; }
.form-status { min-height: 1.6em; margin: 12px 0 0; font-weight: 600; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: #c0392b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .form-status.err { color: #ff8a7a; } }

/* faq */
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); margin: 12px 0 0; max-width: 72ch; }

/* docs/prose pages */
.page { padding: 48px 0 72px; }
.prose { max-width: 760px; }
.prose h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.prose h2 { font-size: 1.45rem; margin-top: 44px; }
.prose h3 { margin-top: 28px; }
.prose p, .prose li { color: var(--text); }
.prose .muted { color: var(--muted); }
.prose pre { background: var(--code-bg); color: var(--code-text); padding: 16px 18px; border-radius: 12px; overflow-x: auto; line-height: 1.6; }
.prose table { min-width: 0; }
.prose .table-wrap { margin: 16px 0; }
.draft-banner { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 12px 16px; font-weight: 600; margin: 0 0 24px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: grid; gap: 20px; }
@media (min-width: 820px) { .site-footer .wrap { grid-template-columns: 1.4fr 1fr; } }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: flex-start; }
@media (min-width: 820px) { .site-footer nav { justify-content: flex-end; } }
.site-footer a { color: var(--muted); }
.site-footer p { margin: 0 0 6px; }

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

/* pricing */
.plans { display: grid; gap: 20px; }
@media (min-width: 760px) { .plans { grid-template-columns: repeat(3, 1fr); } }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.plan.featured { border-color: var(--accent); box-shadow: var(--shadow); }
.plan h3 { font-size: 1.2rem; margin: 0; }
.plan .price { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }
.plan .price small { font-size: .95rem; font-weight: 500; color: var(--muted); }
.plan ul { margin: 0; padding-left: 18px; color: var(--muted); }
.plan .btn { margin-top: auto; text-align: center; }

/* checkout */
.steps-inline { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; }
.steps-inline li { font-size: .85rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.steps-inline li.current { color: var(--btn-text); background: var(--btn-bg); border-color: transparent; }
.kv { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 10px 18px; margin: 0 0 20px; }
.kv dt { color: var(--muted); font-size: .9rem; }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.copy-row { display: flex; gap: 8px; align-items: stretch; }
.copy-row code { flex: 1; display: block; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); overflow-wrap: anywhere; font-size: .95rem; }
.copy-row button { flex: none; }
.amount { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
.warn-box { background: var(--warn-soft); color: var(--text); border-radius: 12px; padding: 14px 18px; margin: 16px 0; }
.warn-box ul { margin: 6px 0 0; padding-left: 18px; }
.secret { background: var(--surface-2); border: 1px dashed var(--accent); border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.btn-small { padding: 8px 12px; font-size: .9rem; }
.stack > * + * { margin-top: 16px; }
[hidden] { display: none !important; }
/* long tokens and addresses must never widen the page on phones */
.split { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.split > *, .kv > *, .form-card, .copy-row > * { min-width: 0; }
#proj-list li { overflow-wrap: anywhere; }

/* Checkout: payment method tabs and PayPal */
.method-tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.method-tabs button { flex: 1; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 9px 12px; border-radius: 9px; cursor: pointer; }
.method-tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.method-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.amount-line { font-size: 1.6rem; font-weight: 700; margin: 0; }
/* PayPal draws its buttons and card form for a light page: keep them on white in both themes. */
.paypal-host { background: #ffffff; color: #141821; border-radius: 12px; padding: 14px; min-height: 64px; color-scheme: light; }
.paypal-host:empty { display: none; }
