/* Direction: printed test report. Warm paper, black ink, one semantic colour per verdict.
   Spacing scale: 4 8 12 16 24 32 48 64 96. Radius: 3px. No shadows, no gradients. */

:root {
  --paper: #F4F2EC;
  --paper-sunk: #ECE9E1;
  --card: #FBFAF7;
  --ink: #16171B;
  --ink-2: #44474F;
  --ink-3: #62656D;
  --rule: #D8D4C9;

  --good: #1D6B45;
  --good-tint: #E2EEE6;
  --warn: #8A4B00;
  --warn-tint: #F5E8D3;
  --bad: #A3241B;
  --bad-tint: #F5E0DC;
  --focus: #1F55D0;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --r: 3px;
  --wrap: 1120px;
  --control-h: 52px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--s5); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s5); }
@media (max-width: 560px) { .wrap { padding: 0 var(--s4); } }

.skip {
  position: absolute; left: var(--s4); top: -100px; z-index: 10;
  background: var(--ink); color: var(--paper); padding: var(--s2) var(--s3); border-radius: var(--r);
}
.skip:focus { top: var(--s4); }

/* ── Header / footer ─────────────────────────────────────────── */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.wordmark { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 650; letter-spacing: -0.01em; text-decoration: none; }
.mark { width: 22px; height: 22px; }
.site-nav { display: flex; gap: var(--s5); font-size: 0.9375rem; }
.site-nav a { text-decoration: none; color: var(--ink-2); }
.site-nav a:hover { color: var(--ink); text-decoration: underline; }

.site-foot { border-top: 1px solid var(--rule); margin-top: var(--s9); }
.site-foot-inner { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); justify-content: space-between; padding-top: var(--s5); padding-bottom: var(--s6); font-size: 0.875rem; color: var(--ink-3); }
.site-foot nav { display: flex; gap: var(--s4); }

/* ── Type primitives ─────────────────────────────────────────── */
.eyebrow {
  font: 600 0.75rem/1.2 var(--mono);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3);
}
.section-title { font-size: 1.5rem; line-height: 1.2; font-weight: 650; letter-spacing: -0.02em; }

/* ── Tool ────────────────────────────────────────────────────── */
.tool { padding: var(--s9) 0 var(--s8); }
.tool-title {
  font-size: clamp(2.5rem, 7vw, 4.75rem);
  line-height: 0.98; font-weight: 700; letter-spacing: -0.045em;
  max-width: 12ch;
}
.lede { margin-top: var(--s5); max-width: 56ch; font-size: 1.1875rem; line-height: 1.5; color: var(--ink-2); }

.test-form { margin-top: var(--s7); max-width: 860px; }
.field-label { display: block; margin-bottom: var(--s2); font-size: 0.875rem; font-weight: 600; }
.optional { font-weight: 400; color: var(--ink-3); }
.test-row { display: flex; gap: var(--s2); }
.test-row input { flex: 1; min-width: 0; }

input[type="url"], input[type="tel"], input[type="email"], select {
  height: var(--control-h);
  padding: 0 var(--s4);
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--r);
  font-size: 1rem;
}
input[type="url"] { font-family: var(--mono); font-size: 0.9375rem; }
input::placeholder { color: #8B8D93; }
input:focus-visible, select:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(31, 85, 208, 0.35); border-color: var(--focus); }
input[aria-invalid="true"] { border-color: var(--bad); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: var(--control-h); padding: 0 var(--s5);
  border-radius: var(--r); border: 1.5px solid var(--ink);
  font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #2C2E34; }
.btn-primary[aria-busy="true"] { cursor: progress; }
.btn-primary[aria-busy="true"]::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 700ms linear infinite;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--paper-sunk); }
.btn-block { width: 100%; }

.link-btn {
  padding: 0; border: 0; background: none; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.link-btn:hover { text-decoration-thickness: 2px; }

.hint { margin-top: var(--s3); font-size: 0.9375rem; color: var(--ink-3); }
.field-error { margin-top: var(--s2); font-size: 0.9375rem; color: var(--bad); font-weight: 500; }

@media (max-width: 640px) {
  .tool { padding: var(--s8) 0 var(--s7); }
  .test-row { flex-direction: column; }
  .test-row .btn { width: 100%; }
}

/* ── Progress ────────────────────────────────────────────────── */
.run { padding-bottom: var(--s8); }
.run .eyebrow span { color: var(--ink); text-transform: none; letter-spacing: 0; }
.steps { margin-top: var(--s4); border-top: 1.5px solid var(--ink); max-width: 860px; }
.step {
  display: grid; grid-template-columns: 24px 1fr auto; gap: var(--s3); align-items: center;
  padding: var(--s3) 0; border-bottom: 1px solid var(--rule);
}
.step-icon { width: 16px; height: 16px; display: grid; place-items: center; }
.step[data-state="run"] .step-icon::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--ink); border-right-color: transparent;
  animation: spin 700ms linear infinite;
}
.step[data-state="done"] .step-icon::before { content: ""; width: 10px; height: 10px; background: var(--ink); }
.step[data-state="fail"] .step-icon::before { content: "×"; font: 700 1.125rem/1 var(--font); color: var(--bad); }
.step-label { font-weight: 500; }
.step[data-state="fail"] .step-label { color: var(--bad); }
.step-detail { font: 0.875rem/1.3 var(--mono); color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Report ──────────────────────────────────────────────────── */
.report { padding-bottom: var(--s8); }
.report-meta {
  display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3);
  font: 0.8125rem/1.4 var(--mono); color: var(--ink-3);
  padding-top: var(--s4); border-top: 1.5px solid var(--ink);
}
.report-meta > * + *::before { content: "/"; margin-right: var(--s3); color: var(--rule); }
#r-host { color: var(--ink); overflow-wrap: anywhere; }

.verdict {
  display: flex; align-items: flex-start; gap: var(--s4);
  margin-top: var(--s5);
  font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.04; font-weight: 700; letter-spacing: -0.035em;
  max-width: 24ch;
}
.verdict:focus { outline: none; }
.verdict-mark { flex: none; width: 0.62em; height: 0.62em; margin-top: 0.2em; background: var(--ink-3); }
.report[data-verdict="good"] .verdict-mark { background: var(--good); border-radius: 50%; }
.report[data-verdict="warn"] .verdict-mark {
  background: var(--warn);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.report[data-verdict="bad"] .verdict-mark,
.report[data-verdict="down"] .verdict-mark { background: var(--bad); }
.report[data-verdict="unclear"] .verdict-mark { background: transparent; border: 0.08em solid var(--ink-3); border-radius: 50%; }

.verdict-summary { margin-top: var(--s4); max-width: 64ch; font-size: 1.125rem; color: var(--ink-2); }

/* Figures: a ruled spec row, not cards */
.figures {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: var(--s7); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.figure { padding: var(--s4) var(--s5) var(--s4) 0; }
.figure + .figure { padding-left: var(--s5); border-left: 1px solid var(--rule); }
.figure dt { font-size: 0.875rem; color: var(--ink-3); }
.figure dd { margin-top: var(--s1); font: 600 2rem/1.1 var(--mono); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.figure .unit { margin-left: 0.2em; font-size: 0.9375rem; font-weight: 500; letter-spacing: 0; color: var(--ink-3); }
.figure .note { display: block; margin-top: var(--s1); font: 0.8125rem/1.3 var(--font); color: var(--ink-3); letter-spacing: 0; }

@media (max-width: 640px) {
  .figures { grid-template-columns: 1fr 1fr; }
  .figure, .figure + .figure { padding: var(--s3) var(--s3) var(--s3) 0; border-left: 0; }
  .figure:nth-child(even) { padding-left: var(--s3); border-left: 1px solid var(--rule); }
  .figure:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .figure:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .figure dd { font-size: 1.625rem; }
}

/* Chart */
.chart { margin-top: var(--s7); }
.chart-cap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2) var(--s5); align-items: baseline; }
.chart-title { font-weight: 600; }
.chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); font-size: 0.8125rem; color: var(--ink-3); }
.key { display: inline-block; vertical-align: middle; margin-right: var(--s1); }
.key-line { width: 16px; height: 0; border-top: 2px solid var(--ink); }
.key-start { width: 0; height: 12px; border-left: 1.5px dashed var(--ink-3); }
.key-stall { width: 12px; height: 12px; background: var(--bad-tint); border: 1px solid var(--bad); }
.chart-canvas { margin-top: var(--s3); background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); }
.chart-canvas svg { display: block; width: 100%; height: auto; }
.chart-canvas .axis text { font: 11px var(--mono); fill: var(--ink-3); }
.chart-canvas .grid line { stroke: var(--rule); stroke-width: 1; }
.chart-canvas .area { fill: var(--ink); opacity: 0.07; }
.chart-canvas .line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.chart-canvas .start { stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart-canvas .stall { fill: var(--bad-tint); stroke: var(--bad); stroke-width: 1; }
.chart-canvas .anno { font: 12px var(--font); fill: var(--ink-2); }
@media (prefers-reduced-motion: no-preference) {
  .chart-canvas .line { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 900ms cubic-bezier(0.3, 0.7, 0.2, 1) forwards; }
  .chart-canvas .area { animation: fade 900ms ease forwards; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } }

/* Unlock panel: the one boxed, inked element on the page. Sits right under the verdict. */
.unlock {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: var(--s6);
  margin-top: var(--s6); padding: var(--s6);
  background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--r);
}
@media (max-width: 860px) { .unlock { grid-template-columns: minmax(0, 1fr); gap: var(--s5); padding: var(--s5); } }
@media (max-width: 420px) { .unlock { padding: var(--s4); margin-left: calc(var(--s2) * -1); margin-right: calc(var(--s2) * -1); } }

.unlock-kicker { font: 600 0.75rem/1.2 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.unlock-title { margin-top: var(--s3); font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.12; font-weight: 700; letter-spacing: -0.03em; max-width: 22ch; }
.unlock-copy { margin-top: var(--s3); color: var(--ink-2); max-width: 46ch; }
.unlock-gets { margin-top: var(--s5); display: grid; gap: var(--s3); }
.unlock-gets li { display: grid; grid-template-columns: 22px 1fr; gap: var(--s2); font-weight: 500; }
.unlock-gets li::before {
  content: ""; width: 14px; height: 14px; margin-top: 4px;
  background: var(--ink);
  clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%);
}
.unlock-gets li[hidden] { display: none; }

.unlock-form { display: grid; gap: var(--s1); align-content: start; }
.unlock-form > * { min-width: 0; }
.unlock-form .field-label { margin-top: var(--s3); }
.devices { border: 0; margin: 0; padding: 0; min-width: 0; }
.devices .field-label { margin-top: 0; padding: 0; }
.device-row { display: flex; flex-wrap: wrap; gap: var(--s2); }
.device-row label { position: relative; cursor: pointer; }
.device-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.device-row span {
  display: inline-flex; align-items: center; height: 36px; padding: 0 var(--s3);
  border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper);
  font-size: 0.875rem; font-weight: 500; transition: border-color 120ms ease, background-color 120ms ease;
}
.device-row label:hover span { border-color: var(--ink-3); }
.device-row input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.device-row input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

.phone-row { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: var(--s2); }
.phone-row select { width: 100%; padding: 0 var(--s2); font-size: 0.875rem; }
.phone-row input, .unlock-form input[type="email"] { width: 100%; min-width: 0; }

.check { display: grid; grid-template-columns: 20px 1fr; gap: var(--s2); margin-top: var(--s3); font-size: 0.875rem; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); }
.check[hidden] { display: none; }
.unlock-form .btn { margin-top: var(--s4); height: 56px; font-size: 1.0625rem; }

.send-done { padding: var(--s5); background: var(--good-tint); border-radius: var(--r); align-self: start; }
.send-done:focus { outline: none; }
.send-done p + p { margin-top: var(--s2); }
.send-done-title { font-weight: 650; color: var(--good); font-size: 1.125rem; }

/* Locked full report */
.full { margin-top: var(--s7); }
.full-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s2); padding-bottom: var(--s3); border-bottom: 1.5px solid var(--ink); }
.lock-badge { display: inline-flex; align-items: center; gap: var(--s2); font-size: 0.8125rem; color: var(--ink-3); }
.lock-badge svg { width: 14px; height: 14px; }
.full:not(.is-locked) .lock-badge { display: none; }

.full-body { position: relative; }
.full-content { transition: filter 400ms ease; }
.full.is-locked .full-content { filter: blur(7px) saturate(0.6); user-select: none; pointer-events: none; max-height: 560px; overflow: hidden; }
.full.is-locked .full-body::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 160px;
  background: linear-gradient(to bottom, rgba(244, 242, 236, 0), var(--paper));
  pointer-events: none;
}
.lock-cover {
  position: absolute; z-index: 2; top: var(--s7); left: 50%; transform: translateX(-50%);
  width: min(400px, calc(100% - var(--s5)));
  padding: var(--s5); background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--r);
}
.full:not(.is-locked) .lock-cover { display: none; }
.lock-cover-title { font-size: 1.125rem; font-weight: 650; letter-spacing: -0.01em; }
.lock-cover-list { margin: var(--s3) 0 var(--s4); display: grid; gap: var(--s1); font-size: 0.9375rem; color: var(--ink-2); }
.lock-cover-list li::before { content: "— "; color: var(--ink-3); }
.lock-cover .btn { width: 100%; text-decoration: none; }
.findings-head { margin-top: var(--s6); }
.full .chart { margin-top: var(--s5); }

.findings { margin-top: var(--s3); border-top: 1.5px solid var(--ink); }
.finding { display: grid; grid-template-columns: 28px 1fr; gap: var(--s3); padding: var(--s4) 0; border-bottom: 1px solid var(--rule); }
.finding-mark {
  width: 22px; height: 22px; display: grid; place-items: center;
  font: 700 0.8125rem/1 var(--mono); border-radius: var(--r);
  background: var(--paper-sunk); color: var(--ink-2);
}
.finding[data-level="ok"] .finding-mark { background: var(--good-tint); color: var(--good); }
.finding[data-level="warn"] .finding-mark { background: var(--warn-tint); color: var(--warn); }
.finding[data-level="bad"] .finding-mark { background: var(--bad-tint); color: var(--bad); }
.finding-title { font-weight: 600; }
.finding-detail { margin-top: var(--s1); color: var(--ink-2); font-size: 0.9375rem; }

.tech { margin-top: var(--s5); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.tech > summary { padding: var(--s3) 0; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.tech > summary::-webkit-details-marker { display: none; }
.tech > summary::after { content: "+"; font: 500 1.25rem/1 var(--mono); }
.tech[open] > summary::after { content: "−"; }
.tech-body { padding-bottom: var(--s5); }
.tech-body h4 { margin: var(--s5) 0 var(--s2); font: 600 0.75rem/1.2 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.tech-body h4:first-child { margin-top: var(--s2); }
.table-scroll { overflow-x: auto; }
.tech-table { width: 100%; border-collapse: collapse; font: 0.8125rem/1.4 var(--mono); font-variant-numeric: tabular-nums; }
.tech-table th, .tech-table td { padding: var(--s2) var(--s3) var(--s2) 0; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tech-table th { font-weight: 500; color: var(--ink-3); white-space: nowrap; }
.tech-table td { overflow-wrap: anywhere; }
.tech-table.kv th { width: 44%; }
.tech-table .num { text-align: right; }

.caveat { margin-top: var(--s5); font-size: 0.875rem; color: var(--ink-3); max-width: 64ch; }

#again-btn { margin-top: var(--s7); }

/* ── How it works / FAQ ──────────────────────────────────────── */
.how { padding-top: var(--s8); border-top: 1px solid var(--rule); }
.how-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s6); margin-top: var(--s6); counter-reset: none; }
.how-list li { border-top: 1.5px solid var(--ink); padding-top: var(--s4); }
.how-num { font: 600 0.875rem/1 var(--mono); color: var(--ink-3); }
.how-list h3 { margin-top: var(--s3); font-size: 1.125rem; font-weight: 650; letter-spacing: -0.01em; }
.how-list p { margin-top: var(--s2); color: var(--ink-2); font-size: 0.9375rem; }
@media (max-width: 820px) { .how-list { grid-template-columns: 1fr; gap: var(--s5); } }

.faq { margin-top: var(--s8); max-width: 760px; }
.faq .section-title { margin-bottom: var(--s4); }
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { padding: var(--s4) var(--s6) var(--s4) 0; cursor: pointer; font-weight: 600; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: var(--s4); font: 500 1.25rem/1.2 var(--mono); }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding-bottom: var(--s4); color: var(--ink-2); max-width: 64ch; }

/* ── Docs ────────────────────────────────────────────────────── */
.doc { padding: var(--s8) 0; }
.doc-wrap { max-width: 720px; }
.doc-back { font-size: 0.9375rem; }
.doc-title { margin-top: var(--s6); font-size: clamp(2rem, 5vw, 3rem); line-height: 1.05; letter-spacing: -0.035em; font-weight: 700; }
.doc-updated { margin-top: var(--s2); font: 0.8125rem var(--mono); color: var(--ink-3); }
.doc h2 { margin-top: var(--s6); font-size: 1.125rem; font-weight: 650; }
.doc p { margin-top: var(--s2); color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
