/* Customer Learning Assessment. Tokens from the Matt Shroyer design system (Day / Dusk).
   Layout: one reading column on paper, wide and low; hairlines over shadows; lake marks
   what matters, ember appears once per view. */
:root {
  --surface: #f6f3ee;
  --surface-raised: #fffdf9;
  --line: #d9d1c4;
  --ink: #1c2431;
  --ink-muted: #4e596b;
  --lake: #2e4f91;
  --on-lake: #ffffff;
  --lake-soft: #dfe6f2;
  --sky: #7391c5;
  --fairway: #495e30;
  --ember: #a03e25;
  --ember-soft: #f5e1d6;
  --gold: #e7b05c;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Public Sans", "Segoe UI", system-ui, sans-serif;
  --space-1: 4px; --space-2: 8px; --space-3: 16px; --space-4: 24px; --space-5: 40px; --space-6: 64px;
  --radius-sm: 2px; --radius-md: 6px; --radius-lg: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #141a23; --surface-raised: #1d2530; --line: #333d4c; --ink: #f1ece4; --ink-muted: #a5b1cc;
    --lake: #8aa6d8; --on-lake: #141a23; --lake-soft: #1f2d47; --sky: #5c77ae; --fairway: #a9af43;
    --ember: #e08a5e; --ember-soft: #3b1d14; --gold: #e7b05c; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface: #141a23; --surface-raised: #1d2530; --line: #333d4c; --ink: #f1ece4; --ink-muted: #a5b1cc;
  --lake: #8aa6d8; --on-lake: #141a23; --lake-soft: #1f2d47; --sky: #5c77ae; --fairway: #a9af43;
  --ember: #e08a5e; --ember-soft: #3b1d14; --gold: #e7b05c; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--surface); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.6;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
a { color: var(--lake); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--lake); outline-offset: 2px; }
h1, h2 { font-family: var(--serif); font-weight: 500; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(34px, 6vw, 44px); line-height: 1.1; letter-spacing: -0.01em; }
h2 { font-size: clamp(26px, 4.5vw, 30px); line-height: 1.2; }
h3 { font-size: 20px; line-height: 1.3; font-weight: 600; margin: 0; text-wrap: balance; }
p { margin: 0; }
.eyebrow { font-size: 13px; line-height: 1.2; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.eyebrow.ember { color: var(--ember); }
.muted { color: var(--ink-muted); }
.small { font-size: 15px; line-height: 1.5; }
.caption { font-size: 13px; line-height: 1.4; color: var(--ink-muted); }
.quote { font-family: var(--serif); font-style: italic; font-size: 24px; line-height: 1.4; }

.page { max-width: 760px; margin: 0 auto; padding-block: var(--space-4) var(--space-6); }
.masthead { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); padding-block: var(--space-3); border-bottom: 1px solid var(--line); }
.masthead a.name { font-family: var(--serif); font-size: 22px; color: var(--ink); text-decoration: none; }
.masthead .tag { font-size: 13px; color: var(--ink-muted); }

.progress { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--surface); padding-block: var(--space-3); border-bottom: 1px solid var(--line); display: grid; gap: var(--space-2); }
.progress .row { display: flex; justify-content: space-between; gap: var(--space-3); font-size: 13px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.progress .track { height: 3px; background: var(--line); }
.progress .fill { height: 100%; background: var(--lake); width: 0; transition: width .25s ease; }

main { display: grid; gap: var(--space-5); padding-top: var(--space-5); }
.stack { display: grid; gap: var(--space-3); }
.stack-lg { display: grid; gap: var(--space-4); }
.lede { font-size: 19px; max-width: 62ch; }
.prose { max-width: 64ch; display: grid; gap: var(--space-3); }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts > div { padding: var(--space-3) var(--space-3) var(--space-3) 0; display: grid; gap: var(--space-1); min-width: 0; }
.facts > div + div { padding-left: var(--space-3); border-left: 1px solid var(--line); }
.facts b { font-family: var(--serif); font-weight: 500; font-size: 26px; line-height: 1.1; }
@media (max-width: 560px) {
  .facts { grid-template-columns: 1fr; }
  .facts > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
}

.section-head { display: grid; gap: var(--space-2); }
.section-head + .questions { margin-top: var(--space-2); }
.questions { display: grid; gap: var(--space-5); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
.q { display: grid; gap: var(--space-3); }
.q-prompt { font-weight: 600; font-size: 18px; line-height: 1.4; }
.q-help { font-size: 15px; color: var(--ink-muted); margin-top: calc(-1 * var(--space-2)); }
.options { display: grid; gap: var(--space-2); }
.opt { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: var(--space-3); align-items: start; padding: 12px var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); cursor: pointer; }
.opt input { appearance: none; -webkit-appearance: none; margin: 3px 0 0; width: 18px; height: 18px; border: 1.5px solid var(--ink-muted); border-radius: 50%; display: grid; place-items: center; background: var(--surface-raised); }
.opt input::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--lake); transform: scale(0); transition: transform .12s ease; }
.opt input:checked { border-color: var(--lake); }
.opt input:checked::after { transform: scale(1); }
.opt:has(input:checked) { border-color: var(--lake); background: var(--lake-soft); }
.opt:has(input:focus-visible) { outline: 2px solid var(--lake); outline-offset: 2px; }
.opt input:focus-visible { outline: none; }
.opt.unknown span { color: var(--ink-muted); }
.q.missing .q-prompt::after { content: "  Please choose an answer."; color: var(--ember); font-weight: 400; font-size: 15px; }

label.field { display: grid; gap: var(--space-1); }
label.field > span { font-size: 15px; font-weight: 500; }
label.field > span em { font-style: normal; font-weight: 400; color: var(--ink-muted); }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select, textarea {
  font: inherit; font-size: 17px; color: var(--ink); background: var(--surface-raised);
  border: 1px solid var(--ink-muted); border-radius: var(--radius-sm); padding: 10px 12px; width: 100%; min-width: 0;
}
textarea { min-height: 96px; resize: vertical; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
@media (max-width: 560px) { .field-grid { grid-template-columns: 1fr; } }
.field.invalid input, .field.invalid textarea { border-color: var(--ember); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.terms { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.terms .opt { grid-template-columns: auto; padding: 8px 14px; }
.terms .opt input { position: absolute; opacity: 0; pointer-events: none; }
.terms .opt span { font-size: 15px; }
.custom-term { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); max-width: 480px; }

/* estimator */
.layers { display: grid; border-top: 1px solid var(--line); }
.layer { display: grid; grid-template-columns: minmax(0, 1fr) 96px minmax(0, 210px); gap: var(--space-3); align-items: center; padding-block: var(--space-3); border-bottom: 1px solid var(--line); }
.layer .what { display: grid; gap: 2px; min-width: 0; }
.layer .what b { font-weight: 600; }
.layer .what span { font-size: 15px; color: var(--ink-muted); }
.layer .share { display: flex; align-items: center; gap: var(--space-1); }
.layer .share input { width: 72px; text-align: right; font-variant-numeric: tabular-nums; }
.layer-head { display: grid; grid-template-columns: minmax(0, 1fr) 96px minmax(0, 210px); gap: var(--space-3); font-size: 13px; color: var(--ink-muted); padding-bottom: var(--space-2); }
@media (max-width: 620px) {
  .layer-head { display: none; }
  .layer { grid-template-columns: 96px minmax(0, 1fr); }
  .layer .what { grid-column: 1 / -1; }
  .layer .share::before { content: "Share"; font-size: 13px; color: var(--ink-muted); margin-right: 4px; }
}
.total { font-size: 15px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.estimate { display: grid; gap: var(--space-3); padding: var(--space-4); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.estimate .big { font-family: var(--serif); font-size: clamp(28px, 5vw, 36px); line-height: 1.15; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--sans); font-size: 12px; fill: var(--ink-muted); }

/* nav */
.nav { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding-top: var(--space-4); border-top: 1px solid var(--line); }
button { font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; border-radius: var(--radius-md); padding: 12px 20px; border: 1px solid var(--lake); background: var(--lake); color: var(--on-lake); }
button.secondary { background: transparent; color: var(--ink); border-color: var(--ink-muted); }
button.link { background: none; border: 0; padding: 0; color: var(--lake); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
button:disabled { opacity: .55; cursor: default; }
.error { color: var(--ember); font-size: 15px; }
.notice { padding: var(--space-3); background: var(--lake-soft); border-radius: var(--radius-md); font-size: 15px; }

/* results */
.results-block { display: grid; gap: var(--space-3); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.explore { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; }
.explore li { padding: 12px 0; border-bottom: 1px solid var(--line); font-family: var(--serif); font-size: 22px; line-height: 1.3; }
.explore li:first-child { border-top: 1px solid var(--line); }

footer.site { margin-top: var(--space-6); padding-top: var(--space-3); border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3); font-size: 13px; color: var(--ink-muted); }
footer.site a { color: var(--ink-muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.opt input[type="checkbox"] { border-radius: var(--radius-sm); }
.opt input[type="checkbox"]::after { border-radius: 1px; width: 10px; height: 10px; }
