/* PersonaLayer project site
   Plain CSS, no external resources. Colour tokens are defined once on :root
   and redefined for dark mode. All text tokens meet WCAG 2.2 AA contrast. */

:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --surface: #f4f6f9;
  --surface-2: #e8ecf2;
  --text: #14181f;
  --muted: #4a5262;
  --accent: #18549e;
  --accent-strong: #0f3d75;
  --on-accent: #ffffff;
  --border: #7a8496;      /* UI component boundaries, >= 3:1 */
  --rule: #d5dbe4;        /* decorative dividers only */
  --focus: #b3261e;
  --figure-bg: #ffffff;
  --layer-bg: rgba(255, 255, 255, 0.94);
  --line-muted: #7a8496;
  --venn-a: #18549e;      /* LLM circle */
  --venn-b: #6b7486;      /* WCAG circle */
  --venn-c: #0f3d75;      /* Expert circle */
  --scroll-shade: rgba(20, 24, 31, 0.28); /* edge cue on sideways-scrolling tables */

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-serif: "Sitka Heading", "Sitka Text", "Iowan Old Style", Charter, "Bitstream Charter", Cambria, Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --measure: 42rem;
  --wide: 73rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151b;
    --surface: #1a2029;
    --surface-2: #232b36;
    --text: #e9ecf1;
    --muted: #b3bbc8;
    --accent: #8ab8f5;
    --accent-strong: #b7d3fa;
    --on-accent: #0b1a2e;
    --border: #6f7a8c;
    --rule: #2f3846;
    --focus: #ffb4a9;
    --figure-bg: #ffffff;
    --layer-bg: rgba(17, 21, 27, 0.94);
    --line-muted: #8a95a8;
    --venn-a: #8ab8f5;
    --venn-b: #8a95a8;
    --venn-c: #c9defb;
    --scroll-shade: rgba(179, 187, 200, 0.32);
  }
}

/* ---------- Base ---------- */

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

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

/* Keeps the footer at the bottom of short pages. */
main {
  flex: 1 0 auto;
}

[hidden] {
  display: none !important;
}

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

img {
  display: block;
  height: auto;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-variant-numeric: lining-nums;
  line-height: 1.2;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.1rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.55rem, 1.3rem + 1vw, 2rem);
}

h3 {
  font-size: clamp(1.2rem, 1.1rem + 0.4vw, 1.35rem);
}

h4 {
  font-size: 1.1rem;
}

p,
ul,
ol,
dl {
  margin: 0 0 1em;
}

ul,
ol {
  padding-left: 1.4em;
}

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

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

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

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

#main:focus {
  outline: none;
}

strong,
b {
  font-weight: 650;
}

abbr[title] {
  text-decoration: underline dotted;
  text-underline-offset: 0.15em;
  cursor: help;
}

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

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

code {
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 0.08em 0.35em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

pre {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.55;
  tab-size: 2;
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  overflow-wrap: normal;
  white-space: pre;
}

/* Keeps model names and hyphenated terms on one line. */
.nowrap {
  white-space: nowrap;
}

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

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -10rem;
  z-index: 100;
  background: var(--bg);
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-weight: 650;
}

.skip-link:focus {
  top: 0.75rem;
}

/* ---------- Layout ---------- */

.wrap {
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.section {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.section + .section {
  border-top: 1px solid var(--rule);
}

.section--tint {
  background: var(--surface);
}

/* The section padding alone sets the space at the bottom of a section. */
.section > .wrap > :last-child,
.section > .wrap > .prose:last-child > :last-child {
  margin-bottom: 0;
}

.page-about .section {
  padding-block: clamp(2rem, 4vw, 3rem);
}

.section-head {
  max-width: var(--measure);
  margin-bottom: 1.75rem;
}

.section-head p {
  color: var(--muted);
}

/* ---------- Header and navigation ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  min-height: 4.25rem;
  padding-block: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

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

.brand-mark {
  width: 1.45em;
  height: 1.45em;
  flex: none;
}

.brand-mark .m-bg {
  fill: var(--accent);
}

.brand-mark .m-bar {
  fill: var(--bg);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.4rem 0.9rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.nav-toggle-icon {
  position: relative;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-icon::before {
  top: -6px;
}

.nav-toggle-icon::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav li + li {
  margin-top: 0;
}

.site-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.25rem 0.75rem;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.site-nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--rule);
}

/* The underline and aria-current mark the current page. The weight stays the
   same so that the menu does not shift between pages. */
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
}

/* On wide screens the current-page underline sits on the header's bottom rule. */
@media (min-width: 48em) {
  .header-inner {
    padding-block: 0;
  }

  .site-nav a {
    min-height: 4.25rem;
    border-top: 3px solid transparent;
  }
}

@media (max-width: 47.99em) {
  .js .nav-toggle {
    display: inline-flex;
  }

  .js .site-nav {
    display: none;
    width: 100%;
    padding-bottom: 0.75rem;
  }

  .js .site-nav.is-open {
    display: block;
  }

  .js .site-nav ul {
    flex-direction: column;
  }

  .js .site-nav a {
    border-bottom: 0;
    border-left: 3px solid transparent;
    padding-left: 0.85rem;
  }

  .js .site-nav a[aria-current="page"] {
    border-left-color: var(--accent);
  }
}

/* ---------- Page head (sub-pages) ---------- */

.page-head {
  border-bottom: 1px solid var(--rule);
}

.page-head .wrap {
  padding-block: clamp(2.25rem, 6vw, 4rem) clamp(2rem, 5vw, 3rem);
}

.page-head h1 {
  max-width: 22ch;
}

.lead {
  font-size: clamp(1.125rem, 1.05rem + 0.4vw, 1.3rem);
  line-height: 1.55;
  max-width: 40rem;
}

.page-head .lead:last-child {
  margin-bottom: 0;
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 1.15rem;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  font: inherit;
  font-weight: 650;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
}

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

.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--on-accent);
}

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

.btn-secondary:hover {
  background: var(--surface);
  color: var(--accent-strong);
  border-color: var(--accent-strong);
}

.btn-small {
  min-height: 36px;
  padding: 0.3rem 0.8rem;
  font-size: 0.925rem;
  border-width: 1px;
  border-color: var(--border);
  background: var(--bg);
  color: var(--text);
}

.btn-small:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Home: hero ---------- */

.hero .wrap {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
  padding-block: clamp(2.5rem, 7vw, 5rem);
}

@media (min-width: 56em) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  }
}

.hero-text {
  container-type: inline-size;
}

/* The single-word title never breaks mid-word: it also scales with its
   column (cqi), so it fits when text is enlarged to 200%. */
.hero h1 {
  font-size: clamp(2.6rem, 1.6rem + 4.4vw, 4.4rem);
  font-size: min(clamp(2.6rem, 1.6rem + 4.4vw, 4.4rem), 15.5cqi);
  overflow-wrap: normal;
  margin-bottom: 0.35em;
}

.hero .lead {
  font-size: clamp(1.2rem, 1.08rem + 0.6vw, 1.45rem);
  max-width: 34rem;
}

.hero-text p:not(.lead) {
  max-width: 36rem;
}

.text-link {
  font-weight: 600;
}

/* The layer illustration: a rendered page with a persona layer on top. */

.layer-figure {
  margin: 0;
}

/* The two sheets share one grid cell, so the figure grows with its content
   instead of clipping it in a fixed-ratio box. */
.layer-demo {
  position: relative;
  display: grid;
  max-width: 31rem;
  margin-inline: auto;
}

.sheet {
  position: relative;
  grid-area: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
}

.sheet-page {
  margin: 0 16% 18% 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 5% 6%;
}

.sheet-layer {
  margin: 26% 0 0 22%;
  align-self: start;
  background: var(--layer-bg);
  border: 2px dashed var(--accent);
  padding: 5% 6%;
  box-shadow: 0 10px 30px -18px rgba(15, 30, 60, 0.45);
}

.wf {
  display: block;
  background: var(--rule);
  border-radius: 3px;
}

.wf-bar {
  height: 1.1rem;
  margin-bottom: 6%;
  background: var(--surface-2);
  border: 1px solid var(--rule);
}

.wf-row {
  display: flex;
  gap: 5%;
  margin-bottom: 6%;
}

.wf-img {
  flex: 0 0 34%;
  aspect-ratio: 1;
  background: var(--surface-2);
  border: 1px solid var(--rule);
}

.wf-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.wf-line {
  height: 5px;
}

.wf-line.short {
  width: 60%;
}

.layer-tag {
  display: inline-block;
  font-size: clamp(0.72rem, 0.66rem + 0.3vw, 0.85rem);
  font-weight: 650;
  color: var(--accent-strong);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  margin-bottom: 0.6rem;
  background: var(--bg);
}

.layer-code {
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 0.66rem + 0.3vw, 0.85rem);
  line-height: 1.5;
  color: var(--text);
  white-space: pre;
  margin: 0 0 0.8rem;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  overflow: visible;
}

.layer-code .c {
  color: var(--muted);
}

.layer-lines {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.layer-lines .wf-line {
  height: 9px;
  background: var(--text);
  opacity: 0.55;
}

.layer-lines .wf-line.short {
  width: 55%;
}

.layer-figure figcaption {
  max-width: 31rem;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Stacked hero: the figure lines up with the text above it. */
@media (max-width: 55.99em) {
  .layer-demo,
  .layer-figure figcaption {
    margin-inline: 0;
  }
}

/* Stacked buttons on phones share one width. */
@media (max-width: 30em) {
  .actions .btn {
    flex: 1 1 100%;
  }
}

/* ---------- Home: three parts ---------- */

.parts {
  display: grid;
  gap: 2rem 2.5rem;
  grid-template-columns: minmax(0, 1fr);
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (min-width: 56em) {
  .parts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.parts > li + li {
  margin-top: 0;
}

.part {
  border-top: 3px solid var(--accent);
  padding-top: 1.1rem;
  display: flex;
  flex-direction: column;
}

.part h3 {
  margin-bottom: 0.2em;
}

.part-kind {
  color: var(--muted);
  font-size: 0.975rem;
  margin-bottom: 0.75rem;
}

.part-links {
  list-style: none;
  padding: 0;
  margin: auto 0 0;
}

.part-links li + li {
  margin-top: 0.15rem;
}

.part-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font-weight: 600;
}

/* ---------- Home: study at a glance ---------- */

.equation {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1.1rem;
  margin: 0 0 1.25rem;
}

.term {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.2;
}

.term .n {
  font-family: var(--font-serif);
  font-size: clamp(2.3rem, 1.6rem + 3vw, 3.6rem);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}

.term .t {
  color: var(--muted);
  font-size: 0.975rem;
  margin-top: 0.35rem;
}

.term.result .n {
  color: var(--accent);
}

.op {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.3rem);
  line-height: 1;
  color: var(--muted);
  padding-bottom: 1.85rem;
}

/* An operator always wraps together with the term that follows it. */
.eq-step {
  display: inline-flex;
  align-items: flex-end;
  gap: 0.75rem 1.1rem;
}

.equation + .equation {
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.facts {
  display: grid;
  gap: 0.25rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  margin: 2rem 0 1.5rem;
}

.facts > div {
  border-left: 2px solid var(--rule);
  padding: 0.25rem 0 0.25rem 0.9rem;
  margin-bottom: 0.75rem;
}

.facts dt {
  font-weight: 650;
}

.facts dd {
  margin: 0;
  color: var(--muted);
}

/* ---------- Home: crossing ranks ---------- */

.finding {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 70em) {
  .finding {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.ranks {
  max-width: 40rem;
  margin: 0;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(1rem, 3vw, 1.5rem);
}

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

.doc-body .ranks {
  margin: 2rem 0;
}

.ranks-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(2.25rem, 9vw, 5rem) minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  column-gap: 0.5rem;
}

.ranks-head {
  grid-row: 1;
  font-weight: 650;
  font-size: 0.975rem;
  line-height: 1.35;
  margin: 0 0 0.75rem;
}

.ranks-head.left {
  grid-column: 1;
  text-align: right;
}

.ranks-head.right {
  grid-column: 3;
}

.ranks-list {
  grid-row: 2;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-rows: repeat(3, minmax(4.25rem, 1fr));
  counter-reset: rank;
}

.ranks-list.left {
  grid-column: 1;
  text-align: right;
}

.ranks-list.left li {
  align-items: flex-end;
}

.ranks-list.right {
  grid-column: 3;
}

.ranks-list li {
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-top: 1px solid var(--rule);
  padding: 0.35rem 0;
  counter-increment: rank;
}

.ranks-list li:last-child {
  border-bottom: 1px solid var(--rule);
}

.ranks-list .name {
  font-weight: 600;
  line-height: 1.25;
}

.ranks-list .name::before {
  content: counter(rank) ". ";
  color: var(--muted);
  font-weight: 500;
}

.ranks-list .val {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

.ranks-list li.is-key .name {
  color: var(--accent);
}

.ranks-lines {
  grid-row: 2;
  grid-column: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ranks-lines line {
  stroke: var(--line-muted);
  stroke-width: 2;
  stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
}

.ranks-lines line.key {
  stroke: var(--accent);
  stroke-width: 3.5;
  stroke-dasharray: none;
}

.ranks-unit {
  grid-row: 3;
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0.6rem 0 0;
  line-height: 1.4;
}

.ranks-unit.left {
  grid-column: 1;
  text-align: right;
}

.ranks-unit.right {
  grid-column: 3;
}

.ranks figcaption {
  margin-top: 1rem;
  font-size: 0.925rem;
  color: var(--muted);
}

@media (max-width: 30em) {
  .ranks {
    padding: 0.85rem;
  }

  .ranks-grid {
    grid-template-columns: minmax(0, 1fr) 1.75rem minmax(0, 1fr);
    column-gap: 0.35rem;
  }

  .ranks-head,
  .ranks-list .name {
    font-size: 0.925rem;
  }

  .ranks-list .val {
    font-size: 0.875rem;
  }
}

/* ---------- Notes and callouts ---------- */

.note {
  border-left: 4px solid var(--accent);
  background: var(--surface);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  max-width: var(--measure);
  margin: 1.5rem 0;
}

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

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

/* Callout titles are headings (h3/h4) for navigation, styled as bold text. */
.note .note-title {
  font-family: var(--font-sans);
  font-size: inherit;
  font-weight: 700;
  line-height: 1.6;
  margin: 0 0 0.3rem;
  max-width: none;
  text-wrap: wrap;
  letter-spacing: normal;
}

.citation {
  padding-left: 1.5em;
  text-indent: -1.5em;
  max-width: var(--measure);
}

/* ---------- Document pages with a contents column ---------- */

.doc {
  display: grid;
  gap: 2rem;
  padding-block: clamp(2rem, 5vw, 3.5rem);
}

@media (min-width: 64em) {
  .doc {
    grid-template-columns: 14.5rem minmax(0, 1fr);
    gap: 3.5rem;
  }
}

.toc {
  font-size: 0.95rem;
}

/* The padding leaves room inside the scroll box for the focus outline, which
   would otherwise be clipped; the negative margin keeps the text in place. */
@media (min-width: 64em) {
  .toc {
    position: sticky;
    top: 1.5rem;
    align-self: start;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    padding: 0.375rem;
    margin: -0.375rem;
  }
}

.toc details {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.25rem 1rem;
}

@media (min-width: 64em) {
  .toc details {
    border: 0;
    padding: 0;
  }
}

.toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 44px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

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

/* Disclosure chevron: points down when closed, up when open. */
.toc summary::after {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.2rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.15rem) rotate(45deg);
}

.toc details[open] > summary::after {
  transform: translateY(0.15rem) rotate(-135deg);
}

.toc ol {
  list-style: none;
  padding: 0 0 0.5rem;
  margin: 0;
}

.toc li + li {
  margin-top: 0;
}

.toc a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0.2rem 0 0.2rem 0.75rem;
  border-left: 2px solid var(--rule);
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
}

.toc a:hover {
  color: var(--accent);
  border-left-color: var(--accent);
  text-decoration: underline;
}

.doc-body {
  min-width: 0;
}

.doc-body > section {
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 1rem;
}

.doc-body > section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.doc-body p,
.doc-body > section > ul,
.doc-body > section > ol,
.doc-body h3 {
  max-width: var(--measure);
}

.doc-body h3 {
  margin-top: 1.75rem;
}

.doc-body h2 + h3 {
  margin-top: 0.5rem;
}

/* Definition lists used for study design and requirements */

.spec {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  max-width: var(--measure);
  border-top: 1px solid var(--rule);
  margin: 1.25rem 0 1.5rem;
}

.spec > div {
  display: grid;
  gap: 0.15rem 1.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 40em) {
  .spec > div {
    grid-template-columns: 10rem minmax(0, 1fr);
  }
}

.spec dt {
  font-weight: 650;
}

.spec dd {
  margin: 0;
}

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

/* The title sits outside the scrolling area, so it stays in view when a
   wide table scrolls sideways on a narrow screen. */
.table-block {
  margin: 1.5rem 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
  max-width: 100%;
}

.table-block.narrow,
.doc-body .table-block {
  max-width: var(--measure);
}

.table-block.compact {
  max-width: 26rem;
}

.doc-body .table-block p.table-title,
.table-title {
  margin: 0;
  padding: 0.8rem 1rem 0;
  font-weight: 650;
  line-height: 1.4;
}

.doc-body .table-block p.table-note,
.table-note {
  margin: 0.15rem 0 0;
  padding: 0 1rem;
  color: var(--muted);
  font-size: 0.925rem;
  line-height: 1.45;
}

/* The focus outline keeps the global 2px offset, outside the scroll box, so
   the sticky first column cannot paint over it. */
.table-scroll {
  overflow-x: auto;
  margin-top: 0.7rem;
}

/* When a table is wider than its box, a soft shade at the left or right edge
   shows that it continues sideways. The "local" layers move with the table
   and cover the shade once that end is reached. */
.table-scroll {
  background:
    linear-gradient(to right, var(--bg) 40%, transparent) left / 2.5rem 100% no-repeat local,
    linear-gradient(to left, var(--bg) 40%, transparent) right / 2.5rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--scroll-shade), transparent) left / 0.9rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--scroll-shade), transparent) right / 0.9rem 100% no-repeat scroll;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.975rem;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 0.6rem 1rem;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--rule);
}

thead th {
  background: var(--surface);
  font-weight: 650;
  vertical-align: bottom;
}

tbody th {
  font-weight: 600;
}

.num {
  text-align: right;
  white-space: nowrap;
}

thead th.num {
  white-space: normal;
}

table.model-rows tbody th:first-child,
table.model-rows tfoot th:first-child {
  white-space: nowrap;
}

tfoot td,
tfoot th {
  font-weight: 650;
  background: var(--surface);
}

@media (max-width: 40em) {
  th,
  td {
    padding: 0.5rem 0.7rem;
  }

  /* Keep the model name in view while the numbers scroll. */
  table.model-rows th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    white-space: nowrap;
    box-shadow: inset -1px 0 0 var(--rule);
  }

  table.model-rows tbody th:first-child {
    background: var(--bg);
  }

  table.model-rows thead th:first-child,
  table.model-rows tfoot th:first-child {
    background: var(--surface);
  }
}

/* Phones: tighter cells, so that most small tables fit without scrolling. */
@media (max-width: 30em) {
  th,
  td {
    padding: 0.5rem;
  }

  .bar-cell {
    width: auto;
    min-width: 3rem;
  }
}

/* ---------- Figures ---------- */

.figure {
  margin: 2rem 0;
}

.figure .frame {
  display: block;
  background: var(--figure-bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(0.5rem, 2vw, 1rem);
}

.figure a.frame:hover {
  border-color: var(--accent);
}

.figure figcaption {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: var(--muted);
  max-width: var(--measure);
}

.figure figcaption a {
  font-weight: 600;
}

.figure.narrow {
  max-width: 34rem;
}

/* The figures were flattened onto white; dimming them a little stops them
   glaring on the dark page. */
@media (prefers-color-scheme: dark) {
  .figure img.frame {
    filter: brightness(0.88);
  }
}

/* One screenshot per row, with its caption beside it on wider screens, so the
   interface text stays readable. */
.shots {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr);
  margin: 2rem 0;
}

.shots .figure {
  margin: 0;
}

.shots .frame {
  padding: 0;
  overflow: hidden;
}

@media (min-width: 48em) {
  .shots .figure {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 0 1.5rem;
    align-items: start;
  }

  .shots .figure figcaption {
    margin-top: 0;
  }
}

/* Persona origins: inline SVG drawn with the colour tokens, so it follows the
   colour scheme. Line styles (solid, dashed, dotted) and labels identify the
   circles without relying on colour. */
.venn-frame {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(0.5rem, 2vw, 1rem);
}

.venn {
  display: block;
  width: 100%;
  height: auto;
}

.venn circle {
  fill-opacity: 0.14;
  stroke-width: 2.5px;
  vector-effect: non-scaling-stroke;
}

.venn .v-llm {
  fill: var(--venn-a);
  stroke: var(--venn-a);
}

.venn .v-wcag {
  fill: var(--venn-b);
  stroke: var(--venn-b);
  stroke-dasharray: 9 5;
}

.venn .v-expert {
  fill: var(--venn-c);
  stroke: var(--venn-c);
  stroke-dasharray: 2 4;
  stroke-linecap: round;
}

.venn text {
  fill: var(--text);
  font-family: var(--font-sans);
}

.venn .v-num {
  font-size: 44px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}

.venn .v-label {
  font-size: 34px;
  font-weight: 650;
}

/* ---------- Steps and code ---------- */

.steps {
  max-width: var(--measure);
  padding-left: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  position: relative;
  padding-left: 2.75rem;
  counter-increment: step;
  min-height: 2rem;
}

.steps > li + li {
  margin-top: 0.85rem;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--text);
  background: var(--bg);
}

.code-block {
  max-width: 50rem;
  margin: 1rem 0 1.5rem;
}

.code-block.wrap-lines pre code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

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

.code-label {
  font-weight: 650;
  font-size: 0.95rem;
}

.copy-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.copy-status {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text);
}

.file-list {
  max-width: var(--measure);
}

/* ---------- Personas ---------- */

/* Shown from the first paint when JavaScript runs (the js class is set in the
   head), so the persona list below does not jump down; hidden without it. */
.explorer-controls {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  background: var(--surface);
  border-radius: var(--radius);
}

html:not(.js) .explorer-controls {
  display: none;
}

.field label,
.group-label {
  display: block;
  font-weight: 650;
  margin-bottom: 0.15rem;
}

.hint {
  color: var(--muted);
  font-size: 0.925rem;
  margin: 0 0 0.45rem;
}

input[type="search"] {
  width: 100%;
  max-width: 30rem;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

input[type="search"]::placeholder {
  color: var(--muted);
  opacity: 1;
}

.filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
}

.filter-list li + li {
  margin-top: 0;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.35rem 0.95rem;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.25;
  text-align: left;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn .count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.filter-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 650;
}

.filter-btn[aria-pressed="true"] .count {
  color: inherit;
}

.filter-btn[aria-pressed="true"]::before {
  content: "";
  flex: none;
  width: 0.7em;
  height: 0.38em;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.12em) rotate(-45deg);
}

.result-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.result-count {
  margin: 0;
  font-weight: 600;
}

/* Phones: more compact chips that still wrap (no sideways scrolling), so the
   first personas appear sooner. Targets stay well above 24 by 24 px. */
@media (max-width: 47.99em) {
  .explorer-controls {
    gap: 1rem;
  }

  .filter-list {
    gap: 0.4rem;
  }

  .filter-btn {
    min-height: 36px;
    padding: 0.2rem 0.7rem;
    font-size: 0.9rem;
    gap: 0.35rem;
  }
}

.persona-group {
  margin-bottom: 2.25rem;
}

.persona-group:last-child {
  margin-bottom: 0;
}

.persona-group h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

.persona-group h3 .group-meta {
  font-family: var(--font-sans);
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--muted);
}

.persona-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  list-style: none;
  padding: 0;
  margin: 0;
}

.persona-grid > li + li {
  margin-top: 0;
}

.persona {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1rem 1.1rem 1.05rem;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.persona h4 {
  font-family: var(--font-sans);
  font-size: 1.075rem;
  font-weight: 650;
  line-height: 1.3;
  margin: 0;
}

.persona-id {
  display: inline-block;
  min-width: 2.6rem;
  margin-right: 0.45rem;
  padding: 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  color: var(--accent-strong);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  vertical-align: 0.12em;
}

.persona p {
  margin: 0;
}

.persona-needs {
  font-size: 0.975rem;
}

.persona-needs .label,
.persona-sources .label {
  font-weight: 650;
}

.persona-sources {
  margin-top: auto !important;
  padding-top: 0.35rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.empty-state {
  padding: 1.25rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  max-width: var(--measure);
}

.venn-layout {
  display: grid;
  gap: 1.5rem 2.5rem;
  align-items: start;
}

@media (min-width: 60em) {
  .venn-layout {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }
}

.venn-layout .figure,
.venn-layout .table-block {
  margin: 0;
}

.sources-note {
  margin-top: 1.5rem;
}

.bar-cell {
  width: 30%;
  min-width: 6rem;
}

@media (min-width: 40em) {
  .cat-table tbody th {
    white-space: nowrap;
  }
}

.bar {
  display: block;
  height: 0.6rem;
  margin-top: 0.45rem;
  background: var(--accent);
  border-radius: 2px;
}

/* ---------- People (about page) ---------- */

.people {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}

.people > li + li {
  margin-top: 0;
}

.person {
  border-top: 3px solid var(--accent);
  padding-top: 1rem;
}

.person h3 {
  margin-bottom: 0.25rem;
}

.person .role {
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.person p {
  margin-bottom: 0.4rem;
}

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

/* A shade darker than tinted sections, so the footer stays distinct when the
   last section is tinted. */
.site-footer {
  background: var(--surface-2);
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  gap: 1.75rem 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  padding-block: 2.5rem 1.5rem;
}

.site-footer h2 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li + li {
  margin-top: 0.1rem;
}

.site-footer li a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

.site-footer p {
  color: var(--muted);
}

.footer-base {
  padding-block: 0 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-base p {
  margin: 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
}

.site-footer > .footer-base:only-child {
  padding-top: 1.25rem;
}

.site-footer > .footer-base:only-child p {
  padding-top: 0;
  border-top: 0;
}

/* ---------- 404 ---------- */

.notfound {
  padding-block: clamp(3rem, 10vw, 6rem);
}

/* ---------- Forced colours and print ---------- */

@media (forced-colors: active) {
  .filter-btn[aria-pressed="true"] {
    border-width: 3px;
  }

  .ranks-lines line,
  .ranks-lines line.key {
    stroke: CanvasText;
  }

  /* The bars are drawn with background, which forced colours remove. */
  .bar {
    forced-color-adjust: none;
    background: CanvasText;
  }

  .brand-mark .m-bg {
    fill: CanvasText;
  }

  .brand-mark .m-bar {
    fill: Canvas;
  }

  /* The menu icon bars are drawn with background, which forced colours
     remove. */
  .nav-toggle-icon,
  .nav-toggle-icon::before,
  .nav-toggle-icon::after {
    forced-color-adjust: none;
    background: ButtonText;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-icon {
    background: transparent;
  }

  .venn circle,
  .venn .v-llm,
  .venn .v-wcag,
  .venn .v-expert {
    fill: none;
    stroke: CanvasText;
  }

  .venn text {
    fill: CanvasText;
  }
}

@media print {
  .site-header nav,
  .nav-toggle,
  .skip-link,
  .copy-wrap,
  .toc,
  .explorer-controls {
    display: none !important;
  }

  body {
    font-size: 11pt;
  }

  a {
    color: inherit;
  }

  .doc {
    display: block;
  }
}
