/* Halyard's own stylesheet: what the ui library's does not cover — the
   code blocks the generator emits, the syntax token colours, the mono
   webfont, and the home page's hero. Everything else is a `--ui-*` token:
   themes and modes come from the library. */

/* The mono webfont the site ships (public/fonts/), self-hosted: no CDN.
   Source Code Pro, Adobe's coding face: a neutral grotesque that recedes
   behind the code, and the one face here that draws no programming
   ligatures, so `->` and `|>` are the characters they are. Subset to the
   Latin, punctuation, currency, arrow and maths ranges the site renders —
   17 KB of the 76 KB the full face weighs, and less than the 50 KB it
   replaces. Its licence travels beside it (SIL OFL 1.1). */
@font-face {
  font-family: "Source Code Pro";
  src: url("/fonts/SourceCodePro-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ui-font-mono: "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  /* The changelog's "Fixed" sections are purple in every theme (the old
     site hardcoded #a855f7); the ui palette has no purple tone. */
  --site-changelog-fixed: #a855f7;
}

/* site.js hides cards and groups with the `hidden` attribute, and the
   rules below give some of them their own `display` — which would beat
   the browser's `[hidden] { display: none }`. The ui library guards its
   own components the same way; this covers the site's. */
[hidden] { display: none !important; }

/* Code blocks ------------------------------------------------------------ */
/* Every code block on the site is `ui::primitives::code_block`, highlighted
   at build time, with its controls ("Run", "Try it") in the block's head.
   ui.css styles the component; the site only spaces it in running prose and
   drops the `<code>`'s own inline-code look inside it. */

.ui-code {
  margin: 0 0 1em;
}

.ui-code__block code {
  padding: 0;
  font: inherit;
  color: inherit;
  background: none;
}

/* Run output ------------------------------------------------------------- */
/* runner.js inserts one panel under the block it ran (Step 12); the block
   above it keeps its own bottom margin, so the two read as one unit. */

.site-run {
  margin: -0.5em 0 1em;
  padding: var(--ui-space-sm) var(--ui-space-md);
  border: 1px solid var(--ui-border);
  border-top: none;
  border-radius: 0 0 var(--ui-radius-md) var(--ui-radius-md);
  background: var(--ui-bg);
}

.site-run__head {
  display: flex;
  align-items: center;
  gap: var(--ui-space-sm);
  min-height: var(--ui-control-h-sm);
}

.site-run__status {
  font-size: var(--ui-text-xs);
  font-weight: var(--ui-control-weight);
  color: var(--ui-text-muted);
}

.site-run__cancel {
  margin-left: auto;
}

.site-run__out {
  margin: 0;
  overflow: auto;
  font-family: var(--ui-font-mono);
  font-size: var(--ui-text-sm);
  line-height: var(--ui-leading);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ui-text);
}

.site-run__out:empty {
  display: none;
}

.site-run__chart {
  margin-top: var(--ui-space-sm);
}

/* Syntax token colours ---------------------------------------------------- */
/* The values the old site's themes used, kept: they clear 4.5:1 on the
   code background in both modes (measured against the default palette's
   bg-subtle: at worst 5.3:1 in light mode, 7.7:1 in dark). */

:root {
  --site-code-keyword: #9e1c60;
  --site-code-string: #0a6b0a;
  --site-code-number: #0044cc;
  --site-code-comment: #5c6370;
  --site-code-type: #a04000;
  --site-code-operator: #383a42;
  --site-code-symbol: #7c3aed;
}

:root[data-mode="dark"] {
  --site-code-keyword: #ff79c6;
  --site-code-string: #50fa7b;
  --site-code-number: #c9a5ff;
  --site-code-comment: #d0d4dc;
  --site-code-type: #ffb86c;
  --site-code-operator: #f8f8f2;
  --site-code-symbol: #bd93f9;
}

@media (prefers-color-scheme: dark) {
  :root[data-mode="system"] {
    --site-code-keyword: #ff79c6;
    --site-code-string: #50fa7b;
    --site-code-number: #c9a5ff;
    --site-code-comment: #d0d4dc;
    --site-code-type: #ffb86c;
    --site-code-operator: #f8f8f2;
    --site-code-symbol: #bd93f9;
  }
}

.halyard-keyword {
  color: var(--site-code-keyword);
  font-weight: 500;
}
.halyard-type {
  color: var(--site-code-type);
}
.halyard-string {
  color: var(--site-code-string);
}
.halyard-number {
  color: var(--site-code-number);
}
.halyard-comment {
  color: var(--site-code-comment);
  font-style: italic;
}
.halyard-operator {
  color: var(--site-code-operator);
}
.halyard-symbol {
  color: var(--site-code-symbol);
}

/* Brand marks -------------------------------------------------------------- */

.ui-topbar__mark svg,
.ui-footer__brand svg {
  display: block;
  height: 1.25em;
  width: auto;
}

/* Home hero ---------------------------------------------------------------- */
/* The landing page's opening section (Step 9 renders it). */

.site-hero {
  display: grid;
  justify-items: center;
  gap: var(--ui-space-lg);
  padding: var(--ui-space-xxl) 0 var(--ui-space-xl);
  text-align: center;
}

.site-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  font-size: var(--ui-text-sm);
  font-weight: var(--ui-control-weight);
  color: var(--ui-accent);
  background: var(--ui-accent-muted);
  border-radius: var(--ui-badge-radius);
}

.site-hero__title {
  margin: 0;
  font-family: var(--ui-font-head);
  font-weight: var(--ui-heading-weight);
  letter-spacing: var(--ui-heading-tracking);
  font-size: calc(var(--ui-text-xl) * 1.75);
  line-height: 1.15;
  text-wrap: balance;
}

.site-hero__tagline {
  margin: 0;
  max-width: 44rem;
  font-size: var(--ui-text-lg);
  line-height: var(--ui-leading);
  color: var(--ui-text-muted);
}

.site-hero__cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--ui-space-sm);
}

.site-hero__code {
  width: 100%;
  max-width: 56rem;
  text-align: left;
}

/* Why the hero's example fails to compile. It sits above the code block, so
   the margin is on the bottom only. */
.site-hero__caption {
  margin: 0 0 var(--ui-space-sm);
  max-width: 56rem;
  text-align: left;
  font-size: var(--ui-text-sm);
  line-height: var(--ui-leading);
  color: var(--ui-text-muted);
}

/* Home sections ------------------------------------------------------------- */
/* The hero's sections are ui primitives (cards, grids, tabs, the accordion,
   the table); these are the two the library has no shape for. */

/* The comparison table's Halyard column leads (the old site's .highlight). */
.site-comparison .ui-table td:nth-child(2) {
  color: var(--ui-accent);
  font-weight: var(--ui-control-weight);
}

/* The roadmap teaser's items: a marker, a titled, badged body. */
.site-roadmap__list {
  display: grid;
  gap: var(--ui-space-lg);
  margin: 0 0 var(--ui-space-lg);
}

.site-roadmap__item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--ui-space-md);
  align-items: start;
}

.site-roadmap__marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--ui-bg-subtle);
  border: 1px solid var(--ui-border);
  color: var(--ui-text-muted);
}

.site-roadmap__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-sm);
}

.site-roadmap__header h3 {
  margin: 0;
}

.site-roadmap__body p {
  margin: 0;
  color: var(--ui-text-muted);
}

/* Project pages (Step 10) --------------------------------------------------- */
/* The examples gallery, the changelog, the roadmap, the benchmarks, the
   coverage report and the 404 page. Each page's class rides on the
   document's <main> (`ui-main <page>-page`); the content sits in a wide
   ui container. Ported from the old site's SCSS, on the ui tokens; the
   heading sizes follow the library's scale rather than the old one's. */

/* Examples gallery ---------------------------------------------------------- */

.examples-header {
  max-width: 50rem;
  margin: 0 auto var(--ui-space-lg);
  text-align: center;
}

.examples-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--ui-space-md);
  margin-bottom: var(--ui-space-xl);
}

.examples-search {
  display: flex;
  align-items: center;
  gap: var(--ui-space-sm);
  flex: 1;
  max-width: 25rem;
  padding: var(--ui-space-sm) var(--ui-space-md);
  background: var(--ui-bg-card);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  color: var(--ui-text-muted);
}

.examples-search:focus-within {
  border-color: var(--ui-accent);
  box-shadow: var(--ui-ring);
}

.examples-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  outline: none;
  font-size: var(--ui-text-base);
  color: var(--ui-text);
}

.examples-search input::placeholder {
  color: var(--ui-text-muted);
}

.examples-categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--ui-space-sm);
}

.category-btn {
  padding: var(--ui-space-sm) var(--ui-space-md);
  font-size: var(--ui-text-sm);
  font-weight: var(--ui-control-weight);
  color: var(--ui-text-muted);
  background: var(--ui-bg-card);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  cursor: pointer;
  transition: all var(--ui-transition);
}

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

.category-btn.active {
  background: var(--ui-accent);
  border-color: var(--ui-accent);
  color: var(--ui-accent-fg);
}

.examples-count {
  font-size: var(--ui-text-sm);
  color: var(--ui-text-muted);
}

.examples-content {
  margin-bottom: var(--ui-space-xl);
}

.examples-empty {
  padding: var(--ui-space-xxl);
  text-align: center;
  color: var(--ui-text-muted);
}

.examples-empty > svg {
  font-size: 2rem;
  margin-bottom: var(--ui-space-md);
  opacity: 0.5;
}

.examples-empty p {
  margin: 0 0 var(--ui-space-lg);
}

.examples-groups {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-xl);
}

.group-title {
  margin: 0 0 var(--ui-space-md);
  padding-bottom: var(--ui-space-sm);
  border-bottom: 2px solid var(--ui-border);
  font-family: var(--ui-font-head);
  font-size: var(--ui-text-lg);
  font-weight: var(--ui-heading-weight);
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: var(--ui-space-md);
}

.example-card {
  display: flex;
  flex-direction: column;
  background: var(--ui-bg-card);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: all var(--ui-transition);
}

.example-card:hover,
.example-card:focus-visible {
  border-color: var(--ui-accent);
  box-shadow: var(--ui-shadow-md);
  transform: translateY(-2px);
}

.example-card,
.example-card * {
  text-decoration: none;
}

.example-card-header {
  padding: var(--ui-space-md);
  border-bottom: 1px solid var(--ui-border);
}

.example-title {
  margin: 0 0 var(--ui-space-sm);
  font-size: var(--ui-text-base);
  font-weight: var(--ui-heading-weight);
}

.example-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-space-xs);
}

.example-card-body {
  flex: 1;
  position: relative;
  padding: var(--ui-space-md);
  background: var(--ui-bg-subtle);
}

.example-card-body .ui-code {
  margin: 0;
}

.example-more {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 3rem;
  padding-bottom: var(--ui-space-sm);
  background: linear-gradient(transparent, var(--ui-bg-subtle));
  color: var(--ui-text-muted);
  font-family: var(--ui-font-mono);
}

.example-card-footer {
  padding: var(--ui-space-sm) var(--ui-space-md);
  border-top: 1px solid var(--ui-border);
}

.example-action {
  display: flex;
  align-items: center;
  gap: var(--ui-space-sm);
  font-size: var(--ui-text-sm);
  font-weight: var(--ui-control-weight);
  color: var(--ui-accent);
}

.example-action svg {
  font-size: var(--ui-text-xs);
}

/* Changelog ----------------------------------------------------------------- */
/* The index lists every release as a row; a release page is one card with
   its categorized sections. The section colours are the old site's, on
   the ui tones (the "Fixed" purple is the site's one local token). */

.changelog-header {
  margin-bottom: var(--ui-space-lg);
  text-align: center;
}

.changelog-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--ui-space-sm);
  margin-bottom: var(--ui-space-xxl);
}

.changelog-releases {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-md);
}

.changelog-release {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-md);
  padding: var(--ui-space-md) var(--ui-space-lg);
  background: var(--ui-bg-card);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  color: inherit;
  text-decoration: none;
  transition: all var(--ui-transition);
}

.changelog-release:hover,
.changelog-release:focus-visible {
  border-color: var(--ui-accent);
  box-shadow: var(--ui-shadow-sm);
}

.changelog-release .version-number {
  color: var(--ui-accent);
  font-weight: var(--ui-heading-weight);
}

.changelog-release .version-count {
  margin-left: auto;
}

.changelog-page .ui-pager {
  margin-top: var(--ui-space-xl);
}

.changelog-version {
  padding: var(--ui-space-lg);
  background: var(--ui-bg-card);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
}

.version-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ui-space-md);
  margin-bottom: var(--ui-space-lg);
  padding-bottom: var(--ui-space-md);
  border-bottom: 1px solid var(--ui-border);
}

.version-header h2 {
  margin: 0;
  font-family: var(--ui-font-head);
  font-size: var(--ui-text-lg);
  font-weight: var(--ui-heading-weight);
}

.version-number {
  color: var(--ui-accent);
}

.version-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-md);
}

.version-date {
  display: flex;
  align-items: center;
  gap: var(--ui-space-xs);
  font-size: var(--ui-text-sm);
  color: var(--ui-text-muted);
}

.version-count {
  font-size: var(--ui-text-sm);
  font-family: var(--ui-font-mono);
  color: var(--ui-text-muted);
}

.version-link {
  display: flex;
  align-items: center;
  gap: var(--ui-space-xs);
  font-size: var(--ui-text-sm);
  color: var(--ui-accent);
}

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

.version-sections {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-lg);
}

.changelog-section-item .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-sm);
  margin-bottom: var(--ui-space-sm);
}

.changelog-section-item h4 {
  display: flex;
  align-items: center;
  gap: var(--ui-space-sm);
  margin: 0;
  font-size: var(--ui-text-base);
  font-weight: var(--ui-heading-weight);
}

.section-icon {
  font-family: var(--ui-font-mono);
  font-weight: var(--ui-heading-weight);
}

.section-count {
  font-size: var(--ui-text-xs);
  font-family: var(--ui-font-mono);
  color: var(--ui-text-muted);
}

.change-list {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

.change-list li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--ui-space-sm);
  padding-left: var(--ui-space-md);
  font-size: var(--ui-text-sm);
  line-height: var(--ui-leading);
}

.change-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--ui-text-muted);
}

.changelog-section-added .section-header h4,
.changelog-section-added .change-list li::before { color: var(--ui-success); }

.changelog-section-changed .section-header h4,
.changelog-section-changed .change-list li::before { color: var(--ui-accent); }

.changelog-section-fixed .section-header h4,
.changelog-section-fixed .change-list li::before { color: var(--site-changelog-fixed); }

.changelog-section-removed .section-header h4,
.changelog-section-removed .change-list li::before { color: var(--ui-danger); }

/* Roadmap ------------------------------------------------------------------- */

.roadmap-header {
  margin-bottom: var(--ui-space-lg);
  text-align: center;
}

.roadmap-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--ui-space-sm);
  margin-bottom: var(--ui-space-lg);
}

.roadmap-filter {
  display: flex;
  justify-content: center;
  margin-bottom: var(--ui-space-xl);
}

.filter-toggle {
  display: flex;
  align-items: center;
  gap: var(--ui-space-sm);
  font-size: var(--ui-text-sm);
  color: var(--ui-text-muted);
  cursor: pointer;
  user-select: none;
}

.filter-toggle input[type="checkbox"] {
  accent-color: var(--ui-accent);
  cursor: pointer;
}

.roadmap-content {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-xl);
}

/* The hide-completed toggle: site.js flips this class, and the generator
   marked every fully-complete phase, section and task `data-done`. */
.roadmap-content.hide-completed [data-done] {
  display: none;
}

.current-state {
  margin-bottom: var(--ui-space-xl);
  padding: var(--ui-space-md);
  background: var(--ui-bg-card);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  font-size: var(--ui-text-base);
}

.roadmap-phases {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-xxl);
}

.roadmap-phase {
  padding: var(--ui-space-lg);
  background: var(--ui-bg-card);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
}

.phase-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ui-space-md);
  margin-bottom: var(--ui-space-md);
}

.phase-header h2 {
  display: flex;
  align-items: baseline;
  gap: var(--ui-space-sm);
  margin: 0;
  font-family: var(--ui-font-head);
  font-size: var(--ui-text-lg);
  font-weight: var(--ui-heading-weight);
}

.phase-number {
  color: var(--ui-accent);
  font-size: var(--ui-text-sm);
  font-weight: var(--ui-control-weight);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.phase-progress {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: var(--ui-space-sm);
}

.progress-text {
  font-size: var(--ui-text-sm);
  color: var(--ui-text-muted);
  white-space: nowrap;
}

.progress-bar {
  overflow: hidden;
  background: var(--ui-border);
  border-radius: var(--ui-radius-full);
}

.phase-progress .progress-bar {
  width: 6.25rem;
  height: 6px;
}

.phase-sections .progress-bar {
  height: 4px;
  margin-bottom: var(--ui-space-sm);
}

.progress-fill {
  height: 100%;
  border-radius: var(--ui-radius-full);
  transition: width var(--ui-transition);
}

.phase-progress .progress-fill {
  background: var(--ui-accent);
}

.phase-sections .progress-fill {
  background: var(--ui-success);
}

.phase-goal {
  margin-bottom: var(--ui-space-lg);
  padding-bottom: var(--ui-space-md);
  border-bottom: 1px solid var(--ui-border);
  font-size: var(--ui-text-sm);
  color: var(--ui-text-muted);
}

.phase-sections {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-lg);
}

.roadmap-section-item .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-sm);
  margin-bottom: var(--ui-space-sm);
}

.roadmap-section-item h4 {
  display: flex;
  align-items: baseline;
  gap: var(--ui-space-sm);
  margin: 0;
  font-size: var(--ui-text-base);
  font-weight: var(--ui-heading-weight);
}

.section-number {
  font-family: var(--ui-font-mono);
  font-size: var(--ui-text-sm);
  color: var(--ui-text-muted);
}

.section-progress {
  font-size: var(--ui-text-xs);
  font-family: var(--ui-font-mono);
  color: var(--ui-text-muted);
  white-space: nowrap;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A task is a checkbox and its text side by side, with its subtasks
   spanning both columns below — the old site's flex row laid the subtasks
   beside the text. */
.task-list .task {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  column-gap: var(--ui-space-sm);
  row-gap: var(--ui-space-xs);
  font-size: var(--ui-text-sm);
  line-height: var(--ui-leading);
}

.task-list .task .subtasks {
  grid-column: 1 / -1;
}

.task-checkbox {
  font-family: var(--ui-font-mono);
  color: var(--ui-text-muted);
}

.task-text {
  color: var(--ui-text);
}

.task.completed .task-text {
  color: var(--ui-text-muted);
  text-decoration: line-through;
}

.subtasks {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-xs);
  margin: 0;
  padding: 0 0 0 var(--ui-space-lg);
  list-style: none;
}

.subtasks .task {
  font-size: var(--ui-text-xs);
}

.priority-section {
  margin-top: var(--ui-space-xl);
  padding: var(--ui-space-lg);
  background: var(--ui-bg-card);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
}

.priority-section h2 {
  margin: 0 0 var(--ui-space-md);
  font-family: var(--ui-font-head);
  font-size: var(--ui-text-lg);
  font-weight: var(--ui-heading-weight);
}

.priority-list {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-sm);
  margin: 0;
  padding-left: var(--ui-space-lg);
}

.priority-list li {
  font-size: var(--ui-text-sm);
  line-height: var(--ui-leading);
}

.priority-list li::marker {
  color: var(--ui-accent);
  font-weight: var(--ui-heading-weight);
}

/* Benchmarks ---------------------------------------------------------------- */

.benchmarks-header {
  margin-bottom: var(--ui-space-md);
  text-align: center;
}

.benchmarks-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--ui-space-md);
  margin-bottom: var(--ui-space-xxl);
}

.benchmarks-meta {
  margin-bottom: var(--ui-space-lg);
  padding: var(--ui-space-lg);
  background: var(--ui-bg-card);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15.625rem, 100%), 1fr));
  gap: var(--ui-space-md);
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.meta-item strong {
  font-size: var(--ui-text-sm);
  font-weight: var(--ui-control-weight);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ui-text-muted);
}

.meta-item span {
  font-family: var(--ui-font-mono);
  font-size: var(--ui-text-base);
}

.benchmarks-error {
  padding: var(--ui-space-xxl);
  text-align: center;
  color: var(--ui-danger);
}

/* Coverage ------------------------------------------------------------------ */

.coverage-header {
  margin-bottom: var(--ui-space-lg);
  text-align: center;
}

.coverage-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--ui-space-sm);
  margin-bottom: var(--ui-space-xxl);
}

.coverage-content {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-xl);
}

.coverage-overview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ui-space-lg);
  padding: var(--ui-space-lg);
  background: var(--ui-bg-card);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
}

@media (min-width: 48em) {
  .coverage-overview {
    flex-direction: row;
    justify-content: space-around;
  }
}

.coverage-score {
  text-align: center;
}

.score-value {
  display: block;
  font-family: var(--ui-font-head);
  font-size: calc(var(--ui-text-xl) * 1.85);
  font-weight: var(--ui-heading-weight);
  line-height: 1;
}

.score-label {
  display: block;
  margin-top: var(--ui-space-sm);
  font-size: var(--ui-text-sm);
  color: var(--ui-text-muted);
}

.coverage-high .score-value { color: var(--ui-success); }
.coverage-medium .score-value { color: var(--ui-warning); }
.coverage-low .score-value { color: var(--ui-danger); }

.coverage-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--ui-space-xl);
}

.coverage-files {
  padding: var(--ui-space-lg);
  overflow-x: auto;
  background: var(--ui-bg-card);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
}

.coverage-files h2 {
  margin: 0 0 var(--ui-space-md);
  font-family: var(--ui-font-head);
  font-size: var(--ui-text-lg);
  font-weight: var(--ui-heading-weight);
}

.coverage-bar {
  height: 8px;
  overflow: hidden;
  background: var(--ui-border);
  border-radius: var(--ui-radius-full);
}

.coverage-fill {
  height: 100%;
  border-radius: var(--ui-radius-full);
  transition: width var(--ui-transition);
}

.coverage-fill.coverage-high { background: var(--ui-success); }
.coverage-fill.coverage-medium { background: var(--ui-warning); }
.coverage-fill.coverage-low { background: var(--ui-danger); }

.coverage-error {
  padding: var(--ui-space-xxl);
  text-align: center;
  color: var(--ui-danger);
}

/* 404 ----------------------------------------------------------------------- */
/* The site layout stretches <main> between the bar and the footer, so the
   error content centers in what is left. */

.error-page {
  display: grid;
  place-items: center;
}

.error-content {
  max-width: 30rem;
  text-align: center;
}

.error-content h1 {
  margin: 0 0 var(--ui-space-md);
  font-family: var(--ui-font-head);
  font-size: calc(var(--ui-text-xl) * 1.85);
  font-weight: var(--ui-heading-weight);
  color: var(--ui-text-muted);
}

.error-content p {
  margin: 0 0 var(--ui-space-xl);
  font-size: var(--ui-text-lg);
  color: var(--ui-text-muted);
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--ui-space-md);
}

/* Playground -------------------------------------------------------------- */
/* The one page whose content is the client (Step 13): a toolbar, the editor
   and the output panel side by side with a divider between them, and the
   three dialogs `ui` draws. `--pg-split` is the editor's share of the row,
   which the divider sets; `--pg-font-size` the editor's type size, which the
   settings dialog sets. */

.playground {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-sm);
  /* The window, minus the topbar and the footer: the editor fills it. */
  min-height: calc(100vh - 12rem);
  padding: var(--ui-space-md) var(--ui-space-lg);
}

.playground-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-sm);
}

.playground-toolbar__left,
.playground-toolbar__right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-xs);
}

.playground-toolbar__right {
  margin-left: auto;
}

.playground-status {
  font-size: var(--ui-text-sm);
  color: var(--ui-text-muted);
}

.playground-nojs {
  margin: 0;
  padding: var(--ui-space-sm) var(--ui-space-md);
  font-size: var(--ui-text-sm);
  color: var(--ui-text-muted);
  background: var(--ui-bg-subtle);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
}

.playground-main {
  --pg-split: 50%;
  display: flex;
  flex: 1;
  min-height: 24rem;
  gap: 0;
}

.playground-editor {
  display: flex;
  flex-direction: column;
  flex: 0 0 var(--pg-split);
  min-width: 0;
}

.playground-editor__host,
.playground-editor__source {
  --pg-font-size: 0.875rem;
  flex: 1;
  min-height: 24rem;
  font-family: var(--ui-font-mono);
  font-size: var(--pg-font-size);
  line-height: var(--ui-leading);
  tab-size: 4;
}

.playground-editor__host .cm-editor {
  height: 100%;
  background: var(--ui-bg-subtle);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
}

.playground-editor__host .cm-editor.cm-focused {
  outline: none;
  box-shadow: var(--ui-ring);
}

.playground-editor__host .cm-scroller {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.playground-editor__source {
  width: 100%;
  padding: var(--ui-space-md);
  color: var(--ui-text);
  background: var(--ui-bg-subtle);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  resize: vertical;
}

/* The divider is a real control: it drags, and it moves with the arrow
   keys for anyone who cannot (WCAG 2.1.1). */
.playground-divider {
  flex: 0 0 0.75rem;
  align-self: stretch;
  cursor: col-resize;
  background:
    linear-gradient(var(--ui-border), var(--ui-border)) center / 1px 100% no-repeat;
}

.playground-divider:focus-visible {
  outline: none;
  box-shadow: var(--ui-ring);
}

.playground-output {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

/* The debug hosts carry the same scroll rules as the two ui panels, because they are
   siblings inside the same flex column and a host without them gets no scroll
   container — which the AST dump needs. Listed here rather than given their own block
   so the four panes cannot drift apart. */
.playground-out,
.playground-chart,
.playground-debug__host {
  flex: 1;
  margin: 0;
  min-height: 12rem;
  max-height: 70vh;
  overflow: auto;
  padding: var(--ui-space-md);
  font-family: var(--ui-font-mono);
  font-size: var(--ui-text-sm);
  line-height: var(--ui-leading);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ui-text);
  background: var(--ui-bg-subtle);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
}

.playground-chart {
  white-space: normal;
}

/* The two playground-owned debug panes (plan halyard-web/004). The wrapper is a flex
   column so a shown host fills the space ui's panels leave when their root is hidden. */
.playground-debug {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: var(--ui-space-sm);
}

.playground-debug__controls {
  display: flex;
  gap: var(--ui-space-sm);
}

.playground-debug__toggle {
  padding: var(--ui-space-xs) var(--ui-space-sm);
  font: inherit;
  font-size: var(--ui-text-sm);
  color: var(--ui-text-muted);
  background: transparent;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  cursor: pointer;
}

.playground-debug__toggle:hover {
  color: var(--ui-text);
  background: var(--ui-bg-subtle);
}

.playground-debug__toggle[aria-pressed="true"] {
  color: var(--ui-text);
  background: var(--ui-bg-subtle);
  border-color: var(--ui-accent);
}

/* The guide's "Compiled" disclosure (plan halyard-web/004, Step 6). The stylesheet
   carried no details or summary rule before this, so these add styling rather than
   override any. */
.site-compiled {
  margin: var(--ui-space-sm) 0 0;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  background: var(--ui-bg-subtle);
}

.site-compiled > summary {
  padding: var(--ui-space-xs) var(--ui-space-sm);
  font-size: var(--ui-text-sm);
  color: var(--ui-text-muted);
  cursor: pointer;
}

.site-compiled > summary:hover {
  color: var(--ui-text);
}

.site-compiled__out {
  margin: 0;
  max-height: 24rem;
  overflow: auto;
  padding: var(--ui-space-sm);
  border-top: 1px solid var(--ui-border);
  font-family: var(--ui-font-mono);
  font-size: var(--ui-text-sm);
  line-height: var(--ui-leading);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ui-text);
}

.playground-hint {
  margin: 0;
  font-size: var(--ui-text-xs);
  color: var(--ui-text-muted);
}

.playground-history {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.playground-history__item .ui-btn {
  width: 100%;
  justify-content: flex-start;
  font-family: var(--ui-font-mono);
  text-align: left;
}

/* Narrow screens: the editor and the output stack, and the divider has
   nothing to divide. */
@media (max-width: 48rem) {
  .playground-main {
    flex-direction: column;
  }
  .playground-editor {
    flex: 1 1 auto;
  }
  .playground-divider {
    display: none;
  }
}

/* The mode toggle's segments are BUTTONS, and the library's segmented
   control is written for links: its `.ui-segmented__item` sets colour,
   size and radius but never `background`, `border` or `appearance`,
   because an `<a>` has none. A `<button>` does — the user agent's own
   grey face and bevelled border — and it painted them over the segment
   track, which is why the toggle looked like a 1990s dialog. The reset
   belongs with the markup that needs it, which is this site's. */
.ui-segmented button.ui-segmented__item {
  appearance: none;
  background: none;
  border: 0;
  margin: 0;
  font-family: inherit;
  cursor: pointer;
}

/* The library paints the selected segment from a class; the toggle marks
   it with `aria-pressed`, which `site.js` maintains. Keyed off the state
   that is actually there, so one segment reads as chosen. */
.ui-segmented button.ui-segmented__item[aria-pressed="true"] {
  color: var(--ui-text);
  background: var(--ui-bg-card);
  box-shadow: var(--ui-shadow-sm);
}

/* Code shows the characters you type.
   The face this replaces carried programming ligatures, so the docs
   rendered `->` as a single arrow glyph, `|>` as a triangle, `>=` as one
   sign and `!=` as another. On a page that teaches the language that is a
   defect: the reader is shown a glyph that is not on their keyboard, and
   `|>` disguised as a triangle reads as an operator halyard does not have.
   Source Code Pro draws none, and this keeps it that way whatever the face
   becomes — including the fallbacks, which a reader without the webfont
   gets. Prose keeps its own ligatures, which is why this is not on the
   root. */
pre,
code,
kbd,
.site-run__out,
.playground-editor__source,
.playground-editor__host .cm-editor {
  font-variant-ligatures: none;
}
