/* Stacey Builds UI. Colours come from design/design-system.md (the doc wins);
   tests/tokens.test.js fails if these drift from design/tokens.json.
   Pages use these classes and variables only: no hex colours in pages. */
:root {
  --sb-blueprint: #4b5bef;
  --sb-zest: #d7f25c;
  --sb-fern: #23a455;
  --sb-bubblegum: #ff7eb6;
  --sb-mist: #e6e9ff;
  --sb-lime-milk: #f4fad9;
  --sb-blush: #fbe3ef;
  --sb-ink: #171a33;
  --sb-paper: #fffdf8;
  --sb-fern-deep: #17773d;
  --sb-blueprint-deep: #3846d6;
  --sb-muted: #5a5d75;
  --sb-line: #e2e0da;
  --sb-danger: #b3261e;
  --sb-font-display: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;
  --sb-font-body: "DM Sans", system-ui, sans-serif;
  --sb-radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--sb-paper); color: var(--sb-ink); font-family: var(--sb-font-body); font-size: 17px; line-height: 1.6; }
a { color: var(--sb-blueprint-deep); }
h1, h2, h3 { font-family: var(--sb-font-display); line-height: 1.1; margin: 0 0 .5em; }
h1 { font-weight: 800; font-size: clamp(34px, 6vw, 60px); }
h2 { font-weight: 600; font-size: 24px; }
h3 { font-weight: 600; font-size: 19px; }
p { margin: 0 0 1em; }
.lede { font-size: 20px; }
.hl { background: var(--sb-zest); color: var(--sb-ink); padding: 0 .18em; border-radius: .18em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.muted { color: var(--sb-muted); }
.small { font-size: 14px; }

/* ---------- SVG fills (attributes can't read CSS variables) */
.f-blueprint { fill: var(--sb-blueprint); }
.f-zest { fill: var(--sb-zest); }
.f-fern { fill: var(--sb-fern); }
.f-bubblegum { fill: var(--sb-bubblegum); }
.f-mist { fill: var(--sb-mist); }
.f-blush { fill: var(--sb-blush); }
.f-white { fill: #fff; }

/* ---------- header and layout */
.site-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; max-width: 1080px; margin: 0 auto; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--sb-ink); font-family: var(--sb-font-display); font-weight: 800; font-size: 22px; }
.wordmark .mark { width: 36px; height: 36px; }
.on-blue .wordmark { color: #fff; }
main.narrow { max-width: 640px; margin: 40px auto 80px; padding: 0 20px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- hero */
.hero { background: var(--sb-blueprint); color: #fff; padding-bottom: 72px; }
.hero h1 { color: #fff; max-width: 820px; }
.hero .lede { max-width: 640px; color: #fff; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start; padding-top: 32px; }
.hero-art { display: flex; justify-content: center; }
.hero-art svg { width: 100%; max-width: 280px; height: auto; }
@media (max-width: 820px) { .hero-grid { grid-template-columns: 1fr; } .hero-art { display: none; } }

/* ---------- pills, buttons */
.pill { display: inline-block; font-weight: 500; font-size: 14px; padding: 3px 12px; border-radius: 99px; color: var(--sb-ink); background: var(--sb-mist); }
.pill-zest { background: var(--sb-zest); }
.pill-bubblegum { background: var(--sb-bubblegum); }
.pill-fern { background: var(--sb-fern); }
.pill-white { background: #fff; }
.pill-outline { background: transparent; border: 1.5px solid var(--sb-ink); }
.btn { display: inline-block; font: inherit; font-weight: 500; font-size: 16px; padding: 11px 22px; border-radius: 12px; border: 1.5px solid var(--sb-ink); background: #fff; color: var(--sb-ink); cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--sb-blueprint); border-color: var(--sb-blueprint); color: #fff; }
.btn-primary:hover { background: var(--sb-blueprint-deep); border-color: var(--sb-blueprint-deep); }
.btn-small { font-size: 14px; padding: 6px 14px; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- cards */
.card { background: #fff; border-radius: 18px; padding: 24px; border: 1px solid var(--sb-line); }
.card-mist { background: var(--sb-mist); border-color: transparent; }
.card-blush { background: var(--sb-blush); border-color: transparent; }
.card-lime { background: var(--sb-lime-milk); border-color: transparent; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 820px) { .grid-3 { grid-template-columns: 1fr; } }
.section { padding: 56px 0; }

/* ---------- form */
.form-card { background: #fff; color: var(--sb-ink); border-radius: 20px; padding: 26px; }
.field { margin-bottom: 18px; }
.field > label, .field > .label { display: block; font-weight: 500; margin-bottom: 6px; }
.field input[type=text], .field input[type=email], .field textarea, .field select {
  width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 1.5px solid var(--sb-line); border-radius: 10px; background: #fff; color: var(--sb-ink);
}
.field textarea { min-height: 76px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 3px solid var(--sb-mist); border-color: var(--sb-blueprint); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span { display: inline-block; padding: 7px 14px; border-radius: 99px; border: 1.5px solid var(--sb-line); cursor: pointer; font-size: 15px; }
.choice input:checked + span { background: var(--sb-zest); border-color: var(--sb-ink); }
.choice input:focus-visible + span { outline: 3px solid var(--sb-blueprint); }
.scale-ends { display: flex; justify-content: space-between; font-size: 13px; color: var(--sb-muted); margin-top: 4px; max-width: 300px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.consent input { margin-top: 5px; width: 18px; height: 18px; }
.error { color: var(--sb-danger); font-size: 14px; margin-top: 4px; }
.error:empty { display: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- footer */
.site-foot { border-top: 1px solid var(--sb-line); padding: 28px 20px; text-align: center; font-size: 14px; color: var(--sb-muted); }

/* ---------- operating system (staceybuilds.app) */
body.os { background: var(--sb-paper); font-size: 15px; }
.topbar { display: flex; align-items: center; gap: 24px; padding: 12px 24px; border-bottom: 1px solid var(--sb-line); background: #fff; }
.topbar .wordmark { font-size: 18px; }
.topbar .wordmark .mark { width: 28px; height: 28px; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { text-decoration: none; color: var(--sb-ink); padding: 6px 12px; border-radius: 8px; }
.topbar nav a[aria-current=page] { background: var(--sb-mist); font-weight: 500; }
.topbar .who { font-size: 13px; color: var(--sb-muted); display: flex; gap: 10px; align-items: center; }
.os main { max-width: 1180px; margin: 0 auto; padding: 28px 24px 60px; }
.os h1 { font-size: 30px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 24px; }
.tile { background: #fff; border: 1px solid var(--sb-line); border-radius: var(--sb-radius); padding: 16px 18px; }
.tile .label { font-size: 13px; color: var(--sb-muted); }
.tile .value { font-family: var(--sb-font-display); font-weight: 800; font-size: 32px; line-height: 1.1; }
.tile-zest { background: var(--sb-zest); border-color: transparent; }
.tile-zest .label { color: var(--sb-ink); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input, .toolbar select { font: inherit; padding: 7px 10px; border: 1.5px solid var(--sb-line); border-radius: 8px; background: #fff; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--sb-line); border-radius: var(--sb-radius); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--sb-line); vertical-align: top; }
.table th { font-weight: 500; color: var(--sb-muted); background: var(--sb-paper); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table td.task { max-width: 360px; }
.banner { padding: 12px 16px; border-radius: 12px; background: var(--sb-lime-milk); margin-bottom: 18px; }
.banner-warn { background: var(--sb-blush); }
.bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--sb-mist); margin: 8px 0; }
.bar span { display: block; height: 100%; }
.bar .b-business { background: var(--sb-blueprint); }
.bar .b-household { background: var(--sb-bubblegum); }
.bar .b-both { background: var(--sb-zest); }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--sb-muted); flex-wrap: wrap; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.dot.b-business { background: var(--sb-blueprint); }
.dot.b-household { background: var(--sb-bubblegum); }
.dot.b-both { background: var(--sb-zest); }
.empty { padding: 28px; text-align: center; color: var(--sb-muted); }
.login { max-width: 420px; margin: 12vh auto; text-align: center; }
.section-gap { margin-top: 28px; }
