/* Sparekey. Visual idea: every permission is a spare key with a colour-coded tag,
   like the key board behind a locksmith's counter. */

@font-face { font-family: "Shoulders"; src: url("fonts/big-shoulders-display-latin-900-normal.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Shoulders"; src: url("fonts/big-shoulders-display-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215; }
@font-face { font-family: "Atkinson"; src: url("fonts/atkinson-hyperlegible-next-latin-ext-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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"; src: url("fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215; }
@font-face { font-family: "Atkinson"; src: url("fonts/atkinson-hyperlegible-next-latin-ext-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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: "AtkinsonMono"; src: url("fonts/atkinson-hyperlegible-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --steel: #e2e6e7;        /* the board */
  --steel-deep: #d3d9db;
  --paper: #f8f9f7;        /* tag stock */
  --ink: #17202b;
  --ink-soft: #4b5664;
  --rule: #bfc8cc;
  --brass: #b0852b;
  --brass-bright: #cf9f3f;
  --red: #c4382a;
  --orange: #d26a1c;
  --yellow: #e0b638;
  --blue: #3c72a0;
  --green: #3b7a4f;
  --on-red: #fff8f2;
  --on-orange: #fff8f2;
  --on-yellow: #241a00;
  --on-blue: #f4f8fc;
  --on-green: #f3faf4;
  --peg: rgba(23, 32, 43, .07);
  --display: "Shoulders", "Arial Narrow", "Roboto Condensed", sans-serif;
  --text: "Atkinson", "Segoe UI", system-ui, sans-serif;
  --mono: "AtkinsonMono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --gutter: clamp(16px, 4vw, 44px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --steel: #12171d;
    --steel-deep: #0d1116;
    --paper: #1d252e;
    --ink: #e8ebe7;
    --ink-soft: #a9b3bd;
    --rule: #33404c;
    --brass: #d6a94f;
    --brass-bright: #e2b961;
    --red: #e05a47;
    --orange: #e98a3c;
    --yellow: #e7c457;
    --blue: #6b9fd0;
    --green: #5fa877;
    --on-red: #1b0a07;
    --on-orange: #1d0e02;
    --on-yellow: #1d1600;
    --on-blue: #06121e;
    --on-green: #061409;
    --peg: rgba(232, 235, 231, .05);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--steel);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--text);
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .18em; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brass-bright); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--mono); font-size: .94em; letter-spacing: .01em; overflow-wrap: anywhere; }

/* Header -------------------------------------------------------------- */
.bar { display: flex; align-items: center; justify-content: space-between; padding-block: 18px 6px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 900 1.7rem/1 var(--display); letter-spacing: .01em; }
.brand-mark { width: 34px; height: 34px; color: var(--brass); }
.brand-tag { fill: var(--red); }
.brand-hole { fill: var(--steel); }
.lang { display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.lang button { background: none; border: 0; padding: 5px 13px; font-weight: 700; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--steel); }

/* Hero ---------------------------------------------------------------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(16px, 4vw, 56px); align-items: center; padding-block: clamp(24px, 6vw, 72px) clamp(32px, 6vw, 64px); }
.hero h1 {
  font: 900 clamp(3.1rem, 8.6vw, 7.2rem)/.95 var(--display);
  letter-spacing: -.005em;
  margin: 0 0 .32em;
  max-width: 11ch;
  text-wrap: balance;
}
.lede { font-size: clamp(1.06rem, 1.6vw, 1.22rem); max-width: 54ch; margin: 0 0 28px; color: var(--ink-soft); }
.scan { display: flex; gap: 10px; max-width: 640px; }
.scan input {
  flex: 1 1 auto; min-width: 0;
  font-family: var(--mono); font-size: 1.05rem;
  padding: 15px 16px; border: 2px solid var(--ink); border-radius: 12px;
  background: var(--paper);
}
.scan input::placeholder { color: var(--ink-soft); opacity: .8; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 2px solid var(--ink); border-radius: 12px; padding: 13px 22px;
  font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--paper); color: var(--ink);
}
.btn-brass { background: var(--brass-bright); border-color: var(--ink); color: #17202b; }
.btn-brass:hover { background: var(--brass); }
.btn-small { padding: 8px 14px; border-radius: 10px; font-size: .95rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.linkish { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: .18em; cursor: pointer; font-weight: 700; }
.fineprint { margin: 14px 0 0; font-size: .95rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.fineprint .linkish { color: var(--ink); }
.form-error { margin: 12px 0 0; color: var(--red); font-weight: 700; }

.hero-art { margin: 0; justify-self: center; width: min(100%, 360px); }
.ring-loop { fill: none; stroke: var(--brass); stroke-width: 12; }
.cord { stroke: var(--brass); stroke-width: 4; stroke-linecap: round; }
.t-red { fill: var(--red); } .t-orange { fill: var(--orange); } .t-yellow { fill: var(--yellow); }
.t-blue { fill: var(--blue); } .t-green { fill: var(--green); }
.punch { fill: var(--steel); stroke: rgba(0, 0, 0, .18); stroke-width: 2; }
.stamp { font: 900 34px/1 var(--display); fill: var(--paper); text-anchor: middle; dominant-baseline: middle; letter-spacing: .04em; }
.stamp-dark { fill: #241a00; }
.swing { transform-origin: 0 0; animation: swing 1.8s cubic-bezier(.3, .7, .3, 1) both; }
.sw2 { animation-delay: .12s; } .sw3 { animation-delay: .24s; } .sw4 { animation-delay: .36s; } .sw5 { animation-delay: .48s; }
@keyframes swing {
  0% { transform: rotate(7deg); }
  35% { transform: rotate(-4deg); }
  65% { transform: rotate(1.5deg); }
  100% { transform: rotate(0); }
}

/* Scanning status ------------------------------------------------------ */
.status { padding-block: 8px 48px; }
.status-board { background: var(--paper); border: 2px solid var(--ink); border-radius: 16px; padding: 22px clamp(18px, 3vw, 28px); max-width: 760px; }
.status-title { font: 900 2rem/1 var(--display); margin: 0 0 8px; }
.status-line { margin: 0 0 16px; min-height: 1.55em; }
.bar-track { height: 10px; border-radius: 99px; background: var(--steel-deep); overflow: hidden; }
.bar-track span { display: block; height: 100%; width: 34%; background: var(--brass-bright); border-radius: 99px; animation: travel 1.6s ease-in-out infinite alternate; }
@keyframes travel { from { transform: translateX(-10%); } to { transform: translateX(210%); } }
.status-note { margin: 12px 0 0; color: var(--ink-soft); font-size: .95rem; }

/* Results -------------------------------------------------------------- */
.results { padding-block: 4px 56px; outline: none; }
.res-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px 32px; align-items: stretch; margin-bottom: 28px; }
.verdict {
  position: relative; display: grid; align-content: center; gap: 2px;
  min-width: 250px; padding: 22px 26px 22px 64px; border-radius: 22px 12px 12px 22px;
}
.verdict::before { content: ""; position: absolute; left: 22px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; background: var(--steel); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .25); }
.verdict-word { font: 900 clamp(2.4rem, 5vw, 3.6rem)/.92 var(--display); }
.verdict-sub { font-weight: 700; max-width: 26ch; }
.verdict-score { font: 800 1.15rem/1.2 var(--display); letter-spacing: .02em; opacity: .9; }
.v-red { background: var(--red); color: var(--on-red); }
.v-orange { background: var(--orange); color: var(--on-orange); }
.v-yellow { background: var(--yellow); color: var(--on-yellow); }
.v-green { background: var(--green); color: var(--on-green); }
.v-blue { background: var(--blue); color: var(--on-blue); }

.res-meta { display: grid; align-content: center; gap: 10px; min-width: 0; }
.res-addr { margin: 0; font-size: 1.05rem; }
.res-ens { font-weight: 700; margin-right: 10px; font-family: var(--text); }
.tally { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tally li { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.d-critical { background: var(--red); } .d-high { background: var(--orange); } .d-medium { background: var(--yellow); }
.d-low { background: var(--blue); } .d-info { background: var(--green); }
.res-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sample-note { margin: 0; padding: 8px 12px; border: 2px dashed var(--ink); border-radius: 10px; font-weight: 700; justify-self: start; }

.res-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: 28px; align-items: start; }

/* The board where tags hang */
.board {
  background-color: var(--steel-deep);
  background-image: radial-gradient(var(--peg) 2.4px, transparent 2.6px);
  background-size: 22px 22px;
  border-radius: 18px; padding: clamp(14px, 2.4vw, 24px);
}
.group + .group { margin-top: 26px; }
.group-h { display: flex; align-items: baseline; gap: 10px; font: 900 1.7rem/1 var(--display); margin: 0 0 12px; }
.group-h .count { font: 700 1rem/1 var(--text); color: var(--ink-soft); }
.tags { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

.tag { display: grid; grid-template-columns: 66px minmax(0, 1fr); background: var(--paper); border-radius: 18px 10px 10px 18px; overflow: hidden; }
.tag-end { position: relative; display: flex; flex-direction: column; align-items: center; padding: 16px 0 14px; gap: 14px; }
.tag-end .hole { width: 18px; height: 18px; border-radius: 50%; background: var(--steel-deep); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .28); flex: none; }
.tag-end .sev { writing-mode: vertical-rl; transform: rotate(180deg); font: 800 1.15rem/1 var(--display); letter-spacing: .04em; }
.s-critical .tag-end { background: var(--red); color: var(--on-red); }
.s-high .tag-end { background: var(--orange); color: var(--on-orange); }
.s-medium .tag-end { background: var(--yellow); color: var(--on-yellow); }
.s-low .tag-end { background: var(--blue); color: var(--on-blue); }
.s-info .tag-end { background: var(--green); color: var(--on-green); }
.tag-body { padding: 14px 18px 16px; min-width: 0; }
.tag-chain { display: inline-block; font-weight: 700; font-size: .85rem; padding: 2px 9px; border: 1.5px solid var(--ink); border-radius: 999px; margin: 0 0 8px; }
.tag-title { font-size: 1.12rem; line-height: 1.3; margin: 0 0 6px; overflow-wrap: anywhere; }
.tag-detail { margin: 0 0 12px; color: var(--ink-soft); max-width: 70ch; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0 0 12px; font-size: .95rem; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts .risk { font-weight: 700; }
.facts .mono { font-size: .82rem; letter-spacing: 0; }
.tag-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tag-status { margin: 10px 0 0; font-weight: 700; font-size: .95rem; }
.tag-status.err { color: var(--red); }
.tag-status.ok { color: var(--green); }
.more { margin-top: 12px; }

.reveal .tag { animation: hang .55s cubic-bezier(.2, .8, .3, 1.2) both; animation-delay: calc(var(--i, 0) * 45ms); transform-origin: 30px 12px; }
@keyframes hang {
  0% { opacity: 0; transform: translateY(-10px) rotate(-1.4deg); }
  70% { opacity: 1; transform: rotate(.4deg); }
  100% { opacity: 1; transform: none; }
}

details.group > summary { list-style: none; cursor: pointer; }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary .group-h::after { content: "+"; font: 900 1.4rem/1 var(--display); margin-left: 4px; }
details.group[open] > summary .group-h::after { content: "−"; }

/* Report (Claude) */
.report { background: var(--paper); border: 2px solid var(--ink); border-radius: 16px; padding: 20px 22px 22px; position: sticky; top: 16px; }
.report-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.report-top h2 { font: 900 1.9rem/1 var(--display); margin: 0; }
.by { font-size: .85rem; font-weight: 700; color: var(--ink-soft); text-align: right; }
.headline { font-size: 1.2rem; font-weight: 700; line-height: 1.3; margin: 0 0 8px; }
.situation { margin: 0 0 16px; }
.steps { list-style: none; counter-reset: step; margin: 0 0 16px; padding: 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 2px 12px; }
.steps li::before { content: counter(step); grid-row: span 4; font: 900 2.1rem/1 var(--display); color: var(--brass); }
.steps h3 { margin: 0; font-size: 1.05rem; line-height: 1.3; }
.steps p { margin: 0; font-size: .97rem; }
.steps .why { color: var(--ink-soft); }
.when { justify-self: start; font-size: .78rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1.5px solid currentColor; margin-bottom: 2px; }
.when-now { color: var(--red); } .when-today { color: var(--orange); } .when-this_week { color: var(--blue); }
.report h3.sub { font: 800 1.2rem/1.1 var(--display); margin: 14px 0 6px; }
.report ul.plain { margin: 0; padding-left: 1.1em; }
.report ul.plain li + li { margin-top: 4px; }
.report .loading { color: var(--ink-soft); }
.shimmer { display: block; height: 12px; border-radius: 6px; background: var(--steel-deep); margin: 10px 0; animation: pulse 1.2s ease-in-out infinite alternate; }
.shimmer:nth-child(2) { width: 82%; } .shimmer:nth-child(3) { width: 64%; }
@keyframes pulse { from { opacity: .45; } to { opacity: 1; } }

/* Coverage */
.coverage { margin-top: 34px; }
.coverage h2 { font: 900 1.7rem/1 var(--display); margin: 0 0 12px; }
.cov-table { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: 14px; overflow: hidden; font-size: .95rem; }
.cov-table th, .cov-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.cov-table th { font-weight: 700; color: var(--ink-soft); }
.cov-table tr:last-child td { border-bottom: 0; }
.cov-notes { color: var(--ink-soft); font-size: .88rem; margin-top: 4px; }
.st { font-weight: 700; }
.st-ok { color: var(--green); } .st-partial { color: var(--orange); } .st-error { color: var(--red); }

/* Explainer sections -------------------------------------------------- */
.kinds, .probe, .claude { padding-block: clamp(28px, 5vw, 56px); }
.kinds h2, .probe h2, .claude h2 { font: 900 clamp(2.1rem, 4.6vw, 3.4rem)/.95 var(--display); margin: 0 0 22px; max-width: 24ch; text-wrap: balance; }
.kind-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kind { position: relative; padding: 52px 18px 20px; border-radius: 22px 22px 12px 12px; }
.kind h3 { margin: 0 0 6px; font: 800 1.45rem/1.05 var(--display); letter-spacing: .01em; }
.kind p { margin: 0; font-size: .98rem; }
.kind-punch { position: absolute; top: 16px; left: 50%; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: var(--steel); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .28); }
.k-red { background: var(--red); color: var(--on-red); }
.k-orange { background: var(--orange); color: var(--on-orange); }
.k-yellow { background: var(--yellow); color: var(--on-yellow); }
.k-blue { background: var(--blue); color: var(--on-blue); }
.kinds-more { max-width: 70ch; margin: 22px 0 0; color: var(--ink-soft); }

.probe { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: center; }
.probe-copy p { margin: 0; max-width: 56ch; }
.probe-demo { display: grid; gap: 14px; }
.lane { display: flex; align-items: center; gap: 0; flex-wrap: nowrap; background: var(--paper); border-radius: 14px; padding: 14px; overflow: hidden; }
.chip { flex: none; font-weight: 700; padding: 6px 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--steel); font-size: .92rem; }
.chip-wallet { background: var(--brass-bright); color: #17202b; }
.wire { flex: 1 1 18px; min-width: 14px; height: 3px; background: var(--ink); }
.wire-out { background: var(--red); }
.result { flex: none; font-weight: 700; margin-left: 12px; font-size: .92rem; }
.result.ok { color: var(--green); }
.result.bad { color: var(--red); margin-left: 0; padding: 6px 12px; border: 2px solid var(--red); border-radius: 999px; }

.claude p { max-width: 68ch; margin: 0; }

.foot { padding-block: 0 48px; margin-top: 24px; color: var(--ink-soft); font-size: .95rem; }
.foot-inner { border-top: 2px solid var(--ink); padding-top: 30px; }
.foot p { margin: 0 0 6px; }
.foot-small { font-size: .85rem; }

/* Responsive ------------------------------------------------------------ */
@media (max-width: 980px) {
  .res-body { grid-template-columns: minmax(0, 1fr); }
  .report { position: static; order: -1; }
  .kind-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-art { order: -1; width: min(62%, 220px); justify-self: start; margin-bottom: -6px; }
  .res-head { grid-template-columns: minmax(0, 1fr); }
  .verdict { min-width: 0; }
  .probe { grid-template-columns: minmax(0, 1fr); }
  .cov-table thead { display: none; }
  .cov-table, .cov-table tbody, .cov-table tr, .cov-table td { display: block; width: 100%; }
  .cov-table tr { border-bottom: 1px solid var(--rule); padding: 8px 0; }
  .cov-table td { border: 0; padding: 3px 14px; }
  .cov-table td::before { content: attr(data-label) ": "; font-weight: 700; color: var(--ink-soft); }
  .cov-table td:first-child::before { content: none; }
  .cov-table td:first-child { font-weight: 700; }
}
@media (max-width: 520px) {
  .scan { flex-direction: column; }
  .scan .btn { width: 100%; }
  .kind-list { grid-template-columns: minmax(0, 1fr); }
  .tag { grid-template-columns: 50px minmax(0, 1fr); }
  .tag-body { padding: 12px 14px 14px; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .facts dd { margin-bottom: 6px; }
  .lane { flex-wrap: wrap; row-gap: 10px; }
  .result.bad { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .swing, .reveal .tag, .bar-track span, .shimmer { animation: none !important; }
}
