@font-face {
  font-family: "Plex Sans";
  src: url("fonts/ibm-plex-sans.woff2") format("woff2");
  font-weight: 100 700;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/ibm-plex-mono.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* The Lycan look, which is fiend's: warm stock ruled in ink, square sheets headed by ink strips, the chosen thing a block of the
   accent, a hard short shadow. Every colour, shape and shadow on the site is one of these tokens. */
:root {
  color-scheme: light;

  /* The palette: fiend-light by day and fiend-dark at dusk */
  --background: light-dark(#d6caab, #342e28);
  --surface: light-dark(#e4d9bd, #423931);
  --text: light-dark(#493f33, #ecdfc3);
  --muted: light-dark(#635746, #c9bb9f);
  --accent: light-dark(#9c4d26, #924b2b);
  --on-accent: light-dark(#f3eacf, #efe3c8);
  --error: light-dark(#9f3829, #8e3a2e);
  --warning: light-dark(#7c560b, #7a5a1c);
  --success: light-dark(#4f6325, #536329);
  --info: light-dark(#2a6460, #2e625d);

  /* Worked out from the palette by fiend's rules: a sheet laid on a sheet is lighter by day and a shade toward the ink at dusk */
  --raised: light-dark(color-mix(in srgb, var(--surface), #faf7e8 40%), color-mix(in srgb, var(--surface), var(--text) 5%));
  --raised-high: light-dark(color-mix(in srgb, var(--surface), #faf7e8 70%), color-mix(in srgb, var(--surface), var(--text) 9%));
  --outline: color-mix(in srgb, var(--surface), var(--text) 24%);
  --frame: color-mix(in srgb, var(--surface), var(--text) 50%);
  --hover: color-mix(in srgb, var(--text) 8%, transparent);
  --pressed: color-mix(in srgb, var(--text) 16%, transparent);
  --grid: light-dark(color-mix(in srgb, var(--text) 12%, transparent), color-mix(in srgb, var(--text) 10%, transparent));
  --shadow: light-dark(color-mix(in srgb, var(--text) 28%, transparent), #100c0878);
  --strip: var(--text);
  --on-strip: var(--surface);
  /* A filled control under the pointer; at dusk it deepens, as lightening it toward the ink would lose its words */
  --accent-lit: light-dark(color-mix(in srgb, var(--accent), var(--text) 10%), color-mix(in srgb, var(--accent), var(--background) 20%));

  /* The accent as ink on the sheets, found by fiend's `ink` rule to read at 4.5 to 1 on them and on what is raised on them, and the
     strip's marker, found by its `reach` rule to read at 3 to 1 on the ink; the strip's quieter words and veils are its ink faded */
  --accent-ink: light-dark(#974921, #e1ad97);
  --strip-mark: light-dark(#b88562, var(--accent));
  --on-strip-quiet: color-mix(in srgb, var(--on-strip) 70%, transparent);
  --strip-hover: color-mix(in srgb, var(--on-strip) 8%, transparent);
  --strip-pressed: color-mix(in srgb, var(--on-strip) 16%, transparent);
  --selection: color-mix(in srgb, var(--accent) 28%, transparent);
  --focus: var(--accent-ink);

  /* Code's inks, as arcus works them out from these palettes in its theme.lyc (`look`, `bracket-inks`): each reads at 4.5 to 1 on the
     code's ground and under the form around the caret. Most code is the ink; brackets take six levels by depth, in two lightness tiers. */
  --code-quiet: light-dark(#5e5549, #bdb6a7);
  --code-accent: light-dark(#783e22, #f1ac90);
  --code-warning: light-dark(#684a13, #daba83);
  --code-success: light-dark(#465723, #b5c88e);
  --code-info: light-dark(#0f5c58, #89cec6);
  --attribute: light-dark(#375e5b, #97c1bc);
  --paren-0: light-dark(#463d30, #dbd3c2);
  --paren-1: light-dark(#7d462d, #e7a78c);
  --paren-2: light-dark(#084945, #a7e1da);
  --paren-3: light-dark(#715015, #d4b177);
  --paren-4: light-dark(#37441f, #ccdbaf);
  --paren-5: light-dark(#7f4339, #eaa598);
  /* Arcus's veil over the form the caret is in */
  --form-around: color-mix(in srgb, var(--info) 12%, transparent);

  /* Shape: square corners, hair rules, a small square marker, the one shadow everything casts and a control's shorter one */
  --rule: 1px;
  --marker: .375rem;
  --strip-height: 1.875rem;
  --lift: 2px;
  --sheet-shadow: 4px 4px 0 var(--shadow);
  --lift-shadow: var(--lift) var(--lift) 0 var(--frame);
  /* A mask drawn in a token's colour: the paper's grid of dots with a cross at every fourth */
  --paper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cpath d='M12 12h1v1h-1zM12 36h1v1h-1zM12 60h1v1h-1zM12 84h1v1h-1zM36 12h1v1h-1zM36 60h1v1h-1zM36 84h1v1h-1zM60 12h1v1h-1zM60 36h1v1h-1zM60 60h1v1h-1zM60 84h1v1h-1zM84 12h1v1h-1zM84 36h1v1h-1zM84 60h1v1h-1zM84 84h1v1h-1zM33 36h7v1h-7zM36 33h1v7h-1z'/%3E%3C/svg%3E");

  /* Type: IBM Plex Sans for everything, its capitals tracked a tenth of an em, and IBM Plex Mono for code a step below the text beside it */
  --sans: "Plex Sans", Arial, sans-serif;
  --mono: "Plex Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --code-size: .85em;
  --caps-size: .75rem;
  --caps-tracking: .1em;
}

/* The reader's preference chooses day or dusk, and the switch turns the page to the other */
:root:has(#theme-toggle:checked) { color-scheme: dark; }
.theme-name-day { display: none; }
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; }
  :root:has(#theme-toggle:checked) { color-scheme: light; }
  .theme-name-dusk { display: none; }
  .theme-name-day { display: inline; }
}

* { box-sizing: border-box; }
html { font-size: clamp(1rem, calc(.875rem + .25vw), 1.25rem); scroll-padding-top: 2rem; scrollbar-color: var(--frame) var(--raised); }
body { margin: 0; background: var(--surface); color: var(--text); font: 1.125rem/1.65 var(--sans); font-variant-numeric: tabular-nums; }
::selection { background: var(--selection); color: var(--text); }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-ink); }
a, button, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { font-family: var(--sans); font-weight: 500; line-height: 1.15; text-wrap: balance; }
h2 { font-size: clamp(2rem, 2.8vw, 2.75rem); letter-spacing: -.025em; }
h3 { font-size: 1.6rem; }
code { font-family: var(--mono); font-size: var(--code-size); font-variant-ligatures: none; }
p > code { padding: 0 .25em; background: var(--raised-high); overflow-wrap: anywhere; }
pre { scrollbar-width: thin; }
.container { width: min(80rem, calc(100% - 7rem)); margin-inline: auto; }

/* Small capitals: labels, headings of sections, the strips' titles, the bar's items */
.eyebrow, .brand, .header-inner nav a, .header-note, .theme-toggle, figcaption, .output-label, th, .section-number, .next-page small,
.reading-list > a span:first-child, .footer-links a, .development-label, .notice-title {
  font: 500 var(--caps-size)/1.6 var(--sans);
  letter-spacing: var(--caps-tracking);
  text-transform: uppercase;
}

/* The square that heads a sheet's strip and marks the chosen row */
.marker, .ownership-diagram > .eyebrow::before, .notice-title::before {
  content: "";
  flex: none;
  display: inline-block;
  width: var(--marker);
  height: var(--marker);
  background: var(--accent-ink);
}
.eyebrow { color: var(--text); }

/* A sheet is headed by an ink strip: a marker and its title, with its controls at the end as a window's are */
.strip, figcaption {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: var(--strip-height);
  padding: 0 .6rem;
  background: var(--strip);
  color: var(--on-strip);
}
figcaption .marker { background: var(--strip-mark); }
.window-title { display: flex; flex: 1; min-width: 0; gap: .6rem; align-items: center; }

.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 10; background: var(--strip); color: var(--on-strip); padding: .7rem 1rem; }
.skip-link:focus { top: 1rem; }

/* The bar, parted from the page by space alone */
.site-header { background: var(--surface); }
.header-inner { min-height: 3.75rem; display: flex; align-items: stretch; gap: 2.5rem; }
.brand { display: flex; align-items: center; gap: .65em; font-size: 1rem; text-decoration: none; }
.brand:hover { color: inherit; }
.brand-mark { flex: none; width: 1.25em; height: 1.25em; }
.header-inner nav { display: flex; align-items: stretch; gap: 0; }
.header-inner nav a { display: flex; align-items: center; gap: .55rem; padding-inline: .9rem; text-decoration: none; }
.header-inner nav a:hover { color: inherit; background: var(--hover); }
.header-inner nav a:active { background: var(--pressed); }
.header-inner nav a[aria-current] { background: var(--accent); color: var(--on-accent); }
.header-inner nav a[aria-current]:hover { background: var(--accent-lit); }
.header-inner nav a[aria-current]::before { content: ""; width: var(--marker); height: var(--marker); background: currentColor; }
.header-tools { display: flex; align-items: center; gap: 1.6rem; margin-left: auto; }
.header-note { color: var(--text); white-space: nowrap; text-decoration: none; }
.header-note:hover { color: var(--accent-ink); text-decoration: underline; }

/* The switch: square, its knob at the end and its track in the colour of what is on while it is on; the pointer inks its frame */
.theme-toggle { display: inline-flex; position: relative; align-items: center; gap: .6rem; min-height: 2.75rem; color: var(--text); cursor: pointer; user-select: none; }
.theme-toggle input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.theme-track { display: flex; flex: none; align-items: center; width: 2.5rem; height: 1.375rem; padding: 3px; border: var(--rule) solid var(--frame); background: var(--raised-high); }
.theme-track::before { content: ""; width: 1rem; height: 1rem; background: var(--muted); }
.theme-toggle:hover .theme-track { border-color: var(--text); }
.theme-toggle input:checked + .theme-track { justify-content: flex-end; background: var(--success); }
.theme-toggle input:checked + .theme-track::before { background: var(--on-accent); }
.theme-toggle input:focus-visible + .theme-track { outline: 2px solid var(--focus); outline-offset: 3px; }

/* The opening: the paper's grid behind it, the name in tracked capitals, and the REPL as the window in focus */
.hero { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 4rem; align-items: center; padding-block: 3.5rem 5.5rem; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--grid); mask: var(--paper) 0 0 / 96px 96px; pointer-events: none; }
.wordmark { font: 500 clamp(4.25rem, 8.2vw, 7.25rem)/1.05 var(--sans); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 1.4rem; }
.hero-description { font: 500 clamp(1.4rem, 2vw, 1.9rem)/1.35 var(--sans); letter-spacing: -.02em; text-wrap: balance; }
.hero-intro { max-width: 28rem; margin-top: 1.3rem; color: var(--muted); }
.hero-links { display: flex; flex-wrap: wrap; align-items: center; gap: 1.6rem; margin-top: 1.9rem; }
.button { display: inline-flex; justify-content: space-between; align-items: center; gap: 1.6rem; background: var(--accent); border: var(--rule) solid var(--frame); box-shadow: var(--lift-shadow); color: var(--on-accent); padding: .7rem 1.1rem; font: 500 .9375rem/1.5 var(--sans); text-decoration: none; }
.button:hover { color: var(--on-accent); background: var(--accent-lit); }
.button:active { transform: translate(var(--lift), var(--lift)); box-shadow: none; }
.button span { font-size: 1.2rem; line-height: 1; }
.text-link { font: 500 .9375rem/1.8 var(--sans); color: var(--accent-ink); text-decoration: underline; }
.text-link:hover { color: var(--text); }
.development-label { display: inline-block; margin-top: 1.6rem; color: var(--muted); text-decoration: none; }
.development-label:hover { color: var(--text); text-decoration: underline; }
.hero-terminal { min-width: 0; color-scheme: dark; border: var(--rule) solid var(--accent); background: var(--background); color: var(--text); box-shadow: var(--sheet-shadow); overflow: hidden; }
.terminal-welcome { padding: 1.6rem 1.7rem 1.2rem; }
.mascot { display: block; position: relative; width: min(100%, 20rem); margin-inline: auto; color: var(--text); cursor: pointer; }
.mascot input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.mascot svg { display: block; width: 100%; height: auto; }
.mascot input:focus-visible + svg { outline: 2px solid var(--focus); outline-offset: 5px; }
.mascot .mouth-dot { transition: transform .18s ease; }
.mascot input:checked + svg .mouth-dot { transform: translateY(var(--smile-y)); }
.session-code { margin: 0 1.7rem; padding: 24px 0; border-top: var(--rule) solid var(--outline); overflow-x: auto; }
.session-code, .code-example pre, .reload-repl pre { font: 400 var(--code-size)/1.5 var(--mono); font-variant-ligatures: none; }
.session-code code { font: inherit; white-space: pre; }
.prompt, .repl-prompt { color: var(--accent-ink); }
.continuation { color: var(--muted); }
.session-result, .repl-result { color: var(--muted); }
.terminal-cursor { color: var(--text); }

/* Sections and their sheets */
.section { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 5rem; align-items: center; padding-block: 5rem; }
.section-copy > .eyebrow { margin-bottom: 1.1rem; }
.section-copy h2 { margin-bottom: 1.4rem; }
.section-copy p:not(.eyebrow) { margin-bottom: 1rem; max-width: 30rem; }
.section-copy > a { display: inline-block; margin-top: .7rem; }
.code-example { min-width: 0; border: var(--rule) solid var(--frame); background: var(--raised); box-shadow: var(--sheet-shadow); overflow: hidden; }
.code-example figcaption a { flex: none; color: inherit; text-decoration: none; }
.code-example figcaption a:hover { color: inherit; text-decoration: underline; }
.code-example pre { margin: 0; padding: 24px; overflow-x: auto; tab-size: 2; }
.code-example pre code { font: inherit; white-space: pre; }
.code-output code { white-space: pre; }
.code-output { display: flex; align-items: baseline; gap: 1rem; padding: .8rem 1.2rem; border-top: var(--rule) solid var(--outline); overflow-x: auto; background: var(--raised-high); }
.output-label { color: var(--muted); }
/* Each class is the arcus face of that name and takes the ink arcus gives it; a field in brackets reads as the keyword that names it */
.syntax-keyword, .syntax-operator { color: var(--code-accent); }
.syntax-type { color: var(--code-info); }
.syntax-string { color: var(--code-success); }
.syntax-number, .syntax-constant { color: var(--code-warning); }
.syntax-comment { color: var(--code-quiet); }
.syntax-attribute, .syntax-field { color: var(--attribute); }
.syntax-paren-0 { color: var(--paren-0); }
.syntax-paren-1 { color: var(--paren-1); }
.syntax-paren-2 { color: var(--paren-2); }
.syntax-paren-3 { color: var(--paren-3); }
.syntax-paren-4 { color: var(--paren-4); }
.syntax-paren-5 { color: var(--paren-5); }
.dark-section, .toolbox-section, .development-section { background: var(--raised); border-block: var(--rule) solid var(--outline); }
.ownership-diagram { border: var(--rule) solid var(--frame); background: var(--raised); box-shadow: var(--sheet-shadow); }
.ownership-diagram > .eyebrow { display: flex; align-items: center; gap: .6rem; min-height: var(--strip-height); padding: 0 .6rem; background: var(--strip); color: var(--on-strip); }
.ownership-diagram > .eyebrow::before { background: var(--strip-mark); }
.ownership-diagram dl { padding: .4rem 1.5rem 0; }
.ownership-diagram dl > div { display: grid; grid-template-columns: 10rem 1fr; align-items: baseline; border-bottom: var(--rule) solid var(--outline); padding-block: .7rem; }
.ownership-diagram dl > div:last-child { border: 0; }
.ownership-diagram dt, .ownership-diagram dd { font-size: 1.0625rem; }
.small-note { padding: .9rem 1.5rem 1.2rem; border-top: var(--rule) solid var(--outline); color: var(--muted); font-size: .9375rem; }
.toolbox-list > div + div { margin-top: 1.2rem; }
.toolbox-list dt { font-weight: 500; margin-bottom: .25rem; }
.toolbox-list dd { color: var(--muted); }
.applications-section { padding-block: 5rem; }
.applications-intro, .library-intro { max-width: 46rem; margin-bottom: 2.5rem; }
.applications-intro p:not(.eyebrow), .library-intro p:not(.eyebrow) { max-width: none; }
.showcase { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.showcase-source { min-width: 0; }
.demo-note { margin-top: 1.4rem; color: var(--muted); font-size: .875rem; }
.scene-preview { min-width: 0; border: var(--rule) solid var(--frame); overflow: hidden; background: var(--raised); box-shadow: var(--sheet-shadow); }
.scene-preview video { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; background: var(--background); }
.reload-showcase { align-items: stretch; }
.reload-source { display: flex; flex-direction: column; min-height: 0; }
.reload-source pre { flex: 1; min-height: 0; contain: size; padding: 12px 16px; overflow: auto; overscroll-behavior: contain; }
.reload-source pre code { display: block; width: max-content; min-width: 100%; }
.reload-function { display: inline-block; min-width: 100%; margin-inline: -16px; padding-inline: 16px; vertical-align: top; background: var(--form-around); box-shadow: inset 3px 0 var(--accent); }
.reload-session { min-width: 0; border: var(--rule) solid var(--frame); overflow: hidden; background: var(--raised); box-shadow: var(--sheet-shadow); }
.reload-session .scene-preview { border: 0; box-shadow: none; }
.reload-restart { display: inline-flex; flex: none; align-items: center; gap: .4rem; height: 1.4rem; padding: 0 .5rem; border: var(--rule) solid var(--on-strip-quiet); background: none; color: inherit; font: 500 var(--caps-size)/1 var(--sans); letter-spacing: var(--caps-tracking); text-transform: uppercase; cursor: pointer; }
.reload-restart:hover { background: var(--strip-hover); }
.reload-restart:active { background: var(--strip-pressed); }
.reload-restart:disabled { opacity: .5; cursor: default; }
.reload-edit-cues { display: inline; }
.reload-edit-cues .reload-frame[aria-hidden="true"] { display: none; }
.reload-frames { display: grid; grid-template-columns: minmax(0, 1fr); overflow-x: auto; }
.reload-frame { grid-area: 1 / 1; min-width: 0; }
/* REPL cues share a stable row height throughout playback. */
.reload-frame[aria-hidden="true"] { visibility: hidden; pointer-events: none; }
.reload-repl { color-scheme: dark; border-top: var(--rule) solid var(--outline); background: var(--background); color: var(--text); }
.reload-repl figcaption { min-height: 0; padding: 10px 16px 0; background: none; color: var(--muted); }
.reload-repl pre { margin: 0; padding: 4px 16px 12px; overflow-x: auto; tab-size: 2; }
.reload-repl code { font: inherit; white-space: pre; }
.reload-edit { color: var(--code-warning); }
.reload-edit.selected { color: var(--text); background: var(--selection); }
.demo-caret { display: inline-block; position: relative; width: 0; height: 1em; vertical-align: -.15em; }
.demo-caret::after { content: ""; position: absolute; left: 0; top: 0; height: 100%; border-left: var(--rule) solid var(--text); }
.reload-showcase[data-cursor="off"] .demo-caret::after { visibility: hidden; }
/* The pane being worked in is the window in focus: its ink strip keeps its rust marker and its frame turns rust */
.reload-source:has(.reload-frame[aria-hidden="false"] .demo-caret),
.reload-showcase:not(:has(.reload-source .reload-frame[aria-hidden="false"] .demo-caret)) .reload-session { border-color: var(--accent); }
.reload-repl:has(.reload-frame[aria-hidden="false"] .demo-caret) figcaption { color: var(--accent-ink); }
.library-section { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 4rem; align-items: start; padding-block: 5rem; }
.library-intro { margin-bottom: 0; }
.library-list { border-top: var(--rule) solid var(--outline); }
.library-list > div { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 1.5rem; padding-block: 1.3rem; border-bottom: var(--rule) solid var(--outline); }
.library-list dt { font-size: 1.1rem; font-weight: 500; }
.library-list dd { color: var(--muted); font-size: 1rem; }
.development-inner { display: grid; grid-template-columns: 1.2fr .8fr; gap: 7rem; padding-block: 4rem; }
.development-inner h2 { margin-block: 1rem 1.3rem; }
.development-inner p:not(.eyebrow) { margin-top: 1rem; }
.development-inner a { color: var(--accent-ink); }
.development-inner a:hover { color: var(--text); }
.reading-list { padding-top: .5rem; }
.reading-list > p { margin-bottom: 1.2rem; }
.reading-list > a { display: flex; gap: 1.2rem; align-items: baseline; border-top: var(--rule) solid var(--outline); padding: 1.1rem .6rem; text-decoration: none; color: var(--text); }
.reading-list > a:last-child { border-bottom: var(--rule) solid var(--outline); }
.reading-list > a span:first-child { color: var(--muted); }
.reading-list strong { font: 500 1.3rem var(--sans); }
.reading-list > a span:last-child { margin-left: auto; }
.reading-list > a:hover { color: var(--text); background: var(--hover); }
.reading-list > a:hover span:first-child { color: var(--text); }
.reading-list > a:active { background: var(--pressed); }
.inspirations-section { padding-block: 3rem; color: var(--muted); }
.inspirations-section a { color: var(--accent-ink); }
.inspirations-section a:hover { color: var(--text); }

.site-footer { padding-block: 2.7rem; }
.footer-inner { display: flex; gap: 2.2rem; align-items: center; }
.footer-brand { font-size: 1.125rem; }
.footer-inner p { font-size: .875rem; margin-top: .6rem; color: var(--muted); }
.footer-links { display: flex; gap: 1.5rem; margin-left: auto; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--accent-ink); text-decoration: underline; }
.footer-inner .footer-note { margin-top: 0; }
.footer-note > span { color: var(--accent-ink); }

/* Pages of reading: a list of rows beside the article, the chosen one a block of the accent with its marker */
.notes-layout, .tour-layout { display: grid; grid-template-columns: 14rem minmax(0, 48rem); gap: 5rem; padding-block: 4rem 6rem; justify-content: space-between; }
.notes-sidebar { align-self: start; position: sticky; top: 2rem; padding-top: .5rem; }
.notes-sidebar > .eyebrow { margin-bottom: 1.2rem; }
.notes-sidebar nav { display: grid; gap: .2rem; }
.notes-sidebar nav a { display: flex; align-items: center; gap: .6rem; font: 500 .9375rem/1.6 var(--sans); padding: .5rem .65rem; margin-inline: -.65rem; text-decoration: none; }
.notes-sidebar nav a::before { content: ""; flex: none; width: var(--marker); height: var(--marker); }
.notes-sidebar nav a:hover { color: inherit; background: var(--hover); }
.notes-sidebar nav a[aria-current]::before { background: currentColor; }
.notes-sidebar nav a:active { background: var(--pressed); }
.notes-sidebar nav a[aria-current] { color: var(--on-accent); background: var(--accent); }
.notes-sidebar nav a[aria-current]:hover { background: var(--accent-lit); }
.sidebar-tour { display: inline-block; margin-top: 1.5rem; font: 500 .9375rem/1.6 var(--sans); color: var(--accent-ink); }
.sidebar-tour:hover { color: var(--text); }
.article { min-width: 0; }
/* Words keep a 44rem measure, and code samples take the column's whole width for their longer lines */
.documentation-notice, .article-heading, .prose p, .table-scroll, .next-page { max-width: 44rem; }
.documentation-notice { margin-bottom: 2rem; border: var(--rule) solid var(--frame); background: var(--raised); box-shadow: var(--sheet-shadow); }
.documentation-notice > p:not(.notice-title) { padding: .9rem 1.2rem 1rem; color: var(--text); font: .9375rem/1.6 var(--sans); }
.notice-title { display: flex; align-items: center; gap: .6rem; min-height: var(--strip-height); padding: 0 .6rem; background: var(--warning); color: var(--on-accent); }
.notice-title::before { background: currentColor; }
.article-heading { margin-bottom: 3rem; }
.article-heading .eyebrow { margin-bottom: 1.2rem; }
.article-heading h1 { font-size: clamp(2.5rem, 4vw, 3.6rem); letter-spacing: -.03em; margin-bottom: 1.3rem; }
.article-summary { font: 400 1.3rem/1.5 var(--sans); max-width: 38rem; color: var(--muted); }
.prose { line-height: 1.8; }
.prose p { margin-block: 1rem; }
.prose p:first-child { margin-top: 0; }
.prose h2 { font-size: 1.85rem; margin-block: 2.7rem 1.1rem; letter-spacing: -.02em; }
.prose h2:first-child { margin-top: 0; }
.prose .code-example { margin-block: 1.6rem; }
.prose a { color: var(--accent-ink); }
.prose a:hover { color: var(--text); }
.prose section + section { margin-top: 4rem; }
.prose .section-number { color: var(--muted); margin-bottom: .8rem; }
.prose .section-number + h2 { margin-top: 0; }
.next-page { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.3rem .6rem; margin-top: 1.7rem; border-block: var(--rule) solid var(--outline); text-decoration: none; }
.next-page + .next-page { margin-top: 0; border-top: 0; }
.next-page small { display: block; color: var(--muted); margin-bottom: .4rem; }
.next-page strong { display: block; font: 500 1.4rem/1.3 var(--sans); color: var(--text); }
.prose .next-page:hover { color: var(--text); background: var(--hover); }
.next-page:hover small { color: var(--text); }
.next-page:active { background: var(--pressed); }
.next-page > span:last-child { font-size: 1.5rem; }
.table-scroll { overflow-x: auto; margin-block: 1.5rem; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 1rem; }
th { color: var(--muted); }
th, td { padding: .8rem .8rem .8rem 0; border-bottom: var(--rule) solid var(--outline); vertical-align: top; }
thead th { border-bottom-color: var(--frame); }
td:first-child { white-space: nowrap; }
.standalone { max-width: 44rem; padding-block: 4rem 6rem; }

@media (max-width: 1100px) {
  .container { width: calc(100% - 4rem); }
  .header-inner { gap: 1.5rem; }
  .header-inner nav a { padding-inline: .7rem; }
  .header-note { display: none; }
  .hero { gap: 2rem; }
  .terminal-welcome { padding-inline: 1.2rem; }
  .session-code { margin-inline: 1.2rem; }
  .section { gap: 3rem; padding-block: 4rem; }
  .development-inner { gap: 3.5rem; }
  .footer-inner { flex-wrap: wrap; gap: 1.5rem; }
  .footer-inner .footer-note { width: 100%; }
  .notes-layout, .tour-layout { gap: 3rem; grid-template-columns: 13rem minmax(0, 1fr); }
  .ownership-diagram dl > div { grid-template-columns: 8.5rem 1fr; }
}
@media (max-width: 850px) {
  .showcase { grid-template-columns: 1fr; }
  .reload-source { height: 480px; }
  .library-section { grid-template-columns: 1fr; gap: 2rem; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 3rem; padding-block: 3rem 4.5rem; }
  .hero-copy { max-width: 36rem; }
  .hero-intro { max-width: 34rem; }
  .hero-terminal { width: 100%; max-width: 36rem; justify-self: center; }
  .terminal-welcome { padding: 1.5rem 1.7rem 1.2rem; }
  .section { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .section-copy p:not(.eyebrow) { max-width: 38rem; }
  .ownership-diagram dl > div { grid-template-columns: 11rem 1fr; }
  .notes-layout, .tour-layout { display: block; padding-top: 2rem; padding-bottom: 4rem; }
  .notes-sidebar { position: static; padding-bottom: 1.5rem; margin-bottom: 2rem; border-bottom: var(--rule) solid var(--outline); }
  .notes-sidebar > .eyebrow { margin-bottom: .7rem; }
  .notes-sidebar nav { display: flex; flex-wrap: wrap; gap: .2rem .4rem; }
  .notes-sidebar nav a { margin: 0; padding: .4rem .5rem; }
  .sidebar-tour { display: none; }
}
@media (max-width: 600px) {
  /* A phone's text is 16px, and code a step below it, so a line of the terminal fits inside its sheet's inset */
  body { font-size: 1rem; }
  .library-section { padding-block: 3rem; }
  .library-list > div { grid-template-columns: 1fr; gap: .5rem; }
  .container { width: calc(100% - 2rem); }
  .header-inner { flex-wrap: wrap; gap: 0; }
  .brand { min-height: 3.25rem; }
  .header-tools { gap: 1rem; }
  .header-note { display: inline; }
  .header-inner nav { order: 3; width: 100%; justify-content: space-between; }
  .header-inner nav a { min-height: 2.5rem; padding-inline: .6rem; }
  .wordmark { font-size: clamp(3rem, 15vw, 4.5rem); margin-bottom: 1.2rem; }
  .hero-description { font-size: 1.5rem; }
  .hero-links { gap: 1.2rem; }
  .terminal-welcome { padding: 1.2rem .9rem 1rem; }
  .session-code { margin-inline: 14px; }
  .code-example pre { padding: 24px 16px; }
  .code-output { padding-inline: .9rem; }
  .ownership-diagram dl { padding-inline: 1rem; }
  .small-note { padding-inline: 1rem; }
  .ownership-diagram dl > div { grid-template-columns: 7.3rem 1fr; gap: .5rem; }
  .ownership-diagram dt, .ownership-diagram dd { font-size: 1rem; }
  .development-inner { grid-template-columns: 1fr; gap: 2.5rem; padding-block: 3rem; }
  .footer-inner { display: block; }
  .footer-links { margin-block: 1.5rem; flex-wrap: wrap; gap: 1.2rem; }
  .article-heading h1 { font-size: 2.5rem; }
  .article-summary { font-size: 1.2rem; }
  .standalone { padding-block: 2.5rem 4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .mascot .mouth-dot { transition: none; }
}
/* Paper and ink for print, whatever the screen shows */
@media print {
  :root, :root:has(#theme-toggle:checked) {
    color-scheme: light;
    --surface: white;
    --background: white;
    --text: #222;
    --muted: #444;
    --accent: #222;
    --on-accent: white;
    --accent-ink: #222;
    --strip-mark: white;
  }
  body { background: white; color: black; font-size: 12pt; }
  .site-header, .site-footer, .notes-sidebar, .skip-link, .next-page { display: none !important; }
  .container { width: 100%; }
  .notes-layout, .tour-layout { display: block; padding: 0; }
  .article { max-width: none; }
  .code-example { break-inside: avoid; background: white; box-shadow: none; }
  .code-example pre, .code-example code { white-space: pre-wrap; }
}
