/* 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);
  --link: light-dark(#006699, #8ab4f8); /* default link color */
  --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)));
  /* Inline code: Nord frost, tinted toward the page, so it takes --ink in both themes. */
  --code: light-dark(
    color-mix(in srgb, #88c0d0 28%, var(--page)),
    color-mix(in srgb, #88c0d0 20%, var(--page))
  ); /* nord8 */

  /* 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(--link);
  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;
}

/* The highlighter, =!like this!=: a felt-tip stroke, the same yellow on every site
   and in both themes, so its text is always black. It sits a little low, as a
   quick stroke does, with soft, uneven ends. It runs to the bottom of the line,
   so descenders stay on yellow: their black would vanish on a dark page. */
mark.marker {
  padding: 0 0.2em;
  border: 0;
  border-radius: 0.4em 0.15em 0.5em 0.2em / 0.3em 0.5em 0.25em 0.45em;
  background: linear-gradient(
    to bottom,
    transparent 8%,
    #fff176 8%,
    #ffee58 100%
  );
  color: #000000;
}

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;
}
code { background: var(--code); }
kbd {
  border: 1px solid var(--line);
  background: var(--recess);
}

/* Blocks of code are a step smaller than inline code, which has to sit in a line
   of text. They're in the opposite theme, scrollbars included, with a thin edge and
   a soft shadow to lift them off the page. Text stays pure black or white.

   Because of that flip, light-dark() in here is from the block's point of view:
   its first value is a light block, on the dark page. */
pre {
  color-scheme: dark;
  padding: 16px 20px;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.8em;
  line-height: 1.6;
  tab-size: 2;
  border: 1px solid light-dark(#d8dee9, #4c566a); /* nord4 / nord3 */
  border-radius: 10px;
  background: light-dark(#e5e9f0, #2e3440);       /* nord5 / nord0 */
  color: light-dark(#000000, #ffffff);
  /* No track, so an always-shown scrollbar keeps to the rounded corners. */
  scrollbar-color: light-dark(color-mix(in srgb, #4c566a 35%, #e5e9f0), #4c566a) transparent; /* nord3 */
  /* A light block glows faintly on the dark page; a dark one casts a shadow. */
  --pre-shadow: light-dark(rgb(236 239 244 / 0.07), rgb(46 52 64 / 0.14)); /* nord6 / nord0 */
  box-shadow: 0 1px 2px var(--pre-shadow), 0 8px 28px -10px var(--pre-shadow);
}
:root[data-theme="dark"] pre { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) pre { color-scheme: light; }
}
/* Each line, from code.js, hangs its wrapped parts two characters past its own
   indent. */
pre .line {
  display: block;
  padding-inline-start: calc((var(--indent) + 2) * 1ch);
  text-indent: calc((var(--indent) + 2) * -1ch);
}

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); }

/* Zoom: an image that opens larger over the page, in a dialog from zoom.js. Any
   click or Esc closes it again. */

.image__zoom {
  display: block;
  cursor: zoom-in;
}

.zoom {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(16px, 4vw, 48px);
  border: 0;
  background: none;
  cursor: zoom-out;
}
.zoom[open] {
  display: grid;
  place-items: center;
}
.zoom::backdrop {
  background: rgb(46 52 64 / 0.72); /* nord0 */
  backdrop-filter: blur(6px);
}

.zoom__images img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 2 * clamp(16px, 4vw, 48px));
  width: auto;
  height: auto;
  border-radius: 12px;
  /* Follows the picture's own shape: a box-shadow would outline the transparent
     margin around a window screenshot. */
  filter: drop-shadow(0 12px 32px rgb(0 0 0 / 0.35));
}

.zoom__close {
  position: fixed;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--page);
  color: var(--ink);
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .zoom[open],
  .zoom[open]::backdrop { animation: zoom-in 160ms ease-out; }
}
@keyframes zoom-in { from { opacity: 0; } }

/* Floated, with text wrapping around it. Narrow screens keep room for the text,
   unless the width is a percentage, which lifts the cap to 100%. */

.image--left,
.image--right {
  width: min(var(--image-width, 240px), var(--image-cap, 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; }

/* A list beside a floated image stays a column next to it, instead of its numbers
   sitting in the image's margin and its items wrapping underneath. */
.image--left + :is(ul, ol),
.image--right + :is(ul, ol) { display: flow-root; }

/* 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: var(--image-border, 1px) solid var(--line);
  border-radius: 12px;
}

/* Rounded corners, as a border's are unless round gives its own radius. */
.image--round img { border-radius: var(--image-round, 12px); }

/* A soft shadow: slate on the light page, and black on the dark one, where it
   takes more to show at all. A drop-shadow follows the picture's own shape, its
   rounded corners or a cut-out's outline, where a box-shadow would draw its box. */
.image--shadow img {
  filter:
    drop-shadow(0 1px 2px light-dark(rgb(46 52 64 / 0.1), rgb(0 0 0 / 0.3)))
    drop-shadow(0 8px 20px light-dark(rgb(46 52 64 / 0.16), rgb(0 0 0 / 0.5)));
}


/* A screenshot in a simulated phone: rounded corners and a wide black bezel, which
   scale with the shot's width (7px and 40px at its usual 256px). */

.image--shot { max-width: var(--image-width, 256px); container-type: inline-size; }
.image--shot figcaption { text-align: center; margin-inline: auto; }
.image--shot:not(.image--left, .image--right) { margin-inline: auto; }
.image--shot.image--left,
.image--shot.image--right { margin-block-end: 24px; }
.image--shot.image--left { margin-inline-end: 40px; }
.image--shot.image--right { margin-inline-start: 40px; }

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

/* 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; }

/* Get: where to get the app, a block for each platform. Each place it comes from
   is a button with a line beside it saying what that place is: the App Store in
   the brand colour, the beta as a quieter outline. On /guide/get/, and in the
   dialog that get.js opens over any other page. */

.get {
  display: grid;
  gap: 28px;
  margin-block: 24px;
}

.get .get__name {
  margin: 0 0 4px;
  font-size: 22px;
}

.get__note {
  margin: 0;
  opacity: 0.75;
}

.get .get__options {
  display: grid;
  gap: 14px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.get__option {
  display: grid;
  grid-template-columns: 8.5em minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin: 0;
}

.get__link,
main a.get__link,
main a.get__link:hover {
  padding: 9px 12px;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-slab);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}
.get__link--quiet,
main a.get__link--quiet,
main a.get__link--quiet:hover {
  border-color: var(--line-strong);
  background: none;
  color: var(--ink);
}

.get__text {
  padding-top: 8px;
  font-size: 15px;
  line-height: 1.45;
}

@media (max-width: 480px) {
  .get__option { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .get__text { padding-top: 0; }
}

.get-dialog {
  width: min(560px, calc(100% - 2 * var(--gutter)));
  max-height: calc(100dvh - 2 * var(--gutter));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--page);
  color: var(--ink);
  box-shadow: 0 24px 64px rgb(0 0 0 / 0.3);
}
.get-dialog::backdrop {
  background: rgb(46 52 64 / 0.6); /* nord0 */
  backdrop-filter: blur(6px);
}

.get-dialog__box { padding: clamp(20px, 5vw, 32px); }
.get-dialog .get { margin-block: 20px 0; }
.get-dialog .get .get__name { font-size: 19px; }

.get-dialog__title {
  margin: 0;
  padding-inline-end: 48px;
  font-size: 28px;
}

.get-dialog__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--page);
  color: var(--ink);
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .get-dialog[open],
  .get-dialog[open]::backdrop { animation: zoom-in 160ms ease-out; }
}

/* Socials: the networks' logos, in the text's colour, as quiet outlined pills
   beside the brand-coloured buttons. */

.socials { margin-block: 1.6em 0; }

.socials__lead {
  margin: 0 0 0.5em;
  font-size: 15px;
}

.socials__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.socials__list li { margin: 0; }

.social,
main a.social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 4px 16px 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  font: 500 15px/1.2 var(--font-slab);
  text-decoration: none;
}
main a.social:hover { background: var(--recess); }

.social__icon {
  flex: none;
  fill: currentColor;
}

.social__handle { font-weight: 400; }

/* 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,
.card__side,
.split__column { display: flow-root; }

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

.card__side > figure:only-child { 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; }

/* Changelog: one version's notes, folded as the FAQ's questions are, with a Beta
   or Release pill beside its name. Each change has its kind's pill in a column of
   its own, and the text beside it, as in the apps. The pills' colours are tints
   with an edge in the full colour, so their text stays black or white. */

.changelog { border-bottom: 1px solid var(--line); }
.changelog:first-of-type,
:not(.changelog) + .changelog { border-top: 1px solid var(--line); }

.changelog__summary {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-block: 16px;
  font-family: var(--font-serif);
  font-size: 1.15em;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
}
.changelog__summary::-webkit-details-marker { display: none; }
.changelog__summary::after {
  content: "";
  flex: none;
  align-self: center;
  width: 0.5em;
  height: 0.5em;
  margin-inline-start: auto;
  margin-inline-end: 0.2em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.15em) rotate(45deg);
}
.changelog[open] > .changelog__summary::after { transform: translateY(0.1em) rotate(-135deg); }

.changelog__type {
  flex: none;
  padding: 1px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font: 600 13px/1.4 var(--font-slab);
  white-space: nowrap;
}
.changelog__type--release {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.changelog__notes { padding-bottom: 20px; }
.changelog__notes > :first-child { margin-top: 0; }
.changelog__notes > :last-child { margin-bottom: 0; }
.changelog__notes h3 {
  margin: 1.4em 0 0.6em;
  font-family: var(--font-sans);
  font-size: 1em;
  font-weight: 600;
}

/* The pills line up in one column, through subgrid. It's at least as wide as a
   Changed pill, so each section's text starts at the same place, whatever its
   pills. A wider word widens its own section's. */
.changelog__notes ul:has(> .changelog__change) {
  display: grid;
  grid-template-columns: minmax(4.5em, max-content) minmax(0, 1fr);
  gap: 10px 12px;
  padding: 0;
  list-style: none;
}
.changelog__change {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: baseline;
  margin: 0;
}
.changelog__notes ul:has(> .changelog__change) > li:not(.changelog__change) { grid-column: 2; margin: 0; }
.changelog__text > p { margin: 0; }

.changelog__tag {
  --tag: #d8dee9; /* any other word: nord4 */
  justify-self: start;
  padding: 0 9px;
  border: 1px solid var(--tag);
  border-radius: 999px;
  background: light-dark(
    color-mix(in srgb, var(--tag) 30%, var(--page)),
    color-mix(in srgb, var(--tag) 35%, var(--page))
  );
  color: var(--ink);
  font: 600 13px/1.6 var(--font-slab);
  white-space: nowrap;
}
.changelog__tag--feature { --tag: #a3be8c; } /* nord14 */
.changelog__tag--bug { --tag: #d08770; }     /* nord12 */
.changelog__tag--changed { --tag: #b48ead; } /* nord15 */

/* Callout: a note set apart from the text, in its kind's Nord colour. The colour is
   a fill tinted toward the page, so the text stays --ink in both themes, plus a full
   colour edge. */

.callout {
  --callout: #88c0d0; /* note: nord8 */
  margin-block: 24px;
  padding: 14px 18px;
  border-left: 4px solid var(--callout);
  border-radius: 4px 8px 8px 4px;
  background: light-dark(
    color-mix(in srgb, var(--callout) 22%, var(--page)),
    color-mix(in srgb, var(--callout) 18%, var(--page))
  );
}

.callout--tip { --callout: #a3be8c; }       /* nord14 */
.callout--warning { --callout: #ebcb8b; }   /* nord13 */
.callout--important { --callout: #bf616a; } /* nord11 */

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

.callout__title { margin: 0 0 0.3em; }
.callout__body > :first-child { margin-top: 0; }
.callout__body > :last-child { margin-bottom: 0; }

/* Inline code needs a step more contrast than its usual tint, on a tinted box. */
.callout code:not(pre code) { background: color-mix(in srgb, var(--code) 70%, var(--page)); }

/* 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;
}

/* Journal: the list of posts at /journal/, under their years, and one post: a
   column of text with its date above and its neighbours below. */

.journal { max-width: 760px; }

.journal__year + .journal__year { margin-top: 40px; }

.journal__year-name {
  margin: 0 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 23px;
}

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

.journal__item {
  display: grid;
  grid-template-columns: 4.5em minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
  max-width: none;
  margin: 0;
  padding-block: 12px;
}
.journal__item + .journal__item { border-top: 1px solid var(--line); }

.journal__date { white-space: nowrap; }

.journal__title {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.25;
}

.journal__summary { margin: 4px 0 0; }

.journal__draft {
  display: inline-block;
  margin-inline-start: 6px;
  padding: 1px 9px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  font: 600 13px/1.4 var(--font-slab);
  vertical-align: 0.15em;
  white-space: nowrap;
}

.journal__feed {
  margin: 40px 0 0;
  font-size: 15px;
}

.post {
  max-width: 760px;
  margin-inline: auto;
}

.post__head { margin-bottom: clamp(28px, 4vw, 44px); }
.post__head h1 { margin: 0 0 12px; }
.post__journal { margin: 0 0 12px; }
.post__meta { margin: 0; }

.post__more {
  display: grid;
  gap: 12px;
  margin-top: clamp(48px, 7vw, 80px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

main a.post__next {
  display: block;
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.3;
  text-decoration: none;
}
main a.post__next:hover { text-decoration: underline; text-underline-offset: 3px; }
.post__next .label { display: block; }

@media (min-width: 600px) {
  .post__more { grid-template-columns: 1fr 1fr; gap: 24px; }
  .post__next--newer { grid-column: 2; text-align: end; }
}

/* 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;
}

/* A section's name, over its pages in the menu. Right under the "Guide" label it
   needs no space of its own. */
.guide__section {
  margin: 20px 0 6px;
  padding-inline-start: 10px;
}
.guide__label + .guide__section { margin-top: 0; }

.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; }
}
