/* ==========================================================================
   MedRadar — site stylesheet
   File:  docs/assets/css/site.css
   Scope: docs/index.html, docs/research/, docs/platform/, docs/explore/,
          docs/documentation/
   Rules: zero external requests (no imports, no webfonts, no CDN), relative
          URLs only, one class per concept, no framework, no inline styles.
   --------------------------------------------------------------------------
   TABLE OF CONTENTS
   01. Design tokens
   02. Reset and base
   03. Typography
   04. Layout: page, sections, prose
   05. Links, focus, skip link
   06. Buttons, pills, badges
   07. Status vocabulary
   08. Header and navigation
   09. Hero
   10. Stat strip
   11. Cards and grids
   12. Callouts and notes
   13. Tables
   14. Code blocks
   15. Figures, media frames, screenshots
   16. Steps and key-value lists
   17. Footer and closing band
   18. Utilities
   19. Responsive (1080 / 900 / 768 / 560)
   20. Dark colour scheme
   21. Motion and print
   ========================================================================== */

/* 01. Design tokens ------------------------------------------------------- */
:root {
  --bg: #fcfdff;
  --bg-soft: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;

  --ink: #0b1220;
  --ink-2: #334155;
  --ink-3: #64748b;
  --ink-4: #94a3b8;

  --line: #e5eaf1;
  --line-strong: #cbd5e1;

  --accent: #2b7fc4;
  --accent-strong: #1b5e96;
  --accent-soft: #eaf3fa;

  --navy: #081120;
  --navy-2: #0b1730;
  --navy-3: #101f3a;
  --dark-ink: #e8f0f8;
  --dark-ink-2: #a9bcd0;
  --dark-ink-3: #7d92aa;
  --dark-line: rgba(126, 164, 204, 0.16);

  --ice: #6fb6e8;
  --ice-soft: rgba(111, 182, 232, 0.14);

  --warn: #a9762a;
  --warn-soft: #fbf3e5;
  --ok: #1d7a5f;
  --ok-soft: #e9f5f1;

  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --radius-pill: 999px;

  --shadow-1: 0 1px 2px rgba(11, 18, 32, 0.05), 0 10px 30px -18px rgba(11, 18, 32, 0.22);
  --shadow-2: 0 2px 4px rgba(11, 18, 32, 0.06), 0 24px 60px -32px rgba(11, 18, 32, 0.35);

  --w-page: 1160px;
  --w-prose: 720px;

  --font-sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: clamp(20px, 5vw, 40px);
  --section-y: clamp(56px, 8vw, 104px);
  --header-h: 64px;
}

/* 02. Reset and base ------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.68;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Anchor targets clear the sticky header. */
[id] {
  scroll-margin-top: calc(var(--header-h) + 20px);
}

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

img {
  height: auto;
}

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

/* 03. Typography ---------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  margin: 0;
  color: inherit;
  font-weight: 600;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

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

ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.2em;
}

li + li {
  margin-top: 0.35em;
}

strong,
b {
  font-weight: 600;
  color: var(--ink);
}

/* Bold text on the dark surfaces must not inherit the light-page ink colour. */
.hero strong,
.hero b,
.closing strong,
.closing b,
.site-footer strong,
.site-footer b,
.code strong,
.code b {
  color: inherit;
}

.display {
  /* 4.7vw keeps the unbreakable compound "medical-technology" inside the hero
     column on every desktop width in 1080-1440 (see .nowrap). */
  font-size: clamp(38px, 4.7vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 600;
}

.h1 {
  font-size: clamp(32px, 4.2vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.section-title {
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.card-title,
.h3 {
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.eyebrow {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.lede {
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.62;
  color: var(--ink-2);
}

.small {
  font-size: 14px;
  line-height: 1.6;
}

.src {
  margin: 10px 0 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-3);
  /* Break only where a token genuinely cannot fit; paths use <wbr> at slashes. */
  overflow-wrap: break-word;
}

.nowrap {
  white-space: nowrap;
}

.src b {
  font-weight: 500;
  color: var(--ink-2);
}

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

.num {
  font-variant-numeric: tabular-nums;
}

/* 04. Layout -------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--w-page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.prose {
  max-width: var(--w-prose);
}

.section {
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: clamp(40px, 5vw, 64px);
}

.section--soft {
  background: var(--bg-soft);
}

.section--ruled {
  border-top: 1px solid var(--line);
}

.section--flush {
  padding-block: 0;
}

/* Page intro for the four interior pages (landing uses the hero instead). */
.page-head {
  padding-block: clamp(44px, 6vw, 72px) clamp(32px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.page-head .h1 {
  max-width: 24ch;
  margin-bottom: 14px;
}

.page-head .lede {
  max-width: 66ch;
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 22px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-3);
}

.section-head {
  max-width: var(--w-prose);
  margin-bottom: clamp(28px, 4vw, 44px);
}

.section-head .section-title {
  margin-bottom: 12px;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.split--wide-left {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
}

.stack > * + * {
  margin-top: 16px;
}

.grid {
  display: grid;
  gap: 20px;
}

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

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

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

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

.mt-0 { margin-top: 0; }
.mt-s { margin-top: 12px; }
.mt-m { margin-top: 24px; }
.mt-l { margin-top: 40px; }
.mb-0 { margin-bottom: 0; }

/* 05. Links, focus, skip link -------------------------------------------- */
a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

p a,
li a,
td a,
dd a {
  overflow-wrap: anywhere;
}

/* Footer-grade quiet link inside meta rows. */
a.plain {
  color: inherit;
  text-decoration: none;
}

a.plain:hover {
  text-decoration: underline;
}

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

.skip {
  position: fixed;
  top: 8px;
  left: 50%;
  z-index: 200;
  transform: translate(-50%, -160%);
  padding: 10px 18px;
  border-radius: var(--radius-s);
  background: var(--ink);
  color: #ffffff;
  font-size: 14px;
  text-decoration: none;
  transition: transform 120ms ease;
}

.skip:focus {
  transform: translate(-50%, 0);
}

/* 06. Buttons, pills, badges --------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn--primary {
  background: var(--ink);
  color: #ffffff;
}

.btn--primary:hover {
  background: #16233c;
}

.btn--accent {
  background: var(--accent-strong);
  color: #ffffff;
}

.btn--accent:hover {
  background: #14496f;
}

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

.btn--ghost:hover {
  border-color: var(--ink-3);
  background: var(--surface-2);
}

.btn--light {
  background: #ffffff;
  color: var(--navy);
}

.btn--light:hover {
  background: var(--ice-soft);
  color: var(--navy);
}

.btn--outline-light {
  border-color: rgba(232, 240, 248, 0.3);
  background: transparent;
  color: var(--dark-ink);
}

.btn--outline-light:hover {
  border-color: rgba(232, 240, 248, 0.55);
  background: rgba(232, 240, 248, 0.08);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.pill:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  text-decoration: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* 07. Status vocabulary ---------------------------------------------------
   implemented solid dot (accent) · limited half ring (warn) ·
   draft dashed ring (ink-3) · planned dotted ring (ink-4).
   A text label always accompanies the mark; colour is never the only cue. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}

.status-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status--implemented .status-dot {
  background: var(--accent);
}

.status--limited .status-dot {
  border: 1.5px solid var(--warn);
  background: linear-gradient(90deg, var(--warn) 0 50%, transparent 50% 100%);
}

.status--draft .status-dot {
  border: 1.5px dashed var(--ink-3);
}

.status--planned .status-dot {
  border: 1.5px dotted var(--ink-4);
}

.legend {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 18px 20px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}

.legend li {
  margin: 0;
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.legend .legend-note {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* 08. Header and navigation ---------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  padding-block: 8px;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 26px;
  height: 26px;
}

.brand:hover {
  text-decoration: none;
}

.nav {
  justify-self: center;
}

.nav ul {
  display: flex;
  gap: clamp(12px, 2.2vw, 28px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav li {
  margin: 0;
}

.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.nav a:hover {
  color: var(--ink);
}

.nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 7px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-self: end;
}

.gh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.gh:hover {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.nav-toggle-bars {
  position: relative;
  display: block;
  width: 14px;
  height: 2px;
  background: var(--ink-2);
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 14px;
  height: 2px;
  background: var(--ink-2);
}

.nav-toggle-bars::before {
  top: -5px;
}

.nav-toggle-bars::after {
  top: 5px;
}

/* 09. Hero ---------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--navy);
  color: var(--dark-ink);
  border-bottom: 1px solid var(--dark-line);
}

/* Hairline grid motif, masked with an ellipse (opacity stays under .5). */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    repeating-linear-gradient(to right, rgba(126, 164, 204, 0.09) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(to bottom, rgba(126, 164, 204, 0.09) 0 1px, transparent 1px 64px);
  -webkit-mask-image: radial-gradient(ellipse 78% 72% at 50% 0%, #000 26%, transparent 76%);
  mask-image: radial-gradient(ellipse 78% 72% at 50% 0%, #000 26%, transparent 76%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 58% 46% at 82% 6%, rgba(111, 182, 232, 0.12), transparent 70%);
  pointer-events: none;
}

.hero .eyebrow,
.band .eyebrow,
.closing .eyebrow {
  color: var(--dark-ink-3);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  padding-block: clamp(56px, 8vw, 96px);
}

.hero h1 {
  color: #ffffff;
  margin-bottom: 20px;
  max-width: 15ch;
}

.hero .hero-copy {
  max-width: 46ch;
  font-size: clamp(16.5px, 1.5vw, 18px);
  line-height: 1.62;
  color: var(--dark-ink-2);
}

.hero-meta {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--dark-line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dark-ink-3);
}

.hero-meta .hero-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--dark-ink-2);
}

.hero-meta .hero-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
}

/* Snapshot card: real numbers only, one row per public source. */
.snap {
  border: 1px solid var(--dark-line);
  border-radius: var(--radius-l);
  background: linear-gradient(180deg, var(--navy-2), rgba(11, 23, 48, 0.86));
  box-shadow: 0 24px 60px -32px rgba(0, 0, 0, 0.7);
  padding: 22px 22px 18px;
}

.snap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
}

.snap-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dark-ink-3);
}

.snap-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dark-ink-2);
}

.snap-flag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ice);
}

.snap-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-top: 1px solid var(--dark-line);
  font-size: 13.5px;
  color: var(--dark-ink-2);
}

.snap-row b {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--dark-ink);
  font-variant-numeric: tabular-nums;
}

.snap-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--dark-line);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--dark-ink-3);
}

.snap-foot b {
  color: var(--dark-ink-2);
  font-weight: 500;
}

/* 10. Stat strip ---------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.stat {
  padding: 26px 24px;
  border-left: 1px solid var(--line);
}

.stat:first-child {
  border-left: 0;
}

.stat-num {
  display: block;
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  display: block;
  margin-top: 4px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

.stat .src {
  margin-top: 8px;
  font-size: 11.5px;
}

/* 11. Cards and grids ----------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}

.card--flush {
  padding: 0;
  overflow: hidden;
}

.card--link {
  color: inherit;
  text-decoration: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.card--link:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-1);
  transform: translateY(-1px);
  text-decoration: none;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

.card ul {
  margin: 0;
  padding-left: 1.1em;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

.card ul li + li {
  margin-top: 6px;
}

.card-foot {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  font-size: 13px;
}

.card-path {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}

.card-metric {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

.card-metric b {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.card-metric span {
  font-size: 13px;
  color: var(--ink-2);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-strong);
  text-decoration: none;
}

.link-arrow:hover {
  text-decoration: underline;
}

.link-arrow::after {
  content: "\2192";
  font-size: 13px;
}

/* 12. Callouts and notes -------------------------------------------------- */
.callout {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-s);
  background: var(--accent-soft);
}

.callout h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.callout p,
.callout li {
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--ink-2);
}

.callout ul {
  margin-bottom: 0;
}

.callout--warn {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

.callout--ok {
  border-left-color: var(--ok);
  background: var(--ok-soft);
}

.callout--plain {
  border-left-color: var(--line-strong);
  background: var(--surface-2);
}

.note {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface-2);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

.note strong {
  color: var(--ink);
}

/* Compact research card used for the three honest highlights. */
.finding {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}

.finding-head {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.finding h3 {
  font-size: 17px;
  line-height: 1.4;
}

.finding p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
}

.finding .finding-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* 13. Tables -------------------------------------------------------------- */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}

table.data caption {
  padding: 16px 20px 0;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.data th {
  padding: 14px 20px;
  text-align: left;
  vertical-align: bottom;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data td {
  padding: 13px 20px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}

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

.data tbody tr:hover td {
  background: var(--surface-2);
}

.data td strong {
  color: var(--ink);
}

.data .num,
.data th.num {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 13.5px;
  white-space: nowrap;
}

.data tr.is-key td {
  background: var(--accent-soft);
}

.data tr.is-key td:first-child {
  box-shadow: inset 2px 0 0 var(--accent);
}

.data tr.is-muted td {
  color: var(--ink-3);
}

/* 14. Code blocks --------------------------------------------------------- */
.code {
  margin: 0;
  padding: 20px 22px;
  border: 1px solid var(--dark-line);
  border-radius: var(--radius-m);
  background: var(--navy);
  color: var(--dark-ink);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  overflow-x: auto;
  tab-size: 2;
}

.code code {
  font: inherit;
  color: inherit;
}

.code .c-comment {
  color: var(--dark-ink-3);
}

.code .c-cmd {
  color: #ffffff;
}

.code-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border: 1px solid var(--dark-line);
  border-bottom: 0;
  border-radius: var(--radius-m) var(--radius-m) 0 0;
  background: var(--navy-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dark-ink-3);
}

.code-wrap .code {
  border-radius: 0 0 var(--radius-m) var(--radius-m);
}

code {
  padding: 0.12em 0.36em;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--ink);
}

/* Long field names must wrap instead of forcing a horizontal scroll on mobile. */
p code,
li code,
dd code {
  overflow-wrap: anywhere;
}

.code code,
.code-head code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

/* 15. Figures, media frames, screenshots --------------------------------- */
.figure {
  margin: 0;
}

.fig-media {
  padding: clamp(12px, 2vw, 22px);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: #ffffff;
  overflow: hidden;
}

.fig-media img {
  display: block;
  width: 100%;
  height: auto;
}

/* Diagrams stay legible: below the tablet breakpoint the container pans instead
   of shrinking the labels to nothing (see 19. Responsive). */
.fig-media--scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.findings {
  display: grid;
  gap: 16px;
}

.figcaption {
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

.figcaption .src {
  margin-top: 6px;
}

/* Screenshot frame: neutral chrome, never a fake browser claim. */
.frame {
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.frame-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

.frame-dots {
  display: inline-flex;
  gap: 5px;
}

.frame-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}

.frame-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frame-body {
  display: block;
  background: var(--navy-2);
}

.frame-body img {
  display: block;
  width: 100%;
  height: auto;
}

.shots {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(20px, 3vw, 32px);
  align-items: start;
}

/* 16. Steps and key-value lists ------------------------------------------ */
.steps {
  counter-reset: step;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 16px;
}

.steps li {
  position: relative;
  margin: 0;
  padding-left: 40px;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 26px;
  text-align: center;
}

.steps h3 {
  margin-bottom: 4px;
  font-size: 16px;
}

.steps p {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-2);
}

.kv {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  overflow: hidden;
}

.kv > div {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.kv > div:first-child {
  border-top: 0;
}

.kv dt {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-top: 2px;
}

.kv dd {
  margin: 0;
  color: var(--ink-2);
}

.kv dd strong {
  color: var(--ink);
}

/* 17. Footer and closing band -------------------------------------------- */
.closing {
  background: var(--navy-2);
  color: var(--dark-ink);
  border-top: 1px solid var(--dark-line);
}

.closing-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  padding-block: clamp(48px, 6vw, 72px);
}

.closing h2 {
  color: #ffffff;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.closing p {
  color: var(--dark-ink-2);
  max-width: 52ch;
  font-size: 15.5px;
}

.closing .btn-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  justify-items: stretch;
  width: min(300px, 100%);
  margin-left: auto;
}

.site-footer {
  background: var(--navy);
  color: var(--dark-ink-2);
  border-top: 1px solid var(--dark-line);
  padding-block: clamp(40px, 5vw, 56px) 28px;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--dark-line);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--dark-ink);
  font-size: 15.5px;
  font-weight: 600;
  text-decoration: none;
}

.footer-brand img {
  display: block;
  width: 26px;
  height: 26px;
}

.footer-mission {
  margin: 0;
  max-width: 54ch;
  font-size: 14px;
  line-height: 1.65;
  color: var(--dark-ink-2);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  padding-block: 36px;
  border-bottom: 1px solid var(--dark-line);
}

.footer-h {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dark-ink-3);
}

.footer-cols ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.footer-cols li {
  margin: 0;
}

.footer-cols a {
  color: var(--dark-ink-2);
  font-size: 13.5px;
  text-decoration: none;
}

.footer-cols a:hover {
  color: var(--dark-ink);
  text-decoration: underline;
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--dark-ink-3);
}

.footer-base p {
  margin: 0;
}

.footer-base a {
  color: var(--dark-ink-2);
}

.footer-base a:hover {
  color: var(--dark-ink);
}

.hero a:not(.btn),
.closing a:not(.btn),
.site-footer a:not(.btn) {
  color: var(--ice);
}

.hero a:not(.btn):hover,
.closing a:not(.btn):hover {
  color: #ffffff;
}

.hero :focus-visible,
.closing :focus-visible,
.site-footer :focus-visible,
.band :focus-visible {
  outline-color: var(--ice);
}

/* 18. Utilities ---------------------------------------------------------- */
.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;
}

.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}

.icon-link:hover {
  text-decoration: underline;
}

/* 19. Responsive --------------------------------------------------------- */
@media (max-width: 1080px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  .snap {
    max-width: 520px;
  }

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

  .shots .shots-side {
    max-width: 340px;
  }

  .closing-inner,
  .footer-top {
    grid-template-columns: minmax(0, 1fr);
  }

  .closing .btn-row {
    grid-template-columns: repeat(3, max-content);
    width: auto;
    margin-left: 0;
  }
}

@media (max-width: 900px) {
  .header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    min-height: var(--header-h);
  }

  .brand {
    order: 1;
  }

  .nav-toggle {
    order: 2;
    display: inline-flex;
  }

  .nav {
    order: 3;
    flex: 0 0 100%;
    padding-bottom: 4px;
  }

  .nav ul {
    flex-direction: column;
    gap: 0;
  }

  .nav a {
    width: 100%;
    min-height: 46px;
    border-top: 1px solid var(--line);
  }

  .nav a[aria-current="page"]::after {
    left: auto;
    right: auto;
    width: 28px;
    bottom: 12px;
  }

  .header-actions {
    order: 4;
    flex: 0 0 100%;
    justify-content: space-between;
    padding: 10px 0 12px;
    border-top: 1px solid var(--line);
  }

  .site-header.is-collapsed .nav,
  .site-header.is-collapsed .header-actions {
    display: none;
  }

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

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

  .fig-media--scroll img {
    min-width: 760px;
  }

  .footer-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .section {
    padding-block: clamp(48px, 9vw, 64px);
  }

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

  .stat {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 20px 18px;
  }

  .stat:nth-child(even) {
    border-left: 1px solid var(--line);
  }

  .stat:nth-child(-n + 2) {
    border-top: 0;
  }

  .display {
    font-size: clamp(34px, 9vw, 44px);
  }

  .legend li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  table.data {
    font-size: 13.5px;
  }

  .data th,
  .data td {
    padding: 11px 14px;
  }
}

@media (max-width: 560px) {
  .grid--2,
  .grid--3,
  .grid--4,
  .grid--cards {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .stat,
  .stat:nth-child(even) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .stat:first-child {
    border-top: 0;
  }

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

  .btn-row .btn {
    width: 100%;
  }

  .closing .btn-row {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .hero .btn-row .btn {
    width: auto;
  }

  .kv > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .card {
    padding: 20px;
  }
}

/* 20. Dark colour scheme --------------------------------------------------
   The site is light-first; this block only re-points the neutral tokens so the
   same markup stays legible when the reader prefers a dark scheme. Navy
   surfaces (hero, closing band, footer, code) are unchanged. Figures and
   screenshots keep their white containers so generated SVGs stay readable. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #081120;
    --bg-soft: #0b1730;
    --surface: #0b1730;
    --surface-2: #101f3a;

    --ink: #e8f0f8;
    --ink-2: #c7d6e6;
    --ink-3: #a9bcd0;
    --ink-4: #7d92aa;

    --line: rgba(126, 164, 204, 0.16);
    --line-strong: rgba(126, 164, 204, 0.32);

    --accent: #6fb6e8;
    --accent-strong: #8fcbf2;
    --accent-soft: rgba(111, 182, 232, 0.14);

    --warn: #d9a94e;
    --warn-soft: rgba(169, 118, 42, 0.2);
    --ok: #4fbf9b;
    --ok-soft: rgba(29, 122, 95, 0.22);

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px -18px rgba(0, 0, 0, 0.6);
    --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.45), 0 24px 60px -32px rgba(0, 0, 0, 0.7);
  }

  .btn--primary {
    background: var(--ink);
    color: var(--navy);
  }

  .btn--primary:hover {
    background: #ffffff;
  }

  .btn--accent {
    background: var(--accent);
    color: var(--navy);
  }

  .btn--accent:hover {
    background: #8fcbf2;
  }

  .skip {
    background: var(--ice);
    color: var(--navy);
  }

  .fig-media {
    border-color: var(--line-strong);
  }

  .frame-body {
    background: #0b1730;
  }
}

/* 21. Motion and print --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .card--link:hover {
    transform: none;
  }
}

@media print {
  .site-header,
  .skip,
  .closing,
  .nav-toggle {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #000000;
    font-size: 11pt;
  }

  .hero,
  .site-footer {
    background: #ffffff;
    color: #000000;
    border-color: #cccccc;
  }

  .hero h1,
  .hero .hero-copy,
  .hero-meta,
  .hero .eyebrow {
    color: #000000;
  }

  .section {
    padding-block: 18pt;
    break-inside: avoid;
  }

  a {
    color: #000000;
  }
}
