:root {
  color-scheme: light;
  --bg: #f5f8f6;
  --bg-glow: #d9f7e3;
  --surface: #ffffff;
  --surface-2: #f0f4f2;
  --border: #e1e8e4;
  --border-strong: #cbd6d0;
  --track: #e3eae6;
  --text: #0f1a14;
  --muted: #55635b;
  --faint: #879489;
  --accent: #15803d;
  --go-from: #4ade80;
  --go-to: #22c55e;
  --on-go: #052e16;
  --bad: #e11d48;
  --meh: #ea580c;
  --ok: #ca8a04;
  --good: #16a34a;
  --radius: 18px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(900px 560px at 50% -140px, var(--bg-glow), transparent 70%);
  background-repeat: no-repeat;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
code { font-family: var(--mono); font-size: 0.9em; }
.wrap { width: min(100% - 32px, 800px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Header */
.site-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand em { font-style: normal; color: var(--muted); font-weight: 600; }
.brand-mark { width: 30px; height: 30px; color: var(--text); }
.site-nav { display: flex; gap: 20px; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.site-nav a:hover { color: var(--text); }

/* Hero + form */
.hero { text-align: center; padding: 32px 0 4px; }
.eyebrow { color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 14px; }
.hero h1 { font-size: clamp(34px, 6vw, 54px); font-weight: 800; }
.lede { color: var(--muted); font-size: clamp(16px, 2.2vw, 18px); max-width: 600px; margin: 14px auto 26px; }
.scan-form {
  display: flex; gap: 8px; max-width: 580px; margin: 0 auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px;
  box-shadow: 0 8px 30px rgb(15 26 20 / 0.08);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.scan-form:focus-within { border-color: var(--go-to); box-shadow: 0 0 0 4px rgb(34 197 94 / 0.18), 0 8px 30px rgb(15 26 20 / 0.08); }
.scan-form input {
  flex: 1; min-width: 0; padding: 12px 18px; border: 0; outline: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 18px;
}
.scan-form input::placeholder { color: var(--faint); }
.form-error { color: var(--bad); margin-top: 14px; font-size: 15px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 12px 22px; cursor: pointer;
  font: inherit; font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: transform 0.1s, filter 0.15s, background 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { cursor: progress; filter: saturate(0.5) brightness(0.85); }
.btn-go, .btn-primary { background: linear-gradient(135deg, var(--go-from), var(--go-to)); color: var(--on-go); }
.btn-go { font-size: 17px; padding: 12px 28px; }
.btn-go:hover, .btn-primary:hover { filter: brightness(1.05) saturate(1.1); }
.btn-primary { font-size: 17px; padding: 15px 28px; }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); font-weight: 600; font-size: 14px; padding: 9px 16px; }
.btn-ghost:hover { background: var(--border); }
.btn-soon, .btn-soon:disabled { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--border-strong); font-size: 16px; padding: 13px 26px; cursor: default; filter: none; }
.soon-badge { display: inline-block; margin-bottom: 10px; padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid #86efac; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

/* Gauge */
.meter { display: flex; flex-direction: column; align-items: center; padding: 24px 0 8px; }
.gauge { position: relative; width: min(340px, 84vw); aspect-ratio: 1; }
.gauge svg { width: 100%; height: 100%; overflow: visible; }
.gauge-track, .gauge-progress { fill: none; stroke-width: 18; stroke-linecap: round; }
.gauge-track { stroke: var(--track); }
.gauge-progress { stroke: url(#gauge-gradient); stroke-dasharray: 100 100; stroke-dashoffset: 100; opacity: 0; }
.gauge-ticks line { stroke: #c3cfc8; stroke-width: 2; stroke-linecap: round; }
.gauge-ticks text { fill: var(--faint); font-size: 12px; font-family: var(--font); text-anchor: middle; dominant-baseline: middle; }
.gauge-needle path { fill: var(--text); }
.gauge-needle circle { fill: var(--surface); stroke: var(--text); stroke-width: 3; }
.gauge-readout { position: absolute; inset: auto 0 2% 0; text-align: center; }
.gauge-value { font-size: clamp(46px, 13vw, 68px); font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1; color: var(--faint); transition: color 0.3s; }
.gauge-label { margin-top: 6px; color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.gauge[data-state="scanning"] .gauge-value { color: var(--muted); animation: pulse 1s ease-in-out infinite; }
.gauge[data-state="done"] .gauge-value { color: var(--text); }
.gauge[data-tone="bad"] .gauge-value, .gauge[data-tone="bad"] .gauge-label { color: var(--bad); }
.gauge[data-tone="meh"] .gauge-value, .gauge[data-tone="meh"] .gauge-label { color: var(--meh); }
.gauge[data-tone="ok"] .gauge-value, .gauge[data-tone="ok"] .gauge-label { color: var(--ok); }
.gauge[data-tone="good"] .gauge-value, .gauge[data-tone="good"] .gauge-label { color: var(--good); }
@keyframes pulse { 50% { opacity: 0.45; } }
.meter-status { color: var(--muted); margin-top: 10px; min-height: 1.55em; text-align: center; }

/* Category tiles */
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; width: 100%; margin-top: 26px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.tile-label { color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.3; min-height: 2.6em; }
.tile-value { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile-value small { color: var(--faint); font-size: 14px; font-weight: 600; }
.tile-bar { height: 5px; border-radius: 9px; background: var(--track); overflow: hidden; }
.tile-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--faint); transition: width 0.9s cubic-bezier(.2,.8,.2,1); }
.tile[data-tone="bad"] .tile-bar span { background: var(--bad); }
.tile[data-tone="meh"] .tile-bar span { background: var(--meh); }
.tile[data-tone="ok"] .tile-bar span { background: var(--ok); }
.tile[data-tone="good"] .tile-bar span { background: var(--good); }

/* Results */
.results, .report { padding: 36px 0 12px; }
.banner { padding: 14px 18px; border-radius: 14px; margin-bottom: 20px; background: rgb(244 63 94 / 0.1); border: 1px solid rgb(244 63 94 / 0.35); color: #9f1239; }
.summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.summary h2 { font-size: clamp(22px, 3.5vw, 28px); }
.summary p { color: var(--muted); margin-top: 6px; }
.issues { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.issue { display: flex; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.issue-icon { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.issue--fail .issue-icon { background: rgb(244 63 94 / 0.15); color: var(--bad); }
.issue--warn .issue-icon { background: rgb(251 146 60 / 0.15); color: var(--meh); }
.issue--pass .issue-icon { background: rgb(34 197 94 / 0.15); color: var(--good); }
.issue-body { flex: 1; min-width: 0; }
.issue-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.issue-head h3 { font-size: 16px; letter-spacing: -0.01em; }
.pts { flex: none; font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.issue--fail .pts { color: var(--bad); }
.issue--warn .pts { color: var(--meh); }
.issue-detail { margin-top: 6px; overflow-wrap: anywhere; }
.issue-why { margin-top: 6px; color: var(--muted); font-size: 14px; }
.issue-why summary { display: inline-block; cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; list-style: none; }
.issue-why summary::-webkit-details-marker { display: none; }
.issue-why summary::after { content: " +"; }
.issue-why[open] summary::after { content: " –"; }
.issue-why p { margin-top: 4px; }
.passed { margin-top: 18px; }
.passed > summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 10px 0; }
.passed .issues { margin-top: 8px; }
.passed .issue { padding: 14px 18px; }
.passed .issue-why { display: none; }

/* Fix-it call to action */
.cta {
  margin: 26px 0; padding: 28px; border-radius: var(--radius); text-align: center;
  background: linear-gradient(160deg, #f0fdf4, #dcfce7);
  border: 1px solid #86efac;
}
.cta h2 { font-size: clamp(22px, 3.6vw, 30px); }
.cta > p { color: var(--muted); margin: 10px auto 0; max-width: 560px; }
.cta ul { list-style: none; padding: 0; margin: 20px auto; display: grid; gap: 8px; text-align: left; max-width: 520px; }
.cta li { display: flex; gap: 10px; }
.cta li::before { content: "✓"; color: var(--good); font-weight: 800; }
.cta-potential { font-weight: 700; margin-bottom: 18px !important; color: var(--text) !important; }
.cta-potential strong { color: var(--good); }
.cta-fine { font-size: 13px; color: var(--faint) !important; margin-top: 12px !important; }
.share { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 24px; }

/* Fix report */
.report-head { text-align: center; margin-bottom: 28px; }
.report-head h2 { font-size: clamp(26px, 4.5vw, 36px); margin-top: 4px; overflow-wrap: anywhere; }
.report-url { color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; font-size: 14px; }
.report-scoreline { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; align-items: center; margin-top: 18px; padding: 10px 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.report-scoreline strong { font-size: 20px; }
.report-scoreline .later strong, .report-scoreline [data-tone="good"] strong { color: var(--good); }
.report-scoreline [data-tone="ok"] strong { color: var(--ok); }
.report-scoreline [data-tone="meh"] strong { color: var(--meh); }
.report-scoreline [data-tone="bad"] strong { color: var(--bad); }
.report-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.report-note { color: var(--muted); font-size: 14px; margin: 16px auto 0; max-width: 560px; }
.fixes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.fix { padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.fix-head { display: flex; gap: 14px; align-items: flex-start; }
.fix-num { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--go-from), var(--go-to)); color: var(--on-go); font-weight: 800; }
.fix-head h3 { font-size: 19px; }
.fix-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fix-meta span { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.fix-meta .impact { color: var(--good); border-color: rgb(34 197 94 / 0.4); background: rgb(34 197 94 / 0.1); }
.fix-summary { margin-top: 14px; }
.fix-steps { margin: 14px 0 0; padding-left: 22px; display: grid; gap: 8px; }
.fix-steps code, .fix-summary code, .fix-note code, .issue-detail code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 5px; border-radius: 6px; overflow-wrap: anywhere; }
.fix-note { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #fefce8; border: 1px solid #fde68a; color: #854d0e; font-size: 14px; }
/* Code blocks stay dark: easier to read and clearly "copy me". */
.code { margin-top: 16px; border: 1px solid #1f2937; border-radius: 12px; overflow: hidden; background: #0b1220; }
.code-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; background: #111827; border-bottom: 1px solid #1f2937; font-size: 13px; font-weight: 600; color: #9ca3af; }
.copy { flex: none; border: 1px solid #374151; background: #1f2937; color: #f3f4f6; border-radius: 8px; padding: 5px 12px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.copy:hover { background: #374151; }
.code pre { margin: 0; padding: 14px; overflow-x: auto; font-size: 13px; line-height: 1.55; }
.code code { font-size: inherit; white-space: pre; color: #d6def0; }
.all-good { text-align: center; color: var(--good); font-weight: 700; }

/* Info sections */
.info { padding: 64px 0 0; }
.info > h2 { font-size: clamp(24px, 4vw, 32px); text-align: center; margin-bottom: 26px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.steps li { padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.step-num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--accent); font-weight: 800; margin-bottom: 14px; }
.steps h3 { font-size: 18px; margin-bottom: 6px; }
.steps p { color: var(--muted); font-size: 15px; }
#faq details { border-bottom: 1px solid var(--border); }
#faq summary { cursor: pointer; padding: 18px 0; font-weight: 700; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
#faq summary::-webkit-details-marker { display: none; }
#faq summary::after { content: "+"; color: var(--accent); font-size: 22px; line-height: 1; }
#faq details[open] summary::after { content: "–"; }
#faq details p { color: var(--muted); padding-bottom: 18px; }

/* Footer */
.site-footer { padding: 64px 0 40px; text-align: center; color: var(--faint); font-size: 14px; }
.site-footer a { color: var(--muted); }
.site-footer .fine { margin-top: 8px; font-size: 12px; }

/* Legal page */
.legal { padding: 24px 0 0; }
.legal h1 { font-size: clamp(30px, 5vw, 40px); margin-bottom: 8px; }
.legal h2 { font-size: 22px; margin: 36px 0 10px; padding-top: 8px; }
.legal p, .legal li { margin-bottom: 10px; }
.legal .updated { color: var(--muted); }

@media (max-width: 720px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tiles .tile:last-child { grid-column: span 2; }
  .tile-label { min-height: 0; }
  .steps { grid-template-columns: 1fr; }
  .summary { flex-direction: column; align-items: flex-start; }
  .site-nav { gap: 14px; }
}
@media (max-width: 480px) {
  .scan-form { border-radius: 18px; flex-direction: column; padding: 8px; }
  .scan-form input { text-align: center; padding: 12px; }
  .btn-go { width: 100%; }
  .cta, .fix { padding: 20px 16px; }
  .issue { padding: 16px 14px; gap: 12px; }
  .site-nav a:first-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .gauge[data-state="scanning"] .gauge-value { animation: none; }
  .tile-bar span { transition: none; }
}
@media print {
  body { background: #fff; color: #111; }
  .site-header, .hero, .meter, .info, .site-footer, .report-actions, .report-note, .copy, .results { display: none !important; }
  .report { padding: 0; }
  .fix, .code, .report-scoreline { background: #fff; border-color: #ccc; break-inside: avoid; }
  .code-head { background: #f3f4f6; color: #333; }
  .code code, .fix-steps, .fix-summary { color: #111; }
  .fix-note { background: #fffbeb; color: #78350f; border-color: #fcd34d; }
  .report-head h2, .fix-head h3 { color: #111; }
}
