/* Cheapli — one stylesheet, no build step, no external requests.
   Every colour is a token defined on :root first, then re-pointed for dark mode. */

:root {
  --canvas: #f2f8f7;
  --surface: #ffffff;
  --surface-2: #eaf4f2;
  --ink: #0b1f2a;
  --ink-soft: #234253;
  --muted: #5b7480;
  --line: #dfeceb;
  --line-strong: #c8dedb;

  --brand: #0fb3a0;
  --brand-dark: #0a8577;
  --brand-ink: #063f38;
  --brand-soft: #e0f6f2;
  --accent: #ff6b5a;
  --accent-soft: #ffece9;

  --pass: #12854c;
  --pass-soft: #dff3e7;
  --warn: #9a6206;
  --warn-soft: #fdf0d8;
  --fail: #b4322f;
  --fail-soft: #fce8e7;

  --code-bg: #08202a;
  --code-ink: #d6ece9;
  --code-line: #17394a;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(11, 31, 42, 0.05), 0 2px 8px rgba(11, 31, 42, 0.04);
  --shadow: 0 2px 4px rgba(11, 31, 42, 0.05), 0 12px 28px rgba(11, 31, 42, 0.08);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #071820;
    --surface: #0d222c;
    --surface-2: #12303b;
    --ink: #e8f4f2;
    --ink-soft: #bcd6d5;
    --muted: #8ea9b1;
    --line: #1c3b47;
    --line-strong: #275160;

    --brand: #2ad4be;
    --brand-dark: #17b7a3;
    --brand-ink: #b6f2e8;
    --brand-soft: #0f3a38;
    --accent: #ff8574;
    --accent-soft: #3a2019;

    --pass: #4bd28c;
    --pass-soft: #0d3325;
    --warn: #ecb44e;
    --warn-soft: #362a10;
    --fail: #ff8b86;
    --fail-soft: #3a1c1c;

    --code-bg: #04141b;
    --code-ink: #cfe8e5;
    --code-line: #17394a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.25), 0 14px 30px rgba(0, 0, 0, 0.35);
  }
}

/* ---------- base ---------- */

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.62;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.02em; font-weight: 680; }
h1 { font-size: clamp(2.3rem, 5.2vw, 3.5rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); letter-spacing: -0.028em; }
h3 { font-size: 1.16rem; }
p { margin: 0 0 1.1em; }
a { color: var(--brand-dark); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand); }
ul, ol { padding-left: 1.2em; }
li { margin-bottom: 0.4em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }
strong { font-weight: 650; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.wrap { width: min(1140px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(820px, 100% - 2.5rem); margin-inline: auto; }
.lede { font-size: 1.12rem; color: var(--ink-soft); }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.tiny { font-size: 0.8rem; }
.center { text-align: center; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
section { padding: 4.2rem 0; }
section.tight { padding: 2.6rem 0; }
.section-head { max-width: 640px; margin-bottom: 2rem; }
.section-head.center { margin-inline: auto; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; font-weight: 720; font-size: 1.18rem; letter-spacing: -0.03em; }
.brand svg { width: 28px; height: 28px; display: block; }
.brand .tag { font-size: 0.68rem; font-weight: 640; letter-spacing: 0.04em; text-transform: uppercase; color: var(--brand-dark); background: var(--brand-soft); border-radius: 99px; padding: 0.15rem 0.5rem; }
.site-nav { display: flex; align-items: center; gap: 1.4rem; margin-left: auto; }
.site-nav a { color: var(--ink-soft); text-decoration: none; font-size: 0.96rem; font-weight: 550; }
.site-nav a:not(.btn):hover, .site-nav a:not(.btn)[aria-current="page"] { color: var(--brand-dark); }
.nav-toggle { display: none; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: inherit; font-weight: 620; font-size: 0.98rem;
  padding: 0.68rem 1.25rem; border-radius: 99px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform 0.06s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-dark); color: #fff; }
.btn-primary:hover { background: var(--brand); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--surface); }
.btn-sm { padding: 0.42rem 0.85rem; font-size: 0.87rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.card h3 { margin-bottom: 0.35rem; }
.card p:last-child { margin-bottom: 0; }
.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.icon-badge {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-dark); margin-bottom: 0.9rem;
}
.icon-badge svg { width: 21px; height: 21px; }

.pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.78rem; font-weight: 640; letter-spacing: 0.02em;
  padding: 0.22rem 0.65rem; border-radius: 99px;
  background: var(--brand-soft); color: var(--brand-dark);
}
.pill-accent { background: var(--accent-soft); color: var(--accent); }
.pill-pass { background: var(--pass-soft); color: var(--pass); }
.pill-borderline { background: var(--warn-soft); color: var(--warn); }
.pill-fail { background: var(--fail-soft); color: var(--fail); }

/* ---------- hero ---------- */

.hero { padding: 3.6rem 0 3rem; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 3rem; align-items: center; }
.hero h1 { margin-bottom: 0.6rem; }
.hero h1 .free { color: var(--brand-dark); }
.hero .lede { font-size: 1.2rem; max-width: 34ch; }
.hero-points { list-style: none; padding: 0; margin: 1.6rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; font-size: 0.9rem; color: var(--muted); }
.hero-points li { display: flex; align-items: center; gap: 0.4rem; margin: 0; }
.hero-points li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }

/* ---------- code / terminal ---------- */

.code {
  position: relative;
  background: var(--code-bg);
  color: var(--code-ink);
  border: 1px solid var(--code-line);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.65;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.code-bar { display: flex; align-items: center; gap: 0.45rem; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--code-line); background: rgba(255, 255, 255, 0.02); }
.code-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: #24505f; }
.code-bar .label { margin-left: 0.4rem; font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: #7ba7ac; }
.code pre { margin: 0; padding: 1rem 1.1rem; overflow-x: auto; }
.code .c-key { color: #7fd8c8; }
.code .c-str { color: #ffc9a3; }
.code .c-num { color: #a8d8ff; }
.code .c-dim { color: #6d94a1; }
.code .c-pass { color: #6ee7a8; }
.code .c-warn { color: #ffd479; }
.copy-btn {
  position: absolute; top: 0.55rem; right: 0.6rem; z-index: 2;
  font: inherit; font-family: var(--font); font-size: 0.74rem; font-weight: 620;
  padding: 0.25rem 0.6rem; border-radius: 7px; cursor: pointer;
  background: rgba(255, 255, 255, 0.08); color: #cfe8e5; border: 1px solid rgba(255, 255, 255, 0.14);
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.16); }
code:not(.code code) {
  font-family: var(--mono); font-size: 0.86em;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 5px; padding: 0.08em 0.34em;
}

/* ---------- price band ---------- */

.price-band { background: var(--surface); border-block: 1px solid var(--line); }
.price-grid { display: grid; grid-template-columns: auto 1fr; gap: 2.5rem; align-items: center; }
.price-figure { text-align: center; padding-right: 2.5rem; border-right: 1px solid var(--line); }
.price-figure .amount { font-size: clamp(4rem, 9vw, 6rem); font-weight: 760; letter-spacing: -0.05em; line-height: 1; color: var(--accent); }
.price-figure .per { display: block; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-top: 0.4rem; }

/* ---------- steps ---------- */

.steps { counter-reset: step; display: grid; gap: 1.1rem; grid-template-columns: repeat(3, 1fr); }
.step { position: relative; padding-top: 2.6rem; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 0;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-dark); color: #fff; font-weight: 700; font-size: 0.95rem;
}

/* ---------- tool grid ---------- */

.tool { display: block; padding: 1.15rem 1.25rem; }
.tool .name { font-family: var(--mono); font-size: 0.88rem; font-weight: 600; color: var(--brand-dark); margin-bottom: 0.35rem; }
.tool p { font-size: 0.92rem; color: var(--ink-soft); margin: 0; }

/* ---------- lender chips ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  font-size: 0.88rem; font-weight: 560; color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 99px; padding: 0.35rem 0.9rem;
}

/* ---------- tables ---------- */

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 640; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .mono { font-size: 0.86rem; }

/* ---------- forms ---------- */

.field { display: grid; gap: 0.28rem; margin-bottom: 1rem; }
.field label { font-size: 0.86rem; font-weight: 620; }
.field .hint { font-size: 0.78rem; color: var(--muted); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 0.95rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.field textarea { min-height: 96px; resize: vertical; }

/* Paired fields stack by default; side by side from 601px up, where labels,
   inputs and hints share grid rows so a long label or hint in one column can't
   shunt the other column's input out of line. */
@media (min-width: 601px) {
  .field-row { display: grid; grid-template-columns: 1fr 1fr; column-gap: 0.9rem; row-gap: 0.28rem; margin-bottom: 1rem; }
  .field-row > .field { display: contents; }
  .field-row > .field > label { grid-row: 1; }
  .field-row > .field > input,
  .field-row > .field > select,
  .field-row > .field > textarea { grid-row: 2; }
  .field-row > .field > .hint { grid-row: 3; }
  .field-row > .field:nth-child(1) > * { grid-column: 1; }
  .field-row > .field:nth-child(2) > * { grid-column: 2; }
}
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
fieldset { border: 0; padding: 0; margin: 0 0 0.4rem; }
legend {
  font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); font-weight: 660; padding: 0; margin-bottom: 0.7rem;
}

/* ---------- notices ---------- */

.notice {
  border: 1px solid var(--line); border-left: 3px solid var(--brand);
  background: var(--surface); border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem; font-size: 0.88rem; color: var(--ink-soft);
}
.notice-accent { border-left-color: var(--accent); }
.notice strong { color: var(--ink); }
.form-status { border-radius: var(--radius-sm); padding: 0.7rem 0.95rem; font-size: 0.9rem; margin-bottom: 1rem; }
.form-status.ok { background: var(--pass-soft); color: var(--pass); }
.form-status.err { background: var(--fail-soft); color: var(--fail); }
.hidden, [hidden] { display: none !important; }

/* ---------- demo ---------- */

.demo-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 1.6rem; align-items: start; }
.demo-grid > * { min-width: 0; } /* let the results column shrink instead of overflowing the page */
.demo-form { position: sticky; top: 88px; }
.result-row {
  display: grid; grid-template-columns: 1.5fr 1fr 1.05fr 0.5fr 0.8fr auto;
  gap: 0.75rem; align-items: center;
  padding: 0.8rem 1rem; border-bottom: 1px solid var(--line);
}
.result-row:last-of-type { border-bottom: 0; }
.result-head { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 660; padding-bottom: 0.5rem; }
.result-lender { font-weight: 640; }
.result-lender .ver { display: block; font-size: 0.74rem; font-weight: 480; color: var(--muted); font-family: var(--mono); }
.result-figure { font-variant-numeric: tabular-nums; font-weight: 620; text-align: right; white-space: nowrap; font-size: 0.95rem; }
/* Column labels live in the header row on desktop; the .cap text is for the
   stacked mobile layout, where that header is hidden. */
.result-figure .cap { display: none; font-size: 0.72rem; font-weight: 520; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.result-toggle {
  background: none; border: 1px solid var(--line-strong); border-radius: 7px;
  color: var(--muted); cursor: pointer; font: inherit; font-size: 0.75rem; padding: 0.2rem 0.5rem;
}
.result-detail { padding: 0 1rem 1.1rem 1rem; font-size: 0.87rem; color: var(--ink-soft); }
.result-detail h4 { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0.9rem 0 0.35rem; }
.result-detail ul { margin: 0; }
.summary-strip { display: flex; flex-wrap: wrap; gap: 1.6rem; padding: 1.1rem 1.25rem; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.summary-strip div span { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.summary-strip div strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.skeleton { color: var(--muted); padding: 3rem 1rem; text-align: center; }

/* ---------- docs ---------- */

.doc-layout { display: grid; grid-template-columns: 220px 1fr; gap: 3rem; align-items: start; }
.toc { position: sticky; top: 88px; font-size: 0.9rem; }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin-bottom: 0.45rem; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--brand-dark); }
.toc .toc-head { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink); font-weight: 680; margin-bottom: 0.7rem; }
.doc-section { scroll-margin-top: 90px; margin-bottom: 3.2rem; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.9rem; }
.tab {
  font: inherit; font-size: 0.86rem; font-weight: 600; cursor: pointer;
  padding: 0.35rem 0.8rem; border-radius: 99px;
  background: transparent; color: var(--muted); border: 1px solid var(--line-strong);
}
.tab[aria-selected="true"] { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.tool-doc { margin-bottom: 1.6rem; }
.tool-doc > summary {
  cursor: pointer; padding: 0.9rem 1.2rem; list-style: none;
  display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap;
  border-radius: var(--radius);
}
.tool-doc > summary::-webkit-details-marker { display: none; }
.tool-doc > summary::after { content: "▸"; margin-left: auto; color: var(--muted); }
.tool-doc[open] > summary::after { content: "▾"; }
.tool-doc > summary .name { font-family: var(--mono); font-weight: 640; color: var(--brand-dark); }
.tool-doc > summary .what { font-size: 0.9rem; color: var(--muted); }
.tool-doc .body { padding: 0 1.2rem 1.2rem; }

/* ---------- footer ---------- */

.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 2.8rem 0 2rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-grid h4 { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.7rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; font-size: 0.92rem; }
.footer-grid a { color: var(--ink-soft); text-decoration: none; }
.footer-grid a:hover { color: var(--brand-dark); }
.disclaimer { border-top: 1px solid var(--line); padding-top: 1.4rem; font-size: 0.8rem; color: var(--muted); }
.disclaimer strong { color: var(--ink-soft); }

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .demo-grid, .doc-layout { grid-template-columns: 1fr; }
  .demo-form, .toc { position: static; }
  .toc { display: none; }
}

@media (max-width: 860px) {
  body { font-size: 16px; }
  section { padding: 3rem 0; }
  .hero-grid, .grid-2, .grid-3, .grid-4, .steps, .price-grid, .footer-grid { grid-template-columns: 1fr; }
  .price-figure { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 1.2rem; }
  .result-row { grid-template-columns: 1fr 1fr; gap: 0.5rem 0.75rem; }
  .result-head { display: none; }
  .result-lender { grid-column: 1 / -1; }
  .result-figure { text-align: left; }
  .result-figure .cap { display: block; }
  .result-toggle { grid-column: 1 / -1; justify-self: start; }

  .site-nav {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.25rem 1rem;
    box-shadow: var(--shadow);
  }
  .site-nav[data-open="false"] { display: none; }
  .site-nav a { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
  .site-nav .btn { margin-top: 0.8rem; }
  .nav-toggle {
    display: inline-flex; margin-left: auto; align-items: center; gap: 0.45rem;
    font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
    background: transparent; border: 1px solid var(--line-strong); border-radius: 99px;
    padding: 0.35rem 0.8rem; color: var(--ink);
  }
}

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

/* ---------- layout utilities ----------
   These exist so no page needs a style="" attribute: the Content-Security-Policy
   sets style-src 'self', which blocks inline style attributes outright. */

.mb-0 { margin-bottom: 0; }
.mb-04 { margin-bottom: 0.4rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-11 { margin-bottom: 1.1rem; }
.mb-15 { margin-bottom: 1.5rem; }
.mt-08 { margin-top: 0.8rem; }
.mt-09 { margin-top: 0.9rem; }
.mt-1 { margin-top: 1rem; }
.mt-11 { margin-top: 1.1rem; }
.mt-14 { margin-top: 1.4rem; }
.mt-16 { margin-top: 1.6rem; }
.only-mt-07 { margin: 0.7rem 0 0; }
.only-mt-08 { margin: 0.8rem 0 0; }
.w-full { width: 100%; }
.mw-720 { max-width: 720px; }
.justify-center { justify-content: center; }
.grid-roomy { gap: 3rem; align-items: start; }
.footer-blurb { margin-top: 0.8rem; max-width: 34ch; }
.lede-centered { margin-inline: auto; max-width: 52ch; }
.h-md { font-size: clamp(2rem, 4vw, 2.8rem); }
.h-sm { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.cta-card { padding: 2.6rem 1.5rem; }
.flush-card { padding: 0; overflow: hidden; }
.summary-strong { cursor: pointer; font-weight: 640; }
.mode-note { padding: 0.7rem 1.25rem; margin: 0; border-bottom: 1px solid var(--line); }
