/* The Spellbook of Azeroth: reader theme of azeroth/*.html.
   Hand-written. scripts/build_azeroth.py writes the pages, never this file.

   The book sets Warcraft's spells beside the old magic they echo, and the theme is a
   guild library's grimoire with two kinds of paper in it:
     page     parchment               text      iron-gall ink
     labels   brass small capitals    links     ink blue
     the spells   each number in a square spell slot, the steps on keycaps, the reagent
                  in a pouch: the furniture of a spellbook that is also a game
     the roots    on a second, older paper (the archive slip), stamped Echo or Borrowed
     ornaments    the wheel of forces: six gems, one per force, each across the ring from
                  its opposite, around the elements' circle and its four-pointed star. All
                  drawn here; no Blizzard art, logos or fonts anywhere.
   Every page sits in a force (<body data-force>): its accent colours the ornaments, the
   spell slots, the effect rule and the reading progress, a cast bar filling along the
   top. The front and back matter take brass. The cover is a dark binding in both themes,
   the gems lit. Dark mode, which follows the system setting like the rest of the site, is
   the same book in a candle-lit library. Every text colour passes WCAG AA (4.5:1) on its
   backgrounds in both themes, and the Caution callouts stay the loudest boxes.

   Type: "Old East Text", self-hosted (font-src 'self', no third-party request) and shared
   with The Old Book of the East (/old-east/fonts/): a subset of Gentium Book Plus by SIL
   International under the SIL Open Font License 1.1 (/old-east/fonts/OFL.txt), renamed
   because the licence reserves the name "Gentium" for unmodified fonts. It has every
   letter this book uses (ð þ đ š ā ī ū Œ …) and the small capitals of its labels. */

@font-face {
  font-family: "Old East Text";
  src: url("/old-east/fonts/old-east-text-regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Old East Text";
  src: url("/old-east/fonts/old-east-text-italic.woff") format("woff");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Old East Text";
  src: url("/old-east/fonts/old-east-text-bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Old East Text";
  src: url("/old-east/fonts/old-east-text-bold-italic.woff") format("woff");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --serif: "Old East Text", Cambria, "Noto Serif", Georgia, "Times New Roman", serif;
  --measure: 38rem;
  --reader-font-scale: 1;

  --page: #f3eee3;
  --panel: #e9e2d3;
  --ink: #26221b;
  --ink-strong: #15120d;
  --muted: #5c5446;
  --rule: #d6ccb8;
  --gold: #765612;
  --link: #23508c;
  --line: rgba(118, 86, 18, .32);
  --caution: #f7e0d2;
  --caution-ink: #8a2d0c;
  --caution-edge: #b4441c;
  --bar: rgba(243, 238, 227, .92);
  --shadow: rgba(40, 30, 15, .14);
  /* the archive slip of each root, and its stamps */
  --slip: #ece3cf;
  --slip-edge: #c9b994;
  --stamp-echo: #2f5878;
  --stamp-borrowed: #8b2232;
  /* the reagent pouch */
  --need: #efe8da;
  /* the seals: three gems, filled in the metal */
  --seal-gold: #b08419;
  --seal-silver: #7d878f;
  --seal-bronze: #9a5528;
  --seal-empty: #d4c9b2;
  /* the forces: text-safe on every background above */
  --f-arcane: #8a2f82;
  --f-fel: #3f660d;
  --f-light: #7a5800;
  --f-void: #5a3a94;
  --f-life: #1d7149;
  --f-death: #2c5f88;
  --f-elements: #a03f19;
  --f-spirit: #1a6873;
  --f-dragons: #83531f;
  /* the wheel on the Foundation page */
  --chart-bg: #f7f3ea;
  --chart-line: #b9ab8e;

  /* the cover is a dark binding in both themes; its gems are lit */
  --binding: #1c1d2c;
  --binding-mid: #131420;
  --binding-deep: #0a0a11;
  --parchment-light: #f1e8d3;
  --mist: #c9c4d6;
  --gilt: #dcbd74;
  --g-arcane: #e38ed6;
  --g-fel: #a6d867;
  --g-light: #f0d071;
  --g-void: #bba2f0;
  --g-life: #74d1a0;
  --g-death: #92c3ee;
  --button: #2a3a66;
  --button-deep: #1f2c51;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #14130f;
    --panel: #1e1c17;
    --ink: #e4ddce;
    --ink-strong: #f5f0e4;
    --muted: #aaa08d;
    --rule: #332f28;
    --gold: #d6b66a;
    --link: #9ec0ee;
    --line: rgba(214, 182, 106, .3);
    --caution: #2d1a11;
    --caution-ink: #f3a57c;
    --caution-edge: #c65f37;
    --bar: rgba(20, 19, 15, .9);
    --shadow: rgba(0, 0, 0, .5);
    --slip: #1b1914;
    --slip-edge: #4a4335;
    --stamp-echo: #94bfe6;
    --stamp-borrowed: #f09aa5;
    --need: #1a1814;
    --seal-gold: #ddb453;
    --seal-silver: #bcc5cc;
    --seal-bronze: #d58548;
    --seal-empty: #3b372f;
    --f-arcane: #e38ed6;
    --f-fel: #a6d867;
    --f-light: #e8c65e;
    --f-void: #bba2f0;
    --f-life: #74d1a0;
    --f-death: #92c3ee;
    --f-elements: #f29a66;
    --f-spirit: #73cdd6;
    --f-dragons: #dcab72;
    --chart-bg: #191813;
    --chart-line: #575041;
    --button: #33477a;
    --button-deep: #283a66;
  }
}

/* each page's force (front and back matter: brass) */
[data-force] { --force: var(--gold); }
[data-force="arcane"] { --force: var(--f-arcane); }
[data-force="fel"] { --force: var(--f-fel); }
[data-force="light"] { --force: var(--f-light); }
[data-force="void"] { --force: var(--f-void); }
[data-force="life"] { --force: var(--f-life); }
[data-force="death"] { --force: var(--f-death); }
[data-force="elements"] { --force: var(--f-elements); }
[data-force="spirit"] { --force: var(--f-spirit); }
[data-force="dragons"] { --force: var(--f-dragons); }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  @view-transition { navigation: auto; }
}
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.5;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
  text-decoration-color: color-mix(in srgb, var(--link) 45%, transparent);
}
a:hover { text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--link) 70%, transparent);
  outline-offset: 3px;
  border-radius: 3px;
}
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 40;
  padding: .55rem 1rem;
  border-radius: .4rem;
  background: var(--ink-strong);
  color: var(--page);
  text-decoration: none;
}
.skip-link:focus { top: .5rem; }
/* read aloud, not shown: "Spell", the colons of labels */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- the wheel of forces (the emblem) ---------- */
.wh-ring { fill: none; stroke: var(--gold); stroke-width: 1.4; }
.wh-axis { fill: none; stroke: var(--gold); stroke-width: .9; stroke-dasharray: 2 3; opacity: .7; }
.wh-core { fill: var(--page); stroke: var(--gold); stroke-width: 1.4; }
.wh-star { fill: var(--gold); }
.wh-gem { stroke: var(--page); stroke-width: 1.4; stroke-linejoin: round; }
.wh-arcane { fill: var(--f-arcane); }
.wh-fel { fill: var(--f-fel); }
.wh-light { fill: var(--f-light); }
.wh-void { fill: var(--f-void); }
.wh-life { fill: var(--f-life); }
.wh-death { fill: var(--f-death); }
.wh-halo { fill: none; stroke: var(--gilt); stroke-width: .6; opacity: .4; }
/* a chapter's force lit, the others dimmed */
.has-lit .wh-gem:not(.is-lit) { opacity: .34; }
.has-lit .wh-gem.is-lit { stroke-width: 1.8; filter: drop-shadow(0 0 3px color-mix(in srgb, var(--force) 75%, transparent)); }
.has-lit .wh-core.is-lit { fill: color-mix(in srgb, var(--force) 22%, var(--page)); stroke: var(--force); stroke-width: 2.2; }
.has-lit .wh-star.is-lit { fill: var(--force); }
.has-lit .wh-ring.is-lit { stroke: var(--force); stroke-width: 2.6; }
.has-lit:has(.wh-core.is-lit, .wh-star.is-lit, .wh-ring.is-lit) .wh-gem { opacity: .4; }
/* the top-bar mark: one colour */
.wm-ring { fill: none; stroke: currentColor; }
.wm-dot, .wm-star { fill: currentColor; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 3rem;
  padding: .35rem 1.25rem;
  background: var(--bar);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar-book, .topbar-back {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  min-height: 2.25rem;
  color: var(--ink-strong);
  font-size: .95rem;
  font-variant-caps: all-small-caps;
  letter-spacing: .12em;
  text-decoration: none;
}
.topbar-book:hover span, .topbar-back:hover { text-decoration: underline; text-underline-offset: .25em; }
.topbar-book .mark { flex: none; width: 1.35rem; height: 1.35rem; color: var(--force); }
.font-controls { display: flex; gap: .35rem; }
.font-btn {
  min-width: 2.75rem;
  min-height: 2.25rem;
  padding: .25rem .5rem;
  border: 1px solid var(--rule);
  border-radius: .45rem;
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: .9rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.font-btn:hover { border-color: var(--force); background: var(--panel); color: var(--ink-strong); }
/* reading progress: a cast bar filling along the bottom of the top bar, a bright spark at
   its leading edge (scroll-driven, no script) */
@supports (animation-timeline: scroll()) {
  .topbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--force) 45%, transparent), var(--force));
    transform-origin: 0 50%;
    transform: scaleX(0);
    animation: az-cast linear both;
    animation-timeline: scroll(root block);
  }
  .topbar::before {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 3px;
    width: 7px;
    height: 7px;
    margin-left: -3.5px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--force) 30%, #fff);
    box-shadow: 0 0 7px 2px color-mix(in srgb, var(--force) 60%, transparent);
    animation: az-spark linear both;
    animation-timeline: scroll(root block);
  }
  @keyframes az-cast { to { transform: scaleX(1); } }
  @keyframes az-spark { to { left: calc(100% - 3.5px); } }
  .topbar-cover::before, .topbar-cover::after { display: none; }
}

/* ---------- the text column ---------- */
.book-text {
  max-width: calc(var(--measure) + 2.5rem);
  margin: 0 auto;
  padding: 3rem 1.25rem 3.5rem;
  font-size: calc(1.1875rem * var(--reader-font-scale));
  line-height: 1.72;
}
/* Generic text rules sit inside :where() (no specificity), so every component
   class below overrides them without !important. */
:where(.book-text) p { margin: 0 0 1em; text-wrap: pretty; -webkit-hyphens: auto; hyphens: auto; }
/* no automatic hyphens in foreign terms, labels and headings */
:where(.book-text) :is(em, h1, h2, h3, [lang]:not([lang="en"])), .rubric, .prov-cap, .kin-stamp {
  -webkit-hyphens: manual;
  hyphens: manual;
}
:where(.book-text) strong { font-weight: 700; }

.chapter-head { margin: .5rem 0 2.5rem; text-align: center; }
.kicker {
  margin: 0 0 .55rem;
  font-size: .88em;
  font-variant-caps: all-small-caps;
  letter-spacing: .22em;
  color: var(--force);
}
.chapter-head h1 {
  margin: 0;
  font-size: 2.45em;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.005em;
  color: var(--ink-strong);
  text-wrap: balance;
}
.h1-gloss {
  display: block;
  margin-top: .45rem;
  font-size: .5em;
  font-style: italic;
  line-height: 1.35;
  letter-spacing: 0;
  color: var(--muted);
}
.chapter-span { margin: .85rem 0 0 !important; font-size: .86em; letter-spacing: .02em; color: var(--muted); }
.ornament { width: 4.6rem; margin: 1.4rem auto 0; }
.ornament svg { display: block; width: 100%; height: auto; }
/* a chapter's place on the wheel, linked to the whole of it in the Foundation */
.force-mark {
  display: block;
  width: 7rem;
  margin: 1.05rem auto 0;
  padding: .3rem;
  border-radius: 50%;
  transition: background-color .15s;
}
.force-mark:hover { background: color-mix(in srgb, var(--panel) 70%, transparent); }
.force-mark svg { display: block; width: 100%; height: auto; }

/* the opening paragraph: its first line in small capitals */
.lede { font-size: 1.07em; line-height: 1.7; }
.lede::first-line { font-variant-caps: small-caps; letter-spacing: .025em; }

/* "In this chapter" / "On this page" */
.in-book {
  margin: 2.2rem 0 .5rem;
  padding: 1rem 1.25rem 1.05rem;
  border: 1px solid var(--rule);
  border-radius: .7rem;
  background: color-mix(in srgb, var(--panel) 55%, transparent);
  font-size: .9em;
  line-height: 1.4;
}
.in-book-cap {
  margin: 0 0 .55rem !important;
  font-size: .95em;
  font-variant-caps: all-small-caps;
  letter-spacing: .18em;
  color: var(--gold);
}
.in-book ol { margin: 0; padding: 0; list-style: none; }
.in-book li { margin: 0; padding: 0; }
.in-book a, .toc-entries a {
  display: grid;
  grid-template-columns: 2.3rem minmax(0, 1fr) auto;
  column-gap: .5rem;
  align-items: baseline;
  padding: .34rem 0;
  color: var(--ink-strong);
  text-decoration: none;
}
.in-page a { display: block; color: var(--link); }
.in-page a:hover { text-decoration: underline; text-underline-offset: .18em; }
.in-book a:hover .toc-name, .toc-entries a:hover .toc-name {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
.toc-n { grid-column: 1; text-align: right; color: var(--force); }
.toc-name { grid-column: 2; }
.toc-seal { grid-column: 3; grid-row: 1; align-self: center; }
.toc-seal .gauge { margin: 0; }

/* ---------- spells ---------- */
.spell { margin-top: 4.4rem; }
.spell > h2 {
  margin: 0 0 1.35rem;
  font-size: 1.62em;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.005em;
  text-align: center;
  color: var(--ink-strong);
  text-wrap: balance;
  scroll-margin-top: 4.5rem;
}
/* the number: a square spell slot on a ruled line */
.sp-num {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1rem;
  font-size: .5em;
  line-height: 1;
  color: var(--ink-strong);
}
.sp-num::before, .sp-num::after { content: ""; flex: 1 1 0; height: 1px; }
.sp-num::before { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--force) 45%, transparent)); }
.sp-num::after { background: linear-gradient(90deg, color-mix(in srgb, var(--force) 45%, transparent), transparent); }
.sp-slot {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.75em;
  height: 2.75em;
  border: 1.5px solid var(--force);
  border-radius: .5em;
  background:
    linear-gradient(150deg, color-mix(in srgb, var(--force) 20%, var(--panel)) 0%, var(--panel) 55%,
      color-mix(in srgb, var(--force) 10%, var(--panel)) 100%);
  box-shadow:
    inset 0 0 0 3px var(--page),
    inset 0 0 0 4px color-mix(in srgb, var(--force) 35%, transparent),
    0 2px 0 -.5px color-mix(in srgb, var(--force) 30%, transparent);
  font-size: 1.15em;
  letter-spacing: 0;
}
.sp-name { display: block; }

/* the provenance label: source and seal */
.provenance {
  margin: 0 0 1.5rem;
  padding: .8rem 1.15rem .85rem;
  border: 1px solid var(--rule);
  border-radius: .6rem;
  background: color-mix(in srgb, var(--panel) 50%, transparent);
  font-size: .88em;
  line-height: 1.55;
}
.prov-row { display: grid; grid-template-columns: 4.9em minmax(0, 1fr); column-gap: .6rem; margin: 0 !important; }
.prov-row + .prov-row { margin-top: .45rem !important; padding-top: .45rem; border-top: 1px dashed var(--rule); }
.prov-cap { font-variant-caps: all-small-caps; letter-spacing: .14em; color: var(--gold); }
.metal { font-variant-caps: all-small-caps; letter-spacing: .07em; white-space: nowrap; color: var(--ink-strong); }
.metal-gold { --seal: var(--seal-gold); }
.metal-silver { --seal: var(--seal-silver); }
.metal-bronze { --seal: var(--seal-bronze); }
/* the gauge: Gold fills three gems, Silver two, Bronze one */
.gauge { display: inline-flex; align-items: center; gap: .18em; margin-right: .45em; vertical-align: .02em; }
.gauge i {
  display: block;
  width: .74em;
  height: .64em;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  background: var(--seal-empty);
}
.gauge i.on {
  background: linear-gradient(160deg, color-mix(in srgb, var(--seal) 50%, #fff) 0%, var(--seal) 55%,
    color-mix(in srgb, var(--seal) 80%, #000) 100%);
}

/* the reagent pouch */
.need {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: .7rem;
  align-items: start;
  margin: 0 0 1.4rem;
  padding: .7rem 1rem .75rem;
  border: 1px dashed var(--slip-edge);
  border-radius: .6rem;
  background: var(--need);
  font-size: .9em;
  line-height: 1.58;
}
.need p { margin: 0; }
.need-icon { width: 1.5rem; height: 1.5rem; margin-top: .05rem; color: var(--force); }
.need-cap { font-variant-caps: all-small-caps; letter-spacing: .14em; color: var(--gold); }

/* the casting */
.casting-head {
  margin: 1.9rem 0 .8rem;
  font-size: 1em;
  font-weight: 400;
  line-height: 1.4;
  font-variant-caps: all-small-caps;
  letter-spacing: .16em;
  color: var(--gold);
}
.casting-note { font-variant-caps: normal; letter-spacing: 0; font-style: italic; color: var(--muted); }
/* the steps, numbered on keycaps */
:where(.book-text) .steps { margin: 0 0 1.5em; padding: 0; list-style: none; counter-reset: step; }
.steps > li { position: relative; margin: 0 0 .75em; padding-left: 2.6rem; counter-increment: step; }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: .08em;
  display: grid;
  place-items: center;
  width: 1.72rem;
  height: 1.66rem;
  border: 1px solid color-mix(in srgb, var(--force) 40%, var(--rule));
  border-bottom-width: 3px;
  border-radius: .36rem;
  background: linear-gradient(180deg, var(--page), var(--panel));
  font-size: .78em;
  line-height: 1;
  color: var(--ink-strong);
}
.step-lead { color: var(--ink-strong); }
:where(.book-text) .steps ul { margin: .45em 0 .2em; padding-left: 1.15em; }

/* "Promised effect": what the spell does, ruled in the force's colour */
.effect { margin: 1.6rem 0; padding: .15rem 0 .15rem 1.15rem; border-left: 3px solid var(--force); }
.effect p { margin: 0; }
.effect-cap, .note-cap {
  margin-right: .15em;
  font-weight: 400;
  font-variant-caps: all-small-caps;
  letter-spacing: .12em;
  color: var(--gold);
}
.note { margin: 1.3rem 0 0; font-size: .9em; line-height: 1.62; }

/* "Caution" and the plain rules: the loudest boxes on the page */
.caution {
  display: grid;
  grid-template-columns: 1.55rem minmax(0, 1fr);
  gap: .85rem;
  align-items: start;
  margin: 1.6rem 0;
  padding: .95rem 1.15rem;
  border-left: 4px solid var(--caution-edge);
  border-radius: 0 .7rem .7rem 0;
  background: var(--caution);
  font-size: .94em;
  line-height: 1.6;
}
.caution p { margin: 0; }
.caution-icon { width: 1.55rem; height: 1.55rem; margin-top: .05rem; color: var(--caution-ink); }
.caution-cap { color: var(--caution-ink); }
.caution-rules { margin: 2.4rem 0 1.6rem; padding: 1.1rem 1.3rem 1.15rem; }
.caution-head {
  margin: 0 0 .45rem;
  font-size: 1.12em;
  font-weight: 700;
  line-height: 1.35;
  color: var(--caution-ink);
  scroll-margin-top: 4.5rem;
}
:where(.book-text) .caution-rules ul { margin: 0; padding-left: 1.15em; }
.caution-rules li::marker { color: var(--caution-ink); }

/* the root: the old world's half of the spell, on an archive slip */
.root {
  position: relative;
  margin: 2rem 0 .4rem;
  padding: 1rem 1.2rem 1rem 1.35rem;
  border: 1px solid var(--slip-edge);
  border-left: 4px double var(--slip-edge);
  border-radius: .2rem .6rem .6rem .2rem;
  background: var(--slip);
  box-shadow: 0 1px 0 var(--shadow);
  font-size: .94em;
  line-height: 1.66;
}
.root p { margin: 0; }
.root-cap, .kin-cap {
  margin-right: .3em;
  font-variant-caps: all-small-caps;
  letter-spacing: .14em;
  color: var(--gold);
}
.kinship {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: .55rem;
  row-gap: .25rem;
  margin-top: .7rem !important;
  padding-top: .65rem;
  border-top: 1px dashed var(--slip-edge);
}
.kin-cap { margin-right: 0; }
.kin-stamp {
  display: inline-block;
  padding: .02rem .5rem .08rem;
  border: 1.5px solid currentColor;
  border-radius: .25rem;
  font-variant-caps: all-small-caps;
  font-weight: 700;
  letter-spacing: .16em;
  line-height: 1.3;
  transform: rotate(-2deg);
}
.kin-echo { color: var(--stamp-echo); }
.kin-borrowed { color: var(--stamp-borrowed); }

/* ---------- front and back matter ---------- */
.sub-head {
  margin: 2.7rem 0 .8rem;
  font-size: 1.3em;
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink-strong);
  scroll-margin-top: 4.5rem;
}
.rubric {
  font-weight: 400;
  font-variant-caps: all-small-caps;
  letter-spacing: .1em;
  color: var(--gold);
}
.li-lead { color: var(--ink-strong); }
.fan-note {
  margin: 2.2rem 0 0 !important;
  padding: .8rem 1.05rem;
  border: 1px solid var(--rule);
  border-radius: .6rem;
  font-size: .86em;
  line-height: 1.6;
  color: var(--muted);
}

/* lists */
:where(.book-text) :is(ul, ol) { margin: 0 0 1.2em; padding-left: 1.5em; }
:where(.book-text) li { margin: .45em 0; padding-left: .25em; }
:where(.book-text) ul > li::marker { color: var(--force); }

/* tables */
.table-wrap { margin: 1.5rem 0 1.9rem; overflow-x: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .84em; line-height: 1.5; }
.table-wrap th {
  padding: .55rem .7rem;
  border-bottom: 2px solid var(--line);
  font-size: 1.02em;
  font-weight: 400;
  font-variant-caps: all-small-caps;
  letter-spacing: .1em;
  text-align: left;
  vertical-align: bottom;
  color: var(--gold);
}
.table-wrap td { padding: .6rem .7rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table-wrap tbody tr:nth-child(even) { background: color-mix(in srgb, var(--panel) 50%, transparent); }
.table-wrap td:first-child { color: var(--ink-strong); }
table.seals td:first-child, table.borrowed td:first-child, table.forces td:first-child { font-weight: 700; }
table.seals td:first-child, table.kinships td:first-child, table.shelf td:first-child { white-space: nowrap; }
table.seals .metal { font-variant-caps: normal; letter-spacing: 0; }
table.kinships .kin-stamp { font-size: .95em; }
table.borrowed td:first-child { white-space: nowrap; }
/* the borrowed names widen past the text on large screens */
@media (min-width: 64rem) {
  .table-wide {
    --wide: min(60rem, calc(100vw - 4rem));
    margin-left: calc(50% - var(--wide) / 2);
    margin-right: calc(50% - var(--wide) / 2);
  }
  .table-wide table { font-size: .82em; }
}

/* ---------- "At a glance": the wheel of forces, drawn ---------- */
.glance {
  margin: 1.4rem 0 2.2rem;
  padding: 1.15rem 1.25rem 1rem;
  border: 1px solid var(--rule);
  border-radius: .8rem;
  background: var(--chart-bg);
  scroll-margin-top: 4.5rem;
}
@media (min-width: 64rem) {
  .glance {
    --wide: min(46rem, calc(100vw - 4rem));
    margin-left: calc(50% - var(--wide) / 2);
    margin-right: calc(50% - var(--wide) / 2);
  }
}
.glance-title { margin: 0 0 .2rem !important; font-size: 1.02em; font-weight: 700; line-height: 1.35; color: var(--ink-strong); }
.glance-sub { margin: 0 0 .7rem !important; font-size: .84em; line-height: 1.45; color: var(--muted); }
.wheel-svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--serif); }
.wheel-narrow { display: none; }
@media (max-width: 40rem) {
  .wheel-wide { display: none; }
  .wheel-narrow { display: block; }
}
.w-spoke { fill: none; stroke: var(--chart-line); stroke-width: 1.1; stroke-dasharray: 3 4; }
.w-core { fill: color-mix(in srgb, var(--panel) 80%, var(--chart-bg)); stroke: var(--chart-line); stroke-width: 1.25; }
.w-pair { fill: none; stroke: var(--chart-line); stroke-width: 1.3; }
.w-pair-tip { fill: none; stroke: var(--chart-line); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.w-name { fill: var(--ink-strong); font-size: 14.5px; font-weight: 700; }
.w-sub { fill: var(--ink); font-size: 12.5px; }
.w-quiet { fill: var(--muted); font-size: 12px; }
.w-quiet a { fill: var(--link); }
.w-force .w-box { stroke-width: 1.7; }
.w-arcane { --w: var(--f-arcane); }
.w-fel { --w: var(--f-fel); }
.w-light { --w: var(--f-light); }
.w-void { --w: var(--f-void); }
.w-life { --w: var(--f-life); }
.w-death { --w: var(--f-death); }
.w-force .w-box { fill: color-mix(in srgb, var(--w) 11%, var(--chart-bg)); stroke: var(--w); }
.w-force:hover .w-box, .w-force:focus-visible .w-box { fill: color-mix(in srgb, var(--w) 20%, var(--chart-bg)); }
.w-force:hover .w-name, .w-force:focus-visible .w-name { text-decoration: underline; text-decoration-thickness: 1px; }
.wheel-svg a { text-decoration: none; }
.glance figcaption { margin: .8rem 0 0; font-size: .86em; line-height: 1.55; color: var(--muted); }
.glance-data { margin-top: .75rem; font-size: .86em; }
.glance-data summary {
  width: fit-content;
  cursor: pointer;
  font-variant-caps: all-small-caps;
  letter-spacing: .1em;
  color: var(--link);
}
.glance-data .table-wrap { margin: .5rem 0 0; }
.glance-data table { font-size: 1em; }

/* epigraph (the cover) */
.epigraph { max-width: 30rem; margin: 0 auto 2.4rem; text-align: center; }
.epigraph blockquote { margin: 0; }
.epigraph blockquote p {
  margin: 0;
  font-size: 1.32em;
  font-style: italic;
  line-height: 1.45;
  color: var(--ink-strong);
  -webkit-hyphens: manual;
  hyphens: manual;
}
.epigraph figcaption { margin-top: .75rem; font-size: .84em; line-height: 1.5; color: var(--muted); text-wrap: balance; }
.epigraph figcaption::before { content: "\2014\00a0"; }

/* ---------- previous / next, footer ---------- */
.pager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 1rem 1.25rem;
  max-width: calc(var(--measure) + 2.5rem);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 2rem;
  border-top: 1px solid var(--rule);
}
.pager a { text-decoration: none; }
.pager-prev, .pager-next {
  display: block;
  padding: .7rem .95rem;
  border: 1px solid var(--rule);
  border-radius: .75rem;
  transition: border-color .15s, background-color .15s;
}
.pager-prev:hover, .pager-next:hover { border-color: var(--force); background: color-mix(in srgb, var(--panel) 70%, transparent); }
.pager-next { text-align: right; }
.pager-dir { display: block; font-size: .85rem; font-variant-caps: all-small-caps; letter-spacing: .16em; color: var(--gold); }
.pager-title { display: block; margin-top: .15rem; font-size: 1rem; line-height: 1.3; color: var(--link); }
.pager-toc { align-self: center; font-size: .92rem; font-variant-caps: all-small-caps; letter-spacing: .16em; color: var(--muted); }
.pager-toc:hover { color: var(--link); }
.pager-empty { visibility: hidden; }

.book-foot {
  max-width: calc(var(--measure) + 2.5rem);
  margin: 0 auto;
  padding: .5rem 1.25rem 3rem;
  text-align: center;
  font-size: .82rem;
  line-height: 1.6;
  color: var(--muted);
}
.book-foot a { color: var(--muted); }
.book-foot a:hover { color: var(--link); }
.foot-note, .foot-fan { margin: 0 auto .7rem; max-width: 34rem; }
.foot-note strong { color: var(--ink); }
.foot-links { margin: 0; letter-spacing: .04em; }

/* ---------- cover ---------- */
.topbar-cover {
  position: relative;
  border-bottom: 0;
  background: var(--binding);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.topbar-cover .topbar-back { color: var(--parchment-light); }
.cover {
  position: relative;
  padding: 3.4rem 1.25rem 4.6rem;
  overflow: hidden;
  background-color: var(--binding-mid);
  background-image:
    radial-gradient(ellipse 55% 42% at 50% 26%, rgba(187, 162, 240, .14), transparent 70%),
    linear-gradient(180deg, var(--binding) 0%, var(--binding-mid) 60%, var(--binding-deep) 100%);
  color: var(--parchment-light);
  text-align: center;
}
/* the binding: two gilt rules tooled inside its edge */
.cover::before, .cover::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid rgba(220, 189, 116, .34);
  border-radius: .5rem;
}
.cover::before { inset: .9rem; }
.cover::after { inset: 1.3rem; border-color: rgba(220, 189, 116, .16); }
.cover-inner { position: relative; z-index: 1; max-width: 40rem; margin: 0 auto; }
.cover-wheel { display: block; width: 12rem; height: auto; margin: 0 auto 1.1rem; overflow: visible; }
.cover-wheel .wh-ring, .cover-wheel .wh-core { stroke: var(--gilt); }
.cover-wheel .wh-axis { stroke: var(--gilt); opacity: .55; }
.cover-wheel .wh-core { fill: var(--binding-mid); }
.cover-wheel .wh-star { fill: var(--parchment-light); }
.cover-wheel .wh-gem { stroke: var(--binding-mid); }
.cover-wheel .wh-arcane { fill: var(--g-arcane); }
.cover-wheel .wh-fel { fill: var(--g-fel); }
.cover-wheel .wh-light { fill: var(--g-light); }
.cover-wheel .wh-void { fill: var(--g-void); }
.cover-wheel .wh-life { fill: var(--g-life); }
.cover-wheel .wh-death { fill: var(--g-death); }
.cover h1 {
  margin: 0;
  font-size: clamp(2.5rem, 7.5vw, 4.25rem);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: .005em;
  color: var(--parchment-light);
  text-wrap: balance;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .4);
}
.cover-sub {
  max-width: 31rem;
  margin: 1.15rem auto 0;
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--mist);
  text-wrap: balance;
}
.cover-sub2 { max-width: 33rem; margin: .6rem auto 0; font-size: 1rem; line-height: 1.55; color: var(--mist); text-wrap: balance; }
.cover-byline { margin: 1.6rem 0 0; font-size: .95rem; font-variant-caps: all-small-caps; letter-spacing: .2em; color: var(--gilt); }
.cover-byline span { white-space: nowrap; }

.cover-main { padding-top: 3rem; }
.cover-blurb { font-size: 1.05em; }
.cover-actions { margin: 1.8rem 0 1rem; text-align: center; }
.btn-begin {
  display: inline-block;
  padding: .75rem 1.8rem;
  border-radius: 999px;
  background: var(--button);
  box-shadow: inset 0 0 0 1px rgba(220, 189, 116, .5), 0 2px 8px -2px var(--shadow);
  color: var(--parchment-light);
  font-size: 1.05rem;
  font-variant-caps: all-small-caps;
  letter-spacing: .14em;
  text-decoration: none;
  transition: background-color .15s;
}
.btn-begin:hover { background: var(--button-deep); }
.cover-facts { text-align: center; font-size: .82em; letter-spacing: .03em; color: var(--muted); }
.cover-note {
  margin: 1.5rem 0 0;
  padding: .85rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: .75rem;
  font-size: .8em;
  line-height: 1.6;
  color: var(--muted);
}
.cover-note strong { color: var(--ink); }
.cover-fan { margin-top: .7rem; }
.contents-title {
  margin: 3.2rem 0 .3rem;
  font-size: 1.55em;
  font-weight: 400;
  text-align: center;
  color: var(--ink-strong);
}
.contents-title::after {
  content: "";
  display: block;
  width: 3.2rem;
  height: 1px;
  margin: .9rem auto 0;
  background: var(--line);
}
.toc-group {
  margin: 2.3rem 0 .45rem;
  font-size: .95em;
  font-weight: 400;
  font-variant-caps: all-small-caps;
  letter-spacing: .2em;
  color: var(--gold);
}
.toc { margin: 0; padding: 0; list-style: none; }
.toc > li { margin: 0; padding: .85rem 0 .95rem; border-top: 1px solid var(--rule); }
.toc-row {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: .8rem;
  color: var(--ink-strong);
  text-decoration: none;
}
.toc-row:hover .toc-title { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.toc-num { font-size: .95em; font-variant-caps: all-small-caps; letter-spacing: .06em; text-align: right; color: var(--gold); }
/* each chapter's numeral in its force's colour, on a small gem */
.toc-chapter .toc-num { color: var(--force); }
.toc-chapter .toc-title::before {
  content: "";
  display: inline-block;
  width: .5em;
  height: .72em;
  margin-right: .5em;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: var(--force);
  vertical-align: .02em;
}
.toc-title { font-size: 1.2em; line-height: 1.3; }
.toc-time { font-size: .76em; white-space: nowrap; color: var(--muted); }
.toc-sections { margin: .35rem 0 0 3.4rem !important; font-size: .84em; line-height: 1.65; color: var(--muted); -webkit-hyphens: manual; hyphens: manual; }
.toc-sections a { text-decoration: none; }
.toc-sections a:hover { text-decoration: underline; }
.toc-sections .sep { margin: 0 .15em; color: var(--gold); }
.toc-entries { margin: .45rem 0 0 3.4rem; padding: 0; list-style: none; font-size: .86em; line-height: 1.4; }
.toc-entries li { margin: 0; padding: 0; }
.toc-entries a { grid-template-columns: 2.2rem minmax(0, 1fr) auto; padding: .26rem 0; color: var(--ink); }

/* ---------- phones ---------- */
@media (max-width: 36rem) {
  .topbar { padding: .3rem 1rem; }
  .topbar-book, .topbar-back { font-size: .85rem; letter-spacing: .08em; }
  .book-text { padding: 2rem 1rem 2.5rem; font-size: calc(1.0625rem * var(--reader-font-scale)); line-height: 1.66; }
  .chapter-head h1 { font-size: 2.05em; }
  .spell > h2 { font-size: 1.45em; }
  .in-book { padding: .9rem 1rem 1rem; }
  .in-book a { grid-template-columns: 2rem minmax(0, 1fr) auto; column-gap: .4rem; }
  .provenance { padding: .75rem .9rem .8rem; }
  .prov-row { grid-template-columns: 1fr; }
  .prov-cap { line-height: 1.3; }
  .need { grid-template-columns: 1.3rem minmax(0, 1fr); gap: .55rem; padding: .65rem .85rem; }
  .need-icon { width: 1.3rem; height: 1.3rem; }
  .steps > li { padding-left: 2.35rem; }
  .caution { grid-template-columns: 1.3rem minmax(0, 1fr); gap: .65rem; padding: .85rem .95rem; }
  .caution-icon { width: 1.3rem; height: 1.3rem; }
  .root { padding: .9rem .95rem .9rem 1.1rem; }
  .glance { margin-left: -.35rem; margin-right: -.35rem; padding: .95rem .8rem .85rem; }
  .pager { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 1.5rem 1rem 1.75rem; }
  .pager-toc { grid-column: 1 / -1; grid-row: 2; text-align: center; }
  .book-foot { padding: .25rem 1rem 2.5rem; }
  .cover { padding: 2.8rem 1.1rem 4rem; }
  .cover::before { inset: .55rem; }
  .cover::after { inset: .85rem; }
  .cover-wheel { width: 9.5rem; }
  .cover-byline .by-sep { display: none; }
  .cover-byline span:not(.by-sep) { display: block; }
  .cover-sub { font-size: 1.05rem; }
  .toc-row { grid-template-columns: 2rem minmax(0, 1fr) auto; column-gap: .6rem; }
  .toc-sections, .toc-entries { margin-left: 2.6rem !important; }
  .toc-entries a { grid-template-columns: 1.9rem minmax(0, 1fr) auto; }
}
/* small phones: the top bar keeps "Azeroth" alone (the link's name stays whole) */
@media (max-width: 28rem) {
  .tb-pre { display: none; }
}
/* tables stack into cards on narrow screens */
@media (max-width: 40rem) {
  .table-wrap :is(table, tbody, tr, td) { display: block; width: auto; }
  .table-wrap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .table-wrap tr { padding: .7rem .15rem .8rem; border-bottom: 1px solid var(--line); }
  .table-wrap tbody tr:nth-child(even) { background: none; }
  .table-wrap td { padding: .1rem 0; border: 0; }
  .table-wrap td:first-child { font-size: 1.08em; white-space: normal; }
  .table-wrap td:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    margin-top: .45rem;
    font-size: .95em;
    font-variant-caps: all-small-caps;
    letter-spacing: .12em;
    color: var(--gold);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
  :root {
    --page: #fff; --ink: #000; --ink-strong: #000; --muted: #444; --rule: #bbb;
    --panel: #fff; --link: #000; --caution: #fff; --chart-bg: #fff; --slip: #fff; --need: #fff;
  }
  .topbar, .skip-link, .pager, .in-book, .cover-actions, .force-mark, .glance-data { display: none !important; }
  .book-text { max-width: none; padding: 0; font-size: 11.5pt; }
  .caution, .provenance, .glance, .root, .need { box-shadow: none; break-inside: avoid; }
  .glance, .table-wide { margin-left: 0; margin-right: 0; }
  .cover { padding: 2rem 0; background: none; color: #000; }
  .cover::before, .cover::after { display: none; }
  .cover h1, .cover-sub, .cover-sub2, .cover-byline { color: #000; text-shadow: none; }
}
