/* ClearMile — shared styles. Neutral base, high-vis yellow as the single signature colour. */
:root {
  --paper: #FAFAF7;
  --surface: #FFFFFF;
  --ink: #141414;
  --ink-2: #3B3B37;
  --muted: #5C5C56;
  --line: #E3E1D8;
  --line-strong: #C9C6BA;
  --hi: #FFC72C;          /* signature yellow — fills only, never text on light */
  --smog: #8C8A80;        /* illustration only */
  --ok: #1F7A4D;
  --err: #B42318;
  --radius: 14px;
  --wrap: 1120px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
}
img, svg { max-width: 100%; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--ink-2); }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.03em; line-height: 1.05; margin: 0; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* ---------- Header / footer ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding-top: 14px; padding-bottom: 14px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.03em; text-decoration: none; color: var(--ink); }
.logo-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--hi); border: 2px solid var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.logo-dot::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.nav a { padding: 10px 12px; text-decoration: none; font-weight: 600; color: var(--ink-2); border-radius: 10px; }
.nav a:hover { background: #F0EEE6; color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; }

.site-footer { border-top: 1px solid var(--line); margin-top: 0; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; padding-top: 32px; padding-bottom: 40px; font-size: 14px; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer a { color: var(--ink-2); }
.disclaimer { max-width: 560px; font-size: 13px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border-radius: 12px; border: 2px solid var(--ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .08s ease, box-shadow .08s ease; }
.btn-primary { background: var(--hi); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.btn-primary:hover { color: var(--ink); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn-primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: #F0EEE6; }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { color: #fff; background: #2A2A27; }
.btn-small { min-height: 40px; padding: 8px 14px; font-size: 15px; border-width: 1.5px; box-shadow: none; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: none; padding: 6px; font: inherit; color: var(--ink-2); text-decoration: underline; cursor: pointer; }

/* ---------- Marketing sections ---------- */
.hero { padding: 72px 0 80px; }
.hero h1 { font-size: clamp(46px, 8vw, 96px); font-weight: 800; letter-spacing: -0.045em; line-height: 0.95; max-width: 900px; }
.hero .lede { margin-top: 24px; max-width: 620px; font-size: clamp(18px, 2.2vw, 21px); color: var(--ink-2); }
.hero .actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border: 1.5px solid var(--ink); border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--surface); margin-bottom: 22px; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--hi); border: 1.5px solid var(--ink); }

.section { padding: 88px 0; border-top: 1px solid var(--line); }
.section.dark { background: var(--ink); color: #F4F2EA; border-top: none; }
.section.dark .eyebrow, .section.dark .muted { color: #B9B6AB; }
.section h2 { font-size: clamp(34px, 5vw, 58px); font-weight: 800; max-width: 860px; }
.section .intro { margin-top: 18px; max-width: 700px; font-size: 19px; color: var(--ink-2); }
.section.dark .intro { color: #D9D6CB; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: 44px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card h3 { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.card p { margin-top: 8px; color: var(--muted); font-size: 16px; }
.stat { background: #1F1F1D; border-radius: var(--radius); padding: 26px; }
.stat .num { font-family: var(--display); font-size: clamp(44px, 6vw, 60px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; color: #fff; }
.stat .num .hl { background: var(--hi); color: var(--ink); padding: 0 8px; border-radius: 8px; }
.stat p { margin-top: 10px; color: #D9D6CB; font-size: 16px; }
.source { margin-top: 18px; font-size: 13px; color: #A9A69B; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 44px 0 0; display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.steps li { border-top: 2px solid var(--ink); padding-top: 18px; }
.steps li::before { counter-increment: step; content: "0" counter(step); font-family: var(--display); font-weight: 800; font-size: 15px; display: inline-block; background: var(--hi); border: 1.5px solid var(--ink); border-radius: 6px; padding: 0 8px; }
.steps h3 { margin-top: 12px; font-size: 24px; font-weight: 700; }
.steps p { margin-top: 8px; color: var(--ink-2); }
.callout { margin-top: 40px; padding: 22px 24px; border: 1.5px dashed var(--ink); border-radius: var(--radius); background: var(--surface); }
.two-col { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-top: 44px; }
.checklist { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist .mark { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; margin-top: 2px; }
.checklist .yes { background: var(--hi); border: 1.5px solid var(--ink); }
.checklist .no { background: #EDEBE3; color: var(--ink-2); }
.cta-band { margin: 0 auto; padding: 56px 40px; border-radius: 28px; background: var(--hi); border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.cta-band h2 { font-size: clamp(30px, 4.2vw, 48px); max-width: 640px; }
.cta-band p { margin-top: 10px; font-size: 18px; max-width: 600px; }

/* Infographic image */
.infographic { margin: 36px 0 0; }
.infographic img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }

/* Illustration: curtain of clean air */
.curtain-fig { margin-top: 44px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.curtain-fig figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 18px; }
.row { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .legend { font-weight: 700; font-size: 15px; }
.hint { font-size: 13px; color: var(--muted); font-weight: 400; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line-strong); border-radius: 10px; padding: 12px 14px; min-height: 48px; width: 100%;
}
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: 2px solid var(--hi); outline-offset: 0; }
fieldset { border: none; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }

/* Chip-style radios and checkboxes (real inputs, visually chips) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: 15px; font-weight: 600; color: var(--ink-2); user-select: none; }
.chip input:checked + span { background: var(--hi); border-color: var(--ink); color: var(--ink); }
.chip input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.chip:hover span { border-color: var(--ink); }

/* 1–5 scale */
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.scale .chip span { width: 100%; justify-content: center; border-radius: 10px; padding: 8px 4px; }
.scale-ends { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 4px; gap: 12px; }
.scale.wide { grid-template-columns: repeat(11, minmax(0, 1fr)); }
.scale.wide .chip span { font-size: 14px; padding: 8px 0; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.panel h2 { font-size: 26px; font-weight: 800; }
.panel-section { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 22px; }
.panel-section > h3 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
details.more { border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; background: #FCFBF8; }
details.more summary { cursor: pointer; font-weight: 700; padding: 12px 0; }
details.more[open] { padding-bottom: 16px; }

.notice { padding: 14px 16px; border-radius: 12px; font-size: 15px; }
.notice.ok { background: #E7F4EC; color: #14532D; border: 1px solid #B7DEC5; }
.notice.err { background: #FDECEA; color: #7A1A12; border: 1px solid #F3C1BB; }
.notice.info { background: #FFF6D6; color: #4A3B00; border: 1px solid #F0D98A; }
.demo-banner { background: var(--ink); color: #F4F2EA; font-size: 14px; text-align: center; padding: 8px 16px; }
.demo-banner code { background: #333; padding: 1px 6px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ---------- App (tester / admin) ---------- */
.app-main { padding-top: 36px; padding-bottom: 72px; }
.app-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.app-head h1 { font-size: clamp(30px, 4.5vw, 44px); font-weight: 800; }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.tile .label { font-size: 13px; color: var(--muted); font-weight: 600; }
.tile .value { font-family: var(--display); font-size: 32px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin-top: 4px; }
.tile .sub { font-size: 13px; color: var(--muted); }
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th, table.data td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: 13px; color: var(--muted); font-weight: 700; background: #FCFBF8; white-space: nowrap; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: none; }
.tag { display: inline-block; padding: 2px 8px; margin: 2px 4px 2px 0; border-radius: 999px; background: #F0EEE6; font-size: 13px; color: var(--ink-2); }
.tag.warn { background: #FDECEA; color: #7A1A12; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.auth-card { max-width: 440px; margin: 48px auto; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 20px; }
.filters .field { min-width: 160px; }
.split { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); margin-top: 16px; }
.chart-card h3 { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.chart-card .note { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Bar chart (single series, horizontal) */
.hbar { display: grid; gap: 2px; margin-top: 16px; }
.hbar-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; align-items: center; gap: 10px; min-height: 30px; padding: 2px 0; border-radius: 6px; }
.hbar-row:hover { background: #F6F4EE; }
.hbar-label { font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 14px; position: relative; }
.hbar-fill { height: 100%; background: #3B3B37; border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar-value { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink); min-width: 52px; text-align: right; }
.chart-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--ink); color: #fff; font-size: 13px; padding: 6px 10px; border-radius: 8px; max-width: 260px; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding: 48px 0 56px; }
  .section { padding: 64px 0; }
  .panel { padding: 20px; }
  .cta-band { padding: 36px 24px; box-shadow: 5px 5px 0 var(--ink); }
  .scale.wide { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
