/* MCPShield: shared look for every page. It follows DevSwarm and Engram: a light
   grey page, white rounded cards, the system font, a frosted header, pill buttons,
   and a night theme picked from the header switch (light is the default).
   app.css adds the dashboard's components, how.css the animated scene. */
:root {
  color-scheme: light;
  --page: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --header: rgba(251, 251, 253, 0.8);
  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #6e6e73;
  --hairline: #e8e8ed;
  --baseline: #d2d2d7;
  --border: transparent;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 28px rgba(0, 0, 0, 0.06);
  --code: #f0f0f2;
  --link: #0066cc;
  --focus: rgba(0, 113, 227, 0.35);
  --action: #0071e3;
  --action-hover: #0077ed;
  --good: #1e7b34;
  --good-bg: #e3f5e7;
  --serious: #b25000;
  --serious-bg: #fff1e0;
  --critical: #d70015;
  --critical-bg: #fde8ea;
  --running: #0066cc;
  --running-bg: #e8f1fc;
  --pending: #5e5ce6;
  --pending-bg: #eeeefc;
  --feature: #1d1d1f;
  --radius: 22px;
  --pill: 980px;
  --mark: rgba(255, 204, 0, 0.38);
  --mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Helvetica Neue", "Segoe UI", sans-serif;
  /* older names, still used by how.css and the fragments */
  --bg: var(--page);
  --panel: var(--surface);
  --panel-2: var(--surface-2);
  --line: var(--hairline);
  --text: var(--ink);
  --accent: var(--action);
  --accent-soft: var(--running-bg);
  --ok: var(--good);
  --ok-soft: var(--good-bg);
  --warn: var(--serious);
  --warn-soft: var(--serious-bg);
  --bad: var(--critical);
  --bad-soft: var(--critical-bg);
  --pending-soft: var(--pending-bg);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #161617;
  --surface: #232325;
  --surface-2: #2e2e31;
  --header: rgba(29, 29, 31, 0.78);
  --ink: #f5f5f7;
  --ink-2: #d1d1d6;
  --muted: #a1a1a6;
  --hairline: #3a3a3d;
  --baseline: #4a4a4e;
  --border: #2e2e31;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.25);
  --code: #2e2e31;
  --link: #2997ff;
  --focus: rgba(41, 151, 255, 0.45);
  --action: #0a84ff;
  --action-hover: #409cff;
  --good: #30d158;
  --good-bg: rgba(48, 209, 88, 0.16);
  --serious: #ff9f0a;
  --serious-bg: rgba(255, 159, 10, 0.16);
  --critical: #ff6961;
  --critical-bg: rgba(255, 69, 58, 0.16);
  --running: #2997ff;
  --running-bg: rgba(41, 151, 255, 0.16);
  --pending: #7d7aff;
  --pending-bg: rgba(125, 122, 255, 0.18);
  --feature: #111112;
  --mark: rgba(255, 214, 10, 0.3);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 17px/1.47 var(--sans);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); letter-spacing: 0; }
code { padding: 2px 6px; border-radius: 6px; background: var(--code); font-size: 14px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus); border-radius: 8px; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--header);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}
.site-header-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px;
  max-width: 1080px; min-height: 52px; margin: 0 auto; padding: 6px 24px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--baseline); }
.brand-mark svg { width: 20px; height: 20px; }
.brand-mark .shield { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.brand-mark .tick { fill: none; stroke: var(--action); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.site-header nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; flex: 1; font-size: 14px; }
.site-header nav a { color: var(--ink-2); }
.site-header nav a:hover { color: var(--ink); text-decoration: none; }
.site-header nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav-action { padding: 8px 18px; border-radius: var(--pill); background: var(--action); color: #fff !important; font-size: 14px; font-weight: 500; }
.nav-action:hover { background: var(--action-hover); text-decoration: none; }
.theme-switch {
  position: relative; flex: none; width: 56px; height: 30px; padding: 0; border: 0;
  border-radius: var(--pill); background: var(--baseline); cursor: pointer;
}
.theme-knob {
  position: absolute; top: 3px; left: 3px; display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%; background: #fff; color: #f5a623;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.25s ease;
}
:root[data-theme="dark"] .theme-knob { transform: translateX(26px); color: #1d1d1f; }
.theme-knob svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.theme-knob .icon-moon, :root[data-theme="dark"] .theme-knob .icon-sun { display: none; }
:root[data-theme="dark"] .theme-knob .icon-moon { display: block; }

main { max-width: 1080px; margin: 0 auto; padding: 24px 24px 96px; }
h1 { margin: 0; font-size: clamp(36px, 5vw, 56px); line-height: 1.05; font-weight: 700; letter-spacing: -0.04em; }
h2 { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -0.025em; }
.section-title { margin: 64px 0 8px; font-size: 40px; line-height: 1.1; letter-spacing: -0.03em; }
.section-lead { margin: 0 0 24px; max-width: 700px; color: var(--muted); font-size: 19px; }

/* hero */
.hero { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 40px 0 40px; text-align: center; }
.eyebrow { margin: 0; color: var(--link); font-size: 15px; font-weight: 600; }
.hero-lead { margin: 0; max-width: 680px; color: var(--muted); font-size: 21px; line-height: 1.45; }
.hero-meta { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.bento { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 20px; }
.bento-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 26px 30px; }
.bento-wide { flex: 2 1 460px; }
.bento-narrow { flex: 1 1 240px; }
.big { font-size: clamp(48px, 6vw, 72px); line-height: 1; font-weight: 700; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.big small { color: var(--muted); font-size: 0.45em; letter-spacing: -0.02em; font-weight: 600; }
.tile-label { color: var(--muted); font-size: 14px; font-weight: 600; }
.tile-note { margin: 0; color: var(--muted); font-size: 14px; }
.t-good { color: var(--good); } .t-bad { color: var(--critical); } .t-warn { color: var(--serious); }
.panel { background: var(--feature); color: #f5f5f7; align-items: center; justify-content: center; text-align: center; border-radius: var(--radius); }
.panel p { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.3; }
.ring circle { fill: none; stroke-width: 12; }
.ring .track { stroke: #3a3a3c; }
.ring .fill { stroke: #30d158; stroke-linecap: round; }
.ring text { fill: #f5f5f7; font-size: 26px; font-weight: 700; font-family: inherit; }
.split { display: flex; height: 14px; gap: 2px; border-radius: 7px; overflow: hidden; background: var(--surface-2); }
.split span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; }

/* method */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.steps li { padding: 24px 26px; }
.step-n { display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 12px; border-radius: 10px; background: var(--action); color: #fff; font-weight: 700; font-size: 15px; }
.steps h3 { margin: 0 0 6px; font-size: 17px; }
.steps p { margin: 0; color: var(--muted); font-size: 15px; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: var(--pill); background: var(--surface-2); color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.bad { background: var(--critical-bg); color: var(--critical); }
.pill.warn { background: var(--serious-bg); color: var(--serious); }
.pill.info { background: var(--running-bg); color: var(--running); }
.pill.pending { background: var(--pending-bg); color: var(--pending); }

/* attack list */
.attacks { overflow: hidden; }
.attack { border-bottom: 1px solid var(--hairline); }
.attack:last-child { border-bottom: 0; }
.attack > summary { display: flex; gap: 18px; align-items: flex-start; padding: 22px 28px; list-style: none; cursor: pointer; }
.attack > summary::-webkit-details-marker { display: none; }
.attack > summary:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.attack > summary::after {
  content: ""; flex: none; width: 8px; height: 8px; margin: 10px 4px 0 auto;
  border-right: 2px solid var(--baseline); border-bottom: 2px solid var(--baseline);
  transform: rotate(-45deg); transition: transform 0.2s ease;
}
.attack[open] > summary::after { transform: rotate(45deg); }
.verdict { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; }
.verdict svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.verdict.stopped { background: var(--good); }
.verdict.missed { background: var(--critical); }
.verdict.other { background: var(--muted); }
.attack-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.attack-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.attack-title strong { font-size: 18px; letter-spacing: -0.015em; }
.attack-src { color: var(--muted); font-size: 14px; }
.attack-sum { margin: 0; color: var(--ink-2); font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.attack-body { padding: 0 28px 24px 90px; display: grid; gap: 14px; }
.attack-body h4 { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.attack-body p { margin: 0; font-size: 15px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.fact { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); font-size: 14px; }
.fact b { display: block; margin-bottom: 2px; font-size: 13px; color: var(--muted); font-weight: 600; }
.actions { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; }
.actions li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }

/* tables */
.table-scroll { overflow-x: auto; padding: 8px 20px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; white-space: nowrap; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--hairline); }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.footnote { margin: 40px 0 0; color: var(--muted); font-size: 14px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .theme-knob, .attack > summary::after { transition: none; }
}
@media (max-width: 720px) {
  main { padding: 16px 16px 72px; }
  .site-header-inner { padding: 6px 16px; gap: 8px 16px; }
  .hero { padding: 24px 0 28px; }
  .hero-lead { font-size: 18px; }
  .section-title { font-size: 30px; margin-top: 48px; }
  .attack > summary { padding: 18px; gap: 12px; }
  .verdict { width: 36px; height: 36px; border-radius: 10px; }
  .attack-body { padding: 0 18px 20px; }
  .bento-card { padding: 22px; }
}
