@font-face { font-family: "Bricolage Grotesque"; font-weight: 500; font-display: swap; src: url("fonts/bricolage-grotesque-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 700; font-display: swap; src: url("fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 800; font-display: swap; src: url("fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 400; font-display: swap; src: url("fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 600; font-display: swap; src: url("fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; font-display: swap; src: url("fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2"); }

:root {
  --oat: #f1ece2;
  --paper: #fbf7f0;
  --ink: #1d1712;
  --muted: #5b4c3f;
  --line: #dccfba;
  --dash: #cdbda2;
  --signal: #d2502a;        /* the "?" and the panic end of the meter */
  --signal-text: #a8381a;   /* signal colour dark enough for text */
  --calm: #7aa874;
  --crit: #b3261e;
  --crit-text: #9c1f18;
  --night: #241b14;
  --night-ink: #efe6d8;
  --night-muted: #cdbfac;
  --night-link: #f0b27a;
  --code-bg: #15100b;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --oat: #17120e;
    --paper: #221a14;
    --ink: #f3ebdf;
    --muted: #bfae9a;
    --line: #3b2f25;
    --dash: #54443a;
    --signal: #e2643c;
    --signal-text: #f08a63;
    --calm: #8fbf88;
    --crit-text: #ff8a7a;
    --night: #241b14;
  }
  .tile { filter: saturate(.92); }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--oat); color: var(--ink); font: 17px/1.55 "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
a { color: var(--signal-text); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* nav */
.topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-top: 30px; }
.wordmark { display: inline-flex; align-items: baseline; color: var(--ink); text-decoration: none; font: 700 26px/1 var(--mono); letter-spacing: -0.045em; }
.wm-q { display: inline-block; margin-left: 3px; padding: 0 8px 2px; border-radius: 5px; background: var(--signal); color: #fff8f0; transform: rotate(-8deg); }
.nav-links { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; font-weight: 600; font-size: 15px; }
.nav-links a { color: var(--ink); text-decoration: none; }
.nav-links a:hover { text-decoration: underline; }
.gh { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 6px; background: var(--paper); }
.gh:hover { border-color: var(--signal); text-decoration: none !important; }

/* hero */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 40px 64px; padding: 88px 0 80px; }
.hero-text { flex: 999 1 520px; min-width: 0; }
h1 { margin: 0; font: 800 clamp(56px, 9.5vw, 128px)/.92 var(--display); letter-spacing: -0.045em; }
.answer { margin: 24px 0 0; font: 500 clamp(26px, 3.6vw, 40px)/1.1 var(--display); letter-spacing: -0.02em; color: var(--signal-text); }
.lede { margin: 24px 0 0; max-width: 32em; color: var(--muted); font-size: 19px; }
.meter-box { flex: 1 1 280px; max-width: 360px; margin: 0; }
.meter { width: 100%; height: auto; display: block; }
.meter-box figcaption { margin-top: 10px; text-align: center; font-size: 15px; font-weight: 600; color: var(--muted); }
.m-track, .m-calm, .m-panic { fill: none; stroke-width: 26; stroke-linecap: round; }
.m-track { stroke: var(--line); }
.m-calm { stroke: var(--calm); }
.m-panic { stroke: var(--signal); }
.m-needle {
  stroke: var(--ink); stroke-width: 8; stroke-linecap: round;
  transform-box: view-box; transform-origin: 160px 170px; transform: rotate(-70deg);
  transition: transform 1.4s cubic-bezier(.34, 1.56, .64, 1);
}
.m-hub { fill: var(--ink); }
.m-label { font: 600 15px "Instrument Sans", sans-serif; fill: var(--muted); }
@media (prefers-reduced-motion: reduce) { .m-needle { transition: none; } }

/* sections */
h2 { margin: 0; font: 700 34px/1.15 var(--display); letter-spacing: -0.02em; }
.current, .how { padding-bottom: 96px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 28px; }
.section-head p { margin: 0; color: var(--muted); font-size: 15px; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.tile {
  position: relative; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden;
  background: var(--card); border: 1.5px solid var(--border); color: var(--ink);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.tile-top {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 26px 26px 22px; background: var(--top); overflow: hidden;
  transition: background-color .35s ease, color .35s ease;
}
/* hover: lift, the top band floods with the scanner's colour, the art wiggles */
.tile-top::before {
  content: ""; position: absolute; inset: 0; background: var(--accent);
  transform: translateY(101%); transition: transform .4s cubic-bezier(.2, .8, .2, 1);
}
.tile-top > * { position: relative; }
.tile:hover .tile-top svg, .tile:focus-within .tile-top svg { filter: drop-shadow(0 0 6px rgba(255, 250, 241, .55)); }
.tile-mark span, .tile .wm-2, .tile .wm-scan { transition: color .35s ease, background-color .35s ease; }
.tile:hover, .tile:focus-within { transform: translateY(-6px); border-color: var(--accent);
  box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--accent) 60%, transparent); }
.tile:hover .tile-top::before, .tile:focus-within .tile-top::before { transform: translateY(0); }
.tile:hover .tile-mark span:not(.wm-2), .tile:focus-within .tile-mark span:not(.wm-2) { color: var(--on-accent); }
.tile:hover .wm-2, .tile:focus-within .wm-2 { background: var(--on-accent); color: var(--accent); }
.tile:hover .tile-top svg, .tile:hover .art-php, .tile:focus-within .tile-top svg, .tile:focus-within .art-php { animation: wiggle .7s ease-in-out; }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-10deg) scale(1.08); } 60% { transform: rotate(8deg) scale(1.08); } }
.tile.is-checked .tile-mark::after {
  content: "✓ checked"; position: absolute; left: 0; top: -20px; font: 600 12px "Instrument Sans", sans-serif;
  letter-spacing: .02em; color: var(--accent); white-space: nowrap;
}
.tile:hover.is-checked .tile-mark::after, .tile:focus-within.is-checked .tile-mark::after { color: var(--on-accent); }
@media (prefers-reduced-motion: reduce) {
  .tile, .tile-top::before { transition: none; }
  .tile:hover, .tile:focus-within { transform: none; }
  .tile:hover .tile-top svg, .tile:hover .art-php { animation: none; }
}
.tile-mark { margin: 0; display: inline-flex; align-items: baseline; font: 700 26px/1 var(--mono); letter-spacing: -0.045em; }
.tile .wm-2 { display: inline-block; margin: 0 2px; padding: 1px 6px 3px; border-radius: 5px; background: var(--accent); color: var(--on-accent); transform: rotate(-6deg); }
.tile .wm-scan { color: var(--accent); }
.tile-mark { position: relative; }
.art-php { display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 48px; border-radius: 10px; background: #1c2a6b; color: #d9e1fb; font: 700 15px var(--mono); transform: rotate(4deg); }
.tile-body { display: flex; flex-direction: column; gap: 12px; flex: 1; padding: 24px 26px 26px; }
.tile-body p { margin: 0; }
.tile h3 { margin: 0; font: 700 26px/1.15 var(--display); letter-spacing: -0.02em; }
.vuln-note { font-weight: 500; color: var(--soft); }
.cves { font: 500 14px var(--mono); }
.cves a { position: relative; z-index: 1; color: var(--accent); }
.severity { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: auto; padding-top: 8px; font-size: 15px; color: var(--soft); }
.severity strong { color: #9c1f18; }
.bars { display: inline-flex; gap: 3px; }
.bars span { width: 16px; height: 9px; border-radius: 2px; background: color-mix(in srgb, var(--soft) 25%, transparent); }
.bars span.on { background: var(--crit); }
.check { display: flex; align-items: center; justify-content: center; min-height: 52px; margin-top: 8px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none; }
.check::after { content: ""; position: absolute; inset: 0; }   /* whole tile is clickable */
.tile:hover .check { filter: brightness(.9); }
.tile-missing { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 300px; padding: 32px; border-radius: 18px; border: 2px dashed var(--dash); color: var(--muted); text-align: center; text-decoration: none; }
.tile-missing:hover { border-color: var(--signal); }
.plus { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; border: 2px dashed var(--dash); font-size: 30px; line-height: 1; }
.missing-title { font: 700 22px var(--display); color: var(--ink); }

/* how */
.how h2 { margin-bottom: 32px; }
.how ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 40px; }
.num { display: block; font: 800 56px/1 var(--display); color: var(--signal-text); }
.how h3 { margin: 12px 0 6px; font-size: 20px; }
.how p { margin: 0; color: var(--muted); }

/* footer */
footer { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; padding: 28px 0 48px; border-top: 1.5px dashed var(--dash); color: var(--muted); font-size: 15px; }
footer p { margin: 0; max-width: 40em; }
.coffee { font-weight: 600; color: var(--ink); }

@media (max-width: 560px) {
  main { padding: 0 16px; }
  .hero { padding: 48px 0 56px; }
  .nav-links { gap: 16px; }
  .nav-links > a:not(.gh) { display: none; }
  .tiles { grid-template-columns: 1fr; }
}
