/* The front page, the examples gallery and the page of each example (layout.ts homePage and
   widePage). The site's tokens come from site.css. One measure for all three: a column up to
   --page-max wide with a --gutter each side; one spacing scale (4, 8, 12, 16, 24, 32, 48, 64,
   96, 112); one radius for frames (--radius) and the buttons' 6px; hairlines, no shadows except
   under a tour's floating caption. Display headings are set in Newsreader; everything a reader
   scans is Instrument Sans. */

:root {
  --page-max: 1280px;
  --gutter: 32px;
  --radius: 8px;
  --faint: color-mix(in srgb, var(--muted) 72%, var(--bg));
}
@media (max-width: 860px) { :root { --gutter: 24px; } }
@media (max-width: 640px) { :root { --gutter: 16px; } }

.home, .wide { overflow-x: clip; }
.ex-wrap { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }
.home-foot { padding: 0 var(--gutter); }
.home-foot .footer { max-width: var(--page-max); margin: 112px auto 0; padding: 24px 0 48px; }

/* ---- headings and the lines under them ------------------------------------------------- */

.ex-head h1,
.hero h1,
.band h2 {
  font-family: var(--serif);
  font-weight: 420;
  letter-spacing: -0.018em;
  text-wrap: balance;
  color: var(--fg);
}
.ex-head { max-width: 44rem; }
.ex-head h1 { margin: 0 0 16px; font-size: 52px; line-height: 1.04; }
.ex-summary { margin: 0 0 12px; font: 19px/1.55 var(--ui); color: var(--muted); text-wrap: pretty; }
.ex-meta { margin: 0; font: 14px/1.55 var(--ui); color: var(--faint); }
.ex-meta strong { font-weight: 600; color: var(--muted); }
.ex-meta code, .ex-lesson code, .ex-card-about code, .ticks code, .ex-group-lead code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--code-inline-bg);
  color: var(--fg);
  font: 0.86em var(--mono);
}

/* ---- the gallery ------------------------------------------------------------------------ */

.wide { padding-top: 64px; }
.page-example .wide { padding-top: 32px; }
.ex-head-gallery { margin: 0 0 48px; }

/* One row: the categories as quiet tabs, and one menu. It stays under the top bar. */
html:has(.ex-bar) { scroll-padding-top: calc(var(--topbar) + 72px); }
.ex-bar {
  position: sticky;
  top: var(--topbar);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 0 0 48px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.ex-filters { display: flex; flex: 1 1 auto; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ex-filters::-webkit-scrollbar { display: none; }
.ex-filter {
  flex: none;
  margin: 0;
  padding: 14px 10px 13px;
  border: 0;
  background: none;
  box-shadow: inset 0 -2px 0 transparent;
  color: var(--muted);
  font: 500 14px/1 var(--ui);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s, box-shadow 0.15s;
}
.ex-filter:first-child { padding-left: 0; }
.ex-filter:hover { color: var(--fg); }
.ex-filter[aria-pressed="true"] { color: var(--fg); box-shadow: inset 0 -2px 0 var(--accent); }
.ex-filter:first-child[aria-pressed="true"] { box-shadow: inset 0 -2px 0 var(--accent); }
.ex-filter:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ex-narrow { position: relative; display: inline-flex; flex: none; align-items: center; }
.ex-narrow select {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 7px 30px 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font: 500 13.5px/18px var(--ui);
  cursor: pointer;
}
.ex-narrow select:hover { border-color: var(--fg); }
.ex-narrow select.ex-narrow-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.ex-narrow select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ex-narrow option, .ex-narrow optgroup { background: var(--surface); color: var(--fg); }
.ex-narrow-caret { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ex-none { margin: 0 0 48px; font: 15px/1.5 var(--ui); color: var(--muted); }
.ex-link { padding: 0; border: 0; background: none; color: var(--link); font: inherit; font-weight: 600; cursor: pointer; }
.ex-link:hover { text-decoration: underline; }

.ex-group { margin: 0 0 80px; }
.ex-group[hidden], .ex-card[hidden] { display: none; }
.ex-group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; margin: 0 0 24px; }
.ex-group-title { margin: 0; font: 420 30px/1.15 var(--serif); letter-spacing: -0.012em; color: var(--fg); }
.ex-group-lead { max-width: 40rem; margin: 0; font: 15px/1.55 var(--ui); color: var(--muted); }

/* ---- a card ------------------------------------------------------------------------------ */

.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 48px 28px; }
.ex-grid-big { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 48px 32px; }
.ex-card { position: relative; display: flex; flex-direction: column; min-width: 0; color: var(--fg); }
/* The top of the page, drawn small in a hairline frame. */
.ex-card-pic {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.15s;
}
.ex-card:hover .ex-card-pic { border-color: var(--border-strong); }
.ex-card-page { position: absolute; inset: 0; overflow: hidden; }
/* Laid out at a reading width (two and a half times the frame) and drawn at two fifths. */
.ex-card-page .preview-host { width: 250%; padding: 44px 52px; transform: scale(0.4); transform-origin: 0 0; pointer-events: none; }
.ex-card-title { margin: 16px 0 6px; font: 600 16px/1.3 var(--ui); letter-spacing: -0.01em; }
.ex-card-big .ex-card-title { margin-top: 20px; font-size: 18px; }
.ex-card-open { color: inherit; text-decoration: none; }
.ex-card-open::after { content: ''; position: absolute; inset: 0; }
.ex-card:hover .ex-card-open { text-decoration: underline 1px; text-underline-offset: 3px; }
.ex-card-open:focus-visible { outline: none; }
.ex-card:has(.ex-card-open:focus-visible) .ex-card-pic { outline: 2px solid var(--accent); outline-offset: 2px; }
.ex-card-why {
  display: -webkit-box;
  margin: 0 0 8px;
  overflow: hidden;
  font: 14.5px/1.5 var(--ui);
  color: var(--muted);
  text-wrap: pretty;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.ex-card-big .ex-card-why { font-size: 15px; }
.ex-card-about { margin: auto 0 0; overflow: hidden; font: 13px/1.4 var(--ui); color: var(--faint); white-space: nowrap; text-overflow: ellipsis; }

/* ---- an example's page ------------------------------------------------------------------ */

.ex-crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; font: 14px/1.4 var(--ui); color: var(--faint); }
.ex-crumbs a { color: var(--muted); text-decoration: none; }
.ex-crumbs a:hover { color: var(--fg); text-decoration: underline 1px; text-underline-offset: 3px; }
.ex-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }

/* What it teaches: three short columns under a hairline. */
.ex-lesson {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1.4fr);
  gap: 24px 40px;
  margin: 48px 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--border);
}
.ex-lesson h2 { margin: 0 0 8px; font: 600 13.5px/1.4 var(--ui); color: var(--fg); }
.ex-lesson p, .ex-lesson li { font: 15px/1.6 var(--ui); color: var(--muted); text-wrap: pretty; }
.ex-lesson p { margin: 0; }
.ex-lesson ul { margin: 0; padding: 0 0 0 1.1em; }
.ex-lesson li + li { margin-top: 8px; }
.ex-lesson li::marker { color: var(--faint); }

/* The page beside its file. The file stays in view while the page scrolls past it. */
.ex-split { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.ex-page .preview-host {
  overflow-x: auto;
  padding: 48px 56px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.ex-source {
  position: sticky;
  top: calc(var(--topbar) + 24px);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--topbar) - 48px);
  scroll-margin-top: calc(var(--topbar) + 24px);
}
.ex-source .codeblock { display: flex; flex-direction: column; min-height: 0; margin: 0; border-radius: var(--radius); }
.ex-source .cb-bar { flex: none; padding: 4px 6px 4px 14px; background: none; }
.ex-source .cb-label { font: 12px var(--mono); color: var(--muted); }
.ex-source .cb-btn { border-color: var(--border); background: none; color: var(--muted); }
.ex-source .cb-btn:hover { color: var(--fg); border-color: var(--border-strong); }
.ex-source pre {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  overflow: auto;
  padding: 16px 16px 20px 0;
  background: none;
  color: var(--fg);
  font: 12.5px/1.65 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}
/* Line numbers in a gutter; a long line wraps under its own start, past the numbers. */
.ex-source .selfhl-numbered .selfhl-line { position: relative; padding-left: 4.2em; }
.ex-source .selfhl-numbered .selfhl-line::before { position: absolute; left: 0; width: 3em; margin: 0; opacity: 1; color: var(--faint); }

.ex-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 64px 0 0; padding: 24px 0 0; border-top: 1px solid var(--border); }
.ex-pager a { display: flex; flex-direction: column; gap: 4px; color: var(--fg); font: 600 16px/1.35 var(--ui); text-decoration: none; }
.ex-pager a:hover { text-decoration: underline 1px; text-underline-offset: 3px; }
.ex-pager .ex-next { align-items: flex-end; text-align: right; }
.ex-pager-label { font: 500 13px/1.4 var(--ui); color: var(--faint); }

/* ---- the front page ----------------------------------------------------------------------- */

/* The words above, the demo under them at the page's full width: beside the headline it had
   half the page, and the rules in it wrapped two and three times. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 56px;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 88px var(--gutter) 32px;
}
/* The headline on the left, what it means and the buttons on the right, level at the bottom. */
.hero-text { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: 64px; align-items: end; }
.hero-text > h1 { grid-column: 1; grid-row: 1 / span 3; align-self: end; }
.hero-text > :not(h1) { grid-column: 2; }
.hero h1 { margin: 0; font-size: clamp(48px, 5.4vw, 78px); line-height: 1; }
.hero h1 em { font-style: italic; color: var(--accent); }
.lede { max-width: 32em; margin: 0 0 28px; font: 19px/1.6 var(--ui); color: var(--muted); text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { margin: 24px 0 0; font: 14px/1.5 var(--ui); color: var(--faint); }
.hero-note a { color: var(--muted); text-decoration: underline 1px; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
.hero-note a:hover { color: var(--fg); text-decoration-color: currentColor; }

/* The demo: a document's text beside the page it makes. */
.demo { position: relative; margin: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.demo-bar { display: flex; align-items: center; min-height: 44px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.demo-name { display: flex; align-items: baseline; gap: 12px; min-width: 0; font: 13.5px/1.3 var(--ui); white-space: nowrap; }
.demo-name strong { font-weight: 600; color: var(--fg); }
.demo-name span { overflow: hidden; color: var(--muted); text-overflow: ellipsis; }
/* Text and page in equal halves of the full-width window: a rule line fits or wraps once. */
.demo-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); height: 500px; }
.demo-src { min-width: 0; overflow: auto; border-right: 1px solid var(--border); background: var(--code-bg); }
.demo-src:not(.is-live) { cursor: text; }
.is-file .demo-src:not(.is-live) { cursor: auto; }
.demo-src pre { margin: 0; padding: 18px 20px; background: none; color: var(--fg); font: 12.5px/1.65 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.demo-src .cm-editor { height: 100%; background: transparent; }
.demo-src .cm-editor .cm-scroller { font: 12.5px/1.65 var(--mono); }
.demo-src .cm-editor .cm-content { padding: 18px 0; }
.demo-src .cm-editor .cm-line { padding: 0 20px 0 calc(20px + 2ch); text-indent: -2ch; }
.demo-out { min-width: 0; overflow: auto; padding: 20px 24px; }
.demo-foot { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 44px; padding: 6px 16px; border-top: 1px solid var(--border); font: 12.5px/1.4 var(--ui); color: var(--muted); }
.demo-timing { overflow: hidden; color: var(--faint); text-align: right; white-space: nowrap; text-overflow: ellipsis; }

/* Code whose long lines wrap under their own start: a wrapped rule still reads as one line. */
.wrap-pre .selfhl-line { padding-left: 2ch; text-indent: -2ch; }

/* The tours (the app's, shared): the cards under the window, a caption that moves to what it
   describes, a caret while it types, a ring on what a step made. */
.tours { --spring: cubic-bezier(0.3, 1.35, 0.5, 1); display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.tour-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; }
.tour-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 10px 0 0;
  border: 0;
  border-top: 1px solid var(--border);
  background: none;
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tour-card:hover .tour-card-title { text-decoration: underline 1px; text-underline-offset: 3px; }
.tour-card[aria-selected="true"] { border-top-color: var(--fg); }
.tour-card-title { overflow: hidden; font: 600 13.5px/1.35 var(--ui); white-space: nowrap; text-overflow: ellipsis; }
.tour-card-time { font: 12.5px/1.35 var(--ui); font-variant-numeric: tabular-nums; color: var(--faint); }
/* While a tour plays, its card's top line fills in the accent. */
.tour-card-bar { position: absolute; top: -1px; left: 0; right: 0; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ease); }
.tour-ctl { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tour-play { display: grid; flex: none; place-items: center; width: 26px; height: 26px; padding: 0; border: 1px solid var(--border-strong); border-radius: 50%; background: none; color: var(--fg); cursor: pointer; transition: border-color 0.15s; }
.tour-play:hover { border-color: var(--fg); }
.tour-label { font: 500 12.5px var(--ui); color: var(--muted); white-space: nowrap; }
.tour-steps { display: flex; align-items: center; }
.tour-steps[hidden], .tour-label[hidden], .demo-timing[hidden] { display: none; }
.tour-step { display: grid; place-items: center; width: 18px; height: 24px; padding: 0; border: 0; border-radius: 4px; background: none; cursor: pointer; }
.tour-step::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); transition: transform 0.25s var(--spring); }
.tour-step-done::before { background: var(--muted); }
.tour-step-on::before { background: var(--accent); transform: scale(1.35); }
.tour-step:hover::before { transform: scale(1.25); }
.tour-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 16px; }
.tour-link { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; border: 0; background: none; color: var(--muted); font: 500 13px var(--ui); cursor: pointer; }
.tour-link:hover { color: var(--fg); }
.tour-link-strong { color: var(--link); font-weight: 600; }
.tour-card:focus-visible, .tour-play:focus-visible, .tour-step:focus-visible, .tour-link:focus-visible, .tour-cap-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tour-caret { position: absolute; top: 0; left: 0; z-index: 3; width: 2px; background: var(--accent); pointer-events: none; }
.tour-pulse { position: absolute; top: 0; left: 0; z-index: 3; pointer-events: none; }
.tour-pulse i { position: absolute; inset: 0; border-radius: 6px; box-shadow: 0 0 0 2px var(--accent); opacity: 0; animation: tour-pulse 1.3s var(--ease) 80ms; }
@keyframes tour-pulse { 0% { opacity: 0; } 22% { opacity: 1; } 70% { opacity: 0.8; } 100% { opacity: 0; } }
.tour-cap { position: absolute; top: 0; left: 0; z-index: 4; width: max-content; max-width: min(300px, calc(100% - 24px)); pointer-events: none; visibility: hidden; transition: transform 0.34s var(--spring); }
.tour-cap.tour-cap-on { visibility: visible; }
.tour-cap-in {
  position: relative;
  padding: 10px 14px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--fg);
  font: 13.5px/1.45 var(--ui);
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  animation: tour-cap-in 0.28s var(--ease);
  transform-origin: var(--arrow, 30px) 0;
}
.tour-cap-in::before { content: ''; position: absolute; left: calc(var(--arrow, 30px) - 6px); width: 10px; height: 10px; background: inherit; border: inherit; border-radius: 2px; transform: rotate(45deg); }
.tour-cap[data-side="top"] .tour-cap-in::before { top: -6px; border-right-color: transparent; border-bottom-color: transparent; }
.tour-cap[data-side="bottom"] .tour-cap-in { transform-origin: var(--arrow, 30px) 100%; }
.tour-cap[data-side="bottom"] .tour-cap-in::before { bottom: -6px; border-left-color: transparent; border-top-color: transparent; }
.tour-cap[data-side="left"] .tour-cap-in::before, .tour-cap[data-side="right"] .tour-cap-in::before { top: calc(var(--arrow, 30px) - 6px); left: auto; }
.tour-cap[data-side="left"] .tour-cap-in { transform-origin: 0 var(--arrow, 30px); }
.tour-cap[data-side="left"] .tour-cap-in::before { left: -6px; border-top-color: transparent; border-right-color: transparent; }
.tour-cap[data-side="right"] .tour-cap-in { transform-origin: 100% var(--arrow, 30px); }
.tour-cap[data-side="right"] .tour-cap-in::before { right: -6px; border-bottom-color: transparent; border-left-color: transparent; }
.tour-cap[data-side="none"] .tour-cap-in::before { display: none; }
@keyframes tour-cap-in { from { opacity: 0; transform: translateY(4px); } }
.tour-cap-count { display: block; margin-bottom: 2px; font: 600 12px var(--ui); color: var(--muted); }
.tour-cap-text { margin: 0; }
.tour-cap-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tour-cap-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border: 0; border-radius: 6px; background: var(--accent); color: var(--accent-fg); font: 600 12.5px var(--ui); cursor: pointer; }
/* `set theme cyber-dark` in a tour: the site has no app to dress, so the window dresses up. */
.demo[data-demo-theme="cyber-dark"] {
  --bg: #12042a; --surface: #1a0838; --surface-2: #241049; --fg: #f7ecff; --muted: #c9b0ec; --border: #3b1c6b; --border-strong: #5b2f9c;
  --accent: #ff2bd6; --accent-fg: #16001f; --link: #00e5ff; --code-bg: #0a0218; --selection: rgba(255, 43, 214, 0.3); --active-line: rgba(255, 43, 214, 0.08);
  --doc-bg: #12042a; --doc-fg: #f7ecff; --doc-heading: #ffffff; --doc-link: #00e5ff;
  color-scheme: dark;
}
.demo[data-demo-theme="cyber-dark"] .demo-out { background: #12042a; color: #f7ecff; }
@media (forced-colors: active) { .tour-cap-in { border-color: CanvasText; } .tour-caret, .tour-card-bar { background: Highlight; } }

/* ---- the front page's sections -------------------------------------------------------------- */

.band { max-width: var(--page-max); margin: 0 auto; padding: 112px var(--gutter) 0; }
.band-head { margin: 0 0 40px; padding-top: 24px; border-top: 1px solid var(--border); }
.band-head > * { max-width: 42rem; }
.band-split .band-head > * { max-width: none; }
.band h2 { margin: 0 0 12px; font-size: clamp(32px, 3.4vw, 44px); line-height: 1.08; }
.band-head p { margin: 0; font: 18px/1.6 var(--ui); color: var(--muted); text-wrap: pretty; }
.band-more { margin: 40px 0 0; font: 600 15px var(--ui); }
.band-more a { color: var(--link); text-decoration: none; }
.band-more a::after { content: ' →'; }
.band-more a:hover { text-decoration: underline 1px; text-underline-offset: 3px; }

/* How it works: three steps, each a text and the page it makes. Their pages line up. */
/* Each step's title, line and example share rows with its neighbours', so the examples start level. */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; margin: 0; padding: 0; list-style: none; }
.step { display: grid; grid-row: span 3; grid-template-rows: subgrid; min-width: 0; }
.step h3 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 6px; font: 600 17px/1.3 var(--ui); letter-spacing: -0.01em; }
.step-n { font: 400 17px/1 var(--serif); color: var(--accent); font-variant-numeric: lining-nums; }
.step > p { margin: 0 0 16px; font: 15px/1.55 var(--ui); color: var(--muted); }
.step-body { display: flex; flex: 1 1 auto; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.step-src { flex: 1 1 auto; border-bottom: 1px solid var(--border); background: var(--code-bg); }
.step-src pre { margin: 0; padding: 14px 16px; background: none; font: 12px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.step-out { padding: 18px 20px; font-size: 14px; }

/* The app: six things it does, in three columns under hairlines. */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 40px; margin: 0; padding: 0; list-style: none; }
.feature > a { display: block; height: 100%; padding-top: 16px; border-top: 1px solid var(--border); color: inherit; text-decoration: none; }
.feature > a:hover h3 { text-decoration: underline 1px; text-underline-offset: 3px; }
.feature > a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.feature h3 { margin: 0 0 6px; font: 600 16px/1.35 var(--ui); }
.feature p { margin: 0; font: 15px/1.55 var(--ui); color: var(--muted); }

/* It's just text. */
.band-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 64px; align-items: start; }
.band-split .band-head { margin: 0; }
.ticks { display: grid; margin: 24px 0 0; padding: 0; list-style: none; font: 15px/1.5 var(--ui); }
.ticks li { padding: 10px 0; border-top: 1px solid var(--border); }
.ticks li:last-child { border-bottom: 1px solid var(--border); }
.term { display: grid; gap: 24px; padding-top: 25px; }
.term-win { margin: 0; }
.term-win figcaption { margin: 0 0 8px; font: 500 13px var(--ui); color: var(--faint); }
.term-win pre { margin: 0; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--code-bg); color: var(--fg); font: 12.5px/1.65 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.t-prompt { color: var(--faint); }

/* Four ways in. */
.ways { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.way { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding-top: 16px; border-top: 1px solid var(--border); color: var(--fg); text-decoration: none; }
.way:hover strong { text-decoration: underline 1px; text-underline-offset: 3px; }
.way:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.way-k { font: 500 13px var(--ui); color: var(--faint); }
.way strong { font: 600 18px/1.3 var(--ui); letter-spacing: -0.01em; }
.way > span:not(.way-k):not(.way-go) { font: 15px/1.55 var(--ui); color: var(--muted); }
.way pre { margin: 4px 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--code-bg); font: 11.5px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.way-go { margin-top: auto; padding-top: 8px; font: 600 14px var(--ui); color: var(--link); }
.way-go::after { content: ' →'; }

/* ---- narrower windows ---------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .hero { gap: 48px; padding-top: 64px; }
  .hero-text { display: block; }
  .lede { max-width: 36em; margin: 28px 0 36px; }
  .ex-split { grid-template-columns: minmax(0, 1fr); }
  .ex-source { position: static; max-height: none; }
  .ex-source pre { overflow: visible; }
  .ex-lesson { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ex-lesson-part:last-child { grid-column: 1 / -1; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .step + .step { margin-top: 40px; }
  .band-split { grid-template-columns: minmax(0, 1fr); }
  .term { padding-top: 0; }
  .ways, .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .wide { padding-top: 40px; }
  .page-example .wide { padding-top: 24px; }
  .ex-head h1 { font-size: 38px; }
  .ex-summary { font-size: 17px; }
  .ex-head-gallery { margin-bottom: 32px; }
  /* The categories scroll sideways; the menu goes under them. The bar no longer follows. */
  .ex-bar { position: static; flex-wrap: wrap; gap: 0; margin-bottom: 40px; border-bottom: 0; }
  .ex-filters { flex-basis: 100%; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); border-bottom: 1px solid var(--border); }
  .ex-narrow { margin-top: 16px; }
  .ex-group { margin-bottom: 64px; }
  .ex-group-title { font-size: 26px; }
  .ex-grid, .ex-grid-big { gap: 40px; }
  .ex-crumbs { margin-bottom: 24px; }
  .ex-lesson { grid-template-columns: minmax(0, 1fr); gap: 24px; margin: 40px 0; }
  .ex-page .preview-host { padding: 24px 20px; }
  .ex-split { gap: 24px; }
  .ex-pager { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ex-pager .ex-next { align-items: flex-start; text-align: left; }
  .hero { gap: 40px; padding-top: 48px; }
  .hero h1 { font-size: 46px; }
  .lede { margin: 20px 0 28px; font-size: 17px; }
  .demo-name span, .demo-timing { display: none; }
  .demo-panel { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; height: auto; }
  /* On a phone the page comes first, its text below. */
  .demo-out { order: -1; max-height: 320px; border-bottom: 1px solid var(--border); }
  .demo-src { max-height: 260px; border-right: 0; }
  .demo-foot { grid-template-columns: auto minmax(0, 1fr); }
  /* One row of cards that scrolls sideways, each snapping into place. */
  .tour-picker { display: flex; gap: 20px; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 4px; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
  .tour-picker::-webkit-scrollbar { display: none; }
  .tour-picker > * { flex: 0 0 min(13rem, 62%); scroll-snap-align: start; }
  .band { padding-top: 80px; }
  .band-head p { font-size: 17px; }
  .ways, .features { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .home-foot .footer { margin-top: 80px; }
}
