/* ==========================================================================
   Agent-Ready Check — design system
   One accent, two themes, an instrument's worth of restraint.
   Every token is themeable, nothing is hard-coded so light and dark stay in step.
   ========================================================================== */

/* ---------- typeface ----------
   Self-hosted IBM Plex, latin subset. Self-hosting is the point: a third-party
   font CDN would be an external request on a site whose whole argument is that
   agents should not have to guess. Licence in fonts/LICENSE.txt (OFL-1.1).
   The sans carries prose; the mono carries every number, id and piece of
   evidence, because on an instrument the measurements are monospaced.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/plex-sans-400.woff2") format("woff2");
}

@font-face {
  font-family: "Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/plex-sans-500.woff2") format("woff2");
}

@font-face {
  font-family: "Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/plex-sans-600.woff2") format("woff2");
}

@font-face {
  font-family: "Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/plex-sans-700.woff2") format("woff2");
}

@font-face {
  font-family: "Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/plex-mono-400.woff2") format("woff2");
}

@font-face {
  font-family: "Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/plex-mono-500.woff2") format("woff2");
}

@font-face {
  font-family: "Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/plex-mono-600.woff2") format("woff2");
}

/* ---------- tokens ---------- */

:root {
  color-scheme: light dark;

  /* Plex covers Latin; the fallback chain has to carry every other script this
     site ships, so the CJK and Arabic families stay explicit and ordered. */
  --font-sans: "Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Noto Sans Arabic", "Noto Sans Devanagari",
    sans-serif;
  --font-mono: "Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --accent: #ff6a2b;
  --accent-strong: #ff4801;
  --accent-soft: rgba(255, 106, 43, 0.12);
  /* Text on an accent fill, and accent used as text.
     White on #ff6a2b is 2.86:1, which fails WCAG AA for a button label, so the
     fill carries near-black text instead: 6.69:1, and the same ink the dark
     theme already used, so both modes agree on how the accent behaves.
     Accent as small text on the light page is 2.74:1, hence a deeper tint of
     the same hue at 5.13:1. */
  --accent-contrast: #1a0c04;
  --accent-ink: #bd4108;

  --ok: #16a34a;
  --ok-soft: rgba(22, 163, 74, 0.12);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, 0.12);
  --bad: #dc2626;
  --bad-soft: rgba(220, 38, 38, 0.12);
  --info: #2563eb;
  --info-soft: rgba(37, 99, 235, 0.12);

  --level-0: #dc2626;
  --level-1: #ea580c;
  --level-2: #ca8a04;
  --level-3: #65a30d;
  --level-4: #059669;
  --level-5: #0284c7;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;
  --space-9: 104px;

  --shell: 1180px;
  --shadow-sm: 0 1px 2px rgba(15, 20, 30, 0.06), 0 1px 3px rgba(15, 20, 30, 0.08);
  --shadow-md: 0 8px 24px -8px rgba(15, 20, 30, 0.18), 0 2px 6px rgba(15, 20, 30, 0.06);
  --shadow-lg: 0 30px 60px -30px rgba(15, 20, 30, 0.35), 0 8px 24px -12px rgba(15, 20, 30, 0.18);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Light theme (explicit opt-in) */
:root[data-theme="light"],
:root[data-theme-pref="light"] {
  --bg: #fbfaf8;
  --bg-sunken: #f2f0ec;
  --surface: #ffffff;
  --surface-2: #f7f5f2;
  --surface-3: #efece7;
  --border: rgba(21, 24, 30, 0.1);
  --border-strong: rgba(21, 24, 30, 0.18);
  --text: #14171c;
  --text-muted: #5b6472;
  --text-faint: #8a929e;
  --code-bg: #f4f2ee;
  --hero-glow: radial-gradient(60% 60% at 50% 0%, rgba(255, 106, 43, 0.16), transparent 70%);
  --grid-line: rgba(21, 24, 30, 0.045);
}

/* Dark theme: the default look. */
:root:not([data-theme="light"]) {
  --bg: #08090c;
  --bg-sunken: #050608;
  --surface: #101216;
  --surface-2: #16191f;
  --surface-3: #1d2129;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #eceef2;
  --text-muted: #9aa3b2;
  --text-faint: #6b7484;
  --code-bg: #0c0e12;
  --hero-glow: radial-gradient(60% 60% at 50% 0%, rgba(255, 106, 43, 0.22), transparent 70%);
  --grid-line: rgba(255, 255, 255, 0.04);
  --accent: #ff7a3d;
  --accent-soft: rgba(255, 122, 61, 0.16);
  /* On a dark page the bright accent is already legible as text (7.68:1), so the
     ink and the fill colour are the same hue here. */
  --accent-ink: #ff7a3d;
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.15);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.15);
  --bad: #f87171;
  --bad-soft: rgba(248, 113, 113, 0.15);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.15);
  --level-0: #f87171;
  --level-1: #fb923c;
  --level-2: #fbbf24;
  --level-3: #a3e635;
  --level-4: #34d399;
  --level-5: #38bdf8;
  --accent-contrast: #1a0c04;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px -12px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 40px 80px -40px rgba(0, 0, 0, 0.9), 0 8px 30px -12px rgba(0, 0, 0, 0.6);
}

/* ---------- base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-3);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 640;
}

h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.7rem);
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.15rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 var(--space-4);
}

code,
pre,
kbd {
  font-family: var(--font-mono);
  font-size: 0.87em;
}

code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.12em 0.4em;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  overflow: auto;
  margin: 0;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--space-6) 0;
}

:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
  border-radius: 4px;
}

.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;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -60px;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-4);
  transition: top 0.15s var(--ease);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ---------- layout ---------- */

.shell {
  width: min(100% - 2 * var(--space-5), var(--shell));
  margin-inline: auto;
}

.section {
  padding: var(--space-8) 0;
}

.section--tight {
  padding: var(--space-6) 0;
}

.section-head {
  max-width: 66ch;
  margin-bottom: var(--space-6);
}

.section-head p {
  color: var(--text-muted);
  font-size: 1.06rem;
  margin-bottom: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: var(--space-3);
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
}

.lede {
  font-size: clamp(1.02rem, 1.9vw, 1.22rem);
  color: var(--text-muted);
  max-width: 62ch;
}

.muted {
  color: var(--text-muted);
}

.faint {
  color: var(--text-faint);
}

.small {
  font-size: 0.86rem;
}

.tiny {
  font-size: 0.78rem;
}

.center {
  text-align: center;
}

.mono {
  font-family: var(--font-mono);
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 640;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.brand__mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--accent), var(--accent-strong));
  display: grid;
  place-items: center;
  color: #fff;
  flex: none;
  box-shadow: 0 6px 18px -8px var(--accent);
}

.brand__mark svg {
  width: 17px;
  height: 17px;
}

.brand__name {
  font-size: 1.02rem;
}

.brand__name span {
  color: var(--text-faint);
  font-weight: 500;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
}

.nav a {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-2);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: var(--space-2);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.icon-btn .icon-sun {
  display: none;
}

:root:not([data-theme="light"]) .icon-btn .icon-sun {
  display: block;
}

:root:not([data-theme="light"]) .icon-btn .icon-moon {
  display: none;
}

/* language menu */

.lang-menu {
  position: relative;
}

.lang-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.lang-menu > summary::-webkit-details-marker {
  display: none;
}

.lang-menu > summary:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.lang-menu > summary svg {
  width: 16px;
  height: 16px;
}

.lang-menu[open] > summary {
  color: var(--text);
  border-color: var(--border-strong);
}

.lang-menu__list {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 60;
  width: 240px;
  max-height: min(70vh, 460px);
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 1px;
}

.lang-menu__list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.lang-menu__list a em {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--text-faint);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.lang-menu__list a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.lang-menu__list a[aria-current="true"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.lang-menu__list a[aria-current="true"] em {
  color: inherit;
  opacity: 0.75;
}

.nav-toggle {
  display: none;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 11px 18px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 560;
  font-size: 0.94rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease),
    box-shadow 0.15s var(--ease);
}

.btn:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong));
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  color: var(--accent-contrast);
  box-shadow: 0 10px 26px -12px var(--accent);
}

.btn--primary:hover {
  filter: brightness(1.06);
}

.btn--ghost {
  background: transparent;
  border-color: var(--border);
}

.btn--sm {
  padding: 7px 13px;
  font-size: 0.86rem;
  border-radius: 9px;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: progress;
}

/* ---------- pills / badges ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.78rem;
  font-weight: 560;
  color: var(--text-muted);
  white-space: nowrap;
}

.pill--accent {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.pill--ok {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: transparent;
}

.pill--warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: transparent;
}

.pill--bad {
  background: var(--bad-soft);
  color: var(--bad);
  border-color: transparent;
}

.pill--neutral {
  background: var(--surface-3);
  color: var(--text-faint);
  border-color: transparent;
}

/* ---------- hero ---------- */

/* ---------- hero: the claim on the left, the instrument on the right ----------
   The page is the scanner. The control and the readout are both above the fold,
   so the first thing a visitor does is the first thing the product does.
   --------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: var(--space-6) 0 var(--space-7);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -60% 40% auto -10%;
  height: 640px;
  background: var(--hero-glow);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(58% 60% at 22% 30%, #000 10%, transparent 72%);
  pointer-events: none;
}

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: var(--space-7);
  align-items: start;
}

.hero__claim {
  padding-top: var(--space-5);
}

.hero h1 {
  margin: 0;
  max-width: 15ch;
  text-align: left;
}

.hero .lede {
  margin: var(--space-4) 0 0;
  max-width: 36ch;
  text-align: left;
}

/* Inside the hero the window stacks: a 600px column has no room for a sidebar,
   and reading the result under the control is closer to how an instrument works
   anyway. The two-column body is kept for the standalone use. */
.hero .app-body {
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
}

.hero .app-panel {
  border-right: 0;
  border-bottom: 1px solid var(--border);
  padding: var(--space-4);
}

.hero .app-results {
  padding: var(--space-4);
  min-height: 188px;
}

/* ---------- the spec strip, once the hero's micro-strip ---------- */

.section--strip {
  padding: 0 0 var(--space-7);
}

.specs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-block: 1px solid var(--border);
  background: var(--border);
}

.specs > div {
  background: var(--bg);
  padding: var(--space-4) var(--space-3) var(--space-4) 0;
}

.specs b {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.specs span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- app window (the interactive hero) ---------- */

.app-window {
  position: relative;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  text-align: left;
}

.app-window::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 55%, transparent), transparent 42%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.app-chrome {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 11px var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.app-chrome__dots {
  display: flex;
  gap: 6px;
}

.app-chrome__dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border);
}

.app-chrome__url {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.app-chrome__url span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-body {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  min-height: 460px;
}

.app-panel {
  padding: var(--space-5);
  border-right: 1px solid var(--border);
  background: var(--surface-2);
}

.app-panel__title {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-faint);
  font-weight: 650;
  margin-bottom: var(--space-3);
}

.app-results {
  padding: var(--space-5);
  min-width: 0;
}

/* ---------- scan form ---------- */

.scan-form {
  display: grid;
  gap: var(--space-3);
}

.input-row {
  display: flex;
  gap: var(--space-2);
  padding: 5px 5px 5px 14px;
  border-radius: 13px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.input-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.input-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.97rem;
  padding: 9px 0;
  outline: none;
}

.input-row input::placeholder {
  color: var(--text-faint);
}

.spinner {
  width: 15px;
  height: 15px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.form-error {
  margin: 0;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--bad-soft);
  color: var(--bad);
  font-size: 0.87rem;
}

/* profile pills */

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 560;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.pill-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.pill-btn[aria-checked="true"] {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  color: var(--accent-ink);
}

/* check toggles */

.check-groups {
  display: grid;
  gap: var(--space-3);
}

.check-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  background: var(--surface);
}

.check-group__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: 0.76rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: var(--space-2);
}

.check-group__title button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--text-faint);
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}

.check-group__title button:hover {
  color: var(--text);
}

.check-list {
  display: grid;
  gap: 2px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px 6px;
  border-radius: 7px;
  font-size: 0.84rem;
  color: var(--text-muted);
  cursor: pointer;
}

.toggle:hover {
  background: var(--surface-2);
  color: var(--text);
}

.toggle input {
  accent-color: var(--accent-ink);
  width: 15px;
  height: 15px;
  flex: none;
  margin: 0;
}

.toggle span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

details.toggles {
  border-top: 1px dashed var(--border);
  padding-top: var(--space-3);
}

details.toggles > summary {
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 560;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

details.toggles > summary::-webkit-details-marker {
  display: none;
}

details.toggles > summary::before {
  content: "▸";
  font-size: 0.7rem;
  transition: transform 0.15s var(--ease);
}

details.toggles[open] > summary::before {
  transform: rotate(90deg);
}

details.toggles .check-groups {
  margin-top: var(--space-3);
  max-height: 340px;
  overflow: auto;
  padding-right: 4px;
}

/* ---------- results ---------- */

.results-empty {
  display: grid;
  place-content: center;
  gap: var(--space-3);
  text-align: center;
  color: var(--text-faint);
  padding: var(--space-7) var(--space-4);
  height: 100%;
}

.results-empty svg {
  width: 34px;
  height: 34px;
  margin-inline: auto;
  opacity: 0.55;
}

.results {
  display: grid;
  gap: var(--space-5);
  align-content: start;
}

.score-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.dial {
  position: relative;
  width: 132px;
  height: 132px;
  flex: none;
}

.dial svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.dial__track {
  fill: none;
  stroke: var(--border);
  stroke-width: 10;
}

.dial__value {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dasharray 0.7s var(--ease), stroke 0.4s var(--ease);
}

.dial__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.dial__score {
  font-size: 2rem;
  font-weight: 680;
  letter-spacing: -0.03em;
  line-height: 1;
}

.dial__unit {
  font-size: 0.7rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.score-meta {
  min-width: 0;
}

.score-meta h3 {
  margin-bottom: 6px;
}

.level-track {
  display: flex;
  gap: 4px;
  margin: var(--space-3) 0;
}

.level-track i {
  height: 5px;
  flex: 1;
  border-radius: 999px;
  background: var(--surface-3);
}

.level-track i.on {
  background: var(--level-color, var(--accent));
}

.score-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* category cards */

.category {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}

.category__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.category__head h4 {
  margin: 0;
  font-size: 0.95rem;
}

.category__count {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.category__bar {
  width: 74px;
  height: 5px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  flex: none;
}

.category__bar i {
  display: block;
  height: 100%;
  background: var(--ok);
}

.check-row {
  border-bottom: 1px solid var(--border);
}

.check-row:last-child {
  border-bottom: 0;
}

.check-row__summary {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  list-style: none;
}

.check-row__summary::-webkit-details-marker {
  display: none;
}

.check-row__summary:hover {
  background: var(--surface-2);
}

.status-dot {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
}

.status-dot--pass {
  background: var(--ok-soft);
  color: var(--ok);
}

.status-dot--warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.status-dot--fail {
  background: var(--bad-soft);
  color: var(--bad);
}

.status-dot--neutral {
  background: var(--surface-3);
  color: var(--text-faint);
}

.check-row__text {
  min-width: 0;
  flex: 1;
}

.check-row__title {
  font-weight: 580;
  font-size: 0.93rem;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.check-row__message {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

.check-row__chevron {
  flex: none;
  color: var(--text-faint);
  transition: transform 0.18s var(--ease);
}

details[open] > .check-row__summary .check-row__chevron {
  transform: rotate(90deg);
}

.check-detail {
  padding: 0 var(--space-4) var(--space-4) calc(var(--space-4) + 32px);
  display: grid;
  gap: var(--space-3);
}

.check-detail h5 {
  margin: 0;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.evidence {
  display: grid;
  gap: var(--space-2);
}

.evidence__item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-sunken);
}

.evidence__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 7px var(--space-3);
  font-size: 0.8rem;
  font-weight: 560;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  flex-wrap: wrap;
}

.evidence__head .mono {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.evidence__body {
  padding: var(--space-3);
  display: grid;
  gap: var(--space-2);
}

.evidence__body pre {
  max-height: 210px;
  font-size: 0.76rem;
  line-height: 1.5;
}

.kv {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(0, 1fr);
  gap: 4px var(--space-3);
  font-size: 0.79rem;
}

.kv dt {
  color: var(--text-faint);
}

.kv dd {
  margin: 0;
  font-family: var(--font-mono);
  word-break: break-word;
}

.fix-block {
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: var(--space-3);
  display: grid;
  gap: var(--space-2);
}

.fix-block pre {
  background: var(--code-bg);
  font-size: 0.79rem;
  white-space: pre-wrap;
}

.spec-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* category strip in results */

.cat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-2);
}

.cat-chip {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  background: var(--surface-2);
}

.cat-chip__name {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.3;
}

.cat-chip__value {
  font-size: 1.02rem;
  font-weight: 640;
  font-variant-numeric: tabular-nums;
}

/* ---------- cards / grids ---------- */

.grid {
  display: grid;
  gap: var(--space-4);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  background: var(--surface);
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.card--link:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card h3 {
  margin-bottom: var(--space-2);
}

.card p:last-child {
  margin-bottom: 0;
}

.card__icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-ink);
  margin-bottom: var(--space-3);
}

.card__icon svg {
  width: 19px;
  height: 19px;
}

/* level ladder */

.ladder {
  display: grid;
  gap: var(--space-2);
}

.rung {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.rung__num {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 680;
  font-size: 1.05rem;
  color: #fff;
  background: var(--level-color);
}

.rung h4 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.rung p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.rung__reqs {
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* tabs */

.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-5);
  overflow-x: auto;
}

.tab {
  appearance: none;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 560;
  color: var(--text-muted);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  white-space: nowrap;
}

.tab[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* FAQ */

.faq {
  display: grid;
  gap: var(--space-2);
}

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.faq summary {
  padding: var(--space-4);
  cursor: pointer;
  font-weight: 580;
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  margin-left: auto;
  color: var(--text-faint);
  font-size: 1.1rem;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "–";
}

.faq__body {
  padding: 0 var(--space-4) var(--space-4);
  color: var(--text-muted);
}

.faq__body > *:last-child {
  margin-bottom: 0;
}

/* prose */

.prose {
  max-width: 74ch;
}

.prose h2 {
  margin-top: var(--space-6);
}

.prose h3 {
  margin-top: var(--space-5);
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
  color: var(--text-muted);
}

.prose li {
  margin-bottom: 6px;
}

.prose strong {
  color: var(--text);
}

.prose code {
  font-size: 0.86em;
}

.callout {
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--space-4);
  margin: var(--space-5) 0;
  color: var(--text-muted);
}

.callout strong {
  color: var(--text);
}

/* breadcrumbs */

.crumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.83rem;
  color: var(--text-faint);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.crumbs a {
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--text);
}

.crumbs span {
  opacity: 0.5;
}

/* table */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--surface-2);
  font-weight: 620;
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

/* footer */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: var(--space-8);
  padding: var(--space-6) 0 var(--space-7);
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-6);
}

.footer-grid h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: var(--space-3);
}

.footer-links {
  display: grid;
  gap: 8px;
}

.footer-links a {
  text-decoration: none;
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--text);
}

.footer-bottom {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-faint);
}

/* toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.86rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  z-index: 80;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* sheet */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 8, 0.6);
  backdrop-filter: blur(3px);
  z-index: 70;
}

.sheet {
  position: fixed;
  z-index: 71;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(940px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-lg);
}

.sheet__head {
  padding: var(--space-5) var(--space-5) var(--space-3);
  border-bottom: 1px solid var(--border);
}

.sheet__head h2 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.sheet__head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.sheet__body {
  padding: var(--space-4) var(--space-5);
  overflow: auto;
  flex: 1;
}

.sheet__body pre {
  white-space: pre-wrap;
  font-size: 0.79rem;
  line-height: 1.6;
}

.sheet__foot {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.sheet__foot .btn {
  margin-left: auto;
}

.close-btn {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .app-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-panel {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  /* The split collapses to a single column: claim first, instrument under it. */
  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-5);
  }

  .hero__claim {
    padding-top: 0;
  }

  .hero h1,
  .hero .lede {
    max-width: 42ch;
  }

  .specs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  :root {
    --space-8: 56px;
    --space-9: 72px;
  }

  .specs {
    grid-template-columns: minmax(0, 1fr);
  }

  .specs > div {
    padding: var(--space-3) 0;
  }

  .nav {
    display: none;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-3);
    gap: 2px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .nav[data-open="true"] {
    display: flex;
  }

  .nav-toggle {
    display: inline-grid;
  }

  .score-card {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
  }

  .score-actions {
    justify-content: center;
  }

  .check-detail {
    padding-left: var(--space-4);
  }

  .brand__name span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- sponsor slot ---------- */

.sponsor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding: var(--space-3) var(--space-4);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 0.86rem;
}

.sponsor__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-faint);
  font-weight: 650;
}

.sponsor__link {
  font-weight: 620;
  text-decoration: none;
}

.sponsor__link:hover {
  text-decoration: underline;
}

.sponsor__blurb {
  color: var(--text-muted);
}

.sponsor__note {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-faint);
}

/* ---------- right-to-left ---------- */

[dir="rtl"] .nav,
[dir="rtl"] .header-tools,
[dir="rtl"] .category__count,
[dir="rtl"] .sheet__foot .btn,
[dir="rtl"] .faq summary::after,
[dir="rtl"] .sponsor__note,
[dir="rtl"] .crumbs span[aria-hidden="true"] {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .eyebrow::before {
  order: 2;
}

[dir="rtl"] .check-detail {
  padding-left: var(--space-4);
  padding-right: calc(var(--space-4) + 32px);
}

[dir="rtl"] .callout {
  border-left: 0;
  border-right: 3px solid var(--accent);
  border-radius: var(--radius) 0 0 var(--radius);
}

[dir="rtl"] .close-btn {
  right: auto;
  left: var(--space-4);
}

[dir="rtl"] .skip-link {
  left: auto;
  right: var(--space-4);
}

[dir="rtl"] .input-row {
  padding: 5px 14px 5px 5px;
}

[dir="rtl"] .prose ul,
[dir="rtl"] .prose ol {
  padding-left: 0;
  padding-right: 1.3em;
}

[dir="rtl"] .check-row__chevron {
  transform: scaleX(-1);
}

[dir="rtl"] details[open] > .check-row__summary .check-row__chevron {
  transform: scaleX(-1) rotate(-90deg);
}

[dir="rtl"] .dial svg {
  transform: rotate(-90deg) scaleX(-1);
}

[dir="rtl"] .kv,
[dir="rtl"] .evidence__body pre,
[dir="rtl"] .sheet__body pre {
  direction: ltr;
  text-align: left;
}

@media print {
  .site-header,
  .site-footer,
  .app-panel,
  .score-actions {
    display: none;
  }
}
