/* Chain — chain-of-custody design. Light, spatial, diagram-led. */
:root {
  --ground1: #F6F8F7;
  --ground2: #EDF3F0;
  --card: #FFFFFF;
  --line: #DCE5E0;
  --line-soft: #ECF1EE;
  --ink: #14201C;
  --dim: #46564F;
  --accent: #0E8A72;
  --accent-ink: #0B6B59;
  --accent-tint: #E5F4EF;
  --warn: #D6742C;
  --warn-ink: #A9561A;
  --warn-tint: #FAEFE3;
  --fail: #B0402A;
  --fail-tint: #F7E9E4;
  --none: #9FB0A8;
  --hatch: repeating-linear-gradient(45deg, #9FB0A8 0 2px, #E7EDEA 2px 4px);
  --shadow: 0 18px 50px rgba(20, 32, 28, 0.08);
  --r-card: 18px;
  --r-tile: 16px;
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Inter Tight", system-ui, sans-serif;
  --font-mono: "Martian Mono", ui-monospace, "SF Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  /* 16px floor: below it iOS Safari zooms on form focus, and small body copy
     is the first thing to fail on a phone. */
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: linear-gradient(160deg, var(--ground1) 0%, var(--ground2) 100%) fixed;
  background-color: var(--ground1);
}
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--line-soft);
  padding: 1px 5px;
  border-radius: 5px;
}
.mono { font-family: var(--font-mono); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- chrome ---------- */
main { max-width: 1060px; margin: 0 auto; padding: 0 24px 72px; }
.topbar { background: transparent; }
.topbar-in {
  max-width: 1060px; margin: 0 auto; padding: 22px 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  color: var(--ink); text-decoration: none;
}
.wordmark svg { color: var(--accent); }
.topnav { display: flex; align-items: center; gap: 6px 24px; flex-wrap: wrap; }
.topnav a {
  font-size: 14.5px; font-weight: 500; color: var(--dim); text-decoration: none;
  padding: 4px 2px; border-radius: 6px;
}
.topnav a:hover { color: var(--accent-ink); }
.topnav a.active {
  color: var(--accent-ink);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.site-footer { border-top: 1px solid var(--line); background: var(--ground2); }
.footer-in {
  max-width: 1060px; margin: 0 auto; padding: 20px 24px;
  display: flex; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--dim);
}

/* ---------- shared bits ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}
.eyebrow {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 400;
  letter-spacing: 0.2em; color: var(--accent-ink); margin: 0 0 14px;
}
.page-title {
  font-family: var(--font-display); font-weight: 700; font-size: 34px;
  line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 12px;
}
.body-copy { color: var(--dim); margin: 0; max-width: 62ch; }
.btn, .btn-outline, .btn-dark {
  display: inline-block; border-radius: 12px; padding: 12px 20px;
  font-weight: 600; font-size: 14.5px; text-decoration: none; border: 1px solid transparent;
}
.btn { background: var(--accent); color: #FFFFFF; }
.btn:hover { background: var(--accent-ink); color: #FFFFFF; }
.btn-outline { background: var(--card); color: var(--accent-ink); border-color: var(--accent); }
.btn-outline:hover { background: var(--accent-tint); }
.btn-dark { background: var(--ink); color: var(--ground1); padding: 15px 24px; font-size: 15px; }
.btn-dark:hover { background: #22332C; color: #FFFFFF; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.code-chip {
  font-family: var(--font-mono); font-size: 0.82em;
  background: var(--accent-tint); color: var(--accent-ink);
  padding: 1px 6px; border-radius: 6px;
}
.arrow-link { font-weight: 600; font-size: 14.5px; text-decoration: none; }
.table-scroll { overflow-x: auto; }
.prov {
  font-style: normal; font-family: var(--font-mono); font-size: 10.5px;
  color: var(--warn-ink); background: var(--warn-tint);
  border: 1px solid var(--warn); border-radius: 999px; padding: 1px 8px;
  white-space: nowrap; vertical-align: middle;
}

/* ---------- grade pills ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; padding: 3px 12px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  border: 1px solid;
}
.pill-lg { min-width: 52px; padding: 6px 16px; font-size: 19px; }
.g-ap, .g-a, .g-b { background: var(--accent-tint); color: var(--accent-ink); border-color: var(--accent); }
.g-c, .g-d { background: var(--warn-tint); color: var(--warn-ink); border-color: var(--warn); }
.g-f { background: var(--fail-tint); color: var(--fail); border-color: var(--fail); }
.g-na { background: var(--line-soft); color: var(--dim); border-color: var(--none); }

/* ---------- home hero ---------- */
.hero { text-align: center; padding: 56px 0 34px; display: flex; flex-direction: column; align-items: center; }
.display-hl {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(26px, 7vw, 56px); line-height: 1.05; letter-spacing: -0.02em;
  margin: 8px 0 18px; max-inline-size: 20ch;
}
.lede { font-size: 17.5px; line-height: 1.65; color: var(--dim); max-width: 56ch; margin: 0 auto; }

/* ---------- the hero chain ---------- */
.chain-card { padding: 40px 44px 26px; margin: 10px 0 28px; }
.hero-chain { display: flex; align-items: flex-start; }
.ch-node {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.ch-tile {
  position: relative; width: 56px; height: 56px; border-radius: var(--r-tile);
  display: flex; align-items: center; justify-content: center; border: 2px solid;
}
.st-ok .ch-tile, .pg-tile.st-ok { background: var(--accent-tint); border-color: var(--accent); color: var(--accent); }
.st-warn .ch-tile, .pg-tile.st-warn { background: var(--warn-tint); border-color: var(--warn); color: var(--warn); }
.st-none .ch-tile, .pg-tile.st-none { background: var(--hatch); border-color: var(--none); color: var(--dim); }
.ch-bead {
  position: absolute; top: -8px; right: -8px; width: 19px; height: 19px;
  border-radius: 50%; background: var(--warn); color: #FFFFFF;
  font: 700 11px/19px var(--font-body); text-align: center;
  box-shadow: 0 0 0 2px var(--card);
}
.ch-name { font-weight: 600; font-size: 14.5px; text-align: center; }
.ch-pct { font-size: 11px; }
.st-ok .ch-pct { color: var(--accent-ink); }
.st-warn .ch-pct { color: var(--warn-ink); }
.st-none .ch-pct { color: var(--dim); }
.ch-conn {
  flex: 0 2 64px; min-width: 14px; height: 3px; margin-top: 27px;
  border-radius: 2px; background: var(--line-soft); overflow: hidden;
}
.ch-conn i {
  display: block; width: 100%; height: 100%; border-radius: 2px;
  background: linear-gradient(var(--conn-dir, 90deg), var(--c1), var(--c2));
  transform-origin: left top;
}
.chain-legend {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 28px;
  margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line-soft);
  font-size: 13px; color: var(--dim);
}
.lg-item { display: inline-flex; align-items: center; gap: 7px; }
.lg-swatch { width: 11px; height: 11px; border-radius: 3px; }
.lg-ok { background: var(--accent); }
.lg-warn { background: var(--warn); }
.lg-hatch { background: var(--hatch); border: 1px solid var(--none); }
.chain-caption {
  margin: 16px 0 0; text-align: center; font-size: 13px; color: var(--dim);
}

/* the one motion moment: the chain verifies left→right on load */
.chain-go .ch-node {
  animation: ch-nodepop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
  animation-delay: calc(var(--i) * 0.26s);
}
.chain-go .ch-conn i {
  animation: ch-sweep 0.34s ease-out both;
  animation-delay: calc(var(--i) * 0.26s + 0.15s);
}
.chain-go .ch-bead {
  animation: ch-beadpop 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.4) both;
  animation-delay: calc(var(--i) * 0.26s + 0.34s);
}
@keyframes ch-nodepop { from { opacity: 0; transform: translateY(8px) scale(0.88); } }
@keyframes ch-sweep { from { transform: scale(0, 1); } }
@keyframes ch-sweep-v { from { transform: scale(1, 0); } }
@keyframes ch-beadpop { from { opacity: 0; transform: scale(0); } }
@media (prefers-reduced-motion: reduce) {
  .chain-go .ch-node, .chain-go .ch-conn i, .chain-go .ch-bead { animation: none !important; }
}

/* ---------- home: CTA + feature strip ---------- */
.cta-row { display: flex; justify-content: center; align-items: stretch; gap: 14px; flex-wrap: wrap; padding: 4px 0 44px; }
.install-card {
  display: inline-flex; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 15px 20px; font-size: 13px; color: var(--ink);
}
.feature-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.feature-card { padding: 24px 26px; display: flex; flex-direction: column; gap: 10px; }
.feature-title { font-family: var(--font-display); font-weight: 600; font-size: 18px; margin: 0; }
.feature-copy { color: var(--dim); font-size: 14.5px; margin: 0; flex: 1; }

/* ---------- directory ---------- */
.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 18px 28px; flex-wrap: wrap; padding: 44px 0 6px;
}
.dir-controls { padding: 18px 0 22px; }
#dir-filter {
  width: 100%; max-width: 420px;
  font-family: var(--font-body); font-size: 14.5px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 16px;
}
#dir-filter::placeholder { color: var(--dim); opacity: 0.75; }
button.btn { font-family: var(--font-body); cursor: pointer; }
button.btn:disabled { background: var(--none); cursor: default; }
.scan-card {
  margin-top: 14px; max-width: 560px;
  padding: 18px 22px;
  border-left: 4px solid var(--accent);
}
.scan-card[hidden] { display: none; }
.scan-copy { margin: 0 0 14px; color: var(--dim); font-size: 14.5px; max-width: 52ch; }
.scan-copy strong { color: var(--ink); }
.scan-status { margin: 12px 0 0; font-size: 12.5px; color: var(--dim); }
.scan-status[hidden] { display: none; }
table.directory { display: block; width: 100%; border-collapse: collapse; }
table.directory tbody {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px;
}
.repo-card {
  display: block; position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.repo-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.repo-card-in { display: flex; flex-direction: column; gap: 12px; padding: 22px 24px; }
.rc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.repo-link {
  font-family: var(--font-display); font-weight: 600; font-size: 17px;
  color: var(--ink); text-decoration: none; word-break: break-word;
}
.repo-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-card); }
.repo-link:focus-visible { outline: none; }
.repo-link:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }
.rc-desc { margin: 0; font-size: 13.5px; color: var(--dim); }
.rc-desc-empty { font-style: italic; opacity: 0.7; }
.rc-meta { font-size: 12.5px; color: var(--dim); }
.rc-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border-top: 1px solid var(--line-soft); padding-top: 12px; margin-top: auto;
}
.rc-date { font-size: 11px; color: var(--dim); }
.lane {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 10.5px; border-radius: 999px;
  padding: 2px 9px; border: 1px solid;
}
.lane-auth { background: var(--accent-tint); color: var(--accent-ink); border-color: var(--accent); }
.lane-ext { background: var(--line-soft); color: var(--dim); border-color: var(--line); }
.lane-unsigned { background: rgba(214, 116, 44, 0.12); color: var(--warn-ink); border-color: var(--warn); }
/* Local lane: a real link, drawn as a shorter one than the authenticated mark. */
.lane-local { background: transparent; color: var(--dim); border-style: dashed; border-color: var(--line); }
.lane-local-overlay {
  background: transparent; color: var(--dim);
  border-style: dashed; border-color: var(--line); font-size: 10px;
}
.rc-cov {
  margin-top: 8px; font-size: 12.5px; line-height: 1.55;
  color: var(--warn-ink); border-left: 2px solid var(--warn); padding-left: 10px;
}
.rc-cov code { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.dir-sortbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px;
  font-size: 11px; letter-spacing: 0.08em; color: var(--dim);
}
.dir-sortbar select {
  font: inherit; letter-spacing: 0; padding: 4px 8px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.dir-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.dir-count { margin-left: auto; }

/* mini chain */
.mini-chain { display: flex; align-items: flex-start; gap: 6px; }
.mc-ph { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mc-dot { width: 12px; height: 12px; border-radius: 4px; }
.mc-ph.st-ok .mc-dot { background: var(--accent); }
.mc-ph.st-warn .mc-dot { background: var(--warn); }
.mc-ph.st-none .mc-dot { background: var(--hatch); box-shadow: inset 0 0 0 1px var(--none); }
.mc-pct { font-size: 10px; line-height: 1; }
.mc-ph.st-ok .mc-pct { color: var(--accent-ink); }
.mc-ph.st-warn .mc-pct { color: var(--warn-ink); }
.mc-ph.st-none .mc-pct { color: var(--dim); }
.mc-link { width: 16px; height: 2px; border-radius: 1px; background: var(--line); margin-top: 5px; }

/* ---------- repo detail ---------- */
.crumbs { padding: 30px 0 4px; font-size: 14px; }
.crumbs a { text-decoration: none; font-weight: 500; }
.repo-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 8px 0 4px; }
.repo-title {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 4vw, 34px);
  letter-spacing: -0.01em; margin: 0; word-break: break-word;
}
.repo-meta { font-size: 13px; color: var(--dim); margin: 4px 0 0; max-width: none; }
.score-line { font-size: 15px; margin: 10px 0 0; }
.chain-card-detail { margin-top: 22px; }
.transparency-note { font-size: 13px; color: var(--dim); margin: 0 0 18px; }

.phase-group { margin: 0 0 18px; overflow: hidden; }
.pg-head {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 22px; border-bottom: 1px solid var(--line-soft);
}
.pg-tile {
  flex: none; width: 38px; height: 38px; border-radius: 12px; border: 2px solid;
  display: flex; align-items: center; justify-content: center;
}
.pg-title-wrap { flex: 1; min-width: 0; }
.pg-title { font-family: var(--font-display); font-weight: 600; font-size: 16px; margin: 0; }
.pg-counts { font-size: 12px; color: var(--dim); }
.pg-pct { font-size: 13px; font-weight: 700; white-space: nowrap; }
.pg-pct.st-ok { color: var(--accent-ink); }
.pg-pct.st-warn { color: var(--warn-ink); }
.pg-pct.st-none { color: var(--dim); }
.ctl-list { list-style: none; margin: 0; padding: 6px 0; }
.ctl {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 10px 22px; border-bottom: 1px solid var(--line-soft);
}
.ctl:last-child { border-bottom: 0; }
.ctl-oos { opacity: 0.55; }
.ctl-mark {
  flex: none; width: 84px; text-align: center;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  border-radius: 999px; border: 1px solid; padding: 2px 0; margin-top: 2px;
}
.ctl-mark.oc-pass { background: var(--accent-tint); color: var(--accent-ink); border-color: var(--accent); }
.ctl-mark.oc-fail { background: var(--fail-tint); color: var(--fail); border-color: var(--fail); }
.ctl-mark.oc-gap { background: var(--warn-tint); color: var(--warn-ink); border-color: var(--warn); }
.ctl-mark.oc-unverified { background: var(--hatch); color: var(--ink); border-color: var(--none); }
.ctl-mark.oc-info { background: var(--line-soft); color: var(--dim); border-color: var(--line); }
.ctl-main { min-width: 0; font-size: 14px; }
.oos {
  font-family: var(--font-mono); font-size: 10px; color: var(--dim);
  border: 1px dashed var(--none); border-radius: 999px; padding: 1px 7px; margin-left: 6px;
}
.raw {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--warn-ink);
  background: var(--warn-tint); border-radius: 6px; padding: 1px 6px; margin-left: 6px;
}
.ctl-reason { font-size: 13px; color: var(--dim); margin-top: 3px; }
.ctl-evidence { margin-top: 4px; font-size: 13px; }
.ctl-evidence summary {
  cursor: pointer; color: var(--accent-ink); font-weight: 500; font-size: 12.5px;
}
.ctl-evidence ul { margin: 6px 0 2px; padding-left: 20px; color: var(--dim); }
.ctl-evidence li { overflow-wrap: anywhere; }

.improve-card { padding: 26px 28px; margin: 26px 0 0; border-left: 4px solid var(--accent); }
.improve-title { font-family: var(--font-display); font-weight: 600; font-size: 19px; margin: 0 0 10px; }

/* ---------- methodology ---------- */
.method-wrap { max-width: 780px; margin: 0 auto; }
.method-head { padding: 44px 0 10px; }
.honesty-card {
  background: var(--accent-tint); border-color: var(--accent);
  padding: 26px 28px; margin: 22px 0 10px;
}
.honesty-motif { display: block; margin-bottom: 12px; max-width: 100%; }
.honesty-title { font-family: var(--font-display); font-weight: 600; font-size: 19px; margin: 0 0 10px; }
.honesty-body { margin: 0; color: var(--ink); }
.honesty-body code { background: rgba(255, 255, 255, 0.75); }
.method-section { padding: 22px 0 6px; }
.method-section h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 22px;
  letter-spacing: -0.01em; margin: 18px 0 10px;
}
.prose p, .prose li { color: var(--dim); }
.prose strong, .prose code { color: var(--ink); }
.prose ol, .prose ul { padding-left: 22px; }
.method-table {
  width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13.5px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}
.method-table th, .method-table td {
  text-align: left; vertical-align: top; padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.method-table th {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  color: var(--dim); text-transform: uppercase;
}
.method-table tr:last-child td { border-bottom: 0; }
.method-table td { color: var(--dim); }
.method-table td strong, .method-table td code { color: var(--ink); }
.inkblock {
  background: var(--ink); color: var(--ground2); border-radius: var(--r-tile);
  padding: 22px 26px; overflow-x: auto; margin: 8px 0 14px;
  font-size: 13px; line-height: 1.8;
}
.inkblock code { background: transparent; color: inherit; font-size: inherit; padding: 0; }
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 6px 0 14px; }
.grade-copy { color: var(--dim); font-size: 14.5px; }
.grade-key { color: var(--ink); font-weight: 700; font-size: 0.9em; }

/* ---------- design switcher ---------- */
.design-switcher {
  position: fixed; right: 16px; bottom: 16px; z-index: 50;
  display: flex; align-items: center; gap: 2px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: var(--shadow); padding: 5px 8px;
}
.design-switcher .ds-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--dim); padding: 0 6px;
}
.design-switcher a {
  font-size: 12.5px; font-weight: 600; color: var(--dim); text-decoration: none;
  padding: 4px 10px; border-radius: 999px;
}
.design-switcher a:hover { color: var(--accent-ink); background: var(--line-soft); }
.design-switcher a[aria-current="true"] { background: var(--accent-tint); color: var(--accent-ink); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .page-head { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 720px) {
  .chain-card { padding: 28px 22px 20px; }
  .hero-chain { flex-direction: column; align-items: center; }
  .ch-node { flex: none; width: 100%; max-width: 260px; }
  .ch-conn {
    flex: none; width: 3px; height: 30px; min-width: 0; margin: 10px 0;
    --conn-dir: 180deg;
  }
  .chain-go .ch-conn i { animation-name: ch-sweep-v; }
  .hero { padding-top: 40px; }
  .topbar-in { flex-direction: column; align-items: flex-start; gap: 10px; }
  .footer-in { flex-direction: column; }
  .ctl { flex-direction: column; gap: 6px; padding: 12px 18px; }
  .ctl-mark { margin-top: 0; }
  .pg-head { padding: 14px 18px; flex-wrap: wrap; }
}
@media (max-width: 480px) {
  main { padding-left: 16px; padding-right: 16px; }
  .topbar-in, .footer-in { padding-left: 16px; padding-right: 16px; }
  table.directory tbody { grid-template-columns: 1fr; }
  .repo-card-in { padding: 18px 18px; }
  .cta-row { flex-direction: column; align-items: stretch; text-align: center; }
  .install-card { justify-content: center; }
  .design-switcher { right: 10px; bottom: 10px; }
  .chain-legend { gap: 8px 16px; font-size: 12px; }
}

/* ── shared components (home panels, taxonomy, exposure) ───────────────── */
:root {
  --hp-surface: var(--card);
  --hp-ground: var(--ground1);
  --hp-ink: var(--ink);
  --hp-dim: var(--dim);
  --hp-muted: var(--none);
  --hp-line: var(--line);
  --hp-line-strong: var(--line);
  --hp-accent: var(--accent);
  --hp-pass: var(--accent);
  --hp-fail: var(--fail);
  --hp-warn: var(--warn);
  --hp-hatch: var(--hatch);
  --hp-mono: var(--font-mono);
  --hp-display: var(--font-display);
  --hp-radius: var(--r-tile);
  --hp-shadow: var(--shadow);
  --tap: 44px;
  --hp-s--2: clamp(0.78rem, 0.755rem + 0.13vw, 0.8125rem);
  --hp-s--1: clamp(0.875rem, 0.85rem + 0.13vw, 0.9375rem);
  --hp-s-0:  clamp(1rem, 0.98rem + 0.1vw, 1.0625rem);
  --hp-s-1:  clamp(1.0625rem, 1.02rem + 0.23vw, 1.1875rem);
  --hp-s-3:  clamp(1.4375rem, 1.24rem + 0.97vw, 1.875rem);
}

/* ── mobile hardening, in every design ─────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; }
body { min-block-size: 100dvh; overflow-wrap: break-word; }
/* Under 16px a focused form control makes iOS Safari zoom the page, and the
   page is then wider than the screen. This is a correctness floor. */
/* Accessibility floor, deliberately !important. Under 16px, iOS Safari zooms
   the viewport when a text field or select takes focus, and the page is then
   wider than the screen — the exact horizontal-overflow bug this whole pass
   exists to remove. A design may restyle these controls any way it likes; it
   may not put them back under 16px. Measured live: console #dir-filter was
   14px and #dir-sort 11px, chain 14.5px and 11px, manual #dir-sort 13.5px.
   Checkboxes are exempt — they carry no text and do not trigger the zoom. */
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  font-size: max(16px, 1em) !important;
}
input[type="search"], select { min-block-size: var(--tap); }
input[type="checkbox"], input[type="radio"] { inline-size: 20px; block-size: 20px; }
.table-scroll, pre { overflow-x: auto; -webkit-overflow-scrolling: touch; }
nav a, .btn, .btn-outline, .btn-dark, summary {
  min-block-size: var(--tap); display: inline-flex; align-items: center;
}
summary { justify-content: flex-start; }
.design-switcher { max-inline-size: calc(100vw - 20px); flex-wrap: wrap; }
.design-switcher a { min-block-size: var(--tap); padding: 6px 10px; }
/* Clearance for the FIXED switcher, on <body> rather than <main>: scrolled to
   the end of the page the switcher covers the FOOTER, which is outside main,
   so main's own bottom padding could never reach it. The switcher's script
   measures itself into --switcher-clearance (its height is 56px at 390px wide
   and 102px at 320px, where the links wrap onto three rows); the literal is
   the no-JS fallback, sized for that worst case. */
body { padding-block-end: var(--switcher-clearance, 132px); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
/* Landscape phones are height-constrained, not width-constrained. */
@media (max-height: 460px) and (orientation: landscape) {
  .hero { padding-block: 20px 24px; }
  .rail-sticky, .method-nav { position: static; }
}

/* ── the search-and-submit control ─────────────────────────────────────── */
.hp-search { margin-block: 14px; }
.hp-search-label {
  display: block; margin-block-end: 8px;
  font-family: var(--hp-mono); font-size: var(--hp-s--2); font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--hp-muted);
}
.hp-search-input {
  inline-size: 100%; max-inline-size: 520px; padding: 12px 16px;
  min-block-size: var(--tap); border-radius: var(--hp-radius);
  border: 2px solid var(--hp-line-strong); background: var(--hp-surface);
  color: var(--hp-ink); font-family: var(--hp-mono); font-size: 16px;
}
.hp-search-input::placeholder { color: var(--hp-muted); }
.hp-chips {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-block: 10px 0; font-size: var(--hp-s--2);
}
.hp-chips-label {
  font-family: var(--hp-mono); font-size: var(--hp-s--2);
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--hp-muted);
}
.hp-chip {
  display: inline-flex; align-items: center; min-block-size: 36px;
  padding: 4px 10px; border: 1.5px solid var(--hp-line);
  border-radius: var(--hp-radius);
  font-family: var(--hp-mono); font-size: var(--hp-s--2);
  color: var(--hp-ink); text-decoration: none; background: var(--hp-surface);
}
.hp-chip:hover { border-color: var(--hp-accent); color: var(--hp-accent); }
/* A relative block that pushes the page down, never a floating dropdown. */
.dir-found {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  max-inline-size: 520px; margin-block-start: 14px; padding: 14px 16px;
  background: var(--hp-surface); border: 2px solid var(--hp-pass);
  border-radius: var(--hp-radius);
}
.dir-found-copy { margin: 0; font-size: var(--hp-s--1); color: var(--hp-dim); }
/* A class setting display:flex beats the user-agent rule that hides [hidden],
   so without this the "already listed" block is visible on every page load —
   it announced a match before anything had been typed. */
.dir-found[hidden], .dir-scan[hidden], [hidden] { display: none !important; }


/* ── exemplar panels ───────────────────────────────────────────────────── */
.hp-panels { display: grid; gap: clamp(28px, 5vw, 48px); padding-block: clamp(32px, 5vw, 56px); }
.hp-panel, .tx-strip { container-type: inline-size; min-inline-size: 0; }
.hp-panel-eyebrow {
  font-family: var(--hp-mono); font-size: var(--hp-s--2); font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--hp-accent);
  margin: 0 0 6px;
}
.hp-panel-title {
  font-family: var(--hp-display); font-size: var(--hp-s-3);
  letter-spacing: -0.01em; margin: 0; color: var(--hp-ink);
}
.hp-panel-line { font-size: var(--hp-s-0); color: var(--hp-dim); margin: 8px 0 20px; max-inline-size: 60ch; }

/* Container queries: how many cards fit is a property of the PANEL's width,
   not the window's. */
.hp-cards { display: grid; grid-template-columns: 1fr; gap: 16px; }
@container (min-width: 640px) { .hp-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 900px) { .hp-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }

.hp-card {
  display: grid; grid-template-rows: auto auto 1fr auto auto; gap: 8px;
  min-block-size: 224px; padding: 16px; text-decoration: none; color: var(--hp-ink);
  background: var(--hp-surface); border: 1.5px solid var(--hp-line-strong);
  border-radius: var(--hp-radius); box-shadow: var(--hp-shadow);
}
.hp-card:hover { border-color: var(--hp-accent); }
.hp-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hp-grade {
  display: inline-flex; align-items: center; justify-content: center;
  inline-size: 40px; block-size: 40px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--g, var(--hp-muted)); color: var(--g, var(--hp-muted));
  font-family: var(--hp-mono); font-weight: 700; font-size: var(--hp-s--1);
}
.hp-grade-aplus, .hp-grade-a, .hp-grade-b { --g: var(--hp-pass); }
.hp-grade-c { --g: var(--hp-warn); }
.hp-grade-d { --g: var(--hp-warn); }
.hp-grade-f { --g: var(--hp-fail); }
.hp-grade-na { --g: var(--hp-muted); }
.hp-src { font-family: var(--hp-mono); font-size: var(--hp-s--2); color: var(--hp-dim); text-align: end; line-height: 1.3; }
.hp-card-name {
  font-family: var(--hp-mono); font-size: var(--hp-s-0); font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hp-card-desc {
  font-size: var(--hp-s--1); color: var(--hp-muted); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  line-clamp: 2; overflow: hidden;
}
.hp-card-facts {
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  font-family: var(--hp-mono); font-size: var(--hp-s--2); color: var(--hp-dim);
  border-block-start: 1px dashed var(--hp-line); padding-block-start: 8px;
}
.hp-fact-date { margin-inline-start: auto; }
.hp-card-note {
  font-size: var(--hp-s--2); color: var(--hp-warn); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  line-clamp: 2; overflow: hidden;
}
.hp-waiting {
  padding: clamp(16px, 3vw, 24px); background: var(--hp-surface);
  border: 2px dashed var(--hp-line-strong); border-radius: var(--hp-radius);
  display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
}
.hp-waiting-copy { margin: 0; font-size: var(--hp-s--1); color: var(--hp-dim); line-height: 1.55; max-inline-size: 62ch; }
.hp-waiting-link {
  font-weight: 600; font-size: var(--hp-s--1); color: var(--hp-ink);
  text-decoration: underline; text-underline-offset: 4px;
  display: inline-flex; align-items: center; min-block-size: var(--tap);
}
.hp-unans { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hp-unans-row {
  display: grid; gap: 4px 12px; align-items: center; grid-template-columns: minmax(0, 1fr);
  padding-block-end: 10px; border-block-end: 1px solid var(--hp-line);
}
@container (min-width: 620px) {
  .hp-unans-row { grid-template-columns: minmax(140px, 1fr) minmax(80px, 2fr) auto minmax(0, 2fr); }
}
.hp-unans-id { font-family: var(--hp-mono); font-size: var(--hp-s--1); overflow-wrap: anywhere; }
.hp-unans-q { font-size: var(--hp-s--1); color: var(--hp-ink); line-height: 1.4; }
.hp-unans-q .hp-unans-id {
  display: block; font-family: var(--hp-mono); font-size: var(--hp-s--2);
  color: var(--hp-muted); margin-block-start: 2px;
}
.tx-questions { margin-block-start: 24px; }
.tx-q-table { min-inline-size: 640px; }
.tx-q-groups { font-family: var(--hp-mono); white-space: nowrap; }

.hp-unans-track { display: block; block-size: 8px; background: var(--hp-line); }
.hp-unans-fill { display: block; block-size: 100%; background: var(--hp-hatch); }
.hp-unans-count {
  font-family: var(--hp-mono); font-size: var(--hp-s--2); color: var(--hp-dim);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.hp-unans-why { font-size: var(--hp-s--2); color: var(--hp-muted); }
.hp-unans-foot { font-size: var(--hp-s--1); color: var(--hp-dim); line-height: 1.55; max-inline-size: 68ch; margin-block-start: 16px; }
.hp-more {
  display: inline-flex; align-items: center; min-block-size: var(--tap);
  font-weight: 600; font-size: var(--hp-s--1); color: var(--hp-ink);
  text-decoration: underline; text-underline-offset: 4px;
}
.hero-count { font-size: var(--hp-s--1); color: var(--hp-dim); }

/* ── taxonomy ──────────────────────────────────────────────────────────── */
.tx-strip { padding-block: clamp(24px, 4vw, 40px); border-block-start: 1.5px solid var(--hp-line); }
.tx-chips { display: grid; grid-template-columns: 1fr; gap: 8px; margin-block-end: 18px; }
@container (min-width: 560px) { .tx-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 880px) { .tx-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tx-chip {
  display: flex; align-items: center; gap: 10px; min-block-size: var(--tap); padding: 8px 12px;
  background: var(--hp-surface); border: 1.5px solid var(--hp-line);
  border-radius: var(--hp-radius); color: var(--hp-ink); text-decoration: none;
  font-size: var(--hp-s--1);
}
.tx-chip:hover { border-color: var(--hp-accent); color: var(--hp-accent); }
.tx-chip-id { font-family: var(--hp-mono); font-weight: 700; font-size: var(--hp-s--2); color: var(--hp-accent); flex-shrink: 0; }
.tx-classes { display: grid; gap: 20px; }
.tx-class {
  padding: 16px; background: var(--hp-surface);
  border-inline-start: 3px solid var(--hp-line-strong); border-radius: var(--hp-radius);
}
.tx-class-title { font-family: var(--hp-display); font-size: var(--hp-s-1); margin: 0 0 6px; color: var(--hp-ink); }
.tx-class-line { margin: 0 0 8px; font-size: var(--hp-s-0); color: var(--hp-ink); }
.tx-class-controls { margin: 0 0 8px; font-size: var(--hp-s--1); overflow-wrap: anywhere; }
.tx-label {
  font-family: var(--hp-mono); font-size: var(--hp-s--2); text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--hp-muted); margin-inline-end: 6px;
}
.tx-lineage { margin: 8px 0 0; font-family: var(--hp-mono); font-size: var(--hp-s--2); color: var(--hp-muted); }
.tx-incidents { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 12px; }
.tx-incident { display: grid; gap: 3px; font-size: var(--hp-s--1); }
.tx-incident-when { font-family: var(--hp-mono); font-size: var(--hp-s--2); color: var(--hp-muted); }
.tx-incident-what { color: var(--hp-dim); line-height: 1.5; }
.tx-reported {
  display: inline-block; font-family: var(--hp-mono); font-size: var(--hp-s--2);
  color: var(--hp-warn); border: 1px solid var(--hp-warn); padding: 0 6px; margin-inline-start: 6px;
}
.tx-sourcing { font-size: var(--hp-s--1); color: var(--hp-dim); }
.tx-defs { font-size: var(--hp-s-0); color: var(--hp-dim); line-height: 1.6; }
.tx-class-posture { border-inline-start-color: var(--hp-muted); border-inline-start-style: dashed; }

/* ── exposure panel ────────────────────────────────────────────────────── */
.exposure {
  margin-block: 32px; padding: clamp(16px, 3vw, 26px);
  background: var(--hp-surface); border: 1.5px solid var(--hp-line-strong);
  border-radius: var(--hp-radius);
}
.exposure .body-copy { color: var(--hp-dim); font-size: var(--hp-s--1); line-height: 1.55; margin: 0 0 18px; }
.ex-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ex-row { display: grid; gap: 5px; padding-inline-start: 12px; border-inline-start: 3px solid var(--hp-line); }
/* Marks the EVIDENCE state, not a severity ranking — the scan has no data
   with which to rank one group above another. */
.ex-none-found { border-inline-start-color: var(--hp-fail); }
.ex-partial { border-inline-start-color: var(--hp-warn); }
.ex-evidenced { border-inline-start-color: var(--hp-pass); }
.ex-not-observed { border-inline-start-color: var(--hp-muted); border-inline-start-style: dashed; }
.ex-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; }
.ex-name {
  font-weight: 600; font-size: var(--hp-s-0); color: var(--hp-ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px; min-block-size: 32px;
}
.ex-name:hover { color: var(--hp-accent); }
.ex-state {
  font-family: var(--hp-mono); font-size: var(--hp-s--2); text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--hp-muted);
}
.ex-line { font-size: var(--hp-s--1); color: var(--hp-dim); }
.ex-detail { font-size: var(--hp-s--2); color: var(--hp-dim); line-height: 1.5; overflow-wrap: anywhere; }
.ex-detail-quiet { color: var(--hp-muted); }
.ex-detail-label {
  font-family: var(--hp-mono); text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--hp-muted); margin-inline-end: 6px;
}
.ex-foot { margin-block-start: 18px; font-size: var(--hp-s--2); color: var(--hp-muted); line-height: 1.55; overflow-wrap: anywhere; }


/* ── tap targets, measured at 390px ────────────────────────────────────
   Each selector below was observed under 44px in a real render and is a
   standalone control, not a link inside a sentence (WCAG 2.5.8 exempts
   those). Named per design because the three alternates each ship their own
   class for the same thing. */
.wordmark, .m-wordmark,
.tm-repo, .method-link, .arrow-link, .entry-name, .repo-link {
  display: inline-flex; align-items: center; min-block-size: var(--tap);
}
.hp-search-label, .dir-filter-label, .dir-controls-label {
  display: flex; align-items: flex-end; min-block-size: var(--tap); padding-block-end: 6px;
}
.dir-check, .dir-sortbar label, .m-sortbar label {
  min-block-size: var(--tap); display: inline-flex; align-items: center;
}
.design-switcher a { min-block-size: var(--tap); }
.hp-chip { min-block-size: var(--tap); }

/* ── inline term definitions ───────────────────────────────────────────── */
.term { color: var(--hp-ink); }
.term-def { color: var(--hp-muted); font-style: italic; }
.key-note { font-size: var(--hp-s--1); color: var(--hp-dim); line-height: 1.6; max-inline-size: 70ch; margin-block: 6px 24px; }
