/* tastemaker · macrostructure: Product Demo / Workbench · mood: technical · page: scanner
 * arc: hook(H1 + live form) -> proof(example finding, then the real report) -> how(coverage) -> close(scan another)
 * nav: N1 · hero: H1 · footer: Ft2 · knobs: hero=statement+form/left/example-right
 * palette: seed 1 (technical/light + dark companion) · contrast: pass (matrix, 2026-11-05)
 * critique: pending user review */

/* ---------- Fonts (self-hosted, OFL, Braille Institute) ---------- */
@font-face {
  font-family: "Atkinson Next";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2-variations"),
       url("/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Next";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2") format("woff2-variations"),
       url("/fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/fonts/atkinson-hyperlegible-mono-latin-wght-normal.woff2") format("woff2-variations"),
       url("/fonts/atkinson-hyperlegible-mono-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/fonts/atkinson-hyperlegible-mono-latin-ext-wght-normal.woff2") format("woff2-variations"),
       url("/fonts/atkinson-hyperlegible-mono-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;

  --bg: #f1fcf9;
  --surface: #e7f2ef;
  --field: #ffffff;
  --text: #111d1b;
  --muted: #46605a;
  --primary: #178372;
  --primary-hover: #0d6a5c;
  --on-primary: #ffffff;
  --accent: #187c8b;
  --link: #0d6a5c;
  --focus: #0d6a5c;
  --edge: #6a817b;        /* state-carrying border, 3:1+ */
  --hairline: #d7e2df;    /* decorative only */
  --track: #c3e7de;

  --sev-critical: #a8202b;  --sev-critical-tint: #fdeaea;  --sev-critical-bar: #a8202b;
  --sev-serious: #9a4400;   --sev-serious-tint: #fcebdc;   --sev-serious-bar: #c25a0a;
  --sev-moderate: #715600;  --sev-moderate-tint: #f8efcc;  --sev-moderate-bar: #a07a00;
  --sev-minor: #3f4f5e;     --sev-minor-tint: #e6ecf1;     --sev-minor-bar: #6b7b8a;

  --font: "Atkinson Next", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Atkinson Mono", ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: clamp(1.75rem, 1.35rem + 1.6vw, 2.25rem);
  --step-4: clamp(2.125rem, 1.4rem + 3.2vw, 3.25rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --radius-control: 8px;
  --radius-panel: 12px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09100e;
    --surface: #141b19;
    --field: #0e1513;
    --text: #e6f6f2;
    --muted: #a2b7b1;
    --primary: #178372;
    --primary-hover: #147a6a;
    --on-primary: #ffffff;
    --accent: #29b1c5;
    --link: #29b1c5;
    --focus: #29b1c5;
    --edge: #5f7570;
    --hairline: #1f2725;
    --track: #15342e;

    --sev-critical: #ff9a9a;  --sev-critical-tint: #3b1618;  --sev-critical-bar: #f26b6b;
    --sev-serious: #ffb27a;   --sev-serious-tint: #3a2412;   --sev-serious-bar: #f08a3c;
    --sev-moderate: #f0cd61;  --sev-moderate-tint: #332a0f;  --sev-moderate-bar: #d9b030;
    --sev-minor: #bccad6;     --sev-minor-tint: #1f272e;     --sev-minor-bar: #8796a3;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--space-6);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.55;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.2;
  font-weight: 750;
  text-wrap: balance;
}
h1 { line-height: 1.1; }
/* Tighter tracking only where headings are 24px or larger. */
h1, h2, .report__section > h3 { letter-spacing: -0.012em; }

p { margin: 0; text-wrap: pretty; }

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

code, pre { font-family: var(--mono); font-size: 0.875em; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  inset-inline-start: var(--space-4);
  top: var(--space-2);
  z-index: 10;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-control);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.icon { flex: none; }

/* ---------- Header ---------- */
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 4.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  text-decoration: none;
  min-height: 44px;
}
.brand__mark { color: var(--primary); }
.brand__name { font-size: var(--step-1); font-weight: 750; letter-spacing: -0.02em; }

.site-header__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--space-2);
  font-weight: 600;
}

/* ---------- Hero ---------- */
.hero { padding-block: var(--space-12) var(--space-16); }

.hero__grid {
  display: grid;
  gap: var(--space-12);
  align-items: start;
}

@media (min-width: 60rem) {
  .hero__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-16); }
  .example { margin-top: var(--space-4); }
}

.hero h1 { font-size: var(--step-4); max-width: 18ch; }

.lede {
  margin-top: var(--space-6);
  max-width: 54ch;
  color: var(--muted);
  font-size: var(--step-1);
  line-height: 1.5;
}

.fact {
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: 1px solid var(--hairline);
  max-width: 54ch;
  color: var(--muted);
  font-size: var(--step--1);
}

/* ---------- Form ---------- */
.scan-form { margin-top: var(--space-8); max-width: 40rem; }

.scan-form__label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 600;
}

.scan-form__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.scan-form__input {
  flex: 1 1 16rem;
  min-width: 0;
  min-height: 3.25rem;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--edge);
  border-radius: var(--radius-control);
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: var(--step-1);
  transition: border-color 120ms var(--ease-out);
}
.scan-form__input::placeholder { color: var(--muted); opacity: 1; }
.scan-form__input[aria-invalid="true"] { border-color: var(--sev-critical); border-width: 2px; }

.scan-form__hint {
  margin-top: var(--space-2);
  color: var(--muted);
  font-size: var(--step--1);
}

.scan-form__error {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-top: var(--space-2);
  color: var(--sev-critical);
  font-weight: 600;
}
.scan-form__error .icon { margin-top: 0.2em; }

.noscript { margin-top: var(--space-4); font-weight: 600; }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 3.25rem;
  padding: var(--space-3) var(--space-6);
  border: 1.5px solid transparent;
  border-radius: var(--radius-control);
  font: inherit;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms var(--ease-out), border-color 120ms var(--ease-out);
}

.button--primary { background: var(--primary); color: var(--on-primary); }
.button--primary[aria-disabled="true"] { cursor: progress; }

.button--quiet {
  min-height: 2.75rem;
  padding-inline: var(--space-4);
  background: transparent;
  border-color: var(--edge);
  color: var(--text);
}

/* ---------- Panels ---------- */
.panel {
  padding: var(--space-6);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-panel);
  background: var(--surface);
}

.progress, .problem { margin-top: var(--space-6); max-width: 40rem; }
.report { padding-block: 0 var(--space-12); }

/* ---------- Progress ---------- */
.progress__panel { display: grid; gap: var(--space-4); }
.progress__title { font-size: var(--step-2); overflow-wrap: anywhere; }
.progress__title:focus { outline: none; }

.progress__track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}
/* Static full bar by default; the sweep runs only under prefers-reduced-motion: no-preference. */
.progress__bar {
  position: absolute;
  inset-block: 0;
  width: 100%;
  border-radius: inherit;
  background: var(--primary);
  opacity: 0.55;
}
@keyframes sweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(270%); }
}

.progress__elapsed { color: var(--muted); font-variant-numeric: tabular-nums; }
.progress__panel .button { justify-self: start; }

/* ---------- Problem ---------- */
.problem__panel { display: grid; gap: var(--space-4); border-color: var(--edge); }
.problem__title { font-size: var(--step-2); }
.problem__title:focus { outline: none; }
.problem__panel .button { justify-self: start; }

/* ---------- Report ---------- */
/* Opacity cross-fade for everyone; the 8px rise is added under no-preference. */
.report { animation: fade-in 200ms var(--ease-out) both; }
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.report__head {
  display: grid;
  gap: var(--space-6);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--hairline);
}
@media (min-width: 52rem) {
  .report__head { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
}

.report__title { font-size: var(--step-3); overflow-wrap: anywhere; }
.report__title:focus { outline: none; }
.report__meta { margin-top: var(--space-2); color: var(--muted); font-size: var(--step--1); }
.report__url { overflow-wrap: anywhere; }
.report__refresh {
  margin-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
}
.report__saved { max-width: 46ch; font-size: var(--step--1); text-wrap: pretty; }

.score {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}
.score__value { font-size: clamp(3rem, 2rem + 4vw, 4.5rem); font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.score__max { color: var(--muted); font-size: var(--step-1); }
.score__label { display: block; color: var(--muted); font-size: var(--step--1); }

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin: var(--space-8) 0 0;
}
@media (min-width: 48rem) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.stats__item {
  padding: var(--space-4);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-panel);
  background: var(--surface);
}
.stats dt { color: var(--muted); font-size: var(--step--1); }
.stats dd { margin: var(--space-1) 0 0; font-size: var(--step-2); font-weight: 750; font-variant-numeric: tabular-nums; }

.severity { margin-top: var(--space-6); }
.severity__bar {
  display: flex;
  gap: 2px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--track);
}
.severity__bar span { min-width: 6px; }
.severity__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--step--1);
}
.severity__legend li { display: inline-flex; align-items: center; gap: var(--space-2); }

.note {
  margin-top: var(--space-6);
  padding: var(--space-4);
  border-inline-start: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  max-width: 68ch;
}

.report__section { margin-top: var(--space-12); }
.report__section > h3 { font-size: var(--step-2); }
.report__section > p { margin-top: var(--space-2); color: var(--muted); max-width: 68ch; }

.issues, .manual-list { margin: var(--space-6) 0 0; padding: 0; list-style: none; display: grid; gap: var(--space-3); }

/* ---------- Issue card ---------- */
.issue {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-panel);
  background: var(--surface);
}
.issue--static { padding: var(--space-6); }

.issue > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-4) var(--space-6);
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius-panel);
}
.issue > summary::-webkit-details-marker { display: none; }

.issue__summary { display: grid; gap: var(--space-2); }
.issue__main { display: grid; gap: var(--space-2); justify-items: start; }
.issue__title { font-weight: 650; font-size: var(--step-1); line-height: 1.3; overflow-wrap: anywhere; }
.issue__title code { font-size: 0.85em; padding: 0.05em 0.3em; border-radius: 4px; background: var(--field); border: 1px solid var(--hairline); }
.issue__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); color: var(--muted); font-size: var(--step--1); }
.issue__group { color: var(--muted); font-size: var(--step--1); font-weight: 600; }

.chevron {
  align-self: center;
  color: var(--muted);
}
.issue[open] .chevron { transform: rotate(180deg); }

.issue__body {
  display: grid;
  gap: var(--space-4);
  padding: 0 var(--space-6) var(--space-6);
}
.issue__body > p { max-width: 68ch; }
.issue__body > .button { justify-self: start; }

.elements { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-3); }
.element {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-control);
  background: var(--bg);
}
.issue--static .element { margin-top: var(--space-4); }
.element__label { font-weight: 650; overflow-wrap: anywhere; }
.element__selector { color: var(--muted); font-size: var(--step--1); overflow-wrap: anywhere; }
.element__selector code { font-size: 1em; }
.element__explanation { color: var(--muted); font-size: var(--step--1); white-space: pre-line; overflow-wrap: anywhere; }
.element__explanation--shared { padding: var(--space-3) var(--space-4); border-radius: var(--radius-control); background: var(--bg); }
.report { scroll-margin-top: var(--space-8); }

.code {
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-control);
  background: var(--field);
  color: var(--text);
  font-size: var(--step--1);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.code code { font-size: 1em; }

/* ---------- Badges & chips ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.2em 0.6em;
  border-radius: 6px;
  font-size: var(--step--1);
  font-weight: 700;
  line-height: 1.3;
}
.badge__icon { flex: none; }
.badge--critical { color: var(--sev-critical); background: var(--sev-critical-tint); }
.badge--serious { color: var(--sev-serious); background: var(--sev-serious-tint); }
.badge--moderate { color: var(--sev-moderate); background: var(--sev-moderate-tint); }
.badge--minor { color: var(--sev-minor); background: var(--sev-minor-tint); }

.bar--critical { background: var(--sev-critical-bar); }
.bar--serious { background: var(--sev-serious-bar); }
.bar--moderate { background: var(--sev-moderate-bar); }
.bar--minor { background: var(--sev-minor-bar); }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.1em 0.55em;
  border: 1px solid var(--edge);
  border-radius: 999px;
  color: var(--text);
  font-size: var(--step--1);
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Example figure ---------- */
.example { margin: 0; }
.example figcaption { margin-top: var(--space-3); color: var(--muted); font-size: var(--step--1); }
.example .issue__summary { gap: var(--space-3); justify-items: start; }

/* ---------- Manual list ---------- */
.manual-list { gap: 0; border-top: 1px solid var(--hairline); }
.manual-list li {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--hairline);
}
.manual-list .icon { margin-top: 0.25em; color: var(--muted); }

.report__actions { margin-top: var(--space-12); display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ---------- Coverage ---------- */
.coverage {
  padding-block: var(--space-16);
  border-top: 1px solid var(--hairline);
}
.coverage h2 { font-size: var(--step-3); }
.coverage__intro { margin-top: var(--space-4); max-width: 60ch; color: var(--muted); }
.coverage__grid {
  display: grid;
  gap: var(--space-8);
  margin-top: var(--space-8);
}
@media (min-width: 48rem) {
  .coverage__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-12); }
}
.coverage h3 { font-size: var(--step-1); }

.checklist { margin: var(--space-4) 0 0; padding: 0; list-style: none; display: grid; gap: var(--space-3); }
.checklist li { position: relative; padding-inline-start: 1.75rem; }
.checklist li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0.15rem;
  top: 0.45em;
  width: 0.9rem;
  height: 0.5rem;
  border-inline-start: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(-45deg);
}
.checklist--manual li::before {
  top: 0.4em;
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid var(--edge);
  border-radius: 50%;
  transform: none;
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: var(--space-8);
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: var(--step--1);
}
.site-footer__inner { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); }

/* ---------- Hover: only on pointers that can hover (on touch, :hover sticks after a tap) ---------- */
@media (hover: hover) {
  a:hover { text-decoration-thickness: 2px; }
  .scan-form__input:not([aria-invalid="true"]):hover { border-color: var(--text); }
  .button--primary:hover { background: var(--primary-hover); }
  .button--quiet:hover { border-color: var(--text); }
  .issue > summary:hover .issue__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
}

/* ---------- Motion: opt-in, so nothing moves unless the person allows it ---------- */
@media (prefers-reduced-motion: no-preference) {
  .progress__bar {
    width: 38%;
    opacity: 1;
    animation: sweep 1.6s cubic-bezier(0.65, 0, 0.35, 1) infinite; /* indeterminate loader: exempt from the 300ms UI budget */
  }
  .report { animation-name: rise; animation-duration: 240ms; }
  .chevron { transition: transform 160ms var(--ease-out); }
  .button {
    transition: background-color 120ms var(--ease-out), border-color 120ms var(--ease-out), transform 150ms var(--ease-out);
  }
  .button { -webkit-tap-highlight-color: transparent; } /* the press scale below replaces the tap flash */
  .button:not([aria-disabled="true"]):active { transform: scale(0.96); }
}

/* ---------- Forced colors (Windows high contrast) ---------- */
@media (forced-colors: active) {
  .badge, .chip, .severity__bar span, .progress__bar { forced-color-adjust: auto; border: 1px solid CanvasText; }
  .button--primary { border-color: ButtonText; }
}
