/* Aegis Scan. Quiet monochrome: warm off-white, near-black ink, hairlines. */
:root {
  --bg: #FAFAF9;
  --surface: #FFFFFF;
  --ink: #111111;
  --ink-2: #55554F;
  --muted: #6B6B65;
  --faint: #8A8A83;
  --line: #E9E9E5;
  --line-strong: #D6D6D1;
  --code-bg: #F1F1EE;
  --btn-bg: #111111;
  --btn-fg: #FFFFFF;
  --now: #D92D20;
  --soon: #E8890C;
  --later: #B4B4AD;
  --ok: #2E7D4F;
  --focus: #2F5BEA;
  --radius: 20px;
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F0F0E; --surface: #171716; --ink: #F2F2EF; --ink-2: #C4C4BE; --muted: #A3A39C;
    --faint: #8C8C85; --line: #262624; --line-strong: #3A3A37; --code-bg: #1E1E1C;
    --btn-bg: #F2F2EF; --btn-fg: #111111; --later: #6F6F69; --ok: #5BBF85; --focus: #8BA6FF;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F0F0E; --surface: #171716; --ink: #F2F2EF; --ink-2: #C4C4BE; --muted: #A3A39C;
  --faint: #8C8C85; --line: #262624; --line-strong: #3A3A37; --code-bg: #1E1E1C;
  --btn-bg: #F2F2EF; --btn-fg: #111111; --later: #6F6F69; --ok: #5BBF85; --focus: #8BA6FF;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; overflow-wrap: break-word; }
p { overflow-wrap: break-word; }
a { color: var(--ink); }
a:hover { color: var(--ink-2); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  background: var(--btn-bg); color: var(--btn-fg); padding: 10px 16px; border-radius: 99px; text-decoration: none;
}
.skip-link:focus { top: 16px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.wrap { max-width: 1080px; margin: 0 auto; padding-inline: 24px; }

/* Header */
.site-header { display: flex; align-items: center; gap: 28px; padding-block: 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; flex-grow: 1; min-height: 44px; }
.brand:hover { color: var(--ink); }
.nav { display: flex; gap: 28px; font-size: 14px; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: transparent;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px; border-radius: 99px; font-size: 14px; font-weight: 500;
  text-decoration: none; cursor: pointer; border: 1px solid var(--line-strong); background: transparent; color: var(--ink);
  transition: background-color .15s, border-color .15s, opacity .15s;
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.btn-primary:hover { opacity: .86; color: var(--btn-fg); }
.btn[disabled] { opacity: .5; cursor: progress; }

/* Hero */
.hero { padding-block: 112px 64px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 28px; }
.hero h1 { font-size: clamp(44px, 8vw, 76px); line-height: 1.02; letter-spacing: -0.045em; font-weight: 400; max-width: 820px; }
.lede { font-size: 19px; color: var(--muted); max-width: 480px; font-weight: 300; }
.scan-form { width: 100%; max-width: 520px; margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.scan-field {
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 22px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 99px;
  transition: border-color .15s, box-shadow .15s;
}
.scan-field:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 8%, transparent); }
.scan-field input {
  flex: 1 1 auto; min-width: 0; min-height: 48px; border: 0; background: transparent; font-size: 16px; outline: none;
}
.scan-field input::placeholder { color: var(--faint); }
.scan-field .btn { min-height: 48px; padding: 0 26px; font-size: 15px; }
.form-note { font-size: 13px; color: var(--faint); }
.form-error { font-size: 14px; color: var(--now); text-align: left; padding-left: 22px; }

/* Example card */
.example { padding-block: 24px 120px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(28px, 5vw, 48px); display: flex; flex-wrap: wrap; gap: 48px 56px; align-items: flex-start;
}
.card-score { flex: 0 1 240px; display: flex; flex-direction: column; gap: 6px; }
.card-list { flex: 1 1 380px; min-width: 0; list-style: none; padding: 0; }
.card-grade { font-size: 15px; color: var(--muted); }
#failures { display: flex; flex-direction: column; gap: 12px; }
.eyebrow { font-size: 13px; color: var(--faint); }
.big-number { font-size: 96px; font-weight: 300; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row-title { flex-grow: 1; min-width: 0; }
.row-meta { font-size: 13px; color: var(--faint); flex-shrink: 0; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--later); }
.dot.now { background: var(--now); }
.dot.soon { background: var(--soon); }
.dot.ok { background: var(--ok); }

/* Sections */
.section { border-top: 1px solid var(--line); padding-block: 120px; }
.section h2 { font-size: clamp(32px, 5vw, 44px); line-height: 1.1; letter-spacing: -0.035em; font-weight: 400; max-width: 600px; }
.checks { margin-top: 64px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 48px 40px; }
.check-item { border-top: 1px solid var(--ink); padding-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.check-item h3 { font-size: 16px; font-weight: 500; }
.check-item p { color: var(--muted); font-size: 15px; }
.split { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-end; justify-content: space-between; }
.split p { color: var(--muted); max-width: 440px; margin-top: 16px; }

.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { padding-block: 36px; display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; font-size: 13px; color: var(--faint); }
.site-footer a { color: var(--faint); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* Scan view */
.narrow { max-width: 560px; margin: 0 auto; padding: 96px 24px 120px; display: flex; flex-direction: column; gap: 48px; }
.view-title { font-size: clamp(36px, 6vw, 44px); letter-spacing: -0.04em; font-weight: 400; line-height: 1.1; overflow-wrap: anywhere; }
.progress { height: 2px; background: var(--line); }
.progress-bar { height: 100%; width: 0; background: var(--ink); transition: width .5s ease; }
.progress-label { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; margin-top: 10px; }
.steps { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.step { display: flex; align-items: center; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); color: var(--faint); }
.step[data-state="running"], .step[data-state="done"], .step[data-state="failed"] { color: var(--ink); }
.step-label { flex-grow: 1; }
.step-status { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; }
.step[data-state="running"] .step-status::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); animation: pulse 1.2s ease-in-out infinite;
}
.step-note { font-size: 13px; color: var(--faint); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* Results */
.results { max-width: 760px; margin: 0 auto; padding: 72px 24px 120px; display: flex; flex-direction: column; gap: 64px; }
.summary { display: flex; flex-wrap: wrap; gap: 32px 56px; align-items: flex-end; justify-content: space-between; }
.summary-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.score { font-size: clamp(88px, 18vw, 120px); font-weight: 300; letter-spacing: -0.055em; line-height: .95; font-variant-numeric: tabular-nums; }
.summary-line { font-size: 17px; color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.findings-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: baseline; justify-content: space-between; }
.findings-head h2, .block-title { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.filters { display: flex; gap: 24px; flex-wrap: wrap; }
.filter {
  min-height: 44px; padding: 0; background: transparent; border: 0; border-bottom: 1px solid transparent;
  color: var(--faint); font-size: 14px; cursor: pointer;
}
.filter:hover { color: var(--ink); }
.filter[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.findings { list-style: none; padding: 0; border-top: 1px solid var(--line); margin-top: 20px; }
.finding { border-bottom: 1px solid var(--line); }
.finding-toggle {
  width: 100%; min-height: 64px; display: flex; align-items: center; gap: 18px; padding: 20px 0;
  background: transparent; border: 0; text-align: left; cursor: pointer; font-size: 16px;
}
.finding-toggle .chev { color: var(--faint); transition: transform .2s; flex-shrink: 0; }
.finding-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.finding-body { padding: 0 0 28px 25px; display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.finding-body p { color: var(--ink-2); }
.finding-body strong { font-weight: 500; color: var(--ink); }
.dev-details summary { cursor: pointer; font-size: 14px; color: var(--muted); min-height: 32px; display: flex; align-items: center; }
.dev-details summary:hover { color: var(--ink); }
.code-wrap { position: relative; margin-top: 12px; }
.code {
  background: var(--code-bg); border-radius: 10px; padding: 16px 18px; padding-right: 72px;
  font-family: var(--mono); font-size: 13px; white-space: pre-wrap; word-break: break-word; line-height: 1.6;
}
.copy-btn {
  position: absolute; top: 8px; right: 8px; min-height: 32px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--line-strong); background: var(--surface); font-size: 12px; cursor: pointer; color: var(--ink-2);
}
.copy-btn:hover { color: var(--ink); border-color: var(--ink); }
.empty { padding: 40px 0; color: var(--muted); border-bottom: 1px solid var(--line); }
.notice {
  border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: flex; flex-wrap: wrap; gap: 12px 20px;
  align-items: center; justify-content: space-between; background: var(--surface);
}
.notice p { color: var(--ink-2); font-size: 15px; }
.passed { border-top: 1px solid var(--line); padding-top: 32px; }
.passed summary { cursor: pointer; font-size: 18px; font-weight: 500; min-height: 44px; display: flex; align-items: center; gap: 10px; }
.passed ul { list-style: none; padding: 8px 0 0; columns: 2 260px; column-gap: 40px; }
.passed li { display: flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--ink-2); font-size: 15px; break-inside: avoid; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; border-top: 1px solid var(--line); padding-top: 32px; }
.facts dt { font-size: 13px; color: var(--faint); }
.facts dd { margin: 2px 0 0; font-size: 15px; overflow-wrap: anywhere; }
.method-note { font-size: 13px; color: var(--faint); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 560px) {
  .hero { padding-block: 72px 48px; }
  .section { padding-block: 80px; }
  .nav { gap: 20px; }
  .scan-field { padding-left: 16px; }
}

@media print {
  .site-header, .site-footer, .actions, .filters, .copy-btn, .skip-link, .notice .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .results { padding: 0; gap: 32px; }
  .finding-body, .dev-details > * { display: block !important; }
  .finding-body[hidden] { display: flex !important; }
  .dev-details:not([open]) .code-wrap { display: block; }
  .finding-toggle .chev { display: none; }
}

/* Headings receive focus when the view changes; the ring is only for keyboard targets. */
[tabindex="-1"]:focus { outline: none; }
