/* Roboto Slab, hosted here so visitors never connect to a font service. One variable
   file holds every weight, and the second only loads for characters outside Latin-1.
   "optional" means text never changes font while being read: if the font isn't ready
   in time on a first visit, that page keeps the fallback, and the next one has it. */

@font-face {
  font-family: "Roboto Slab";
  font-style: normal;
  font-weight: 100 900;
  font-display: optional;
  src: url("fonts/roboto-slab-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Roboto Slab";
  font-style: normal;
  font-weight: 100 900;
  font-display: optional;
  src: url("fonts/roboto-slab-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Tokens ---------------------------------------------------------------- */

:root {
  color-scheme: light dark;

  /* Nord (nordtheme.com), except for pure white and black: the light page,
     and all text, which is only ever #000 or #fff (--ink, --on-accent).
     Brand colours (--accent, --dot) are fills and never text. */
  --page: light-dark(#ffffff, #2e3440);   /* white / nord0 */
  --recess: light-dark(#eceff4, #3b4252); /* nord6 / nord1 */
  --ink: light-dark(#000000, #ffffff);
  --line: light-dark(#d8dee9, #4c566a);   /* nord4 / nord3 */
  --line-strong: light-dark(#4c566a, #d8dee9); /* nord3 / nord4: form field edges, 3:1 or better */
  --accent: light-dark(#2e3440, #88c0d0); /* nord0 / nord8 */
  --on-accent: light-dark(#ffffff, #000000);
  /* The brand colour tinted toward the page, so highlights take --ink in both themes.
     Dark mode tints further: white text needs 4.5:1 on every brand colour. */
  --mark: light-dark(
    color-mix(in srgb, var(--accent) 55%, var(--page)),
    color-mix(in srgb, var(--accent) 40%, var(--page))
  );
  /* The edge: full brand colour on the light tint, a dark step on the dark one. */
  --mark-line: light-dark(var(--accent), color-mix(in srgb, var(--accent) 15%, var(--page)));

  /* Four voices: serif for headings and titles, sans for body and navigation,
     mono for dates, versions and code, slab for UI labels. */
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, "New York", "Iowan Old Style", Charter, Georgia, Cambria, "Times New Roman", serif;
  --font-slab: "Roboto Slab", Rockwell, "Courier Prime", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: clamp(16px, 4vw, 40px);
  --measure: 1200px;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

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

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

/* Keeps the layout still between short pages and long ones that scroll. */
html {
  overflow-y: scroll;
  scroll-padding-top: 56px; /* Keeps jump targets clear of the sticky top bar. */
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

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

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  z-index: 10;
  top: 4px;
  left: 4px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--ink);
  color: light-dark(#ffffff, #000000);
  font-size: 14px;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

main {
  max-width: var(--measure);
  margin-inline: auto;
  padding: clamp(32px, 6vw, 64px) var(--gutter);
}

/* Typography ------------------------------------------------------------ */

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

/* Serif: headings. More space above than below, so each stays with its text. */

h1, h2, h3, h4 {
  margin: 1.8em 0 0.5em;
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

h1 { font-size: clamp(34px, 5vw, 48px); line-height: 1.1; letter-spacing: -0.012em; }
h2 { font-size: clamp(26px, 3.4vw, 32px); }
h3 { font-size: 23px; }
h4 { font-size: 19px; }

main > :first-child { margin-top: 0; }

/* Sans: running text. */

p, ul, ol, dl, blockquote, pre, table, figure, fieldset {
  margin: 0 0 1.1em;
}

p, li, dd, blockquote, figcaption {
  max-width: 68ch;
  text-wrap: pretty;
}

.lede {
  font-size: clamp(19px, 2.4vw, 22px);
  line-height: 1.45;
}

ul, ol { padding-inline-start: 1.4em; }
li + li { margin-top: 0.3em; }

strong { font-weight: 600; }
small, figcaption { font-size: 14px; }

main a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
main a:hover { text-decoration-thickness: 2px; }

/* A pill in the text. Vertical padding and the border don't change the line height,
   so the padding stays small enough to clear the lines above and below. A highlight
   that wraps gets rounded ends on each line. */
mark {
  padding: 0.04em 0.3em;
  border: 0.5px solid var(--mark-line);
  border-radius: 0.35em;
  background: var(--mark);
  color: var(--ink);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

blockquote {
  padding-inline-start: 1.1em;
  border-inline-start: 3px solid var(--accent);
  font-family: var(--font-serif);
  font-size: 1.12em;
}
blockquote > :last-child { margin-bottom: 0; }

hr {
  margin-block: 2.5em;
  border: 0;
  border-top: 1px solid var(--line);
}

figure { margin-inline: 0; }
figcaption { margin-top: 8px; }

/* Mono: dates, versions and code. Slightly smaller, to match the sans around it. */

code, kbd, samp, pre, time, .mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code, kbd {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--recess);
}
kbd { border: 1px solid var(--line); }

pre {
  padding: 16px;
  overflow-x: auto;
  border-radius: 8px;
  background: var(--recess);
  line-height: 1.5;
}
pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

/* Slab: UI labels. */

legend, label, th, caption, dt, .label {
  font-family: var(--font-slab);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.label, label, th, caption { font-size: 14px; }
.label { margin-bottom: 0.4em; }

dt + dd { margin: 0 0 0.8em; }

fieldset {
  max-width: 68ch;
  min-width: 0;
  padding: 16px 20px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
legend {
  padding-inline: 8px;
  margin-inline-start: -8px;
  font-size: 15px;
}

label { display: block; margin-bottom: 4px; }

label.choice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
}

input:not([type="checkbox"], [type="radio"]), select, textarea {
  width: 100%;
  max-width: 28em;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--page);
  color: var(--ink);
  font: inherit;
}
/* Drawn by hand, because WebKit's own control ignores padding. The chevron is
   two gradients, so it follows the text colour. */
select {
  appearance: none;
  padding-inline-end: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: right 18px center, right 13px center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

::placeholder { color: var(--ink); opacity: 1; font-style: italic; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}
caption {
  margin-bottom: 8px;
  text-align: start;
}
th, td {
  padding: 8px 20px 8px 0;
  border-bottom: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
}
td.mono, td time { white-space: nowrap; }

/* The specimen page's stand-in for an image. */
.specimen-figure {
  height: 120px;
  border-radius: 8px;
  background: var(--accent);
}

/* Top bar: mikka and the apps on the left, resources and theme on the right.
   The current site is a tab, the same colour as the site bar it opens onto. */

.topbar {
  --row: 32px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--recess);
  font-size: 13px;
  line-height: 1;
}

.topbar__inner {
  display: flex;
  align-items: stretch;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.topbar__scroll {
  display: flex;
  flex: 1;
  min-width: 0;
  margin-inline-start: -10px;
  justify-content: space-between;
  gap: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.topbar__scroll::-webkit-scrollbar { display: none; }

/* Set by topbar.js while there's more to scroll to. */
.topbar__scroll--more {
  mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
}

.topbar__group {
  display: flex;
  flex: none;
}

.topbar__item {
  display: flex;
  flex: none;
  align-items: center;
  min-height: var(--row);
  padding-inline: 10px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
a.topbar__item:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.topbar__item:focus-visible { outline-offset: -2px; }

/* Always the same weight, so nothing in the row moves between sites. */
.topbar__item--home { font-weight: 600; }

.topbar__dot {
  flex: none;
  width: 7px;
  height: 7px;
  margin-inline-end: 6px;
  border-radius: 50%;
  background: var(--dot);
}

.topbar__external {
  margin-inline-start: 2px;
  font-size: 11px;
}

.topbar__item[aria-current] {
  background: var(--page);
  color: var(--ink);
}

.theme-switch {
  display: flex;
  flex: none;
  align-items: center;
  min-height: var(--row);
  margin-inline-start: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.theme-switch__pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--page);
}
.theme-switch:hover .theme-switch__pill { border-color: var(--ink); }
.theme-switch:focus-visible { outline: none; }
.theme-switch:focus-visible .theme-switch__pill {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

/* The icon shows the theme in use, whether chosen or following the device. */
.theme-switch__icon { width: 13px; height: 13px; }
.theme-switch__icon--dark { display: none; }

:root[data-theme="dark"] .theme-switch__icon--light { display: none; }
:root[data-theme="dark"] .theme-switch__icon--dark { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-switch__icon--light { display: none; }
  :root:not([data-theme="light"]) .theme-switch__icon--dark { display: block; }
}

/* Site bar: icon and title on the left, nav and call to action on the right. */

.sitebar {
  background: var(--page);
  border-bottom: 1px solid var(--line);
}

.sitebar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  max-width: var(--measure);
  min-height: 72px;
  margin-inline: auto;
  padding: 14px var(--gutter);
}

.sitebar__brand {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  margin-inline-end: auto;
  color: inherit;
  text-decoration: none;
}

.sitebar__icon {
  display: block;
  flex: none;
  width: 44px;
  height: 44px;
}

/* One slot for every logo, so site titles start in the same place everywhere.
   Logos sit at its left, on the page's edge. */
img.sitebar__icon {
  width: 46px;
  object-fit: contain;
  object-position: left center;
}

.sitebar__icon--initial {
  display: grid;
  margin-inline-end: 2px;
  place-items: center;
  border-radius: 11px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 22px;
  font-weight: 600;
}

.sitebar__title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.sitebar__nav {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.sitebar__nav::-webkit-scrollbar { display: none; }

.sitebar__link {
  flex: none;
  padding-block: 6px;
  color: var(--ink);
  font-size: 15px;
  text-decoration: none;
  text-underline-offset: 6px;
  white-space: nowrap;
}
.sitebar__link:hover { text-decoration: underline; }
.sitebar__link:focus-visible { outline-offset: -2px; }
.sitebar__link[aria-current] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.sitebar__cta {
  flex: none;
  padding: 9px 16px;
  line-height: 1.2;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-slab);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

/* Hero: a big statement beside a short paragraph. Stacked and centred on smaller
   screens; side by side, left-aligned and vertically centred on larger ones. */

.hero {
  display: grid;
  gap: 20px;
  margin-bottom: clamp(48px, 8vw, 96px);
  text-align: center;
}

.hero__statement {
  margin: 0;
  font-size: clamp(44px, 6.5vw, 84px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

/* A rounded box, layered behind all of the statement's text, so the descenders
   of the line above draw over it rather than being cut off by it. */
.hero__statement { isolation: isolate; }

.hero__statement mark {
  position: relative;
  z-index: -1;
  padding: 0 0.12em;
  border-radius: 0.14em;
}

.hero__body {
  font-family: var(--font-slab);
  font-size: clamp(19px, 1.9vw, 22px);
  font-weight: 300;
  line-height: 1.45;
}
.hero__body p { margin-inline: auto; }
.hero__body > :last-child { margin-bottom: 0; }

@media (min-width: 860px) {
  .hero {
    grid-template-columns: 3fr 2fr;
    align-items: center;
    gap: clamp(32px, 5vw, 72px);
    text-align: start;
  }

  .hero__body p { margin-inline: 0; }
}

/* Image: shows the file for the current theme. Both are in the page, because
   <picture> can only follow the device's theme, not the theme switch. The hidden
   one isn't downloaded, since it's lazy-loaded and never on screen. */

.image img {
  display: block;
  max-width: 100%;
  height: auto;
}

.image__dark { display: none !important; }

:root[data-theme="dark"] .image__light { display: none !important; }
:root[data-theme="dark"] .image__dark { display: block !important; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .image__light { display: none !important; }
  :root:not([data-theme="light"]) .image__dark { display: block !important; }
}

.image { max-width: var(--image-width, none); }

/* Floated, with text wrapping around it. Narrow screens keep room for the text. */

.image--left,
.image--right {
  width: min(var(--image-width, 240px), 45%);
  margin-block: 0 16px;
}

.image--left { float: left; margin-inline-end: 24px; }
.image--right { float: right; margin-inline-start: 24px; }

/* Text follows the image's outline instead of its box. */
.image--shape { shape-margin: 12px; }

/* What comes after a floated image is still the start of its container. */
.image--left:first-child + *,
.image--right:first-child + * { margin-top: 0; }

.image--line img {
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* A screenshot in a simulated phone: rounded corners and a wide black bezel. */

.image--shot { margin-inline: auto; max-width: 256px; }

.image--shot img {
  border: 7px solid #000;
  border-radius: 40px;
}

/* Button: a link in the brand colour, sized from the text around it. The same when
   hovered, so main a:hover is matched and undone here. */

.button,
main a.button,
main a.button:hover {
  display: inline-block;
  margin-block: 0.1em;
  padding: 0.3em 0.8em;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-slab);
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
}

.button--m { font-size: 1em; }
.button--l { font-size: 1.2em; }
.button--xl { font-size: 1.4em; }

.button__glyph { margin-inline-start: 0.4em; }

/* Card: no outer design yet, just how its content is arranged. Beside each other
   on larger screens when it has an image. Stacked on smaller ones, always with the
   text first, so the heading introduces the picture. */

.card {
  margin-block: clamp(48px, 7vw, 88px);
}

main > .card:first-child { margin-top: 0; }

/* Keeps a floated image inside its block of text. */
.card__text,
.split__column { display: flow-root; }

.card__text > :first-child { margin-top: 0; }
.card__text > :last-child { margin-bottom: 0; }

.card__image figure { margin-block: 0; }

/* minmax(0, …) stops a large image from stretching its column past the page. */
.card--left,
.card--right {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

/* The text column sits in the middle of the page, with its text left-aligned. */
.card--none .card__text {
  max-width: 68ch;
  margin-inline: auto;
}

.card--center { text-align: center; }

.card--center p,
.card--center li,
.card--center dd,
.card--center blockquote {
  margin-inline: auto;
}

@media (max-width: 859.98px) {
  .card--left .card__text { order: -1; }
}

@media (min-width: 860px) {
  .card--left,
  .card--right {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: clamp(32px, 5vw, 72px);
  }
}

/* FAQ: questions that open to show their answers. The chevron is drawn in the text
   colour. Questions are headings in all but name, so they're serif. */

.faq {
  margin-block: 24px;
  border-top: 1px solid var(--line);
}

.faq:first-child { margin-top: 0; }
.faq:last-child { margin-bottom: 0; }

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

.faq__question {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-block: 16px;
  font-family: var(--font-serif);
  font-size: 1.15em;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
}

.faq__question::-webkit-details-marker { display: none; }

.faq__question::after {
  content: "";
  flex: none;
  width: 0.5em;
  height: 0.5em;
  margin-inline-end: 0.2em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.15em) rotate(45deg);
}

.faq__item[open] > .faq__question::after {
  transform: translateY(0.1em) rotate(-135deg);
}

.faq__answer { padding-bottom: 16px; }
.faq__answer > :first-child { margin-top: 0; }
.faq__answer > :last-child { margin-bottom: 0; }

/* Contents: a box that opens and closes. Full width, with room for columns, or floated
   with text around it. Floated ones stop floating on phones, where text would be squeezed. */

.toc {
  margin-block: 24px;
  padding-inline: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.toc:first-child { margin-top: 0; }

.toc__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding-block: 12px;
  cursor: pointer;
  list-style: none;
}

.toc__title::-webkit-details-marker { display: none; }

.toc__title::after {
  content: "";
  flex: none;
  width: 0.5em;
  height: 0.5em;
  margin-inline-end: 0.2em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.15em) rotate(45deg);
}

.toc[open] > .toc__title::after {
  transform: translateY(0.1em) rotate(-135deg);
}

.toc nav { padding-bottom: 12px; }

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

.toc ul ul { padding-inline-start: 16px; }

.toc li { margin: 0; }

.toc a {
  display: block;
  padding-block: 3px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  text-decoration: none;
}
.toc a:hover { text-decoration: underline; text-underline-offset: 3px; }

.toc--wide nav > ul {
  columns: 16em;
  column-gap: 32px;
}
.toc--wide nav > ul > li { break-inside: avoid; }

@media (min-width: 721px) {
  .toc--left,
  .toc--right {
    width: min(45%, 280px);
    margin-top: 0.3em;
    margin-bottom: 16px;
  }

  .toc--left {
    float: left;
    margin-right: 32px;
  }

  .toc--right {
    float: right;
    margin-left: 32px;
  }
}

/* Slides: cards shown one at a time. Without JavaScript they simply stack. Pills
   sit below the cards, and pin to the bottom of the window while the end of the
   group is out of view. Cards are a swipeable row on smaller screens. On larger
   ones they're layered in one spot, so the group is as tall as its tallest card. */

.slides { margin-block: clamp(48px, 7vw, 88px); }

.slides .card { margin-block: 0; }

.slides:not(.slides--ready) .card + .card { margin-top: 48px; }

.slides__pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.slides__pill {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--page);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.3;
  cursor: pointer;
}
.slides__pill:hover { border-color: var(--ink); }
.slides__pill[aria-selected="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.slides--ready {
  display: flex;
  flex-direction: column;
}

.slides--ready .slides__pills {
  position: sticky;
  bottom: 12px;
  z-index: 1;
  order: 2;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-self: center;
  max-width: 100%;
  margin: 24px 0 0;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--page);
  scrollbar-width: none;
}
.slides--ready .slides__pills::-webkit-scrollbar { display: none; }

.slides--ready .slides__pill {
  flex: none;
  white-space: nowrap;
}

.slides--ready .slides__track {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 24px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.slides--ready .slides__track::-webkit-scrollbar { display: none; }

.slides--ready .slides__track > .card {
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

@media (pointer: coarse) {
  .slides__pill {
    min-height: 44px;
    padding-inline: 18px;
  }
}

@media (min-width: 860px) {
  .slides--ready .slides__pills {
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 32px;
    overflow-x: visible;
  }

  .slides--ready .slides__track {
    display: grid;
    align-items: stretch;
    overflow: visible;
    scroll-snap-type: none;
  }

  .slides--ready .slides__track > .card {
    grid-area: 1 / 1;
    align-content: center;
  }

  .slides--ready .slides__track > .card[inert] {
    visibility: hidden;
    opacity: 0;
  }
}

@media (min-width: 860px) and (prefers-reduced-motion: no-preference) {
  .slides--ready .slides__track > .card {
    transition: opacity 180ms ease, visibility 180ms;
  }
}

/* Split: two columns on larger screens, stacked on smaller ones. */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 48px;
  margin-block: clamp(48px, 7vw, 88px);
}

.split__column > :first-child { margin-top: 0; }
.split__column > :last-child { margin-bottom: 0; }

@media (min-width: 860px) {
  .split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(32px, 5vw, 72px);
  }
}

/* Tiles: rows with an icon, a name and a line. Inset for their hover fill, so their
   icons still line up with the text around them. */

.tiles {
  margin: 0 0 0 -10px;
  padding: 0;
  list-style: none;
}

.tiles li { margin: 0; }

.tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}
main a.tile { text-decoration: none; }
a.tile:hover { background: var(--recess); }

.tile__icon {
  display: block;
  flex: none;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.tile__icon--initial {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--page);
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
}

.tile__body { min-width: 0; }

.tile__name {
  display: block;
  font-weight: 600;
  line-height: 1.3;
}

.tile__external {
  margin-inline-start: 3px;
  font-size: 0.8em;
  font-weight: 400;
}

.tile__text {
  display: block;
  font-size: 15px;
  line-height: 1.4;
}

/* Guide: menu, wide content, table of contents. Just the content on phones, under
   a menu that opens and closes. The menu and contents stay in view while scrolling. */

.guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.guide__content > h1:first-child { margin-top: 0; }

.guide__toc { display: none; }

/* Links are inset for their highlight, so this lines their text up with the page. */
.guide__menu,
.guide__toc { margin-inline-start: -10px; }

.guide__label {
  margin-bottom: 8px;
  padding-inline-start: 10px;
}

.guide__menu ul,
.guide__toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide__menu li + li,
.guide__toc li + li { margin-top: 2px; }

.guide__menu a,
.guide__toc a {
  display: block;
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  text-decoration: none;
}
.guide__menu a:hover,
.guide__toc a:hover { text-decoration: underline; text-underline-offset: 3px; }

.guide__menu a[aria-current] {
  background: var(--accent);
  color: var(--on-accent);
}

.guide__toc a { font-size: 14px; }
.guide__toc-item--3 a { padding-inline-start: 22px; }

.guide__toggle {
  display: flex;
  margin-inline-start: 10px;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 44px;
  padding-inline: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--page);
  font-size: 15px;
  list-style: none;
  cursor: pointer;
}
.guide__toggle::-webkit-details-marker { display: none; }
.guide__menu[open] > .guide__toggle { margin-bottom: 16px; }
.guide__menu nav .guide__label { display: none; }

@media (min-width: 860px) {
  .guide {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: clamp(32px, 4vw, 56px);
    align-items: start;
  }

  .guide__toggle { display: none; }
  .guide__menu nav .guide__label { display: block; }

  .guide__menu,
  .guide__toc {
    position: sticky;
    top: 56px;
    max-height: calc(100vh - 72px);
    overflow: hidden auto;
  }
}

@media (min-width: 1200px) {
  .guide--toc { grid-template-columns: 200px minmax(0, 1fr) 200px; }
  .guide__toc { display: block; }
}

/* Phones: the site's nav gets its own row under the title and call to action. */

@media (max-width: 720px) {
  .sitebar__inner {
    min-height: 0;
    padding-block: 12px 8px;
  }

  .sitebar__title { font-size: 19px; }

  .sitebar__nav {
    order: 3;
    flex-basis: 100%;
    gap: 20px;
  }

  .sitebar__cta { padding: 8px 14px; font-size: 14px; }
}

/* Touch: taller targets in the top bar and site nav. */

@media (pointer: coarse) {
  .topbar { --row: 44px; }
  .sitebar__link,
  .sitebar__cta {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding-block: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .skip-link { transition: transform 120ms ease; }
}
