/* howtosecure.ai stylesheet.

   Colour has four jobs, and each colour does only one of them:

   1. Neutral (black, white, grey): structure, text, buttons and anything that
      is a sequence or a list, such as the three steps.
   2. Accent (violet): interaction and selection only. Checked boxes, the
      selected level, focus rings, link hover, the open requirement.
   3. Signature gradient (orange to pink to violet, ending on the accent):
      brand moments only. The headline phrase, the stage behind the sample
      plan, the closing banner and the wash at the top of the page.
   4. Chapter spectrum: one hue per AISVS chapter, stepping round the colour
      wheel in chapter order at equal lightness and chroma. A chapter keeps its
      hue wherever its icon appears. It is keyed on data-chapter, never on
      position.

   Tokens come first, then base styles, then one section per component.
   Print is last so it overrides everything above it. */
/* ---------- Fonts (self-hosted, SIL OFL; see assets/fonts) ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/inter-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/inter-italic-latin.woff2") format("woff2");
}

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

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

/* ---------- Design tokens ---------- */
:root {
  color-scheme: light dark;
  /* 1. Neutral: structure, text, buttons, sequences */
  --paper: #ffffff;
  --card: #f4f4f3;
  --ink: #0d0d0d;
  --ink-soft: #2e2e2e;
  --muted: #5e5e5e;
  --on-ink: #ffffff;
  --line: #e7e7e6;
  --line-strong: #cbcbca;
  --row-hover: #ebebea;
  /* 2. Accent: interaction and selection only */
  --accent: #6c4df2;
  --accent-hover: #5536d6;
  --focus: #6c4df2;
  --check-bg: var(--accent);
  --error: #b3261e;
  /* 3. Signature gradient: brand moments only */
  --sig-1: #ff7a4d;
  --sig-2: #ff5fa8;
  --sig-3: #7b5cff;
  /* Darker stops for the headline, so large text keeps 3:1 on white. */
  --headline: linear-gradient(95deg, #f0481e 0%, #e0338a 50%, #6c4df2 100%);
  /* 4. Chapter spectrum: lightness and chroma shared by every chapter hue */
  --chapter-l: 0.84;
  --chapter-c: 0.11;
  --on-chapter: #0d0d0d;
  /* AISVS levels. The text ("Level 2") carries the meaning; colour supplements it. */
  --level-1: #1f6b3f;
  --level-2: #1a4fb0;
  --level-3: #a8321c;
  /* Controls */
  --btn-bg: var(--ink);
  --btn-fg: var(--on-ink);
  --btn-bg-hover: var(--ink-soft);
  --tick-on: url("../assets/tick-inverse.svg");
  /* Type */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  --h-weight: 500;
  --h-tracking: -0.035em;
  /* Shape and spacing */
  --space: 1rem;
  --radius: 10px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d0d0d;
    --card: #1a1a1a;
    --ink: #f3f3f3;
    --ink-soft: #d2d2d2;
    --muted: #a3a3a3;
    --on-ink: #0d0d0d;
    --line: #2a2a2a;
    --line-strong: #474747;
    --row-hover: #262626;
    --accent: #a898ff;
    --accent-hover: #c4b8ff;
    --focus: #a898ff;
    --error: #ff9c8f;
    --headline: linear-gradient(95deg, var(--sig-1) 0%, var(--sig-2) 50%, #9a84ff 100%);
    --level-1: #8fd0a6;
    --level-2: #9dbcff;
    --level-3: #ff9c8f;
    --tick-on: url("../assets/tick.svg");
  }
}

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

/* Component display rules must never override the hidden attribute. */
[hidden] {
  display: none !important;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 1.0625rem;
  line-height: 1.6;
  background-image: radial-gradient(42rem 22rem at 12% -6rem, color-mix(in srgb, var(--sig-1) 20%, transparent), transparent 70%),
    radial-gradient(40rem 22rem at 50% -8rem, color-mix(in srgb, var(--sig-2) 18%, transparent), transparent 70%),
    radial-gradient(42rem 22rem at 88% -6rem, color-mix(in srgb, var(--sig-3) 24%, transparent), transparent 70%);
  background-repeat: no-repeat;
}

main {
  flex: 1;
  padding-block: calc(var(--space) * 3.5) calc(var(--space) * 5);
}

main:focus {
  outline: none;
}

h1,
h2,
h3 {
  font-family: var(--font-sans);
  line-height: 1.08;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 1.6rem + 3vw, 3.75rem);
  margin-block: 0 var(--space);
  font-weight: var(--h-weight);
  letter-spacing: var(--h-tracking);
  line-height: 1.04;
}

h2 {
  font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem);
  margin-block: calc(var(--space) * 3) calc(var(--space) * 0.75);
  font-weight: var(--h-weight);
  letter-spacing: var(--h-tracking);
}

h3 {
  font-size: 1.4rem;
  font-weight: var(--h-weight);
  letter-spacing: var(--h-tracking);
}

p {
  text-wrap: pretty;
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent-hover);
  text-decoration-thickness: 2px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 0.1em 0.35em;
  border-color: var(--line);
  border-radius: 4px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

::selection {
  background: var(--ink);
  color: var(--on-ink);
}

svg {
  flex: none;
}

.container {
  width: 100%;
  max-width: 75rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 1.5rem);
}

.prose {
  max-width: 50rem;
}

.lead {
  font-size: clamp(1.15rem, 1.05rem + 0.45vw, 1.375rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 36rem;
  margin-top: 0;
}

.hint,
.loading {
  color: var(--muted);
}

/* Everything the paper design set in mono as "labelling" moves to the UI face.
   Requirement IDs, level markers and question numbers stay mono. */
.mono-label {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.875rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.loading {
  font-size: 0.9rem;
  font-family: var(--font-sans);
}

.loading::before {
  content: "";
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-right: 0.6rem;
  vertical-align: -0.15rem;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: var(--space);
  top: -10rem;
  background: var(--ink);
  color: var(--on-ink);
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  z-index: 100;
  font-family: var(--font-sans);
}

.skip-link:focus {
  top: var(--space);
  color: var(--on-ink);
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid transparent;
  background: var(--paper);
}

@media (min-width: 40.01rem) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--paper) 82%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
  }
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space);
  padding-block: 0.875rem;
  border-bottom: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  gap: 0.625rem;
}

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

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-mark img {
  height: auto;
  width: 3rem;
  margin-top: -1px;
}

/* The logo is one dark colour with transparent cut-outs, so dark mode flips it. */
@media (prefers-color-scheme: dark) {
  .brand-mark img,
  .footer-logo {
    filter: invert(1);
  }
}

.brand-name {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 300;
  letter-spacing: -0.03em;
}

/* Light "howto", heavy "secure", so the run-together name reads as words. */
.brand-strong,
.brand-tld {
  font-weight: 750;
}

.brand-tld {
  color: var(--accent);
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  gap: 0.25rem 1.75rem;
  font-size: 0.9375rem;
}

.nav-list a {
  display: inline-block;
  padding-block: 0.5rem;
  text-decoration: none;
  color: var(--muted);
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  color: var(--ink);
}

/* ---------- Footer ---------- */
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  justify-content: space-between;
  align-items: flex-start;
  padding-block: 2rem 3rem;
  color: var(--muted);
  line-height: 1.6;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
}

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

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

.footer-logo {
  flex: none;
  height: auto;
  opacity: 0.85;
  width: 2rem;
}

.footer-inner p {
  margin: 0;
  flex: 1 1 26rem;
  max-width: 39rem;
}

.footer-inner .footer-note {
  flex: 1 1 20rem;
  max-width: 26rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
  background: transparent;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  font-family: var(--font-sans);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
}

.button:hover {
  background: var(--row-hover);
  border-color: var(--ink);
  color: var(--ink);
}

.button-primary {
  background: var(--btn-bg);
  border-color: var(--btn-bg);
  color: var(--btn-fg);
}

.button-primary:hover {
  background: var(--btn-bg-hover);
  border-color: var(--btn-bg-hover);
  color: var(--btn-fg);
}

.button-light {
  background: var(--on-ink);
  border-color: var(--on-ink);
  color: var(--ink);
}

.button-light:hover {
  background: var(--card);
  border-color: var(--card);
  color: var(--ink);
}

.button svg {
  width: 1.1em;
  height: 1.1em;
}

.button-large {
  min-height: 3.25rem;
  padding-inline: 1.75rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block: calc(var(--space) * 1.5) 0;
}

/* ---------- Hero badge ---------- */
.stamp {
  display: inline-block;
  margin: 0;
  font-weight: 500;
  font-family: var(--font-sans);
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  font-size: 0.8125rem;
  align-self: center;
  border-color: var(--line);
  background: var(--card);
}

/* ---------- Home ---------- */
.home {
  padding-top: 0;
}

/* Home: a centred hero, then the sample plan on a wide grey stage. */
.hero {
  display: flex;
  align-items: center;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: clamp(3rem, 6vw, 4.5rem);
  padding-block: clamp(3.5rem, 9vw, 7rem) clamp(3rem, 6vw, 5rem);
  text-align: center;
}

.hero-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  flex: none;
  align-items: center;
  max-width: 60rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.75rem, 1rem + 6.4vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.hero .lead {
  margin: 0;
  max-width: 40rem;
}

.hero h1 em {
  font-style: normal;
  font-weight: inherit;
  background: var(--headline);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (forced-colors: active) {
  .hero h1 em {
    background: none;
    color: CanvasText;
  }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  justify-content: center;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem 1.75rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  justify-content: center;
}

.hero-points li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hero-points svg {
  width: 1rem;
  height: 1rem;
  color: var(--ink);
}

.hero-visual {
  min-width: 0;
  display: flex;
  justify-content: center;
  flex: none;
  width: 100%;
  padding: clamp(1.5rem, 6vw, 4.5rem) 1.25rem;
  border-radius: 28px;
  background: var(--card);
  background-color: var(--sig-2);
  background-image: radial-gradient(70% 90% at 0% 0%, var(--sig-1) 0%, transparent 65%),
    radial-gradient(70% 90% at 100% 100%, var(--sig-3) 0%, transparent 65%);
}

/* The sample action plan in the hero. */
.index-card {
  position: relative;
  width: 100%;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  max-width: 30rem;
  border: 0;
  background: var(--paper);
  text-align: left;
  box-shadow: 0 30px 60px -24px rgba(40, 10, 80, 0.45);
}

.index-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--line);
}

.index-card-total {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  color: var(--ink-soft);
  height: auto;
  padding-block: 1.125rem 0.875rem;
}

.index-card-number {
  font-family: var(--font-sans);
  font-size: 4.5rem;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ink);
  font-weight: var(--h-weight);
}

.index-card-list {
  padding: 0;
  list-style: none;
  font-family: var(--font-sans);
  margin: 0;
  font-size: 0.9375rem;
}

.index-card-list li {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  height: auto;
  padding-block: 0.7rem;
  border-top: 1px solid var(--line);
}

.index-card-list li span:nth-child(2) {
  flex: 1;
}

.tickbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

.home-section {
  border-top: 0;
  padding-block: clamp(3rem, 6vw, 4.5rem);
}

.home-section-double {
  border-top: 0;
  padding-block: clamp(3rem, 6vw, 4.5rem);
}

.home-section h2,
.cta-band h2 {
  margin: 0;
}

.home-section h2 {
  font-size: clamp(2.25rem, 1.4rem + 3vw, 3.75rem);
  line-height: 1;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space);
  margin-bottom: 3rem;
}

.section-heading p {
  margin: 0;
  max-width: 26rem;
  font-size: 1.0625rem;
  color: var(--muted);
}

.steps-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  gap: 0.75rem;
}

.step-label {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.125rem;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line-strong);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--on-ink);
}

.steps-list h3 {
  margin: 0 0 0.625rem;
  letter-spacing: -0.01em;
  font-size: 1.375rem;
}

.steps-list p {
  margin: 0;
  color: var(--ink-soft);
}

.steps-list li {
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  border: 0;
  background: var(--card);
}

.split {
  display: flex;
  flex-wrap: wrap;
  gap: 3.5rem;
}

.split-intro {
  flex: 1 1 20rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.split-intro .mono-label {
  color: var(--muted);
}

.split-intro p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.125rem;
}

.split-intro h2 {
  font-size: clamp(2rem, 1.4rem + 2vw, 2.75rem);
}

.feature-list {
  flex: 999 1 35rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  display: flex;
  gap: 1.5rem;
  padding-block: 1.75rem;
  border-bottom: 1px solid var(--line);
}

.feature-numeral {
  flex: none;
  line-height: 1;
  width: 2rem;
  padding-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-style: normal;
  color: var(--muted);
}

.feature-list h3 {
  margin: 0 0 0.375rem;
  font-size: 1.25rem;
}

.feature-list p {
  margin: 0;
  color: var(--ink-soft);
}

.feature-list li:first-child {
  border-top: 1px solid var(--line);
}

.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3rem);
  background: var(--ink);
  color: var(--on-ink);
  flex-direction: column;
  padding-block: clamp(3rem, 7vw, 5.5rem);
  border-radius: 28px;
  text-align: center;
  background-image: radial-gradient(38% 75% at 0% 100%, color-mix(in srgb, var(--sig-1) 55%, transparent), transparent 70%),
    radial-gradient(40% 80% at 100% 0%, color-mix(in srgb, var(--sig-3) 75%, transparent), transparent 70%);
}

.cta-band > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  flex: none;
  align-items: center;
  max-width: 40rem;
}

.cta-band p {
  margin: 0;
  opacity: 0.88;
  font-size: 1.0625rem;
}

.cta-band a:not(.button) {
  color: var(--on-ink);
}

.cta-band :focus-visible {
  outline-color: var(--on-ink);
}

.cta-band h2 {
  font-size: clamp(2.25rem, 1.4rem + 3vw, 3.75rem);
  line-height: 1;
}

/* What it covers: one ruled entry per AISVS chapter, with its icon. */
.coverage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  gap: 0.75rem;
}

.coverage-item {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 2rem;
  padding: 1.25rem 1.25rem 1.5rem;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--card);
}

.coverage-item .chapter-badge {
  margin-top: 0.15rem;
}

.coverage-item .mono-label {
  margin: 0;
}

.coverage-item h3 {
  margin: 0.2rem 0 0.25rem;
  font-size: 1.125rem;
}

/* The chapter name opens that chapter in the guide library; the link covers
   the whole card. */
.coverage-item {
  position: relative;
}

.coverage-item h3 a {
  color: inherit;
  text-decoration: none;
}

.coverage-item h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.coverage-item:hover h3 a {
  text-decoration: underline;
}

.section-heading p a {
  white-space: nowrap;
}

.coverage-item p:last-child {
  margin: 0;
  line-height: 1.45;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* ---------- Document head (assessment, results, about) ---------- */
/* Inner pages */
.doc-head {
  margin-bottom: 2.5rem;
}

.doc-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--font-sans);
  padding: 0 0 0.875rem;
  border-bottom: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.doc-title {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 0 2rem;
  padding-bottom: 0.5rem;
}

.doc-title h1 {
  margin-bottom: 0.625rem;
}

.doc-title .lead {
  margin: 0;
}

/* ---------- Assessment ---------- */
.assessment-shell {
  max-width: 52rem;
}

.progress {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
  font-family: var(--font-sans);
  gap: 0.375rem;
}

.progress-step {
  display: flex;
  align-items: center;
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--muted);
}

.progress-step + .progress-step {
  border-left: 1px solid var(--line);
}

.progress-step.is-active {
  background: var(--btn-bg);
  border-color: var(--btn-bg);
  color: var(--btn-fg);
}

.progress-dot::after {
  content: "\00a0·\00a0";
}

.step-heading {
  display: block;
  margin: 0 0 1rem;
  padding-bottom: 0.75rem;
  font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem);
  border-bottom: 1px solid var(--line);
}

.step-heading:focus {
  outline: none;
}

.step-heading:focus-visible {
  outline: 3px solid var(--focus);
}

.step-intro {
  margin-top: 0;
  color: var(--ink-soft);
}

.step .button-row {
  justify-content: space-between;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.step .button-row .button-primary:only-child {
  margin-left: auto;
}

/* ---------- Form controls ---------- */
fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 var(--space);
  min-width: 0;
}

legend {
  font-weight: 500;
  line-height: 1.45;
  padding: 0;
  margin-bottom: 1rem;
  font-size: 1.1875rem;
}

.field-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--error);
  border: 1.5px solid var(--error);
  background: var(--card);
  padding: 0.625rem 0.875rem;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  border-width: 1px;
  border-radius: var(--radius);
}

.field-error::before {
  content: "Error:";
  font-weight: 500;
}

fieldset.has-error .choice-radio {
  border-color: var(--error);
}

.choice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.125rem 0.25rem;
}

.choice:hover {
  background: var(--row-hover);
}

.choice:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.choice input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 1.375rem;
  height: 1.375rem;
  margin: 0.15rem 0 0;
  background: var(--card) no-repeat center / 100%;
  cursor: pointer;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  background-color: var(--paper);
}

.choice input[type="radio"] {
  border-radius: 50%;
}

.choice input:focus-visible {
  outline: none;
}

/* Custom boxes lose their marks in forced colours, so fall back to native. */
@media (forced-colors: active) {
  .choice input {
    appearance: auto;
    -webkit-appearance: auto;
  }
}

.choice label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  cursor: pointer;
}

/* Makes the whole row clickable while keeping the label as the accessible name. */
.choice label::after {
  content: "";
  position: absolute;
  inset: 0;
}

.choice input[type="checkbox"]:checked {
  border-color: var(--check-bg);
  background-color: var(--check-bg);
  background-image: var(--tick-on);
}

.choice input[type="radio"]:checked {
  border-color: var(--accent);
  background-image: radial-gradient(circle, var(--accent) 0 0.3rem, transparent calc(0.3rem + 1px));
}

.choice-label {
  font-weight: 500;
  font-size: 1.125rem;
}

.choice-help {
  font-size: 1rem;
  color: var(--muted);
}

.choice-radio {
  padding: 1.125rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  border-color: transparent;
}

.choice-radio:hover {
  background: var(--row-hover);
}

.choice-radio:has(input:checked) {
  border: 2px solid var(--ink);
  padding: calc(1.125rem - 1px) calc(1.25rem - 1px);
  border-color: var(--accent);
}

.choice-radio + .choice-radio {
  margin-top: 0.75rem;
}

.choice-radio label {
  gap: 0.25rem;
  color: var(--ink-soft);
}

.level-tag-number {
  margin-left: 0.625rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

.choice-radio .choice-help {
  font-size: 0.9375rem;
}

.choice-radio .level-tag {
  align-self: flex-start;
  padding: 0;
  border: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: 0;
}

.assessment-form .choice-radio label {
  padding-right: 5.5rem;
}

.assessment-form .choice-radio:has(input:checked)::after {
  content: "Selected";
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font-sans);
}

.question-tree {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.question-tree > li {
  border-bottom: 1px solid var(--line);
}

.question-children {
  margin-left: 2.5rem;
  border-top: 1px solid var(--line);
}

.question-children .choice-label {
  font-weight: 400;
  font-size: 1.0625rem;
}

.question-children > li {
  border-bottom: 0;
}

.question-children > li + li {
  border-top: 1px solid var(--line);
}

/* Form numbering: 2.1, 2.1.1 … in mono, beside each question. */
.assessment-form .question-tree {
  counter-reset: question;
}

.assessment-form .question-tree > li {
  counter-increment: question;
}

.assessment-form .question-tree .choice::before {
  content: "2." counters(question, ".");
  flex: none;
  min-width: 3rem;
  padding-top: 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- Level tags ---------- */
/* The text ("Level 2") carries the meaning; colour only supplements it. */
.level-tag {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid currentColor;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--ink);
  font-family: var(--font-sans);
  padding: 0.125rem 0.6rem;
  border-width: 1px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
}

.level-tag-1 {
  color: var(--level-1);
}

.level-tag-2 {
  color: var(--level-2);
}

.level-tag-3 {
  color: var(--level-3);
  border-width: 2px;
}

/* ---------- Notices ---------- */
.notice {
  background: var(--card);
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.notice h2 {
  margin-top: 0;
}

.notice-error {
  border-width: 2px;
  border-color: var(--error);
}

.notice-error h2 {
  color: var(--error);
}

/* ---------- Results ---------- */
/* Every chapter that applies on one page, with a chapter list that stays in
   view. Requirements are one-line rows that open in place. */
/* The results use the full width so their edges line up with the document head. */
.assessment-shell:has(.results) {
  max-width: none;
}

.results {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.link-button {
  padding: 0.5rem 0.25rem;
  border: 0;
  background: none;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.875rem;
}

.link-button:hover {
  color: var(--accent-hover);
}

/* Answers bar */
.answers-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: -1rem;
}

.answer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  max-width: 100%;
  overflow: hidden;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-sans);
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  border-color: transparent;
}

.chip-level {
  color: var(--ink);
  font-weight: 500;
}

.answers-actions {
  display: flex;
  gap: 1rem;
}

/* The summary, with "Expand all" beside it. */
.results-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.results-summary {
  margin: 0;
  color: var(--ink-soft);
}

/* Chapters on the left, requirements on the right. On narrower screens the
   chapter list becomes a strip that sticks to the top instead. */
.results-layout {
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
  align-items: start;
  gap: 3rem;
}

.results-panel {
  min-width: 0;
}

.chapter-nav {
  position: sticky;
  top: 5.5rem;
}

.chapter-nav ul {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  max-height: calc(100vh - 7rem);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.chapter-nav-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem 0.5rem 0.5rem;
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.3;
  text-decoration: none;
}

.chapter-nav-link:hover {
  background: var(--card);
  color: var(--ink);
}

/* The chapter being read. */
.chapter-nav-link[aria-current] {
  background: var(--card);
  box-shadow: inset 2px 0 0 var(--accent);
  color: var(--ink);
  font-weight: 500;
}

/* The list scrolls, so an outline outside the link would be clipped. */
.chapter-nav-link:focus-visible {
  outline-offset: -3px;
}

.chapter-nav .chapter-badge {
  width: 2rem;
  height: 2rem;
}

.chapter-nav .chapter-badge svg {
  width: 1rem;
  height: 1rem;
}

.chapter-nav-count {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.chapter-section + .chapter-section {
  margin-top: 4rem;
}

@media (max-width: 60rem) {
  .results-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  /* Sits under the sticky header and runs to the screen edges. */
  .chapter-nav {
    top: calc(4.25rem + 1px);
    z-index: 5;
    margin-inline: calc(-1 * clamp(1rem, 4vw, 1.5rem));
    padding: 0.5rem clamp(1rem, 4vw, 1.5rem);
    border-bottom: 1px solid var(--line);
    background: var(--paper);
  }

  .chapter-nav ul {
    flex-direction: row;
    gap: 0.5rem;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .chapter-nav-link {
    grid-template-columns: auto auto auto;
    padding: 0.375rem 0.875rem 0.375rem 0.375rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    white-space: nowrap;
  }

  .chapter-nav-link[aria-current] {
    border-color: var(--accent);
    box-shadow: none;
  }

  /* Leaves room for the strip when jumping to a chapter. */
  .chapter-section {
    scroll-margin-top: 3.5rem;
  }
}

/* The header is not sticky on phones, so the strip goes to the very top. */
@media (max-width: 40rem) {
  .chapter-nav {
    top: 0;
  }

  .chapter-section {
    scroll-margin-top: 0;
  }
}

/* Answers dialog */
.answers-dialog {
  width: min(100%, 30rem);
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0 0 0 auto;
  padding: 1.25rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  background: var(--card);
  color: var(--ink);
  border-left: 1px solid var(--line);
}

.answers-dialog::backdrop {
  background: rgba(8, 8, 12, 0.5);
}

.answers-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.answers-dialog h2 {
  margin: 0;
  font-size: 1.5rem;
}

.answers-dialog .profile-form {
  margin-top: 1rem;
}

.answers-dialog .level-fieldset {
  margin-bottom: 1.5rem;
}

.answers-dialog legend {
  font-size: 1.0625rem;
}

.answers-dialog .choice {
  font-size: 1rem;
}

.answers-dialog .choice-radio {
  padding: 0.75rem 0.875rem;
  background: var(--paper);
}

.answers-dialog .choice-radio:has(input:checked) {
  padding: calc(0.75rem - 1px) calc(0.875rem - 1px);
}

.answers-dialog .choice-help {
  font-size: 0.9375rem;
}

.answers-dialog .question-children {
  margin-left: 1.25rem;
}

/* Implementation guide panel: the guide page's main column, over the results. */
html:has(.guidance-panel[open]) {
  overflow: hidden;
}

.guidance-panel {
  width: min(100%, 44rem);
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0 0 0 auto;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  border-left: 1px solid var(--line);
}

.guidance-panel::backdrop {
  background: rgba(8, 8, 12, 0.5);
}

.guidance-panel-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.guidance-panel-label {
  font-size: 0.75rem;
  font-family: var(--font-sans);
}

.guidance-panel-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.guidance-panel-full {
  font-size: 0.8rem;
  text-underline-offset: 4px;
  font-family: var(--font-sans);
}

.guidance-panel-body {
  padding: 1.25rem 1.25rem 2rem;
}

.guidance-panel-status {
  margin: 0;
  color: var(--muted);
}

/* The strip repeats the panel's own label. */
.guidance-panel .doc-strip {
  display: none;
}

.guidance-panel .doc-head {
  margin-bottom: 1.5rem;
}

.guidance-panel h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.guidance-panel .guide-plain {
  font-size: 1.125rem;
}

.guidance-panel .guide-columns {
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.guidance-panel .doc-title {
  padding: 0 0 1.1rem;
}

/* Chapter badges */
.chapter-badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--ink);
  border: 0;
  border-radius: 50%;
  background: var(--paper);
}

.chapter-badge svg {
  width: 1.375rem;
  height: 1.375rem;
}

.chapter-badge-id {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
}

.chapter-badge-large {
  width: 3.5rem;
  height: 3.5rem;
}

.chapter-badge-large svg {
  width: 1.75rem;
  height: 1.75rem;
}

/* Chapter spectrum: one hue per chapter, at equal lightness and chroma, in
   chapter order. Keyed on data-chapter so a chapter keeps its hue wherever
   its badge appears. */
[data-chapter="C1"] {
  --chapter-h: 30;
}

[data-chapter="C2"] {
  --chapter-h: 58;
}

[data-chapter="C3"] {
  --chapter-h: 85;
}

[data-chapter="C4"] {
  --chapter-h: 113;
}

[data-chapter="C5"] {
  --chapter-h: 141;
}

[data-chapter="C6"] {
  --chapter-h: 168;
}

[data-chapter="C7"] {
  --chapter-h: 196;
}

[data-chapter="C8"] {
  --chapter-h: 224;
}

[data-chapter="C9"] {
  --chapter-h: 252;
}

[data-chapter="C10"] {
  --chapter-h: 279;
}

[data-chapter="C11"] {
  --chapter-h: 307;
}

[data-chapter="C12"] {
  --chapter-h: 335;
}

[data-chapter="AC"] {
  --chapter-h: 2;
}

[data-chapter] .chapter-badge,
.chapter-badge[data-chapter] {
  background: oklch(var(--chapter-l) var(--chapter-c) var(--chapter-h));
  color: var(--on-chapter);
}

/* Chapter heading */
.chapter-view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.chapter-view-head > div {
  flex: 1;
  min-width: 0;
  padding-left: 0.85rem;
}

.chapter-view-head > .chapter-badge-large {
  order: 1;
}

.chapter-view-heading {
  margin: 0;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
}

.chapter-view-heading:focus {
  outline: none;
}

.chapter-view-count {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-sans);
}

/* One line until "More" is pressed. */
.chapter-view-objective {
  max-width: 46rem;
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
  font-size: 1rem;
}

.topic {
  margin-top: 1.75rem;
}

.topic-heading {
  margin: 0 0 0.4rem;
  padding-left: 0.85rem;
  font-family: var(--font-sans);
  letter-spacing: -0.01em;
  font-size: 1.0625rem;
  font-weight: 600;
}

/* Requirement rows: one line each, the whole row opens it. */
.req-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

/* An open row is one block: heading and panel share a background and a
   left bar (an inset shadow, so nothing shifts when it opens). */
.req.is-open {
  background: var(--card);
  box-shadow: inset 2px 0 0 var(--accent);
}

.req-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto 1rem;
  align-items: center;
  gap: 1rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.5rem 0.55rem 0.85rem;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.req:not(.is-open) .req-toggle:hover {
  background: var(--row-hover);
}

.req.is-open .req-title {
  font-weight: 500;
}

.req-title {
  line-height: 1.3;
  font-size: 1rem;
}

.req .requirement-id {
  min-width: 3rem;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: right;
}

.req-chevron {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s;
}

.req.is-open .req-chevron {
  transform: rotate(90deg);
}

.req {
  border-bottom: 1px solid var(--line);
}

@media (prefers-reduced-motion: reduce) {
  .req-chevron {
    transition: none;
  }
}

/* Level marker: dots and "L1" to "L3" in one ink colour. */
.level-marker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.level-dots {
  display: inline-flex;
  gap: 2px;
}

.level-dots span {
  width: 6px;
  height: 6px;
  border: 1px solid var(--ink-soft);
  border-radius: 50%;
}

.level-dots .is-on {
  background: var(--ink-soft);
}

/* The open panel, with "Implementation guide" as its one call to action. */
.req-detail {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  /* Lines up with the title above it. */
  padding: 0.1rem 2.5rem 1.1rem 0.85rem;
}

.req-detail p {
  max-width: 44rem;
  margin: 0;
}

.guidance-cta {
  min-height: 2.25rem;
  padding: 0.35rem 0.9rem;
  font-size: 0.8125rem;
  text-decoration: none;
}

.guidance-cta:hover {
  background: var(--row-hover);
  color: var(--ink);
}

@media (max-width: 40rem) {
  .req-toggle {
    grid-template-columns: minmax(0, 1fr) auto 1rem;
    gap: 0.6rem;
  }

  .req .requirement-id {
    display: none;
  }
}

.requirement-note {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  font-family: var(--font-sans);
}

.results-footer {
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.export-hint {
  margin: 0.75rem 0 0;
  max-width: 46rem;
  font-size: 0.95rem;
}

.export-status {
  min-height: 1.5em;
  margin: 0.625rem 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  font-family: var(--font-sans);
}

.link-status {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
}

.link-status:empty {
  display: none;
}

.print-sheet {
  display: none;
}

/* ---------- Guidance pages (generated by tools/build-guidance.js) ---------- */
.guide-page {
  max-width: 60rem;
}

.guide-context {
  margin: 0 0 0.5rem;
}

.guide-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}

.guide-quote {
  margin: 0 0 2rem;
  background: var(--card);
  border-left: 0;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}

.guide-quote p {
  margin: 0 0 0.4rem;
}

.guide-quote cite {
  font-size: 0.75rem;
  font-style: normal;
  color: var(--muted);
  font-family: var(--font-sans);
}

.guide-page h2 {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  font-family: var(--font-sans);
  letter-spacing: 0;
}

.guide-plain {
  max-width: 44rem;
  margin: 0;
  line-height: 1.5;
  font-size: 1.1875rem;
}

.guide-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem 2.5rem;
  margin-top: 2rem;
}

.guide-section {
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.guide-section ul {
  margin: 0;
  padding-left: 1.2rem;
}

.guide-section li {
  margin-bottom: 0.4rem;
  font-size: 1rem;
}

.guide-section li::marker {
  color: var(--muted);
}

.guide-mistakes h2 {
  color: var(--muted);
}

.guide-related {
  margin-top: 2rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.guide-related p {
  margin: 0;
}

.guide-related span {
  color: var(--muted);
}

.guide-next {
  margin: 2rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.guide-reviewed {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Guide library (guides.html, generated by tools/build-guidance.js) ---------- */
.library-page {
  max-width: 60rem;
}

.library-next {
  margin: 0 0 2rem;
}

.library-chapters ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 4rem;
  padding: 0;
  list-style: none;
}

.library-chapter-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.85rem 0.3rem 0.3rem;
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--ink);
  font-size: 0.9375rem;
  line-height: 1.3;
  text-decoration: none;
}

.library-chapter-link:hover {
  background: var(--row-hover);
  color: var(--ink);
}

.library-chapter-link .chapter-badge {
  width: 2rem;
  height: 2rem;
}

.library-chapter-link .chapter-badge svg {
  width: 1rem;
  height: 1rem;
}

/* The page already leaves room for the sticky header; the extra room the
   results page adds for its chapter strip is not needed here. */
.library-body .chapter-section {
  scroll-margin-top: 0;
}

.library-list li {
  border-bottom: 1px solid var(--line);
}

/* One row per guide; the whole row is the link. */
.library-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 3.75rem;
  align-items: center;
  gap: 1rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.5rem 0.55rem 0.85rem;
  color: var(--ink);
  text-decoration: none;
}

.library-link:hover {
  background: var(--row-hover);
  color: var(--ink);
}

.library-link:hover .library-title {
  text-decoration: underline;
}

.library-title {
  line-height: 1.3;
}

.library-link .requirement-id {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: right;
}

@media (max-width: 44rem) {
  .guide-columns {
    grid-template-columns: 1fr;
  }
}

/* ---------- About ---------- */
.prose section {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.prose section h2 {
  margin-top: 0;
}

.prose ul {
  padding-left: 1.4rem;
}

/* Numbered markers are wider than bullets; widen the indent so they start at the same left edge. */
.prose ol {
  padding-left: 2rem;
}

.prose li + li {
  margin-top: 0.4rem;
}

.prose li::marker {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--muted);
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .button,
  .nav-list a,
  .choice,
  .chapter-nav-link {
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, transform 0.15s ease;
  }

  .loading::before {
    animation: spin 0.8s linear infinite;
  }

  .button svg {
    transition: transform 0.15s ease;
  }

  .button:hover svg {
    transform: translateX(3px);
  }
}

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

/* Everything below is decoration. Each animation fills backwards only or is
   tied to scroll, so content is never left hidden if one does not run. */
@media screen and (prefers-reduced-motion: no-preference) {
  /* The top of each page rises in once on load. */
  .hero-copy > *,
  .hero-visual,
  main > .doc-head {
    animation: rise 0.6s var(--ease-out) backwards;
  }

  .hero-copy > :nth-child(2) { animation-delay: 0.06s; }
  .hero-copy > :nth-child(3) { animation-delay: 0.12s; }
  .hero-copy > :nth-child(4) { animation-delay: 0.18s; }
  .hero-copy > :nth-child(n + 5) { animation-delay: 0.24s; }
  .hero-visual { animation-delay: 0.15s; }

  /* The sample plan fills in line by line. */
  .index-card-list li {
    animation: fade-in 0.5s ease backwards;
  }

  .index-card-list li:nth-child(1) { animation-delay: 0.55s; }
  .index-card-list li:nth-child(2) { animation-delay: 0.7s; }
  .index-card-list li:nth-child(n + 3) { animation-delay: 0.85s; }

  /* Opacity only: a transform here would unpin the sticky chapter list. */
  main > .doc-head ~ * {
    animation: fade-in 0.5s ease 0.1s backwards;
  }

  /* Home sections ease in as they scroll into view. Browsers without scroll
     timelines skip this and show the sections as they are. */
  @supports (animation-timeline: view()) {
    .section-heading,
    .coverage-item,
    .steps-list li,
    .split-intro,
    .feature-list li,
    .cta-band {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 9rem;
    }
  }

  /* Hover and press. */
  .brand-mark img {
    transform-origin: 50% 90%;
    transition: transform 0.4s var(--ease-spring);
  }

  .brand:hover .brand-mark img {
    transform: rotate(-9deg);
  }

  .button-primary:hover,
  .button-light:hover {
    transform: translateY(-1px);
  }

  .button:active {
    transform: scale(0.97);
  }

  .nav-list a {
    background: linear-gradient(currentColor, currentColor) no-repeat 0 calc(100% - 0.3rem) / 0 1px;
    transition: color 0.15s ease, background-size 0.25s var(--ease-out);
  }

  .nav-list a:hover {
    background-size: 100% 1px;
  }

  .coverage-item .chapter-badge {
    transition: transform 0.4s var(--ease-spring);
  }

  .coverage-item:hover .chapter-badge {
    transform: scale(1.08) rotate(-5deg);
  }

  /* A requirement's detail fades in under its row; nothing moves. */
  .req-detail {
    animation: fade-in 0.25s ease backwards;
  }

  /* The answers and guidance panels slide in from their edge. */
  .answers-dialog[open],
  .guidance-panel[open] {
    animation: panel-in 0.3s var(--ease-out) backwards;
  }

  .answers-dialog[open]::backdrop,
  .guidance-panel[open]::backdrop {
    animation: fade-in 0.3s ease backwards;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateX(2.5rem);
  }
}

/* ---------- Narrow screens ---------- */
@media (max-width: 40rem) {
  .brand {
    margin-inline: auto;
  }

  .brand-mark img {
    width: 2.25rem;
  }

  /* Keep all five links on one row; the desktop sizing wraps "Newsletter" onto a line of its own. */
  .header-inner {
    row-gap: 0.75rem;
  }

  .header-inner nav {
    width: 100%;
    border-top: 1px solid var(--line);
  }

  .nav-list {
    flex-wrap: nowrap;
    justify-content: space-between;
    column-gap: 0.5rem;
    font-size: clamp(0.8125rem, 3.7vw, 0.9375rem);
  }

  .nav-list a {
    padding-block: 0.75rem;
  }

  .question-children {
    margin-left: 1rem;
  }

  .assessment-form .question-tree .choice::before {
    display: none;
  }

  .assessment-form .choice-radio label {
    padding-right: 0;
    padding-top: 1.25rem;
  }

  .assessment-form .choice-radio:has(input:checked)::after {
    top: 0.75rem;
  }
}

/* ---------- Print ---------- */
@media print {
  :root {
    --paper: #ffffff;
    --card: #ffffff;
    --ink: #000000;
    --ink-soft: #222222;
    --muted: #333333;
    --line: #cccccc;
    --line-strong: #999999;
    --on-ink: #ffffff;
    --accent: #000000;
  }

  body {
    background: #ffffff;
  }

  .site-header,
  .skip-link,
  .doc-strip,
  .footer-logo,
  .answers-bar,
  .results-toolbar,
  .chapter-nav,
  .results-panel,
  .results-footer,
  .answers-dialog,
  .guidance-panel {
    display: none !important;
  }

  /* Print gets its own plain list, with every requirement's full text. */
  .print-sheet {
    display: block;
  }

  .print-summary {
    margin: 0 0 1rem;
    font-weight: 500;
  }

  .print-chapter {
    margin-top: 1.25rem;
  }

  .print-chapter h3 {
    margin: 0 0 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1.5px solid #000000;
    font-size: 1.15rem;
    break-after: avoid;
  }

  .print-chapter ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .print-req {
    padding: 0.4rem 0;
    border-bottom: 1px dashed #999999;
    break-inside: avoid;
    font-size: 0.95rem;
  }

  .print-req p {
    margin: 0;
  }

  .print-req-title {
    font-weight: 500;
  }

  .print-mark {
    display: inline-block;
    width: 1.25em;
  }

  main {
    padding-top: 0;
  }

  .doc-head {
    border: 0;
    margin-bottom: 1rem;
  }

  .doc-title {
    padding: 0;
  }

  a {
    color: #000000;
  }
}
