/* Static SEO layer styles. No JavaScript, no framework. */

/* Brand wordmark only. The SEO layer otherwise uses the system font stack, but
   the header lockup must match the React app: Montserrat 18px, EXAM in 800 and
   SCIENCE in 400. Self-hosted from /public/fonts, so no third-party request. */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/montserrat-400-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/montserrat-800-latin.woff2') format('woff2');
}

:root {
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-alt: #f1f5f9;
  --blue: #1d4ed8;
  --blue-soft: #dbeafe;
  --green: #047857;
  --green-soft: #d1fae5;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.06), 0 8px 24px rgb(15 23 42 / 0.06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
}

h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
}

h3 {
  font-size: 1.08rem;
}

p {
  margin: 0 0 1em;
}

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

li {
  margin-bottom: 0.35em;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.container.narrow {
  width: min(780px, calc(100% - 40px));
}

/* Header ------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(255 255 255 / 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

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

/* Wordmark colours and metrics mirror `.app-logo-*` in src/styles/global.css. */
.brand-wordmark {
  font-family: 'Montserrat', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-exam {
  font-weight: 800;
  color: #0f3258;
}

.brand-science {
  font-weight: 400;
  color: #5296c8;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-left: auto;
}

.header-actions .btn {
  white-space: nowrap;
}

/* Buttons ----------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

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

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

.btn-primary:hover {
  background: #1e293b;
}

.btn-outline {
  border-color: var(--line-strong);
  color: var(--ink);
  background: #fff;
}

.btn-outline:hover {
  border-color: var(--ink);
}

.btn-light {
  background: #fff;
  color: var(--ink);
}

.btn-practice {
  padding: 8px 16px;
  background: var(--blue);
  color: #fff;
  font-size: 0.84rem;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgb(29 78 216 / 0.28);
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.btn-practice:hover {
  background: #1e40af;
  color: #fff;
  box-shadow: 0 4px 14px rgb(29 78 216 / 0.34);
  transform: translateY(-1px);
}

.btn-lg {
  padding: 13px 22px;
  font-size: 1rem;
}

/* Hero -------------------------------------------------------------- */

.hero {
  padding: 72px 0 56px;
  background:
    radial-gradient(900px 420px at 12% -10%, #dbeafe 0%, transparent 62%),
    radial-gradient(700px 360px at 92% 0%, #e0e7ff 0%, transparent 58%),
    var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 48px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hero-lead {
  max-width: 60ch;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.85rem;
}

.hero-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-panel div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px;
  background: #fff;
}

.hero-panel strong {
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.hero-panel span {
  color: var(--muted);
  font-size: 0.82rem;
}

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

.page-hero {
  padding: 58px 0 40px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

.page-hero-compact {
  padding: 44px 0 34px;
}

.page-lead {
  max-width: 72ch;
  color: var(--ink-soft);
  font-size: 1.04rem;
}

.meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

/* Sections ---------------------------------------------------------- */

.section {
  padding: 58px 0;
}

.section-tight {
  padding: 36px 0;
}

.section-alt {
  background: var(--bg-soft);
  border-block: 1px solid var(--line);
}

.section-dark {
  background: var(--ink);
  color: #f8fafc;
}

.section-dark a {
  color: #c7d2fe;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-title {
  margin-bottom: 8px;
}

.section-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.table-action {
  margin: 16px 0 20px;
}

.text-link {
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

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

/* Cards and grids --------------------------------------------------- */

.card-grid {
  display: grid;
  gap: 18px;
}

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

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

.board-card,
.unit-card,
.step-card,
.link-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.board-card:hover,
.unit-card:hover,
.link-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.board-card h3,
.unit-card h3,
.step-card h3 {
  margin-bottom: 2px;
}

.board-card p,
.unit-card p,
.step-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.step-card {
  gap: 3px;
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.85rem;
  font-weight: 700;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.paper-code-group + .paper-code-group {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.group-title {
  margin-bottom: 4px;
  font-size: 1.05rem;
}

.group-meta {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.86rem;
}

.link-card {
  padding: 18px 20px;
  gap: 4px;
}

.link-card strong {
  font-size: 0.98rem;
}

.link-meta {
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 600;
}

.link-note {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

/* Chips ------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.chip-blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.chip-green {
  background: var(--green-soft);
  color: var(--green);
}

.chip-amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.chip-soft {
  background: #f1f5f9;
  color: var(--muted);
}

.chip-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 500;
}

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

.chip-link span {
  color: var(--muted);
  font-size: 0.75rem;
}

.topic-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

/* Paper list -------------------------------------------------------- */

.paper-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.paper-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

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

.paper-row:hover {
  background: var(--bg-soft);
  text-decoration: none;
}

.paper-code {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.paper-name {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.paper-meta {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

/* Tables ------------------------------------------------------------ */

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

.table-wrap caption {
  caption-side: top;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  text-align: left;
}

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

th,
td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

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

tbody tr:hover {
  background: #fbfdff;
}

td strong {
  font-weight: 600;
}

.table-note {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.paper-link {
  display: block;
  margin: -4px -6px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.paper-link:hover {
  background: var(--bg-alt);
  text-decoration: none;
}

.paper-link:hover strong {
  color: var(--blue);
  text-decoration: underline;
}

.practice-cell {
  white-space: nowrap;
}

/* Unit page paper list ---------------------------------------------- */

.paper-table td {
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

.paper-table td:nth-child(n + 2) {
  white-space: nowrap;
}

.paper-table td:last-child,
.paper-table th:last-child {
  text-align: right;
}

.paper-table .btn-practice {
  white-space: nowrap;
}

.question-table tr[id] {
  scroll-margin-top: 90px;
}

.question-table-metrics th {
  vertical-align: bottom;
  white-space: normal;
}

.question-table-metrics th:nth-child(5),
.question-table-metrics th:nth-child(6) {
  min-width: 120px;
}

.question-table-metrics td {
  padding: 10px 12px;
  font-size: 0.86rem;
}

.question-table-metrics th {
  padding: 10px 12px;
}

/* FAQ --------------------------------------------------------------- */

.faq {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
}

.faq details p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.93rem;
}

/* Callouts ---------------------------------------------------------- */

.callout {
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.callout h2 {
  font-size: 1.3rem;
}

.callout p {
  color: var(--ink-soft);
}

.callout-lock {
  background: #fffbeb;
  border-color: #fde68a;
}

.callout-cta {
  margin-top: 36px;
  background: var(--blue-soft);
  border-color: #bfdbfe;
}

/* Plans ------------------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.plan-table {
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: var(--radius);
  overflow: hidden;
}

.plan-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 0.75fr));
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgb(255 255 255 / 0.12);
  font-size: 0.88rem;
}

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

.plan-head {
  background: rgb(255 255 255 / 0.08);
}

.plan-row span:not(:first-child),
.plan-row strong:not(:first-child) {
  text-align: center;
}

/* Question blocks --------------------------------------------------- */

.question-block {
  scroll-margin-top: 90px;
  padding: 26px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.question-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.question-number {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.question-stem,
.part-text {
  overflow-x: auto;
  overflow-y: hidden;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.7;
}

.question-stem {
  margin-bottom: 16px;
}

.part-block {
  padding: 14px 0;
  border-top: 1px dashed var(--line);
}

.part-label {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 700;
}

.part-marks {
  display: inline-block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.option-list {
  margin: 10px 0 0;
  padding-left: 1.4em;
}

.option-list li {
  margin-bottom: 6px;
}

.question-footnote {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

/* Prose ------------------------------------------------------------- */

.prose {
  max-width: 72ch;
}

.prose h2 {
  margin-top: 1.6em;
  font-size: 1.28rem;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p,
.prose li {
  color: var(--ink-soft);
}

.prose a {
  font-weight: 500;
}

/* Breadcrumbs ------------------------------------------------------- */

.breadcrumb {
  padding: 14px 0 0;
  background: var(--bg);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.8rem;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--line-strong);
}

.breadcrumb a {
  color: var(--muted);
}

/* Footer ------------------------------------------------------------ */

.site-footer {
  padding: 52px 0 26px;
  background: var(--ink);
  color: #cbd5e1;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.site-footer .brand {
  color: #fff;
}

.site-footer h2 {
  margin-bottom: 10px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer a {
  display: block;
  margin-bottom: 6px;
  color: #cbd5e1;
}

.site-footer a:hover {
  color: #fff;
}

.footer-note {
  max-width: 42ch;
  margin-top: 12px;
  color: #94a3b8;
  font-size: 0.86rem;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid rgb(255 255 255 / 0.12);
  color: #94a3b8;
  font-size: 0.78rem;
}

.footer-bottom a {
  display: inline;
  margin: 0;
}

/* GEO topic hierarchy ---------------------------------------------- */

.tldr {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.06rem;
  line-height: 1.7;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.chart-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.chart-head h3 {
  margin: 0;
  font-size: 1rem;
}

.chart-unit {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(170px, 300px) minmax(0, 1fr) 78px;
  gap: 14px;
  align-items: start;
}

.bar-label-wrap {
  min-width: 0;
}

.bar-label {
  display: block;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

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

.bar-label .katex {
  font-size: 0.94em;
}

.bar-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.bar-track {
  height: 12px;
  margin-top: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-alt);
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.bar-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  color: var(--ink);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.2;
  text-align: right;
}

.bar-percent {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.metric-card {
  --accent: var(--ink-soft);
  --accent-soft: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
}

.metric-card.tone-blue {
  --accent: #1d4ed8;
  --accent-soft: #eff6ff;
}

.metric-card.tone-violet {
  --accent: #6d28d9;
  --accent-soft: #f5f3ff;
}

.metric-card.tone-teal {
  --accent: #0f766e;
  --accent-soft: #ecfdf5;
}

.metric-card.tone-amber {
  --accent: #b45309;
  --accent-soft: #fffbeb;
}

.metric-card.tone-rose {
  --accent: #be123c;
  --accent-soft: #fff1f2;
}

.metric-card .metric-label {
  color: var(--accent);
}

.metric-card .metric-value {
  color: var(--accent);
}

.metric-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.35;
  text-transform: uppercase;
}

.metric-value {
  color: var(--ink);
  font-size: 1.85rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.1;
}

.metric-value-sm {
  font-size: 1.35rem;
}

.metric-note {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.subsection-title {
  margin: 0 0 12px;
  font-size: 1.02rem;
}

/* Band pills: Easy/Low, Medium, Hard/High --------------------------- */

.band {
  display: inline-flex;
  align-items: center;
  margin-top: 2px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.band-low {
  background: #d1fae5;
  color: #047857;
}

.band-mid {
  background: #fef3c7;
  color: #b45309;
}

.band-high {
  background: #fee2e2;
  color: #b91c1c;
}

.metric-cell-value {
  display: block;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.metric-table td {
  font-size: 0.86rem;
  line-height: 1.5;
}

.metric-table td:first-child {
  min-width: 220px;
}

.metric-table td:nth-child(2) {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.metric-table td:nth-child(3) {
  color: var(--ink-soft);
}

.metric-footnote {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.measure-def-table td:nth-child(1) {
  min-width: 190px;
}

.measure-def-table td:nth-child(2) {
  white-space: nowrap;
}

.measure-def-table td:nth-child(4) {
  color: var(--ink-soft);
}

.scale-note {
  margin: -10px 0 24px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.scale-note a {
  font-weight: 600;
}

/* Measure calibration page ----------------------------------------- */

.band-table td,
.worked-table td,
.worked-table th {
  font-size: 0.84rem;
  line-height: 1.5;
}

.band-table caption,
.worked-table caption {
  caption-side: top;
  padding: 12px 16px;
  background: #fff;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: left;
}

.band-table td:first-child,
.worked-table td:first-child {
  white-space: nowrap;
  font-weight: 600;
}

.band-table td:nth-child(2),
.worked-table td:nth-child(2),
.worked-table td:nth-child(4),
.worked-table td:nth-child(5),
.worked-table td:nth-child(6) {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.band-table td:nth-child(2) {
  font-weight: 700;
}

.worked-table .worked-decayed td {
  background: var(--amber-soft);
}

.worked-table tfoot td {
  background: var(--bg-soft);
  border-top: 1px solid var(--line-strong);
  font-weight: 700;
}

.formula-line {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

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

.fact-faq {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.fact-faq-row {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

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

.fact-faq dt {
  margin-bottom: 6px;
  font-weight: 600;
}

.fact-faq dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.93rem;
}

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

  .bar-row {
    grid-template-columns: minmax(0, 1fr) 66px;
    gap: 6px 10px;
  }

  .bar-label-wrap {
    grid-column: 1 / -1;
  }

  .bar-track {
    grid-column: 1;
  }
}

/* KaTeX ------------------------------------------------------------- */

.katex {
  font-size: 1.02em;
}

.katex-display {
  margin: 0.6em 0;
  padding: 2px 0;
  overflow-x: auto;
  overflow-y: hidden;
}

/* Responsive -------------------------------------------------------- */

@media (max-width: 940px) {
  .hero-grid,
  .split {
    grid-template-columns: 1fr;
    gap: 28px;
  }

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

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

@media (max-width: 720px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 10px 0;
  }

  .header-actions {
    flex-wrap: wrap;
    margin-left: auto;
  }

  .card-grid.two,
  .card-grid.three {
    grid-template-columns: 1fr;
  }

  .paper-row {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .paper-row .paper-meta {
    display: none;
  }

  .section {
    padding: 42px 0;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .question-block {
    padding: 18px;
  }
}

/* ==================================================================
   Homepage ----------------------------------------------------------
   Typewriter H1, drag-select H2s, the four-step flow with CSS-only
   question tabs, and the published exam-data table. Nearly everything
   is scoped to body.page-home so the other SEO pages keep their
   existing rhythm.
   ================================================================== */

.page-home .hero {
  padding: 60px 0 48px;
}

.page-home h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
}

.page-home .hero-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 44px;
}

.page-home .hero-lead {
  max-width: 62ch;
  font-size: 1.04rem;
}

.page-home .hero-actions {
  gap: 10px 12px;
  margin-top: 24px;
}

.page-home .hero-note {
  margin-top: 16px;
}

.page-home .section {
  padding: 56px 0;
}

.page-home .section-title {
  margin-bottom: 22px;
  text-align: left;
}

/* Typewriter on the last word of the H1 ---------------------------- */

/* One 2.9s loop: 0.9s to type, 2s to hold, then a hard cut back to blank
   and straight into the next run. Pure CSS, no runtime script; reduced
   motion simply shows the finished line. */

.typed-wrap {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  color: var(--blue);
}

.typed {
  display: inline-block;
  clip-path: inset(0 100% 0 0);
  animation: type-cycle 2.9s steps(15, end) infinite;
}

.typed-caret {
  position: absolute;
  top: 0.18em;
  bottom: 0.16em;
  left: 0;
  width: 2px;
  background: var(--blue);
  animation: caret-cycle 2.9s steps(15, end) infinite;
}

@keyframes type-cycle {
  0% {
    clip-path: inset(0 100% 0 0);
  }

  31%,
  100% {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes caret-cycle {
  0% {
    left: 0;
  }

  31%,
  100% {
    left: 100%;
  }
}

/* The system statement --------------------------------------------- */

.system-title {
  max-width: 34ch;
  margin-bottom: 0;
  font-size: clamp(1.65rem, 3vw, 2.3rem);
  line-height: 1.14;
  letter-spacing: -0.025em;
}

.duty-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  max-width: 960px;
  margin: 30px 0 0;
}

.duty {
  padding-top: 12px;
  border-top: 2px solid var(--blue-soft);
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.55;
}

.duty b {
  display: block;
  margin-bottom: 4px;
  color: var(--v, var(--ink));
  font-size: 0.92rem;
}

/* Four tints of the same blue: one per duty, reused by the labels below. */

.v-mark {
  --v: #1e40af;
}

.v-data {
  --v: #1e40af;
}

.v-record {
  --v: #0369a1;
}

.v-advise {
  --v: #2563eb;
}

.v-plan {
  --v: #4338ca;
}

.v-mark,
.v-record,
.v-advise,
.v-plan,
.v-data {
  color: var(--v);
}

/* Drag-select animation -------------------------------------------- */

/* The H2 verbs replay a mouse drag, one character at a time: a blue block
   grows letter by letter in reading order and each letter flips to white as
   the block reaches it. Then one hard cut: block off, verbs in their own
   blue, a 5s hold, hard cut to black. 11s, step-end, no fades, no caret.

   Letters overlap by a fraction of an em so their blocks tile without seams;
   the negative margins keep the line length and the glyph positions. */

.sel .l {
  padding: 0.05em 0.02em 0.05em 0.03em;
  margin: 0 -0.02em 0 -0.03em;
  animation-duration: 11s;
  animation-timing-function: step-end;
  animation-iteration-count: infinite;
}

.sel .l:nth-child(1) { animation-name: sel-1; }
.sel .l:nth-child(2) { animation-name: sel-2; }
.sel .l:nth-child(3) { animation-name: sel-3; }
.sel .l:nth-child(4) { animation-name: sel-4; }
.sel .l:nth-child(5) { animation-name: sel-5; }
.sel .l:nth-child(6) { animation-name: sel-6; }
.sel .l:nth-child(7) { animation-name: sel-7; }
.sel .l:nth-child(8) { animation-name: sel-8; }
.sel .l:nth-child(9) { animation-name: sel-9; }
.sel .l:nth-child(10) { animation-name: sel-10; }
.sel .l:nth-child(11) { animation-name: sel-11; }
.sel .l:nth-child(12) { animation-name: sel-12; }
.sel .l:nth-child(13) { animation-name: sel-13; }
.sel .l:nth-child(14) { animation-name: sel-14; }
.sel .l:nth-child(15) { animation-name: sel-15; }
.sel .l:nth-child(16) { animation-name: sel-16; }
.sel .l:nth-child(17) { animation-name: sel-17; }
.sel .l:nth-child(18) { animation-name: sel-18; }
.sel .l:nth-child(19) { animation-name: sel-19; }
.sel .l:nth-child(20) { animation-name: sel-20; }
.sel .l:nth-child(21) { animation-name: sel-21; }
.sel .l:nth-child(22) { animation-name: sel-22; }
.sel .l:nth-child(23) { animation-name: sel-23; }
.sel .l:nth-child(24) { animation-name: sel-24; }
.sel .l:nth-child(25) { animation-name: sel-25; }
.sel .l:nth-child(26) { animation-name: sel-26; }
.sel .l:nth-child(27) { animation-name: sel-27; }
.sel .l:nth-child(28) { animation-name: sel-28; }
.sel .l:nth-child(29) { animation-name: sel-29; }
.sel .l:nth-child(30) { animation-name: sel-30; }
.sel .l:nth-child(31) { animation-name: sel-31; }
.sel .l:nth-child(32) { animation-name: sel-32; }
.sel .l:nth-child(33) { animation-name: sel-33; }

@keyframes sel-1 {
  0% { color: var(--ink); background-color: transparent; }
  3.0% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-2 {
  0% { color: var(--ink); background-color: transparent; }
  3.4% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-3 {
  0% { color: var(--ink); background-color: transparent; }
  3.8% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-4 {
  0% { color: var(--ink); background-color: transparent; }
  4.2% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-5 {
  0% { color: var(--ink); background-color: transparent; }
  4.6% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-6 {
  0% { color: var(--ink); background-color: transparent; }
  5.0% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-7 {
  0% { color: var(--ink); background-color: transparent; }
  5.4% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-8 {
  0% { color: var(--ink); background-color: transparent; }
  5.8% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-9 {
  0% { color: var(--ink); background-color: transparent; }
  6.2% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-10 {
  0% { color: var(--ink); background-color: transparent; }
  6.6% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-11 {
  0% { color: var(--ink); background-color: transparent; }
  7.0% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-12 {
  0% { color: var(--ink); background-color: transparent; }
  7.4% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-13 {
  0% { color: var(--ink); background-color: transparent; }
  7.8% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-14 {
  0% { color: var(--ink); background-color: transparent; }
  8.2% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-15 {
  0% { color: var(--ink); background-color: transparent; }
  8.6% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-16 {
  0% { color: var(--ink); background-color: transparent; }
  9.0% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-17 {
  0% { color: var(--ink); background-color: transparent; }
  9.4% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-18 {
  0% { color: var(--ink); background-color: transparent; }
  9.8% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-19 {
  0% { color: var(--ink); background-color: transparent; }
  10.2% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-20 {
  0% { color: var(--ink); background-color: transparent; }
  10.6% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-21 {
  0% { color: var(--ink); background-color: transparent; }
  11.0% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-22 {
  0% { color: var(--ink); background-color: transparent; }
  11.4% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-23 {
  0% { color: var(--ink); background-color: transparent; }
  11.8% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-24 {
  0% { color: var(--ink); background-color: transparent; }
  12.2% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-25 {
  0% { color: var(--ink); background-color: transparent; }
  12.6% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-26 {
  0% { color: var(--ink); background-color: transparent; }
  13.0% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-27 {
  0% { color: var(--ink); background-color: transparent; }
  13.4% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-28 {
  0% { color: var(--ink); background-color: transparent; }
  13.8% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-29 {
  0% { color: var(--ink); background-color: transparent; }
  14.2% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-30 {
  0% { color: var(--ink); background-color: transparent; }
  14.6% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-31 {
  0% { color: var(--ink); background-color: transparent; }
  15.0% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-32 {
  0% { color: var(--ink); background-color: transparent; }
  15.4% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes sel-33 {
  0% { color: var(--ink); background-color: transparent; }
  15.8% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

.sel-data .l:nth-child(1) { animation-name: data-1; }
.sel-data .l:nth-child(2) { animation-name: data-2; }
.sel-data .l:nth-child(3) { animation-name: data-3; }
.sel-data .l:nth-child(4) { animation-name: data-4; }
.sel-data .l:nth-child(5) { animation-name: data-5; }
.sel-data .l:nth-child(6) { animation-name: data-6; }
.sel-data .l:nth-child(7) { animation-name: data-7; }
.sel-data .l:nth-child(8) { animation-name: data-8; }
.sel-data .l:nth-child(9) { animation-name: data-9; }
.sel-data .l:nth-child(10) { animation-name: data-10; }
.sel-data .l:nth-child(11) { animation-name: data-11; }
.sel-data .l:nth-child(12) { animation-name: data-12; }
.sel-data .l:nth-child(13) { animation-name: data-13; }
.sel-data .l:nth-child(14) { animation-name: data-14; }
.sel-data .l:nth-child(15) { animation-name: data-15; }

@keyframes data-1 {
  0% { color: var(--ink); background-color: transparent; }
  3.0% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes data-2 {
  0% { color: var(--ink); background-color: transparent; }
  3.9% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes data-3 {
  0% { color: var(--ink); background-color: transparent; }
  4.8% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes data-4 {
  0% { color: var(--ink); background-color: transparent; }
  5.7% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes data-5 {
  0% { color: var(--ink); background-color: transparent; }
  6.6% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes data-6 {
  0% { color: var(--ink); background-color: transparent; }
  7.6% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes data-7 {
  0% { color: var(--ink); background-color: transparent; }
  8.5% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes data-8 {
  0% { color: var(--ink); background-color: transparent; }
  9.4% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes data-9 {
  0% { color: var(--ink); background-color: transparent; }
  10.3% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes data-10 {
  0% { color: var(--ink); background-color: transparent; }
  11.2% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes data-11 {
  0% { color: var(--ink); background-color: transparent; }
  12.1% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes data-12 {
  0% { color: var(--ink); background-color: transparent; }
  13.0% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes data-13 {
  0% { color: var(--ink); background-color: transparent; }
  13.9% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes data-14 {
  0% { color: var(--ink); background-color: transparent; }
  14.8% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

@keyframes data-15 {
  0% { color: var(--ink); background-color: transparent; }
  15.7% { color: #fff; background-color: var(--blue); }
  25% { color: var(--v); background-color: transparent; }
  70% { color: var(--ink); }
  100% { color: var(--ink); }
}

/* Pillar II -------------------------------------------------------- */

.pillar {
  margin-top: 56px;
}

/* Same type scale as .system-title: both are section-level H2s. */

.pillar-title {
  margin-bottom: 10px;
  font-size: clamp(1.65rem, 3vw, 2.3rem);
  line-height: 1.14;
  letter-spacing: -0.025em;
}

.pillar-lead {
  max-width: 60ch;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.94rem;
}

.data-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.85rem;
}

.data-stats strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.data-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.page-home .table-wrap {
  margin-top: 28px;
}

.measure-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.measure-table th {
  padding: 10px 14px;
  background: var(--bg-alt);
  border-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.measure-table td {
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  vertical-align: top;
}

.measure-table td:first-child {
  color: var(--ink);
  font-weight: 600;
}

.measures-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.79rem;
}

/* Flowchart -------------------------------------------------------- */

/* Nodes live in a left gutter, so each step is one horizontal band. */

.flow {
  --node: 60px;
  position: relative;
  max-width: 960px;
  margin-top: 36px;
}

.flow::before {
  content: "";
  position: absolute;
  left: calc(var(--node) / 2 - 1px);
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, #bfdbfe, #cbd5e1 12%, #cbd5e1 88%, #bfdbfe);
}

.flow-step {
  position: relative;
  display: grid;
  grid-template-columns: var(--node) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.flow-node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: var(--node);
  height: var(--node);
  border: 2px solid var(--blue);
  border-radius: 999px;
  background: #eff6ff;
  color: var(--blue);
  font-size: 1.08rem;
  font-weight: 700;
  box-shadow: 0 0 0 9px var(--bg);
}

.flow-card {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  text-align: left;
}

.flow-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}

.flow-card p {
  max-width: 62ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* Copy on the left, actions on the right: a step stays one band tall. */

.flow-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}

.flow-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.flow-actions .btn {
  white-space: nowrap;
}

.flow-card p.flow-small {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.flow-arrow {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: var(--node);
  height: 44px;
}

/* Solid arrowhead on the spine: reads as a flow, not a divider. */

.flow-arrow span {
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 10px solid var(--blue);
  opacity: 0.8;
}

/* Step media ------------------------------------------------------- */

.flow-media {
  margin-top: 18px;
}

/* The step 2 video matches the question card above it: the 1fr column left
   after the 210px "Try this question" aside and its 20px gap. The step 3/4
   report screens keep the full card width so their text stays readable. */

.flow-media--card {
  width: calc(100% - 230px);
}

.step-figure {
  margin: 0;
}

.step-figure figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.step-video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgb(15 23 42 / 0.12);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #0f172a;
}

/* Step 3/4 slideshow: three report screens cross-faded on one clock. The frame
   uses the screenshots' own background (#1e293b), so letterboxing is invisible
   even though the captures have different aspect ratios. */

.slide-cycle {
  position: relative;
  aspect-ratio: var(--slide-ratio, 1775 / 685);
  overflow: hidden;
  border-radius: 12px;
  background: #1e293b;
  box-shadow: 0 6px 20px rgb(15 23 42 / 0.12);
}

/* Step 3's three screens are near 1209×522, so it gets its own frame ratio. */

.slide-cycle--feedback {
  --slide-ratio: 1209 / 522;
}

.slide-cycle img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  animation: slide-cycle 13.5s linear infinite;
}

.slide-cycle img:nth-child(1) {
  animation-delay: 0s;
}

.slide-cycle img:nth-child(2) {
  animation-delay: 4.5s;
}

.slide-cycle img:nth-child(3) {
  animation-delay: 9s;
}

.slide-cycle:hover img {
  animation-play-state: paused;
}

@keyframes slide-cycle {
  0% { opacity: 0; }
  2% { opacity: 1; }
  31% { opacity: 1; }
  33.34% { opacity: 0; }
  100% { opacity: 0; }
}

/* Pillar II charts -------------------------------------------------- */

.pillar-charts {
  margin: 6px 0 0;
}

.chart-note {
  margin: 12px 0 20px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.chart-note a {
  font-weight: 600;
}

/* Question tabs (CSS only) ---------------------------------------- */

/* Panel on the left, "try this question" action on the right: one row, no
   dead space under the card. */

.q-tabs {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  column-gap: 20px;
  row-gap: 14px;
  align-items: start;
  margin-top: 18px;
}

.q-tabs input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.q-tablist {
  grid-column: 1 / -1;
  display: inline-flex;
  justify-self: start;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.q-tablist label {
  padding: 6px 18px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.q-tablist label:hover {
  color: var(--ink);
}

.q-panel {
  display: none;
}

/* The question itself is the loudest element in the step. */

.q-card {
  padding: 20px;
  border: 1px solid #c7ddff;
  border-radius: var(--radius);
  background: #f5f8ff;
  box-shadow: 0 10px 26px rgb(29 78 216 / 0.12);
}

.q-panels {
  grid-column: 1;
}

.q-aside {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  align-self: center;
}

.q-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.q-body {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

/* Only the button that matches the checked tab is visible, so it always
   opens the question currently on screen. */

.q-aside .q-link {
  display: none;
}

#q-easy:checked ~ .q-aside [data-q-link="easy"],
#q-medium:checked ~ .q-aside [data-q-link="medium"],
#q-hard:checked ~ .q-aside [data-q-link="hard"] {
  display: inline-flex;
}

.q-foot-note {
  max-width: 200px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.q-body .katex {
  font-size: 1.02em;
}

.q-body .katex-display {
  margin: 0.55em 0;
  overflow-x: auto;
  overflow-y: hidden;
}

#q-easy:checked ~ .q-panels .q-panel[data-q="easy"],
#q-medium:checked ~ .q-panels .q-panel[data-q="medium"],
#q-hard:checked ~ .q-panels .q-panel[data-q="hard"] {
  display: block;
}

#q-easy:checked ~ .q-tablist label[for="q-easy"],
#q-medium:checked ~ .q-tablist label[for="q-medium"],
#q-hard:checked ~ .q-tablist label[for="q-hard"] {
  background: var(--ink);
  color: #fff;
}

#q-easy:focus-visible ~ .q-tablist label[for="q-easy"],
#q-medium:focus-visible ~ .q-tablist label[for="q-medium"],
#q-hard:focus-visible ~ .q-tablist label[for="q-hard"] {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

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

.btn-quiet {
  padding: 9px 4px;
  color: var(--blue);
}

.btn-quiet:hover {
  color: #1e40af;
  text-decoration: underline;
}

/* Responsive ------------------------------------------------------- */

@media (max-width: 940px) {
  .page-home .hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

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

@media (max-width: 720px) {
  .flow {
    --node: 42px;
  }

  .flow-step {
    gap: 12px;
  }

  .flow-card {
    padding: 18px;
  }

  .flow-node {
    font-size: 0.92rem;
    box-shadow: 0 0 0 6px var(--bg);
  }

  .flow-arrow {
    height: 36px;
  }

  .flow-arrow span {
    border-left-width: 6px;
    border-right-width: 6px;
    border-top-width: 9px;
  }

  .flow-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .flow-actions {
    align-items: flex-start;
  }

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

  .q-tablist {
    display: flex;
    width: 100%;
  }

  .q-tablist label {
    flex: 1;
    padding: 6px 10px;
    text-align: center;
  }

  .q-aside {
    grid-column: 1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    align-self: start;
  }

  .q-foot-note {
    max-width: none;
  }

  /* The question panel is full width here, so the video follows it. */

  .flow-media--card {
    width: 100%;
  }

  /* Three wide report screens in a 390px column would be unreadable as a
     slideshow, so small screens show all three stacked instead. */

  .slide-cycle {
    display: grid;
    gap: 8px;
    aspect-ratio: auto;
    overflow: visible;
    background: transparent;
    box-shadow: none;
  }

  .slide-cycle img {
    position: static;
    height: auto;
    border-radius: 10px;
    background: #1e293b;
    opacity: 1;
    animation: none;
  }

  .measure-table {
    font-size: 0.8rem;
  }

  .measure-table th:nth-child(2),
  .measure-table td:nth-child(2) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .typed {
    animation: none;
    clip-path: none;
  }

  .typed-caret {
    display: none;
  }

  .sel .l {
    animation: none;
  }

  .slide-cycle {
    display: grid;
    gap: 8px;
    aspect-ratio: auto;
    overflow: visible;
    background: transparent;
    box-shadow: none;
  }

  .slide-cycle img {
    position: static;
    height: auto;
    border-radius: 10px;
    background: #1e293b;
    opacity: 1;
    animation: none;
  }
}

