@font-face {
  font-family: 'Barlow Condensed';
  src: url('../fonts/barlow-condensed-600.woff2') format('woff2');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Barlow Condensed';
  src: url('../fonts/barlow-condensed-700.woff2') format('woff2');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('../fonts/atkinson-400.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('../fonts/atkinson-400-italic.woff2') format('woff2');
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('../fonts/atkinson-700.woff2') format('woff2');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/ibm-plex-mono-500.woff2') format('woff2');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  --furnace: #111516;
  --iron: #1c2325;
  --iron-light: #2c3435;
  --steel: #89928d;
  --ash: #a8b0aa;
  --bone: #e7e0d2;
  --bone-light: #f4efe5;
  --paper-line: #cbc2b2;
  --ink: #171c1d;
  --oxide: #a73e29;
  --oxide-light: #d36a4e;
  --brass: #cbb06c;
  --focus: #3f83a3;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Atkinson Hyperlegible', Arial, sans-serif;
  --mono: 'IBM Plex Mono', Consolas, monospace;
  --shadow: 0 18px 55px rgb(0 0 0 / 24%);
  --header-height: 79px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  background: var(--furnace);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--furnace);
  color: var(--bone);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

::selection {
  color: var(--bone-light);
  background: var(--oxide);
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.17em;
}

a:hover {
  text-decoration-color: var(--oxide-light);
}

button,
input {
  font: inherit;
}

button,
a,
input,
summary,
[tabindex='0'] {
  outline-offset: 4px;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.7rem;
  left: 0.7rem;
  padding: 0.7rem 1rem;
  color: var(--ink);
  background: var(--bone-light);
  font-weight: 700;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

/* The header stays put so search is always one click away. */
.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--iron-light);
  background: var(--furnace);
}

/* Column one matches the chapter nav so the search box lines up with the page body. */
.header-inner {
  display: grid;
  width: min(100%, 1680px);
  min-height: 78px;
  align-items: center;
  row-gap: 1rem;
  column-gap: 0;
  margin-inline: auto;
  padding: 0.85rem 0;
  grid-template-columns: 220px minmax(0, 1fr);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding-inline: 1rem;
  color: var(--bone-light);
  text-decoration: none;
}

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

.wordmark strong,
.wordmark small {
  display: block;
}

.wordmark strong {
  font-family: var(--display);
  font-size: 1.18rem;
  white-space: nowrap;
  line-height: 1;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.wordmark small {
  margin-top: 0.24rem;
  color: var(--ash);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Keep the search compact and aligned with the reading column. */
.header-search {
  display: flex;
  width: min(100%, 620px);
  align-items: stretch;
  justify-self: center;
  margin-left: 0;
  border: 1px solid var(--iron-light);
  background: var(--iron);
}

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

.header-search input {
  min-width: 0;
  flex: 1;
  padding: 0.6rem 0.85rem;
  border: 0;
  color: var(--bone-light);
  background: transparent;
  font-family: var(--body);
  font-size: 0.92rem;
}

.header-search input::placeholder {
  color: var(--steel);
}

.header-search input:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: -2px;
}

.header-search button {
  padding-inline: 1rem;
  border: 0;
  border-left: 1px solid var(--iron-light);
  color: var(--brass);
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.header-search button:hover {
  color: var(--bone-light);
  background: var(--iron-light);
}

.nav-disclosure {
  display: none;
}

.site-layout {
  display: grid;
  width: min(100%, 1680px);
  min-height: calc(100vh - var(--header-height));
  margin-inline: auto;
  grid-template-columns: 220px minmax(0, 1fr);
}

.chapter-nav {
  position: sticky;
  top: var(--header-height);
  align-self: start;
  max-height: calc(100vh - var(--header-height));
  padding: 3.2rem 1.25rem 2rem;
  overflow-y: auto;
  border-right: 1px solid var(--iron-light);
}

.nav-label,
.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.nav-label {
  margin: 0 0 1.4rem 2.55rem;
  color: var(--steel);
}

.chapter-nav a {
  display: grid;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.62rem 0.35rem;
  color: var(--ash);
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.035em;
  line-height: 1.05;
  text-decoration: none;
  text-transform: uppercase;
  grid-template-columns: 1.8rem 1fr;
}

.chapter-nav a span {
  color: var(--steel);
  font-family: var(--mono);
  font-size: 0.58rem;
}

.chapter-nav a:hover {
  color: var(--bone-light);
}

.chapter-nav a[aria-current='page'] {
  color: var(--bone-light);
}

.chapter-nav a[aria-current='page'] span {
  color: var(--oxide-light);
}

.chapter-nav a[aria-current='page']::after {
  width: 2.25rem;
  margin: 0.2rem 0 0 2.55rem;
  border-bottom: 2px solid var(--oxide-light);
  content: '';
  grid-column: 1 / -1;
}

.main-stage {
  display: grid;
  min-width: 0;
  padding: clamp(0.75rem, 2vw, 1.8rem);
  grid-template-columns: 52px minmax(0, 1fr);
}

.main-stage > :not(.chapter-measure) {
  grid-column: 2;
}

.chapter-measure {
  position: sticky;
  top: calc(var(--header-height) + 1.25rem);
  display: flex;
  width: 52px;
  height: calc(100vh - var(--header-height) - 2.5rem);
  min-height: 420px;
  align-self: start;
  align-items: flex-end;
  flex-direction: column;
  padding: 1.1rem 0.65rem;
  border: 1px solid #343d3e;
  border-right: 0;
  background: var(--iron);
  box-shadow: inset 5px 0 0 #161b1c;
}

.chapter-measure strong {
  align-self: center;
  margin-bottom: 1.2rem;
  color: var(--brass);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.chapter-measure span,
.chapter-measure i {
  display: block;
  height: 0;
  margin-bottom: 2.35rem;
  border-top: 1px solid var(--steel);
}

.chapter-measure span {
  width: 25px;
}

.chapter-measure i {
  width: 12px;
}

.chapter-measure small {
  margin-top: auto;
  color: var(--steel);
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.13em;
  writing-mode: vertical-rl;
}

.page-surface,
.home-surface {
  min-width: 0;
  box-shadow: var(--shadow);
}

.page-surface {
  min-height: calc(100vh - 3.6rem);
  padding: clamp(2rem, 5vw, 5.6rem) clamp(1.15rem, 5vw, 5.8rem);
  color: var(--ink);
  background: var(--bone);
}

.page-surface--wide {
  max-width: none;
}

.chapter-heading,
.chapter-tabs,
.rule-section,
.chapter-intro,
.talent-browser,
.search-form,
.search-status,
.search-results,
.notice,
.missing-page > * {
  width: min(100%, 1060px);
  margin-inline: auto;
}

.chapter-heading {
  padding-bottom: clamp(1.8rem, 4vw, 3.4rem);
  border-bottom: 1px solid var(--paper-line);
}

.chapter-tabs {
  display: grid;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--paper-line);
  gap: 0.75rem 1rem;
  grid-template-columns: auto minmax(0, 1fr);
}

.chapter-tabs__label {
  color: var(--oxide);
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chapter-tabs__scroller {
  min-width: 0;
  padding: 0.25rem 0.1rem 0.4rem;
}

.chapter-tabs ul {
  display: flex;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
}

.chapter-tabs a {
  display: block;
  padding: 0.42rem 0.65rem;
  border: 1px solid var(--paper-line);
  color: var(--ink);
  background: var(--bone-light);
  font-family: var(--display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  line-height: 1.1;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.chapter-tabs a:hover {
  border-color: var(--oxide);
  color: var(--bone-light);
  background: var(--oxide);
}

.chapter-art {
  position: relative;
  margin-block: 1.5rem 2rem;
}

.chapter-art img {
  display: block;
  width: 100%;
  height: auto;
}

.chapter-art--cloud-vignette,
.chapter-art--cutout {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  shape-margin: 1.1rem;
}

.chapter-art--cloud-vignette {
  width: min(42%, 23rem);
}

.chapter-art--cutout {
  width: min(38%, 21rem);
  shape-outside: url('/assets/images/chapter-art/female-warrior-cutout.webp');
  shape-image-threshold: 0.08;
}

.chapter-art--cutout img {
  filter: drop-shadow(0.35rem 0.65rem 0.35rem rgb(34 27 20 / 22%));
}

.chapter-art--left {
  float: left;
  margin-right: 1.5rem;
  margin-left: -0.75rem;
}

.chapter-art--right {
  float: right;
  margin-right: -0.75rem;
  margin-left: 1.5rem;
}

.chapter-art--mist-panorama,
.chapter-art--storm-cloud,
.chapter-art--action-panorama,
.chapter-art--folio-panorama,
.chapter-art--night-oval {
  clear: both;
  width: calc(100% + 3rem);
  margin: 1.25rem -1.5rem 2rem;
}

.chapter-art--folio-panorama {
  width: calc(100% + 1rem);
  margin-inline: -0.5rem;
}

.rule-copy::after {
  display: table;
  clear: both;
  content: '';
}

.rule-copy > h3,
.rule-copy > h4,
.rule-copy > .table-wrap {
  clear: both;
}

.eyebrow {
  color: var(--oxide);
}

/* Every rule of a chapter lives on one page, so each section reads as its own opening. */
.rule-section {
  padding-top: clamp(3rem, 6vw, 5rem);
}

.legacy-anchor {
  display: block;
  scroll-margin-top: 1.5rem;
}

.rule-section + .rule-section {
  border-top: 3px double var(--paper-line);
}

.rule-section-heading h2 {
  margin: 0.5rem 0 0;
  padding: 0;
  border: 0;
  font-size: clamp(2.3rem, 5vw, 3.4rem);
  letter-spacing: -0.02em;
  scroll-margin-top: 1.5rem;
  text-transform: uppercase;
}

.rule-section .rule-deck {
  margin-top: 0.75rem;
}

.rule-section .rule-copy {
  margin-top: clamp(1.4rem, 3vw, 2.2rem);
}

.home-surface .eyebrow {
  color: var(--oxide-light);
}

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 0.98;
  text-wrap: balance;
}

h1 {
  max-width: 17ch;
  margin: 0.6rem 0 1rem;
  font-size: clamp(3.15rem, 8vw, 7rem);
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.chapter-deck,
.rule-deck {
  max-width: 62ch;
  margin: 1rem 0 0;
  color: #3d4747;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  line-height: 1.42;
}

ul.rule-deck {
  padding-left: 1.25rem;
}

.chapter-intro {
  max-width: 72ch;
  padding: clamp(1.8rem, 4vw, 3rem) 0 0;
}

.prose {
  font-size: 1.02rem;
}

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

.prose h2,
.prose h3,
.prose h4 {
  position: relative;
  scroll-margin-top: 1rem;
}

.prose h2 {
  margin: 2.8rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--paper-line);
  font-size: clamp(1.9rem, 4vw, 2.65rem);
  letter-spacing: -0.015em;
}

.prose h3 {
  margin: 2rem 0 0.7rem;
  font-size: 1.55rem;
}

.prose h4 {
  margin: 1.6rem 0 0.6rem;
  font-size: 1.18rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.heading-anchor::after {
  content: '#';
}

.heading-anchor {
  margin-left: 0.45rem;
  color: var(--oxide);
  font-family: var(--mono);
  font-size: 0.52em;
  opacity: 0;
  text-decoration: none;
}

h2:hover .heading-anchor,
h3:hover .heading-anchor,
.heading-anchor:focus {
  opacity: 1;
}

.prose p,
.prose li,
.prose dd {
  max-width: 72ch;
}

.prose li + li {
  margin-top: 0.35rem;
}

.prose strong {
  font-weight: 700;
}

.prose a {
  color: #81301f;
  font-weight: 700;
}

.prose code,
.talent-facts code,
.creature-profile code {
  padding: 0.06em 0.27em;
  border: 1px solid #bcb29f;
  color: #6f291c;
  background: var(--bone-light);
  font-family: var(--mono);
  font-size: 0.82em;
}

.prose code {
  overflow-wrap: anywhere;
  white-space: normal;
}

.talent-facts code {
  white-space: nowrap;
}

.prose blockquote {
  margin: 1.8rem 0;
  padding: 0.25rem 1.2rem;
  border-left: 5px solid var(--oxide);
  color: #344040;
  background: rgb(255 255 255 / 25%);
}

.table-wrap {
  width: 100%;
  margin: 1.7rem 0 2rem;
  overflow-x: auto;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  scrollbar-color: var(--oxide) var(--paper-line);
}

table {
  width: 100%;
  min-width: 570px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 0.67rem 0.75rem;
  border-bottom: 1px solid var(--paper-line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--bone-light);
  background: var(--iron);
  font-family: var(--display);
  font-size: 0.86rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

tbody tr:nth-child(even) {
  background: rgb(255 255 255 / 24%);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.footnotes {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--paper-line);
  font-size: 0.9rem;
}

.section-rule {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 0.8rem;
  border-bottom: 3px solid var(--ink);
}

.section-rule h2 {
  margin: 0.3rem 0 0;
  font-size: clamp(2rem, 5vw, 3.5rem);
  text-transform: uppercase;
}

.section-rule > p {
  margin: 0 0 0.2rem;
  color: #53605f;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.talent-browser {
  margin-top: clamp(3rem, 7vw, 6.5rem);
}

.aliases span {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.filter-bar {
  display: none;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.2rem 0 1.5rem;
}

.js .filter-bar {
  display: flex;
}

.filter-bar button {
  padding: 0.48rem 0.75rem;
  border: 1px solid #958d7e;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.filter-bar button:hover,
.filter-bar button[aria-pressed='true'] {
  color: var(--bone-light);
  border-color: var(--ink);
  background: var(--ink);
}

.talent-list {
  border-top: 1px solid var(--paper-line);
}

.talent-profile {
  display: block;
  padding-top: clamp(2.4rem, 5vw, 3.6rem);
  padding-bottom: clamp(1rem, 2vw, 1.6rem);
}

.talent-profile + .talent-profile {
  border-top: 1px solid var(--paper-line);
}

.talent-profile[hidden] {
  display: none;
}

.talent-profile-heading {
  display: flex;
  align-items: flex-start;
  gap: clamp(1rem, 2vw, 1.6rem);
}

.talent-cost {
  display: flex;
  width: 48px;
  height: 54px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--bone-light);
  background: var(--oxide);
  line-height: 1;
}

.talent-cost strong {
  font-family: var(--display);
  font-size: 1.55rem;
}

.talent-cost span {
  margin-top: 0.12rem;
  font-family: var(--mono);
  font-size: 0.55rem;
}

/* Legal copy: dense, readable, and never competing with the rules typography. */
.legal-page .page-surface {
  max-width: 60rem;
  margin-inline: auto;
}

.legal-page h1 {
  max-width: none;
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.legal-page h2 {
  margin: 2.6rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--paper-line);
  font-size: clamp(1.5rem, 3vw, 2rem);
  text-transform: uppercase;
}

.legal-page p,
.legal-page li {
  max-width: 82ch;
  font-size: 0.86rem;
  line-height: 1.55;
}

.legal-page .page-surface > p:first-of-type {
  color: #3d4747;
  font-size: 1rem;
}

.legal-page ol {
  padding-left: 1.6rem;
}

.legal-page li + li {
  margin-top: 0.9rem;
}

.legal-page .page-surface a {
  color: #81301f;
  font-weight: 700;
}

.site-footer a {
  color: var(--ash);
}

.site-footer a:hover {
  color: var(--bone-light);
}

.filter-empty {
  padding: 2rem;
  border: 1px solid var(--paper-line);
  text-align: center;
}

.creature-browser {
  margin-top: clamp(3rem, 7vw, 6.5rem);
}

.creature-grid {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.6rem);
}

.creature-profile {
  display: grid;
  min-width: 0;
  align-items: start;
  gap: clamp(1.1rem, 2.5vw, 2rem);
  padding-top: clamp(1.5rem, 3vw, 2.6rem);
  border-top: 1px solid var(--paper-line);
  grid-template-columns: 132px minmax(0, 1fr);
}

.creature-profile--illustrated {
  gap: clamp(1.5rem, 3.5vw, 2.8rem);
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
}

.creature-profile[hidden] {
  display: none;
}

.creature-profile:first-child {
  padding-top: 0;
  border-top: 0;
}

.creature-portrait {
  position: relative;
  display: grid;
  overflow: hidden;
  aspect-ratio: 1;
  align-content: center;
  justify-items: center;
  border: 1px solid #a89e8c;
  background: repeating-linear-gradient(135deg, #ded6c6, #ded6c6 6px, #d7cebd 6px, #d7cebd 12px);
  box-shadow: 5px 5px 0 #cfc5b4;
}

.creature-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.creature-profile--illustrated .creature-portrait {
  box-shadow: 7px 7px 0 #cfc5b4;
}

.creature-portrait-mark {
  color: #8d8371;
  font-family: var(--display);
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1;
}

.creature-portrait-note {
  margin-top: 0.35rem;
  color: #8d8371;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.creature-detail {
  min-width: 0;
}

.creature-heading h2 {
  margin: 0.2rem 0 0;
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  scroll-margin-top: 1.5rem;
  text-transform: uppercase;
}

.creature-deck {
  max-width: 68ch;
  margin: 0.5rem 0 0;
  color: #3d4747;
  font-size: 1.02rem;
  line-height: 1.45;
}

.creature-tags,
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.creature-tags li {
  padding: 0.16rem 0.45rem;
  border: 1px solid #a89e8c;
  color: #4d5756;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chip-list li {
  padding: 0.16rem 0.45rem;
  background: var(--bone-light);
  font-size: 0.82rem;
}

.creature-note {
  margin: 0.6rem 0 0;
  color: #4d5756;
  font-size: 0.88rem;
}

/* Cell borders rather than a gap grid, so a part-filled last row leaves no orphan blocks. */
.stat-row {
  display: grid;
  margin: 1rem 0 0;
  border-top: 1px solid var(--paper-line);
  border-left: 1px solid var(--paper-line);
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.stat-row--derived {
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
}

.stat-row > div {
  padding: 0.45rem 0.55rem;
  border-right: 1px solid var(--paper-line);
  border-bottom: 1px solid var(--paper-line);
  background: var(--bone-light);
}

.stat-row dt {
  color: var(--oxide);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat-row dd {
  margin: 0.15rem 0 0;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.1;
}

/* The generating dice for a characteristic, e.g. 14 (4D6) — roll it to vary an individual or
   build a specific creature instead of using the average member. */
.stat-dice {
  /* --steel reads fine on the dark chrome but fails contrast on this light card;
     match .creature-note's grey instead (6.5:1 against --bone-light). */
  color: #4d5756;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  /* A last resort: on its own line a long formula like (10D6+30) can still be wider than the
     narrowest phone's stat cell. Never let it push the page wider than the viewport. */
  overflow-wrap: anywhere;
}

.creature-lists {
  display: grid;
  margin-top: 1.2rem;
  gap: 1.1rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* Talents and Plunder are one-line facts, so they read as a label and a value. */
.creature-inline {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.creature-inline p {
  margin: 0;
}

.creature-inline h3 {
  flex: none;
}

.creature-inline h3 a {
  text-decoration-color: var(--paper-line);
}

.creature-lists h3 {
  margin: 0;
  color: #53605f;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.creature-lists p {
  margin: 0.45rem 0 0;
  font-size: 0.9rem;
}

.attack-list {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
}

.attack-list li + li {
  margin-top: 0.3rem;
}

.creature-abilities {
  margin-top: 1.3rem;
  font-size: 0.95rem;
}

.creature-abilities h3.creature-abilities-title {
  margin: 0 0 0.6rem;
  color: #53605f;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.creature-abilities p {
  margin: 0.55rem 0 0;
}

.talent-cost--large {
  width: 70px;
  min-width: 70px;
  height: 78px;
}

.talent-cost--large strong {
  font-size: 2.2rem;
}

.talent-facts {
  display: grid;
  width: min(100%, 1060px);
  margin: 1.2rem auto 0;
  border-bottom: 1px solid var(--paper-line);
  grid-template-columns: repeat(3, 1fr);
}

.talent-facts div {
  padding: 0.9rem 1rem;
  border-right: 1px solid var(--paper-line);
}

.talent-facts div:first-child {
  padding-left: 0;
}

.talent-facts div:last-child {
  border-right: 0;
}

.talent-facts dt {
  color: var(--oxide);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.talent-facts dd {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
}

.search-form {
  margin-top: 2.8rem;
}

.search-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.search-form > div {
  display: flex;
  gap: 0.6rem;
}

.search-form input {
  min-width: 0;
  flex: 1;
  padding: 0.9rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: var(--bone-light);
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 0.75rem 1rem;
  border: 1px solid currentcolor;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.045em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.button--primary {
  color: var(--bone-light);
  border-color: var(--oxide);
  background: var(--oxide);
}

.button--primary:hover {
  border-color: #7f2c1d;
  background: #7f2c1d;
}

.search-status {
  margin-top: 1.2rem;
  color: #586360;
}

.search-results {
  margin-top: 1rem;
  padding: 0;
  list-style: none;
}

.search-results li {
  padding: 1.25rem 0;
  border-top: 1px solid var(--paper-line);
}

.search-results h2 {
  margin: 0;
  font-size: 1.6rem;
  text-transform: uppercase;
}

.search-results h2 a {
  text-decoration: none;
}

.search-results p {
  max-width: 70ch;
  margin: 0.35rem 0 0;
}

.search-results mark {
  padding: 0 0.1em;
  color: var(--ink);
  background: #e5bf75;
}

.search-result-meta {
  color: var(--oxide);
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
}

.search-index-context {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.notice {
  padding: 1rem;
  border-left: 4px solid var(--oxide);
  background: var(--bone-light);
}

.example {
  margin: 1.7rem 0;
  border: 1px solid #aaa190;
  background: rgb(255 255 255 / 22%);
}

.example > summary {
  padding: 0.8rem 1rem;
  color: #70291c;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.example > summary > :is(h2, h3) {
  margin: 0;
  color: inherit;
  font: inherit;
}

.example[open] > summary {
  border-bottom: 1px solid var(--paper-line);
}

.example-content {
  padding: 0.2rem 1rem 1rem;
}

.home-surface {
  color: var(--bone);
  background: var(--iron);
}

.home-hero {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1672 / 941;
  border-bottom: 1px solid #3b4445;
  background: #0a0e10;
  isolation: isolate;
}

.home-hero::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(180deg, rgb(6 9 10 / 10%) 35%, rgb(6 9 10 / 82%) 100%),
    linear-gradient(90deg, rgb(6 9 10 / 46%) 0%, transparent 52%);
  content: '';
  pointer-events: none;
}

.home-hero-picture,
.home-hero-art {
  display: block;
  width: 100%;
  height: 100%;
}

.home-hero-art {
  object-fit: cover;
  object-position: center;
}

.home-hero-caption {
  position: absolute;
  z-index: 2;
  top: clamp(1.5rem, 3.5vw, 3.5rem);
  left: clamp(1.2rem, 5vw, 5rem);
  width: min(38rem, calc(100% - 2.4rem));
  padding-left: clamp(0.9rem, 1.5vw, 1.4rem);
  border-left: 4px solid var(--oxide-light);
  text-shadow: 0 2px 18px rgb(0 0 0 / 88%);
}

.home-hero-caption .eyebrow {
  color: var(--brass);
}

.home-hero-caption h1 {
  max-width: 22ch;
  margin: 0.45rem 0 0;
  color: var(--bone-light);
  font-size: clamp(1.4875rem, 2.55vw, 2.55rem);
  line-height: 1;
  text-transform: uppercase;
}

.chapter-directory {
  padding: clamp(2rem, 7vw, 6rem);
}

.section-rule--dark {
  border-color: var(--bone);
}

.section-rule--dark > p {
  color: var(--ash);
}

.chapter-directory ol {
  display: grid;
  margin: 0;
  padding: 0;
  border-left: 1px solid #3b4445;
  list-style: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chapter-directory li {
  border-right: 1px solid #3b4445;
  border-bottom: 1px solid #3b4445;
}

.chapter-directory a {
  display: grid;
  min-height: 150px;
  gap: 1rem;
  padding: 1.3rem;
  text-decoration: none;
  grid-template-columns: 2rem 1fr auto;
}

.chapter-directory a:hover {
  background: #242c2e;
}

.directory-number {
  color: var(--oxide-light);
  font-family: var(--mono);
  font-size: 0.67rem;
}

.directory-copy strong,
.directory-copy small {
  display: block;
}

.directory-copy strong {
  font-family: var(--display);
  font-size: 1.65rem;
  line-height: 1;
  text-transform: uppercase;
}

.directory-copy small {
  max-width: 48ch;
  margin-top: 0.55rem;
  color: var(--ash);
  font-size: 0.85rem;
  line-height: 1.38;
}

.directory-arrow {
  color: var(--brass);
}

.missing-page {
  display: flex;
  justify-content: center;
  flex-direction: column;
}

.missing-page .button {
  width: max-content;
  margin-top: 1rem;
}

.site-footer {
  display: flex;
  max-width: 1680px;
  justify-content: space-between;
  gap: 1rem 3rem;
  margin-inline: auto;
  padding: 1.5rem clamp(1rem, 3vw, 2.8rem);
  border-top: 1px solid var(--iron-light);
  color: var(--steel);
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 1120px) {
  .site-layout {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .header-inner {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .header-search {
    margin-left: 0;
  }

  .chapter-nav {
    padding-inline: 0.75rem;
  }

  .page-surface {
    padding-inline: clamp(1.15rem, 4vw, 3rem);
  }

  .creature-profile--illustrated {
    grid-template-columns: 240px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .chapter-nav {
    display: none;
  }

  .header-inner {
    padding-inline: clamp(1rem, 3vw, 2.8rem);
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .wordmark {
    padding-inline: 0;
  }

  .header-search {
    margin-left: 0;
  }

  .nav-disclosure {
    display: block;
    color: var(--bone-light);
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
  }

  .nav-disclosure summary {
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--iron-light);
    cursor: pointer;
  }

  .nav-disclosure[open] nav {
    position: absolute;
    z-index: 30;
    top: calc(100% + 1px);
    right: 0;
    display: grid;
    width: min(320px, 100vw);
    padding: 0.75rem;
    border: 1px solid var(--iron-light);
    background: var(--furnace);
    box-shadow: var(--shadow);
  }

  .nav-disclosure nav a {
    padding: 0.65rem;
    color: var(--ash);
    text-decoration: none;
  }

  .nav-disclosure nav a[aria-current='page'] {
    color: var(--bone-light);
    border-left: 3px solid var(--oxide-light);
  }

  .site-layout {
    display: block;
  }

  .main-stage {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .chapter-measure {
    width: 38px;
    padding-inline: 0.4rem;
  }

  .chapter-measure span {
    width: 18px;
  }

  .chapter-measure i {
    width: 9px;
  }

  .creature-profile--illustrated {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .chapter-art,
  .chapter-art--cloud-vignette,
  .chapter-art--cutout,
  .chapter-art--mist-panorama,
  .chapter-art--storm-cloud,
  .chapter-art--action-panorama,
  .chapter-art--folio-panorama,
  .chapter-art--night-oval {
    float: none;
    width: 100%;
    margin: 1.25rem 0 1.75rem;
    shape-outside: none;
  }

  .chapter-art--cutout {
    width: min(78%, 22rem);
    margin-inline: auto;
  }
}

@media (max-width: 720px) {
  :root {
    --header-height: 103px;
  }

  .header-inner {
    min-height: 0;
    padding: 0.55rem 0.8rem;
    gap: 0.5rem;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .wordmark-mark {
    width: 40px;
    height: 40px;
  }

  .header-search input {
    padding-block: 0.45rem;
  }

  .header-search {
    width: 100%;
    grid-row: 2;
    grid-column: 1 / -1;
  }

  .nav-disclosure {
    grid-row: 1;
    grid-column: 2;
  }

  .wordmark strong {
    font-size: 1.08rem;
  }

  .wordmark small {
    font-size: 0.52rem;
  }

  .main-stage {
    display: block;
    padding: 0;
  }

  .chapter-measure {
    display: none;
  }

  .page-surface,
  .home-surface {
    min-height: calc(100vh - var(--header-height));
    box-shadow: none;
  }

  .page-surface {
    padding: 2.2rem 1rem 3rem;
  }

  .chapter-tabs {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
  }

  .chapter-tabs__scroller {
    overflow-x: auto;
    scrollbar-color: var(--oxide) var(--paper-line);
    scrollbar-width: thin;
  }

  .chapter-tabs ul {
    width: max-content;
    flex-wrap: nowrap;
  }

  h1 {
    font-size: clamp(2.9rem, 16vw, 4.8rem);
  }

  .section-rule {
    align-items: start;
    flex-direction: column;
    gap: 0.4rem;
  }

  .section-rule > p {
    margin: 0;
  }

  .chapter-directory ol {
    grid-template-columns: 1fr;
  }

  .talent-cost--large {
    width: 54px;
    min-width: 54px;
    height: 62px;
  }

  .talent-facts {
    grid-template-columns: 1fr;
  }

  .talent-facts div,
  .talent-facts div:first-child {
    padding: 0.65rem 0;
    border-right: 0;
    border-bottom: 1px solid var(--paper-line);
  }

  .talent-facts div:last-child {
    border-bottom: 0;
  }

  .table-wrap {
    width: calc(100vw - 2rem);
  }

  /* Profile tables stay inside their own column instead of the full viewport. */
  .creature-profile .table-wrap {
    width: 100%;
  }

  .search-form > div {
    align-items: stretch;
    flex-direction: column;
  }

  .home-hero {
    display: grid;
    overflow: visible;
    aspect-ratio: auto;
  }

  .home-hero::after {
    display: none;
  }

  .home-hero-picture {
    aspect-ratio: 1672 / 941;
  }

  .home-hero-caption {
    position: static;
    width: 100%;
    max-width: none;
    padding: 1.35rem 1.2rem 1.6rem;
    border-top: 1px solid #3b4445;
    border-left: 0;
    background: var(--furnace);
    text-shadow: none;
  }

  .home-hero-caption h1 {
    max-width: 22ch;
    font-size: clamp(1.4875rem, 7.225vw, 2.295rem);
  }

  .chapter-directory {
    padding: 2.5rem 1.2rem;
  }

  .chapter-directory a {
    min-height: 130px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .creature-profile {
    grid-template-columns: 96px minmax(0, 1fr);
  }

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

  .creature-profile--illustrated .creature-portrait {
    width: min(100%, 28rem);
  }

  .creature-portrait-mark {
    font-size: 2.2rem;
  }

  .creature-portrait-note {
    font-size: 0.48rem;
  }

  .stat-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stat-row--derived {
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  }

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

@media (max-width: 420px) {
  /* The 4-column stat grid is too narrow here for a long formula like (10D6+30) to sit
     next to its average on one line; drop it to its own line instead of overflowing. */
  .stat-dice {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body {
    color: #000;
    background: #fff;
  }

  .site-header,
  .chapter-nav,
  .chapter-tabs,
  .chapter-measure,
  .site-footer,
  .filter-bar {
    display: none !important;
  }

  .site-layout,
  .main-stage {
    display: block;
  }

  .main-stage,
  .page-surface {
    padding: 0;
  }

  .page-surface {
    color: #000;
    background: #fff;
    box-shadow: none;
  }

  a {
    color: #000 !important;
  }

  .chapter-art,
  .chapter-art--cloud-vignette,
  .chapter-art--cutout,
  .chapter-art--mist-panorama,
  .chapter-art--storm-cloud,
  .chapter-art--action-panorama,
  .chapter-art--folio-panorama,
  .chapter-art--night-oval {
    float: none;
    width: auto;
    max-width: 85%;
    margin: 1rem auto;
    break-inside: avoid;
    -webkit-mask-image: none;
    mask-image: none;
    shape-outside: none;
  }

  .chapter-art--cutout img {
    filter: none;
  }
}
