/* Wands documentation: one stylesheet for every page. No scripts.
   A builder's handbook: warm earth and moss, slab headings, the real items in inventory slots, and one input chip
   for every gesture. Fonts and images are self-hosted next to this file (fonts/, images/). */

/* ---------------------------------------------------------------------------------------------------------------
   Fonts: Zilla Slab for headings, Atkinson Hyperlegible Next for text, Pixelify Sans for in-game text and keys.
   All SIL OFL 1.1, latin subsets from the fontsource packages; licences in fonts/. */

@font-face {
  font-family: "Zilla Slab";
  src: url(fonts/zilla-slab-latin-700-normal.woff2) format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Zilla Slab";
  src: url(fonts/zilla-slab-latin-600-normal.woff2) format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url(fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2) format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Pixelify Sans";
  src: url(fonts/pixelify-sans-latin-500-normal.woff2) format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

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

:root {
  color-scheme: light dark;

  --font-text: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Zilla Slab", Rockwell, "Roboto Slab", Georgia, serif;
  --font-pixel: "Pixelify Sans", ui-monospace, Menlo, Consolas, monospace;
  --font-code: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Earth and moss: birch paper, dark loam ink, moss for actions, oak for structure. */
  --paper: #efece3;
  --paper-sunk: #e5e0d2;
  --card: #faf8f2;
  --ink: #29251d;
  --ink-soft: #5b5446;
  --rule: #d7d0bf;
  --rule-strong: #b3a88f;
  --moss: #39661f;
  --moss-hover: #2c5016;
  --on-moss: #f7f5ec;
  --moss-edge: #23400f;
  --oak: #8a5a26;
  --focus: #1b63b8;

  /* Inventory slots: the item icons sit in them, as in the game's inventory. */
  --slot: #d6ccb4;
  --slot-dark: #a2957a;
  --slot-light: #f8f4ea;

  /* Input chips. Mouse inputs in the colours the preview mod draws with: right-click (which mostly places) teal like
     a placed block's outline, left-click (which mostly removes) berry like a removed block's box, scroll amber. */
  --key-bg: #faf8f2;
  --key-edge: #b3a88f;
  --r-ink: #0b5c66;
  --r-bg: #d6edf0;
  --r-edge: #86c0c8;
  --l-ink: #962057;
  --l-bg: #f7dde9;
  --l-edge: #dba0bd;
  --s-ink: #6e4c00;
  --s-bg: #f6e5b5;
  --s-edge: #d6b25c;

  /* The item's tooltip: a plain card in daylight, the game's own tooltip at night. */
  --tip-bg: var(--card);
  --tip-frame: var(--rule-strong);
  --tip-text: var(--ink);
  --tip-title: var(--ink-soft);

  /* The in-game hover tooltip on the hotbar. */
  --hover-bg: #1a0f22;
  --hover-frame: #5a2fc4;
  --hover-text: #fbf7ff;

  /* Stepped corners, one pixel step of 2 px; the pill has two steps. */
  --notch: polygon(2px 0, calc(100% - 2px) 0, calc(100% - 2px) 2px, 100% 2px, 100% calc(100% - 2px),
    calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 2px calc(100% - 2px), 0 calc(100% - 2px),
    0 2px, 2px 2px);
  --notch-top: polygon(2px 0, calc(100% - 2px) 0, calc(100% - 2px) 2px, 100% 2px, 100% 100%, 0 100%, 0 2px, 2px 2px);
  --notch-bottom: polygon(0 0, 100% 0, 100% calc(100% - 2px), calc(100% - 2px) calc(100% - 2px),
    calc(100% - 2px) 100%, 2px 100%, 2px calc(100% - 2px), 0 calc(100% - 2px));
  --pill: polygon(4px 0, calc(100% - 4px) 0, calc(100% - 4px) 2px, calc(100% - 2px) 2px, calc(100% - 2px) 4px,
    100% 4px, 100% calc(100% - 4px), calc(100% - 2px) calc(100% - 4px), calc(100% - 2px) calc(100% - 2px),
    calc(100% - 4px) calc(100% - 2px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 2px), 2px calc(100% - 2px),
    2px calc(100% - 4px), 0 calc(100% - 4px), 0 4px, 2px 4px, 2px 2px, 4px 2px);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Night in the woods: spruce-dark ground, warm lamplight text. */
    --paper: #1d1b16;
    --paper-sunk: #16140f;
    --card: #27241d;
    --ink: #efe9db;
    --ink-soft: #b8ae9a;
    --rule: #3a352b;
    --rule-strong: #5a5241;
    --moss: #a4d27b;
    --moss-hover: #bfe39d;
    --on-moss: #142008;
    --moss-edge: #5f8f3a;
    --oak: #d9a467;
    --focus: #6fc6f5;

    --slot: #353027;
    --slot-dark: #171410;
    --slot-light: #4d4537;

    --key-bg: #302c24;
    --key-edge: #6a614d;
    --r-ink: #8fdde8;
    --r-bg: #173a40;
    --r-edge: #2f6d76;
    --l-ink: #f5a8d2;
    --l-bg: #47223b;
    --l-edge: #84406c;
    --s-ink: #f2cb6b;
    --s-bg: #3d3115;
    --s-edge: #7d6327;

    --tip-bg: #211a29;
    --tip-frame: #6a4aa6;
    --tip-text: #f1c053;
    --tip-title: #b9a8d6;
  }
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.6;
}

img {
  image-rendering: pixelated;
}

.wrap {
  width: 100%;
  max-width: 76rem;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* Type scale: 17 px text, steps of about 1.25. */

h1,
h2,
h3 {
  font-family: var(--font-head);
  line-height: 1.12;
  color: var(--ink);
}

h1 {
  font-size: 2.875rem;
  font-weight: 700;
  letter-spacing: -.012em;
  margin: 0 0 .75rem;
}

h2 {
  font-size: 1.875rem;
  font-weight: 700;
  margin: 3.25rem 0 1rem;
  scroll-margin-top: 1.5rem;
}

h3 {
  font-size: 1.3125rem;
  font-weight: 600;
  margin: 2rem 0 .5rem;
}

p,
ul,
ol,
dl,
table {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.25rem;
}

li + li {
  margin-top: .35rem;
}

.lead {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--ink);
  max-width: 38em;
}

.note {
  color: var(--ink-soft);
  font-size: .9375rem;
}

a {
  color: var(--moss);
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
}

a:hover {
  color: var(--moss-hover);
  text-decoration-thickness: .14em;
}

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

code {
  font-family: var(--font-code);
  font-size: .86em;
  padding: .08em .3em;
  background: var(--paper-sunk);
  border-radius: 3px;
  overflow-wrap: anywhere;
}

strong {
  font-weight: 700;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: .5rem .9rem;
  background: var(--moss);
  color: var(--on-moss);
  font-weight: 700;
}

.skip:focus {
  top: .75rem;
  color: var(--on-moss);
}

/* ---------------------------------------------------------------------------------------------------------------
   Input chips: one component for every gesture, in the cards, the gesture tables and the item's tooltip. Keys are
   pixel keycaps, the bottom edge a little deeper; Sneak carries the shift arrow. Mouse inputs are pills with the
   pressed button lit, each in its own colour. The word is always there; colour and glyph only help the eye. The
   glyphs are pixel SVGs (images/input/, one per theme in the chip's ink), drawn at 2 px a pixel. */

kbd {
  display: inline-block;
  min-width: 1.75em;
  margin: .1em .06em;
  padding: 0 .42em;
  border: 2px solid var(--key-edge);
  border-bottom-width: 4px;
  background: var(--key-bg);
  color: var(--ink);
  font-family: var(--font-pixel);
  font-size: .875em;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  text-indent: 0;
  white-space: nowrap;
  vertical-align: baseline;
  clip-path: var(--notch);
}

kbd.in-sneak::before,
kbd.in-r::before,
kbd.in-l::before,
kbd.in-scroll::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 18px;
  margin: 0 .3em 0 0;
  vertical-align: -4px;
  background: url(images/input/mouse-right.svg) 0 0 / 14px 18px no-repeat;
}

kbd.in-sneak {
  padding-left: .3em;
}

/* In running text a chip keeps to the line, so the lines around it stay evenly spaced. */
.prose :is(p, li, dd) kbd,
#mod :is(p, li) kbd {
  margin-block: 0;
  line-height: 1.2;
  vertical-align: 1px;
}

kbd.in-sneak::before {
  height: 16px;
  margin-right: .25em;
  vertical-align: -3px;
  background-image: url(images/input/sneak.svg);
  background-size: 14px 16px;
}

kbd.in-r,
kbd.in-l,
kbd.in-scroll {
  padding: 0 .5em 0 .32em;
  border-color: var(--chip-edge);
  background: var(--chip-bg);
  color: var(--chip-ink);
  clip-path: var(--pill);
}

kbd.in-r {
  --chip-ink: var(--r-ink);
  --chip-bg: var(--r-bg);
  --chip-edge: var(--r-edge);
}

kbd.in-l {
  --chip-ink: var(--l-ink);
  --chip-bg: var(--l-bg);
  --chip-edge: var(--l-edge);
}

kbd.in-l::before {
  background-image: url(images/input/mouse-left.svg);
}

kbd.in-scroll {
  --chip-ink: var(--s-ink);
  --chip-bg: var(--s-bg);
  --chip-edge: var(--s-edge);
}

kbd.in-scroll::before {
  background-image: url(images/input/mouse-scroll.svg);
}

@media (prefers-color-scheme: dark) {
  kbd.in-sneak::before {
    background-image: url(images/input/sneak-dark.svg);
  }

  kbd.in-r::before {
    background-image: url(images/input/mouse-right-dark.svg);
  }

  kbd.in-l::before {
    background-image: url(images/input/mouse-left-dark.svg);
  }

  kbd.in-scroll::before {
    background-image: url(images/input/mouse-scroll-dark.svg);
  }
}

/* In forced colours the chips keep their frame, and the focus rings drawn inside a box take the system's colour. */
@media (forced-colors: active) {
  kbd {
    border-color: CanvasText;
  }

  .button:focus-visible,
  .card:focus-within,
  .pager a:focus-visible,
  .toc a:focus-visible,
  .wand-nav li a:focus-visible {
    outline-color: Highlight;
  }
}

/* ---------------------------------------------------------------------------------------------------------------
   Header and footer */

.site-header {
  border-bottom: 2px solid var(--rule);
}

.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 2rem;
  padding-top: .85rem;
  padding-bottom: .85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-icon {
  width: 32px;
  height: 32px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.5rem;
  margin-left: auto;
  font-weight: 600;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: .2rem 0;
  border-bottom: 3px solid transparent;
}

.site-nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--rule-strong);
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--moss);
}

/* DE | EN: the same page in the other language, the current one underlined like the current page above. */
.lang-switch {
  display: flex;
  align-items: center;
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.lang-switch a {
  padding: .2rem .55rem;
  color: var(--ink-soft);
  line-height: 1.1;
  text-decoration: none;
}

.lang-switch a + a {
  border-left: 2px solid var(--rule-strong);
}

.lang-switch a:hover {
  color: var(--ink);
}

.lang-switch a[aria-current="true"] {
  color: var(--ink);
  text-decoration: underline 3px var(--moss);
  text-underline-offset: .35em;
}

/* Narrower screens: the brand and the language switch share the first line, the site's links take the second. */
@media (max-width: 48rem) {
  .site-nav {
    order: 1;
    flex-basis: 100%;
    margin-left: 0;
  }
}

.site-footer {
  margin-top: 5rem;
  padding: 1.75rem 0 3rem;
  border-top: 2px solid var(--rule);
  background: var(--paper-sunk);
  color: var(--ink-soft);
  font-size: .9375rem;
}

.site-footer p {
  margin: .25rem 0;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 3rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.25rem;
  font-weight: 600;
}

.footer-links a {
  color: var(--ink-soft);
}

.footer-links a:hover {
  color: var(--ink);
}

/* ---------------------------------------------------------------------------------------------------------------
   Inventory slots and the items in them */

.slot {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  background: var(--slot);
  box-shadow: inset 2px 2px 0 var(--slot-dark), inset -2px -2px 0 var(--slot-light);
}

.slot img {
  display: block;
}

.slot-sm {
  width: 44px;
  height: 44px;
}

.slot-sm img {
  width: 32px;
  height: 32px;
}

.slot-md {
  width: 64px;
  height: 64px;
}

.slot-md img {
  width: 48px;
  height: 48px;
}

.slot-lg {
  width: 88px;
  height: 88px;
}

.slot-lg img {
  width: 64px;
  height: 64px;
}

/* ---------------------------------------------------------------------------------------------------------------
   Start page */

.hero {
  padding-top: 3.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 3rem 4rem;
  align-items: stretch;
}

.hero-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 1.5rem;
}

/* One block placed, the preview's ghost blocks beside it, standing on the row of grass below the hero. */
.hero-ghosts {
  display: block;
  width: 240px;
  height: 144px;
  margin: auto 0 0 3rem;
  padding-top: 2.5rem;
  box-sizing: content-box;
}

.home h1 {
  font-size: 6rem;
  line-height: .9;
  letter-spacing: -.02em;
  margin-bottom: 1.25rem;
}

.home .lead {
  margin-bottom: 2rem;
}

/* The hotbar: every wand's item, a quick way to its page; hovering shows the name as the game would. */
.hotbar {
  display: grid;
  grid-template-columns: repeat(7, 56px);
  gap: 2px;
  width: max-content;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--slot-dark);
}

.hotbar li {
  margin: 0;
}

.hotbar .slot {
  width: 56px;
  height: 56px;
}

.hotbar .slot img {
  width: 48px;
  height: 48px;
}

.hotbar .slot:hover {
  background: var(--slot-light);
}

.hotbar .slot:focus-visible {
  outline-offset: 0;
  z-index: 2;
}

/* Thirteen wands, seven to a row: the last place is an empty slot, as in a hotbar with room to spare. */
.hotbar .slot-empty .slot {
  vertical-align: top;
  pointer-events: none;
}

/* The name is the link's text: hidden from sight (not from screen readers) until the slot is hovered or focused. */
.slot-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 3;
  width: 1px;
  height: 1px;
  overflow: hidden;
  padding: .2rem .55rem .25rem;
  border: 2px solid var(--hover-frame);
  background: var(--hover-bg);
  color: var(--hover-text);
  font-family: var(--font-pixel);
  font-size: .9375rem;
  line-height: 1.3;
  white-space: nowrap;
  transform: translateX(-50%);
  clip-path: inset(50%);
  pointer-events: none;
}

.slot:hover .slot-tip,
.slot:focus-visible .slot-tip {
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: var(--notch);
}

/* At the ends of a row the name opens inwards, so it never leaves the page. */
.hotbar li:nth-child(7n + 1) .slot-tip {
  left: 0;
  transform: none;
}

.hotbar li:nth-child(7n) .slot-tip {
  left: auto;
  right: 0;
  transform: none;
}

/* The download: the one call to action, standing on the ground like a signpost. */
.download {
  position: relative;
  margin-bottom: -2px;
  padding: 1.75rem 2rem 1.25rem;
  border: 2px solid var(--rule-strong);
  border-bottom: 0;
  background: var(--card);
  clip-path: var(--notch-top);
}

.download h2 {
  margin: 0 0 .5rem;
  font-size: 1.875rem;
}

.download-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.25rem;
  margin: 1.25rem 0 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem 1.3rem .6rem;
  border-bottom: 4px solid var(--moss-edge);
  background: var(--moss);
  color: var(--on-moss);
  font-size: 1.0625rem;
  font-weight: 700;
  text-decoration: none;
  clip-path: var(--notch);
}

.button:hover {
  background: var(--moss-hover);
  color: var(--on-moss);
}

/* A notched box clips anything outside it, so its focus ring is an outline drawn inside the edge: an outline, not a
   shadow, so it shows in forced colours too. On the moss button a light inner ring sets the blue off the green. */
.button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
  box-shadow: inset 0 0 0 5px var(--on-moss);
}

.build {
  color: var(--ink-soft);
  font-size: .9375rem;
}

/* The install steps are a real sequence, so they are numbered, each number in a slot. */
.steps {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  min-height: 2rem;
  margin: 0;
  padding: .2rem 0 .7rem 2.75rem;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: .1rem;
  width: 1.9rem;
  height: 1.9rem;
  background: var(--slot);
  box-shadow: inset 2px 2px 0 var(--slot-dark), inset -2px -2px 0 var(--slot-light);
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 1.0625rem;
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1.9rem;
  text-align: center;
}

.download .note {
  margin: 0;
  padding-top: .9rem;
  border-top: 2px dashed var(--rule);
}

/* The ground the start page stands on: a row of grass blocks at three times their size. */
.ground {
  height: 48px;
  background: url(images/block/grass_block_side.png) repeat-x 0 0 / 48px 48px;
  image-rendering: pixelated;
}

.section h2 {
  margin-top: 4rem;
}

/* Gestures on the start page: the mouse gestures as a table, undo and the spam rule as notes beside it. */
.gesture-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(17rem, 1fr);
  gap: 2rem 3rem;
  align-items: start;
  margin-top: 1.5rem;
}

.gesture-layout .gestures {
  margin: 0;
}

.gesture-notes {
  display: grid;
  gap: 1rem;
}

.note-card {
  padding: 1rem 1.25rem 1.05rem;
  border: 2px solid var(--rule-strong);
  background: var(--card);
  clip-path: var(--notch);
}

.note-card h3 {
  margin: 0 0 .45rem;
  font-size: 1.1875rem;
}

.note-card h3 code {
  font-size: .8em;
}

.note-card p {
  margin: 0;
}

.note-card code {
  white-space: nowrap;
}

/* The mod's keys and functions below the gestures: text at the measure of a wand page, a little room between keys. */
#mod > p {
  max-width: 43rem;
}

.keys {
  max-width: 43rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.keys li {
  margin: .45rem 0;
}

/* The wand cards: a guidebook entry each, the item in its slot. The whole card links to the wand's page. */
.wands {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  container-type: inline-size;
}

.wands > li {
  display: flex;
  margin: 0;
}

.card {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.25rem 1.4rem 1.1rem;
  border: 2px solid var(--rule-strong);
  background: var(--card);
  clip-path: var(--notch);
}

.card:hover {
  border-color: var(--oak);
}

.card:focus-within {
  border-color: var(--focus);
  outline: 2px solid var(--focus);
  outline-offset: -4px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: .9rem;
}

.card-name {
  margin: 0;
  font-size: 1.4375rem;
}

.card-name a {
  color: var(--ink);
  text-decoration: none;
}

.card-name a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card-name a:focus-visible {
  outline: none;
}

.card-item {
  margin: .2rem 0 0;
  color: var(--oak);
  font-weight: 600;
  font-size: .9375rem;
}

.card-text {
  margin: 0 0 .9rem;
}

.card-gestures {
  margin: 0 0 1rem;
  padding: .7rem 0 0;
  border-top: 2px dashed var(--rule);
  list-style: none;
  color: var(--ink-soft);
  font-size: .9375rem;
  line-height: 1.5;
}

.card-gestures li {
  margin: 0;
  padding: .12rem 0;
}

.card-gestures kbd {
  margin-top: 0;
  margin-bottom: 0;
}

.card-more {
  margin: auto 0 0;
  color: var(--moss);
  font-weight: 700;
  font-size: .9375rem;
}

.card:hover .card-more {
  text-decoration: underline;
  text-decoration-thickness: .12em;
  text-underline-offset: .18em;
}

/* After the wands, the rules for all of them: the same card, set back into the page. */
.card-more-tile {
  background: var(--paper);
  border-style: dashed;
}

/* It fills the last row: three to a row (from 66rem, 3 x 21rem and two gaps), 13 wands leave it two places. */
@container (min-width: 66rem) {
  .wands > li:last-child:nth-child(3n + 2) {
    grid-column: span 2;
  }
}

/* ---------------------------------------------------------------------------------------------------------------
   Wand pages and the commands page: the wand list on the left, the page in the middle, its contents on the right. */

.page {
  display: grid;
  grid-template-columns: 13.5rem minmax(0, 1fr);
  column-gap: 3rem;
  padding-top: 2.5rem;
}

.page > main {
  grid-column: 2;
  grid-row: 1;
}

.wand-nav {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  margin-inline: -5px;
  padding: .25rem 5px 1rem;
}

.wand-nav-title,
.toc-title {
  margin: 0 0 .5rem;
  color: var(--ink-soft);
  font-family: var(--font-head);
  font-size: 1.125rem;
  font-weight: 700;
}

.wand-nav-title a {
  color: inherit;
  text-decoration: none;
}

.wand-nav-title a:hover {
  color: var(--ink);
  text-decoration: underline;
}

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

.wand-nav li {
  margin: 0;
}

.wand-nav li a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .2rem .5rem .2rem .25rem;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  border-left: 3px solid transparent;
}

.wand-nav li a:hover {
  background: var(--paper-sunk);
  color: var(--ink);
}

/* The list scrolls, and a scrolling box cuts off what lies outside it: the links' focus ring is drawn inside them, and
   the list has 5 px to spare at the sides for the title's. */
.wand-nav li a:focus-visible {
  outline-offset: -3px;
}

.wand-nav li a[aria-current="page"],
.wand-nav li a[aria-current="true"] {
  background: var(--card);
  border-left-color: var(--moss);
  font-weight: 700;
}

.wand-nav img {
  width: 32px;
  height: 32px;
  flex: none;
}

.wand {
  display: grid;
  grid-template-columns: minmax(0, 43rem) minmax(11rem, 1fr);
  column-gap: 3rem;
  align-content: start;
}

.wand > * {
  grid-column: 1;
}

.wand-hero {
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--rule);
}

.wand-hero h1 {
  margin-bottom: .5rem;
}

.wand-hero .lead {
  margin-bottom: 1.75rem;
}

.doc-hero {
  padding-bottom: 1.25rem;
}

.doc-hero h1 {
  margin: 0;
}

/* The item and its tooltip, side by side, as when you hover the item in your inventory. */
.specimen {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.tooltip {
  flex: 1;
  min-width: 0;
  padding: .7rem 1.1rem .85rem;
  border: 2px solid var(--tip-frame);
  background: var(--tip-bg);
  clip-path: var(--notch);
}

.tooltip-title {
  margin: 0 0 .35rem;
  color: var(--tip-title);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.lore {
  margin: 0;
  padding: 0;
  color: var(--tip-text);
  font-family: var(--font-pixel);
  font-size: 1.0625rem;
  line-height: 1.5;
  list-style: none;
}

.lore li {
  margin: 0;
  padding: .1rem 0 .1rem 1rem;
  text-indent: -1rem;
}

.lore kbd {
  margin-top: 0;
  margin-bottom: 0;
  font-size: .8125em;
}

/* Item, command and permission as a strip of three: each name above its value. */
.facts {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: auto auto;
  grid-auto-columns: max-content;
  column-gap: 2.5rem;
  margin: 0;
}

.facts dt {
  color: var(--ink-soft);
  font-size: .875rem;
  font-weight: 600;
}

.facts dd {
  margin: .1rem 0 0;
  font-weight: 600;
}

/* The contents of a page: a sticky column beside the text when there is room. */
.toc {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: start;
  position: sticky;
  top: 1rem;
  padding-top: .35rem;
}

.toc ul {
  margin: 0;
  padding: 0 0 0 .1rem;
  list-style: none;
  border-left: 2px solid var(--rule);
}

.toc li {
  margin: 0;
}

.toc a {
  display: block;
  margin-left: -2px;
  padding: .3rem 0 .3rem .9rem;
  border-left: 2px solid transparent;
  color: var(--ink-soft);
  font-size: .9375rem;
  line-height: 1.35;
  text-decoration: none;
}

.toc a:hover {
  border-left-color: var(--moss);
  color: var(--ink);
}

.prose {
  max-width: 43rem;
}

/* Back to the contents, at the end of a long list, where the contents are no longer beside the text. */
.to-toc {
  display: none;
  margin: .75rem 0 0;
  font-size: .9375rem;
  font-weight: 600;
}

.toc-title {
  scroll-margin-top: 1rem;
}

.prose > section:first-child h2 {
  margin-top: 2.25rem;
}

/* Gesture tables: the gesture on the left, what it does on the right; the rows line up on their first line. */
.gestures {
  width: 100%;
  border-collapse: collapse;
}

.gestures th,
.gestures td {
  padding: .85rem 0;
  border-top: 2px solid var(--rule);
  text-align: left;
  vertical-align: baseline;
}

.gestures tr:last-child th,
.gestures tr:last-child td {
  border-bottom: 2px solid var(--rule);
}

.gestures th {
  width: 48%;
  padding-right: 1.25rem;
  font-weight: 600;
  line-height: 1.75;
}

.gestures th kbd {
  margin-top: 0;
  margin-bottom: 0;
}

.g-when {
  display: block;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: .9375rem;
  line-height: 1.4;
}

/* Tiles: a choice that shows best as a picture, the picture above its name and what it does. The modes are cards,
   one block, a mix and a pattern side by side; the clump sizes stand free, so they read as one scale. */
.tiles {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: auto 1fr;
  grid-auto-columns: minmax(0, 1fr);
  column-gap: 1.5rem;
  margin: 1.25rem 0 1.5rem;
}

.tiles dt {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
}

.tiles dt img {
  display: block;
  margin-bottom: .75rem;
  box-shadow: 0 0 0 2px var(--rule-strong);
}

.tiles-3 dt img {
  width: 128px;
  height: 128px;
}

.tiles-4 dt img {
  width: 96px;
  height: 96px;
}

.tiles dd {
  margin: .35rem 0 0;
  color: var(--ink-soft);
  font-size: .9688rem;
  line-height: 1.5;
}

.tiles-modes {
  column-gap: 1rem;
}

.tiles-modes dt {
  padding: 1rem 1rem .1rem;
  border: 2px solid var(--rule-strong);
  border-bottom: 0;
  background: var(--card);
  clip-path: var(--notch-top);
}

.tiles-modes dd {
  margin: 0;
  padding: .35rem 1rem 1rem;
  border: 2px solid var(--rule-strong);
  border-top: 0;
  background: var(--card);
  clip-path: var(--notch-bottom);
}

/* Scenes: renders of what a wand does in game, each a diorama on a transparent ground, so they stand on the page
   without a card. An animation shows its last frame instead to readers who ask for less motion (the <picture>'s
   still). The renders are drawn at twice their size and filtered, so they scale smoothly, not pixelated. */
.scene {
  margin: 1.75rem 0 2.25rem;
}

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

.scene figcaption {
  max-width: 38em;
  margin-top: .35rem;
  color: var(--ink-soft);
  font-size: .9375rem;
  line-height: 1.45;
}

/* The start page's showcase clip, filmed in a real client: at the width of a wand page's scenes, not of the page,
   centred. */
.home .scene {
  max-width: 45rem;
  margin-inline: auto;
}

/* A row of stills of the same build, one per variant, each named under its picture. */
.scene-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem 1.5rem;
}

.scene-items figure {
  margin: 0;
}

.scene .scene-items figcaption {
  margin-top: .1rem;
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.scene-grid {
  margin-top: 1rem;
}

.scene-grid > figcaption {
  margin-top: 1rem;
}

/* A catalog: one still per type, its in-game name under it (the tree types page). The stills are all the same
   size, each fitted to its tree, so that the rows line up. */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.catalog-grid > li {
  margin: 0;
}

.catalog-grid figure {
  margin: 0;
}

.catalog-grid img {
  display: block;
  width: 100%;
  height: auto;
}

.catalog-grid figcaption {
  margin-top: .1rem;
  line-height: 1.2;
  text-align: center;
}

.tree-name {
  display: block;
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 1.125rem;
  font-weight: 600;
}

.variants {
  display: block;
  margin-top: .1rem;
  color: var(--ink-soft);
  font-size: .875rem;
}

/* To a page of a wand's own that goes deeper into one part of it, and back. */
.more {
  margin: 1rem 0 0;
  font-weight: 600;
}

.more a::after {
  content: " →";
}

.back-link {
  margin: 0 0 .5rem;
  font-size: .9375rem;
  font-weight: 600;
}

.back-link a::before {
  content: "← ";
}

/* Options and commands: a name, then what it does, set off by a rule. */
.options,
.commands {
  margin: 1.25rem 0 1.5rem;
}

.options dt,
.commands dt {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
}

.options dd,
.commands dd {
  margin: .3rem 0 1.5rem;
  padding-left: 1rem;
  border-left: 3px solid var(--rule);
}

.options dd p,
.presets dd p {
  margin: 0;
}

.detail {
  display: block;
  margin-top: .2rem;
  color: var(--ink-soft);
  font-size: .9375rem;
}

/* Long lists of presets: numbered in the order the wand goes through them (the count starts again in each section
   and runs on across the groups inside it), the names in a column of their own, so the eye runs down the names and
   stops where it wants. */
section {
  counter-reset: preset;
}

.presets {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  margin: 1.25rem 0 2rem;
  border-bottom: 2px solid var(--rule);
}

.presets dt,
.presets dd {
  margin: 0;
  padding: .85rem 0 .95rem;
  border-top: 2px solid var(--rule);
}

.presets dt {
  grid-column: 1;
  display: flex;
  align-items: baseline;
  gap: .55rem;
  padding-right: 1.5rem;
  counter-increment: preset;
  font-family: var(--font-head);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.25;
}

.presets dt::before {
  content: counter(preset);
  flex: none;
  min-width: 1.6rem;
  color: var(--oak);
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
}

.presets dd {
  grid-column: 2;
}

/* Presets with a picture each (the Vegetation and Path Wands'): the picture at the left, its name and description beside it.
   The picture floats in the name's padding and the description keeps the same indent, so the text stays in one column
   however long it runs; each name clears the picture before it. */
.presets-pictured {
  --pic: 15rem;
  --pic-gap: 1.25rem;
  display: flow-root;
}

/* A long name wraps under itself, not under its number (1.6rem wide and .55rem off). */
.presets.presets-pictured dt {
  display: block;
  clear: both;
  padding: 1rem 0 .3rem calc(var(--pic) + var(--pic-gap) + 2.15rem);
  text-indent: -2.15rem;
}

.presets-pictured dt::before {
  display: inline-block;
  margin-right: .55rem;
  text-indent: 0;
}

.presets-pictured dt img {
  float: left;
  width: var(--pic);
  height: auto;
  margin: 0 0 1rem calc(-1 * (var(--pic) + var(--pic-gap) + 2.15rem));
}

.presets.presets-pictured dd {
  margin-left: calc(var(--pic) + var(--pic-gap));
  padding: 0 0 1rem;
  border-top: 0;
  overflow-wrap: break-word;
}

/* A palette's blocks, as a strip of the real textures, their names below. */
.palette {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
  margin-top: .6rem;
}

.palette .detail {
  margin: 0;
}

.swatches {
  display: inline-flex;
  flex: none;
  margin: 2px;
  box-shadow: 0 0 0 2px var(--rule-strong);
}

.swatches img {
  display: block;
  width: 32px;
  height: 32px;
}

/* Lists of points: square pixel bullets in oak; limits get a moss bullet, tips an outlined one. */
.prose ul:not([class]),
.points {
  padding: 0;
  list-style: none;
}

.prose ul:not([class]) > li,
.points > li {
  position: relative;
  padding-left: 1.5rem;
}

.prose ul:not([class]) > li::before,
.points > li::before {
  content: "";
  position: absolute;
  left: .25rem;
  top: .6em;
  width: 8px;
  height: 8px;
  background: var(--oak);
}

.points-limits > li::before {
  background: var(--moss);
}

.points-tips > li::before {
  background: none;
  box-shadow: inset 0 0 0 2px var(--oak);
}

.points > li + li {
  margin-top: .55rem;
}

/* Vanilla tree types and structure categories: numbered in the order the wand goes through them, in columns. */
.cycle {
  columns: 3 10.5rem;
  column-gap: 1.5rem;
  margin: .4rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: cycle;
}

.cycle li {
  display: flex;
  align-items: baseline;
  gap: .45rem;
  margin: 0;
  padding: .1rem 0;
  break-inside: avoid;
  counter-increment: cycle;
}

.cycle li::before {
  content: counter(cycle);
  flex: none;
  min-width: 1.4rem;
  color: var(--oak);
  font-family: var(--font-head);
  font-size: .9375rem;
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
}

/* Previous and next wand, at the end of each wand's page. */
.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 43rem;
  margin-top: 3.5rem;
}

.pager a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: .9rem;
  align-items: center;
  padding: .85rem 1rem;
  border: 2px solid var(--rule-strong);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  clip-path: var(--notch);
}

.pager a:hover {
  border-color: var(--oak);
}

.pager a:focus-visible {
  border-color: var(--focus);
  outline: 2px solid var(--focus);
  outline-offset: -4px;
}

.pager img {
  grid-row: span 2;
  width: 32px;
  height: 32px;
}

.pager-dir {
  color: var(--ink-soft);
  font-size: .875rem;
}

.pager-name {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.pager .pager-next {
  grid-column: 2;
  grid-template-columns: minmax(0, 1fr) auto;
  text-align: right;
}

.pager .pager-next img {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.commands dt code {
  font-size: .8em;
}

/* ---------------------------------------------------------------------------------------------------------------
   Narrower screens */

/* No room for the contents column: it becomes a row of chips under the page's heading. */
@media (max-width: 75rem) {
  .wand {
    grid-template-columns: minmax(0, 43rem);
  }

  .to-toc {
    display: block;
  }

  .toc {
    grid-column: 1;
    grid-row: auto;
    position: static;
    padding-top: 1.5rem;
  }

  .toc ul {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    border-left: 0;
  }

  .toc a {
    margin: 0;
    padding: .3rem .7rem;
    border: 2px solid var(--rule);
    background: var(--card);
    color: var(--ink);
    clip-path: var(--notch);
  }

  .toc a:hover {
    border-color: var(--moss);
  }
}

/* The chips are notched, so their focus ring is drawn inside them (on phones they are plain links again). */
@media (min-width: 40.0625rem) and (max-width: 75rem) {
  .toc a:focus-visible {
    border-color: var(--focus);
    outline: 2px solid var(--focus);
    outline-offset: -4px;
  }
}

/* No room for the wand list beside the page: it moves to the end, as a grid. */
@media (max-width: 60rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .hero-intro {
    padding-bottom: 2.5rem;
  }

  .hero-ghosts {
    display: none;
  }

  .download {
    max-width: 40rem;
  }

  .gesture-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Undo and the spam rule side by side below the table. */
  .gesture-notes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page {
    grid-template-columns: minmax(0, 1fr);
  }

  .page > main,
  .wand-nav {
    grid-column: 1;
    grid-row: auto;
  }

  .wand-nav {
    position: static;
    max-height: none;
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--rule);
  }

  .wand-nav ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: .15rem 1rem;
  }
}

/* Phones */
@media (max-width: 40rem) {
  body {
    font-size: 1rem;
  }

  .wrap {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  h1 {
    font-size: 2.25rem;
  }

  h2 {
    font-size: 1.625rem;
    margin-top: 2.75rem;
  }

  .lead {
    font-size: 1.125rem;
  }

  /* Two stills a row, so that each stays large enough to read. */
  .scene-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
  }

  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

  /* An odd still out on the last row (grids of three or nine) stands in the middle, not alone at the left. */
  .scene-items > figure:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc((100% - 1rem) / 2);
  }

  .header-row {
    gap: .4rem 1rem;
  }

  .site-nav {
    gap: .1rem 1.1rem;
    font-size: .9375rem;
  }

  .hero {
    padding-top: 2rem;
  }

  .home h1 {
    font-size: 3.25rem;
  }

  .hero-intro {
    padding-top: 0;
    padding-bottom: 2rem;
  }

  .hotbar {
    grid-template-columns: repeat(7, 44px);
  }

  .hotbar .slot {
    width: 44px;
    height: 44px;
  }

  .hotbar .slot img {
    width: 32px;
    height: 32px;
  }

  .download {
    padding: 1.25rem 1.1rem 1rem;
  }

  .download h2 {
    font-size: 1.5rem;
  }

  .ground {
    height: 32px;
    background-size: 32px 32px;
  }

  .section h2 {
    margin-top: 3rem;
  }

  .gesture-notes {
    grid-template-columns: minmax(0, 1fr);
  }

  .wands {
    grid-template-columns: minmax(0, 1fr);
    gap: .85rem;
  }

  .card {
    padding: .9rem 1rem .85rem;
  }

  .card-head {
    gap: .85rem;
    margin-bottom: .6rem;
  }

  .card .slot-md {
    width: 56px;
    height: 56px;
  }

  .card-name {
    font-size: 1.3125rem;
  }

  .card-text {
    margin-bottom: .6rem;
  }

  .card-gestures {
    margin-bottom: .7rem;
    padding-top: .55rem;
  }

  .page {
    padding-top: 1.75rem;
  }

  /* The item's slot moves up beside the name; its tooltip takes the full width below. */
  .wand-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 1rem;
  }

  .wand-hero > *,
  .specimen > * {
    grid-column: 1 / -1;
  }

  .specimen {
    display: contents;
  }

  .wand-hero h1 {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    margin: 0;
  }

  /* On a page of a wand's own, the way back stays above the name. */
  .wand-hero .back-link {
    grid-row: 1;
  }

  .wand-hero .back-link + h1 {
    grid-row: 2;
  }

  .wand-hero .slot-lg {
    grid-column: 2;
    grid-row: 1;
    width: 72px;
    height: 72px;
  }

  .slot-lg img {
    width: 48px;
    height: 48px;
  }

  .wand-hero .lead {
    margin: .9rem 0 1.25rem;
  }

  .tooltip {
    margin: 0 0 1.25rem;
    padding: .6rem .85rem .7rem;
  }

  .lore {
    font-size: 1rem;
  }

  .lore li + li {
    margin-top: .2rem;
  }

  .facts {
    grid-auto-flow: row;
    grid-template-rows: none;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: .3rem 1rem;
  }

  .facts dt {
    padding-top: .1rem;
  }

  .facts dd {
    margin: 0;
  }

  /* The contents: a box at the top of the page, two columns of links. */
  .toc {
    margin-top: 1.5rem;
    padding: .8rem 1rem .7rem;
    border: 2px solid var(--rule-strong);
    background: var(--card);
    clip-path: var(--notch);
  }

  .toc-title {
    margin-bottom: .3rem;
  }

  .toc ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1rem;
  }

  .toc a {
    padding: .3rem 0;
    border: 0;
    background: none;
    color: var(--moss);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: .06em;
    clip-path: none;
  }

  /* Gesture rows stack: the gesture, then what it does. */
  .gestures tr {
    display: block;
    padding: .8rem 0;
    border-top: 2px solid var(--rule);
  }

  .gestures tr:last-child {
    border-bottom: 2px solid var(--rule);
  }

  .gestures th,
  .gestures td,
  .gestures tr:last-child th,
  .gestures tr:last-child td {
    display: block;
    width: auto;
    padding: 0;
    border: 0;
  }

  .gestures th {
    margin-bottom: .3rem;
  }

  /* Tiles become rows: the picture beside the name, what it does below. */
  .tiles {
    grid-auto-flow: row;
    grid-template-rows: none;
    grid-template-columns: minmax(0, 1fr);
  }

  .tiles dt {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
  }

  .tiles dt img {
    margin: 0;
  }

  /* The modes (64 px art) shrink to 1:1; the clump figures keep 96 px, as their 1 px detail needs whole pixels. */
  .tiles-3 dt img {
    width: 64px;
    height: 64px;
  }

  .tiles dd {
    margin-top: .5rem;
  }

  .tiles-modes dt {
    margin-top: .75rem;
    padding: .75rem .85rem .2rem;
  }

  .tiles-modes dd {
    margin: 0;
    padding: .3rem .85rem .85rem;
  }

  .presets {
    grid-template-columns: minmax(0, 1fr);
  }

  .presets dt {
    grid-column: 1;
    padding-right: 0;
    padding-bottom: .3rem;
  }

  .presets dd {
    grid-column: 1;
    padding-top: 0;
    padding-left: 2.15rem;
    border-top: 0;
  }

  /* Smaller pictures, still beside the text. German compounds are long for the narrow column beside them: they are
     hyphenated, or broken where no hyphen fits. */
  .presets-pictured {
    --pic: 9rem;
    --pic-gap: .75rem;
  }

  .presets.presets-pictured dd {
    hyphens: auto;
  }

  .pager {
    grid-template-columns: minmax(0, 1fr);
    gap: .6rem;
  }

  .pager .pager-next {
    grid-column: 1;
  }

  /* The wand list at the end: two columns of items. */
  .wand-nav ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .1rem .5rem;
  }

  .wand-nav li a {
    gap: .45rem;
    padding: .25rem .3rem .25rem .2rem;
    font-size: .9375rem;
  }

  /* Vanilla tree types and structure categories in two columns. */
  .cycle {
    columns: 2;
    column-gap: 1rem;
  }

  .footer-row {
    flex-direction: column;
    gap: .75rem;
  }
}

/* The narrowest phones: the wand names still fit on one line beside their 32 px icons, and the preset pictures
   shrink further, so that the text beside them keeps room for a word. */
@media (max-width: 23.5rem) {
  .presets-pictured {
    --pic: 6.5rem;
  }

  .wand-nav ul {
    column-gap: .25rem;
  }

  .wand-nav li a {
    gap: .3rem;
    padding-right: .1rem;
    padding-left: .15rem;
    font-size: .875rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
