/* Shared palette, typography, page shell and components for Hugo and the reader.
 * Hugo-specific presentation lives in hugo.css; finished book frames in covers.css.
 * Keep responsive and theme overrides after their base rules to preserve the cascade.
 */
@font-face {
  font-family: "Vollkorn";
  src: url("/fonts/vollkorn/vollkorn-bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans";
  src: url("/fonts/noto-sans/noto-sans-bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("/fonts/literata/literata-latin-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("/fonts/literata/literata-latin-variable-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* Locked logo colors are independent of the reading palette. */
  --mw-logo-red: #C73E1D;
  --mw-logo-green: #006B3C;
  --mw-border-red: var(--mw-logo-red);
  --mw-border-neutral: #666666;
  --mw-border-green: var(--mw-logo-green);
  --mw-cover-border-gradient:
    linear-gradient(
    90deg,
    var(--mw-border-red) 0 42%,
    var(--mw-border-neutral) 50%,
    var(--mw-border-green) 58% 100%
  );
  --reader-canvas: #F1EFE9;
  --reader-surface: #FBFAF7;
  --reader-raised: #F5F2EA;
  --reader-text: #363430;
  --reader-heading: #1D1C1A;
  --reader-muted: #504E48;
  --reader-link: #174E82;
  --reader-visited: #604078;
  --reader-monk: #922B14;
  --reader-rule: #D6D2C8;
  --reader-control-border: #77736A;
  --reader-focus: #174E82;
  --action-background: #2B2926;
  --action-color: #FBFAF7;
  --action-border: var(--reader-control-border);
  --action-hover-background: var(--reader-heading);
  --action-hover-color: var(--reader-surface);
  --action-focus: var(--reader-focus);
  --reader-font: "Literata", Georgia, "Times New Roman", serif;
  --reader-ui-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --reader-measure: 64ch;
  --reader-shell: 48rem;
  --reader-landing-shell: min(740px, 66ch);
  --reader-gutter: clamp(1rem, 4.5vw, 1.5rem);
  --reader-navigation-control-height: 44px;
  --page-gap: clamp(1rem, 3vw, 1.5rem);
  --panel-padding: clamp(1rem, 3vw, 1.5rem);
}

html {
  background: var(--reader-canvas);
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  --shell-width: var(--reader-shell);
  display: block;
  margin: 0;
  padding: 0;
  background: var(--reader-canvas);
  color: var(--reader-text);
  font-family: var(--reader-ui-font);
  font-size: 1.18em;
  line-height: 1.55;
}

.shell--collection {
  --shell-width: var(--reader-landing-shell);
}

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 0.18em;
}

p {
  margin: 0 0 1em;
}

/* The cover compositor supplies its own heading typography. */
h1 {
  font-family: "Vollkorn", serif;
  font-style: normal;
  font-weight: 700;
  font-synthesis: none;
}

.page-frame {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--shell-width);
  margin-inline: auto;
}

.page-frame > :is(main, nav.pagination, .reader-bootstrap__navigation) {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

::selection {
  background: var(--reader-link);
  color: var(--reader-surface);
}

.page-content {
  --page-content-padding-start: clamp(1.25rem, 3vw, 2.5rem);
  box-sizing: border-box;
  width: 100%;
  max-width: var(--reader-shell);
  min-width: 0;
  margin-inline: auto;
  padding:
    var(--page-content-padding-start)
    max(var(--reader-gutter), env(safe-area-inset-right))
    clamp(1.5rem, 4vw, 3rem)
    max(var(--reader-gutter), env(safe-area-inset-left));
  border: 0;
  background: var(--reader-surface);
  color: var(--reader-text);
  font-size: 1rem;
}

.shell--collection .page-content {
  padding: var(--page-gap) 0 0;
  background: transparent;
  font-size: inherit;
}

.document,
.prose {
  max-width: var(--reader-measure);
  margin-inline: auto;
  color: var(--reader-text);
  font-family: var(--reader-font);
  font-size: clamp(1.125rem, 1.04rem + 0.35vw, 1.25rem);
  font-style: normal;
  font-weight: 400;
  font-synthesis: none;
  font-optical-sizing: auto;
  line-height: 1.68;
  text-align: left;
  word-spacing: normal;
  letter-spacing: normal;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.prose p,
.prose li {
  font-size: 1em;
  line-height: inherit;
}

.prose p {
  margin: 0 0 1.05em;
}

.prose :is(ul, ol) {
  margin-block: 0 1.2em;
  padding-inline-start: 1.4em;
}

.prose li + li {
  margin-block-start: 0.35em;
}

:where(.document, .prose) :is(strong, b) {
  font-weight: 650;
  letter-spacing: normal;
}

.prose p strong {
  font-weight: 800;
  letter-spacing: 0.01em;
}

.prose em,
.prose i {
  font-style: italic;
}

.prose > :last-child,
.document > :last-child,
.collection > :last-child,
.panel > :last-child {
  margin-block-end: 0;
}

:where(.document, .prose, .panel) :is(h1, h2, h3) {
  display: block;
  color: var(--reader-heading);
  border: 0;
  font-family: var(--reader-font);
  font-style: normal;
  font-weight: 650;
  font-synthesis: none;
  font-optical-sizing: auto;
  text-wrap: balance;
}

:where(.document, .prose) h1 {
  margin: 0.2em 0 0.9em;
  padding: 0;
  font-size: clamp(2rem, 1.55rem + 2.2vw, 3rem);
  line-height: 1.15;
  text-align: center;
}

:where(.document, .prose, .panel) h2 {
  margin: 1.7em 0 0.65em;
  font-size: clamp(1.5rem, 1.35rem + 0.6vw, 1.75rem);
  line-height: 1.22;
  text-align: left;
}

:where(.document, .prose, .panel) h3 {
  margin: 1.55em 0 0.55em;
  font-size: clamp(1.25rem, 1.16rem + 0.4vw, 1.4rem);
  line-height: 1.28;
  text-align: left;
}

.page-header {
  margin-block-end: clamp(1.4rem, 4vw, 2.25rem);
}

@media (max-width: 600px) {
  body {
    font-size: 1em;
  }
}

.term {
  font-size: 1em;
  font-variant-caps: normal;
  white-space: normal;
  font-weight: 550;
}

:where(.document, .prose, .panel, .site-footer, .error-page__choices) a {
  color: var(--reader-link);
  text-decoration-line: underline;
  text-decoration-thickness: 0.075em;
  text-underline-offset: 0.16em;
}

:where(.document, .prose, .panel, .site-footer, .error-page__choices) a:visited {
  color: var(--reader-visited);
}

:where(.document, .prose, .panel, .site-footer, .error-page__choices) a:focus-visible,
nav.pagination a:focus-visible,
.action:focus-visible,
.table-scroll:focus-visible {
  outline: 3px solid var(--reader-focus);
  outline-offset: 0.2rem;
}

@media (hover: hover) {
  :where(.document, .prose, .panel, .site-footer, .error-page__choices) a:hover {
    text-decoration-thickness: 0.12em;
  }
}

/**********
  Reader Navigation
**********/

nav.pagination a,
nav.pagination span {
  margin: 0;
  text-decoration: none;
}

nav.pagination .prev > i {
  margin-inline-end: 0.25em;
}

nav.pagination .next > i {
  margin-inline-start: 0.25em;
}

nav.pagination,
.reader-bootstrap__navigation {
  display: grid;
  grid-template-areas: "prev context next";
  grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
  align-items: stretch;
  box-sizing: border-box;
  width: min(100%, var(--reader-shell));
  min-height: calc(var(--reader-navigation-control-height) + .5rem);
  margin-inline: auto;
  padding: 0.25rem var(--reader-gutter);
  border: 0;
  border-inline: 0;
  border-block: 1px solid var(--reader-rule);
  background: var(--reader-surface);
  color: var(--reader-heading);
  font-family: var(--reader-ui-font);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
  text-transform: uppercase;
}

.shell--collection .page-frame > nav.pagination {
  border-inline: 1px solid var(--reader-rule);
}

.page-frame > :is(nav.pagination, .reader-bootstrap__navigation):first-child {
  border-block-start: 0;
}

nav.pagination > .prev {
  grid-area: prev;
  justify-self: start;
}

nav.pagination > .next {
  grid-area: next;
  justify-self: end;
}

.pagination__context {
  grid-area: context;
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-width: 0;
}

nav.pagination > :is(a, .prev, .next),
.pagination__context > :is(a, span) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: var(--reader-navigation-control-height);
  margin: 0;
  padding: 0.45rem 0.55rem;
  color: var(--reader-link);
  text-decoration: none;
}

nav.pagination .disabled {
  color: var(--reader-muted);
  opacity: 1;
}

/**********
  Collection Composition, Panels, and Actions
**********/

.book-page {
  padding-block-end: var(--page-gap);
}

.book-page__cover {
  padding-block: 0 var(--page-gap);
}

.book-page__cover--with-action {
  padding-block-end: 0;
}

.book-page__cover > .book-page__cover-action {
  margin: 0;
  padding: 0;
}

.book-page__contents {
  margin-top: var(--page-gap);
  scroll-margin-top: 1.5rem;
}

.book-page__contents h2 {
  margin: 0 0 1rem;
  font: 700 1.5rem/1.3 "Vollkorn", Georgia, serif;
  color: var(--reader-heading);
}

.book-toc__part + .book-toc__part {
  margin-top: 1.5rem;
}

.book-toc__part h3 {
  margin: 0 0 .5rem;
  font: 600 .875rem/1.5 var(--reader-ui-font);
  color: var(--reader-muted);
}

.book-toc__chapters {
  margin: 0;
  padding-left: 1.75rem;
  font: 1rem/1.6 var(--reader-ui-font);
}

.book-toc__chapters li {
  padding-left: .25rem;
}

.book-toc__chapters li::marker {
  color: var(--reader-muted);
  font-variant-numeric: tabular-nums;
}

.book-toc__chapters a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.panel {
  box-sizing: border-box;
  padding: var(--panel-padding);
  border: 1px solid var(--reader-rule);
  background: var(--reader-surface);
}

.panel :is(p, li):last-child {
  margin-block-end: 0;
  padding-block-end: 0;
}

/* The historical ruled book notice, restored independently of retired notices. */
.book-about {
  margin: 1.65em 0;
  color: var(--reader-text);
  font-family: var(--reader-font);
  line-height: 1.65;
}

.book-about__inner.prose {
  max-width: none;
  margin-inline: 0;
  line-height: inherit;
}

.book-about .book-about__title {
  padding-block: 0 0.5rem;
  margin: 0 0 0.625rem;
  border-block-end: 1px solid var(--reader-rule);
  color: var(--reader-heading);
  font-family: var(--reader-font);
  font-size: clamp(1.25rem, 1.16rem + 0.4vw, 1.4rem);
  font-weight: 450;
  line-height: 1.28;
  letter-spacing: -0.02em;
}

.book-about__inner > p {
  margin: 0;
  font-size: inherit;
}

.book-about__inner > p + p,
.book-about__inner > .action-row {
  margin-block-start: 1.05em;
}

.action-row {
  margin-block: 0 var(--page-gap);
}

/**********
  Notes, Quotations, and Status
**********/

.prose blockquote {
  position: relative;
  margin: 1.65em 0;
  padding: 1.1em 1.15em;
  border: 0;
  border-inline-start: 3px solid var(--reader-control-border);
  background: var(--reader-raised);
  color: var(--reader-text);
  font-family: inherit;
  font-size: 1em;
  font-style: normal;
  line-height: inherit;
}

.prose blockquote::before {
  content: none;
}

.prose blockquote p {
  margin-block: 0 0.8em;
}

.prose blockquote p:last-child {
  margin-block-end: 0;
}

/* Actions use the shared light, dark and print palette defined in this file. */
.action {
  display: flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  width: 100%;
  min-height: 48px;
  padding: 0.75em 1.25em;
  border: 2px solid var(--action-border);
  border-block-start-width: 0;
  background: var(--action-background);
  box-shadow: none;
  color: var(--action-color);
  font-family: var(--reader-ui-font);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0.015em;
  line-height: 1.2;
  text-decoration: none;
}

.action:visited {
  color: var(--action-color);
}

.action__label {
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: none;
}

a.action:hover {
  background: var(--action-hover-background);
  color: var(--action-hover-color);
}

.action--compact {
  gap: 0.45em;
  padding: 0.7rem 0.9em;
  line-height: 1.25;
}

.prose hr {
  width: 3rem;
  margin: clamp(2rem, 7vw, 3.5rem) auto;
  border: 0;
  border-block-start: 1px solid var(--reader-rule);
}

/**********
  Homepage
**********/

.hugo-site.shell--home {
  --shell-width: min(48rem, calc(100% - 2 * clamp(1rem, 3.6vw, 3.5rem)));
}

.home-header {
  border-block-end: 1px solid var(--reader-rule);
}

.home-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  inline-size: var(--shell-width);
  min-block-size: 3.5rem;
  margin-inline: auto;
}

.home-header__author,
.home-header__saga {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-block-size: 2.75rem;
  font-size: 0.875rem;
  font-weight: 650;
  text-decoration: none;
}

.home-header a:hover {
  text-decoration: underline;
}

.home-header__author {
  color: var(--reader-heading);
}

.home-header__saga {
  color: var(--reader-link);
}

.hugo-site.shell--home .page-content {
  padding: 1.5rem 0 2.5rem;
}

.home-page {
  --home-art-shadow: #0002;
  display: grid;
  grid-template-areas:
    "intro"
    "saga"
    "synopsis";
  gap: 1.5rem;
  line-height: 1.4;
}

:is(.home-header, .home-page) a:focus-visible {
  outline: 3px solid var(--reader-focus);
  outline-offset: 4px;
}

.home-page__intro {
  grid-area: intro;
  min-inline-size: 0;
}

.home-page__tagline {
  margin: 0 0 0.5rem;
  color: var(--reader-muted);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.home-page__title {
  max-inline-size: 14ch;
  margin: 0 0 0.85rem;
  color: var(--reader-heading);
  font-size: clamp(2.55rem, 8.6vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.home-page__ampersand {
  color: var(--reader-muted);
}

.home-banner__link {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 0.55rem;
  background: var(--reader-raised);
  box-shadow: 0 0.3rem 0.9rem var(--home-art-shadow);
  text-decoration: none;
}

.home-banner__link img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  aspect-ratio: 2.12;
  object-fit: cover;
  object-position: center 57%;
}

.home-banner__action {
  position: absolute;
  inset-inline-start: 0.65rem;
  inset-block-end: 0.65rem;
  display: inline-flex;
  align-items: center;
  min-block-size: 2rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--action-border);
  border-radius: 0.3rem;
  background: var(--action-background);
  color: var(--action-color);
  font-size: 0.75rem;
  font-weight: 650;
}

.home-banner__link:is(:hover, :focus-visible) .home-banner__action {
  background: var(--action-hover-background);
  color: var(--action-hover-color);
}

.home-page__text {
  grid-area: synopsis;
  max-inline-size: 57ch;
  color: var(--reader-text);
  font: clamp(1.06rem, 2.2vw, 1.15rem) / 1.58 Georgia, serif;
}

.home-page__text p {
  margin: 0;
}

.home-page__text p + p {
  margin-block-start: 0.8em;
}

.home-page__text strong {
  color: var(--reader-heading);
}

.home-page__saga {
  grid-area: saga;
  min-inline-size: 0;
  align-self: start;
  padding: clamp(0.7rem, 2.6vw, 1.45rem);
  border: 1px solid var(--reader-rule);
  border-radius: 0.8rem;
  background: var(--reader-surface);
  scroll-margin-block-start: 1rem;
}

.saga-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  margin-block-end: 0.5rem;
  padding: 0.1rem 0.3rem 0.65rem;
  border-block-end: 1px solid var(--reader-rule);
}

.saga-header h2 {
  margin: 0;
  color: var(--reader-heading);
  font: 700 clamp(1.9rem, 4vw, 2.4rem) / 1.04 Vollkorn, Georgia, serif;
}

.saga-header p {
  margin: 0;
  color: var(--reader-muted);
  font-size: 0.78rem;
}

.saga-grid {
  --saga-cover-width: 8.125rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem clamp(0.45rem, 1.2vw, 1rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.saga-grid li {
  position: relative;
  display: flex;
  min-inline-size: 0;
}

/* Begin each new row with a rule, even if the catalogue grows. */
.saga-grid li:nth-child(n + 4) {
  padding-block-start: 0.35rem;
  border-block-start: 1px solid var(--reader-rule);
}

/* Keep volume headings and deep links at the first card of each volume. */
.saga-volume {
  position: absolute;
  inset-block-start: 0;
  inline-size: 1px;
  block-size: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  scroll-margin-block-start: 1rem;
}

.saga-book {
  display: grid;
  align-content: start;
  justify-items: center;
  inline-size: 100%;
  min-inline-size: 0;
  padding: 0.4rem 0.15rem 0.45rem;
  border-radius: 0.35rem;
  text-align: center;
  text-decoration: none;
}

.saga-book picture {
  display: block;
  inline-size: min(100%, var(--saga-cover-width));
  margin-block-end: 0.5rem;
}

.saga-book img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  border-radius: 0.18rem;
  background: var(--reader-raised);
  box-shadow: 0 0.3rem 0.65rem var(--home-art-shadow);
}

.saga-book__number {
  margin-block-end: 0.16rem;
  color: var(--reader-muted);
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.saga-book__title {
  color: var(--reader-heading);
  font: 700 clamp(0.82rem, 2.95vw, 1rem) / 1.14 Vollkorn, Georgia, serif;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.saga-book:is(:hover, :focus-visible) {
  background: var(--reader-raised);
}

.saga-book:is(:hover, :focus-visible) .saga-book__title {
  text-decoration: underline;
  text-decoration-color: var(--reader-link);
  text-underline-offset: 0.17em;
}

@media (40rem <= width < 1200px) {
  .home-page__intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    align-items: center;
    gap: 1.5rem;
  }

  .home-page__title {
    margin-block-end: 0;
    font-size: clamp(2.9rem, 6.2vw, 4rem);
  }

  .home-banner__link img {
    aspect-ratio: 1.8;
  }
}

@media (min-width: 1200px) {
  .hugo-site.shell--home {
    --shell-width: min(78rem, calc(100% - 6rem));
  }

  .home-header__inner {
    min-block-size: 3.75rem;
  }

  .home-header__saga {
    display: none;
  }

  .hugo-site.shell--home .page-content {
    padding-block-start: 2rem;
  }

  .home-page {
    grid-template-areas:
      "intro saga"
      "synopsis saga";
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-rows: auto 1fr;
    gap: 1.4rem clamp(2.25rem, 4vw, 4rem);
  }

  .home-page__intro {
    padding-block-start: 0.35rem;
  }

  .home-page__title {
    margin-block-end: 1.15rem;
  }

  .home-banner__link img {
    aspect-ratio: 1.68;
  }

  .saga-header {
    margin-block-end: 0.65rem;
  }

  .saga-grid {
    /* Keep all three cover rows easy to scan on shorter desktop displays. */
    --saga-cover-width: clamp(6rem, calc(20vh - 4.5rem), 8.125rem);
  }
}

/**********
  Tables
**********/

.table-scroll {
  box-sizing: border-box;
  max-width: 100%;
  margin: 1.5rem 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
  border: 1px solid var(--reader-rule);
  background: var(--reader-surface);
}

.table-scroll table {
  width: max-content;
  min-width: 100%;
  margin: 0;
  border-collapse: collapse;
  color: var(--reader-text);
  font-family: var(--reader-ui-font);
  font-size: 1rem;
  line-height: 1.45;
}

.table-scroll th,
.table-scroll td {
  min-width: 4.25rem;
  padding: 0.65rem 0.6rem;
  border: 0;
  border-block-end: 1px solid var(--reader-rule);
  text-align: left;
  vertical-align: top;
}

.table-scroll th {
  background: var(--reader-raised);
  color: var(--reader-heading);
  font-weight: 700;
}

.table-scroll th:empty {
  display: table-cell;
}

.table-scroll :is(th, td):last-child {
  text-align: right;
}

.table-scroll tbody tr:last-child td {
  border-block-end: 0;
}

@media (hover: hover) {
  .table-scroll tbody tr:hover {
    background: var(--reader-raised);
  }
}

/**********
  Non-cover Media
**********/

.prose img,
.panel img {
  max-width: 100%;
  height: auto;
}

/* The author portrait uses the shared image frame. */
.cover {
  display: block;
  box-sizing: border-box;
  width: auto;
  height: auto;
  max-width: min(100%, var(--cover-max-width));
  max-height: var(--cover-max-height);
  margin: 0 auto 0.85em;
  border: 2px solid #ccc;
}

.cover.avatar {
  --cover-max-width: 240px;
  --cover-max-height: 240px;
}

@media (max-width: 600px) {
  .cover {
    --cover-max-width: 100%;
    --cover-max-height: 70vh;
    margin-bottom: 0.75em;
  }
}

.prose pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--reader-rule);
  background: var(--reader-raised);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  line-height: 1.5;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  overflow-wrap: normal;
}

/**********
  Error Page
**********/

/* Footer presentation is maintained in site-footer.css. */
body.error-page .page-content {
  display: grid;
  align-items: center;
  min-height: 68vh;
  padding-block: clamp(1.25rem, 4vw, 2.5rem);
}

.error-page__content {
  container-type: inline-size;
  width: 100%;
  max-width: 42rem;
  border: 1px solid var(--reader-rule);
  background: var(--reader-surface);
  box-shadow: 0 0.35rem 1rem rgb(0 0 0 / 0.08);
}

.error-page__brand {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: clamp(7rem, 23vw, 10rem);
  padding: clamp(1.5rem, 6vw, 2.75rem) clamp(1rem, 5vw, 2rem);
  overflow: hidden;
  border-block-end: 2px solid transparent;
  background:
    linear-gradient(#171712, #171712) padding-box,
    var(--mw-cover-border-gradient) border-box;
  color: #FFF3DC;
  text-decoration: none;
  isolation: isolate;
}

.error-page__brand::before,
.error-page__brand::after {
  position: absolute;
  z-index: -1;
  width: 55%;
  height: 180%;
  border-radius: 50%;
  content: "";
  filter: blur(2.25rem);
  opacity: 0.24;
}

.error-page__brand::before {
  top: -80%;
  left: -20%;
  background: var(--mw-logo-red);
}

.error-page__brand::after {
  right: -20%;
  bottom: -80%;
  background: var(--mw-logo-green);
}

.error-page__brand:visited {
  color: #FFF3DC;
}

.error-page__brand:focus-visible {
  outline-color: #FFF3DC;
  outline-offset: -5px;
}

@media (hover: hover) {
  .error-page__brand:hover .error-page__brand-title {
    transform: scale(1.015);
  }
}

.error-page__brand-title {
  color: inherit;
  font-family: "Noto Sans", system-ui, sans-serif;
  font-size: clamp(0.95rem, 6.2cqi, 2.45rem);
  font-weight: 700;
  font-synthesis: none;
  letter-spacing: 0.035em;
  line-height: 1.05;
  text-align: center;
  text-shadow: 0 0.05em 0.12em rgb(0 0 0 / 0.3);
  text-transform: uppercase;
  text-wrap: balance;
  transition: transform 160ms ease-out;
  white-space: nowrap;
}

.error-page__body {
  padding: clamp(1.5rem, 5vw, 2.5rem);
}

.error-page__code {
  color: var(--reader-monk);
}

.error-page__content h1 {
  margin-block-start: 0;
  margin-block-end: clamp(1.25rem, 4vw, 1.75rem);
  font-size: clamp(1.8rem, 1.35rem + 2vw, 2.6rem);
}

.error-page__message {
  text-align: center;
}

.error-page__message p {
  margin-block-end: 0.55em;
}

.error-page__content h1 span {
  white-space: nowrap;
}

.error-page__content h1 span::before {
  content: " · ";
}

.error-page__choices {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  margin-block-start: clamp(1.5rem, 5vw, 2rem);
  font-family: var(--reader-ui-font);
  font-size: 1rem;
}

.error-page__choices a {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 48px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--action-border);
  background: var(--action-background);
  color: var(--action-color);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.error-page__choices a:visited {
  color: var(--action-color);
}

@media (hover: hover) {
  .error-page__choices a:hover {
    background: var(--action-hover-background);
    color: var(--action-hover-color);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --mw-border-red: rgb(199 62 29 / 75%);
    --mw-border-neutral: rgb(102 102 102 / 75%);
    --mw-border-green: rgb(0 107 60 / 75%);
    --reader-canvas: #10110F;
    --reader-surface: #181A17;
    --reader-raised: #20221F;
    --reader-text: #D8D5CC;
    --reader-heading: #F1EEE6;
    --reader-muted: #B7B3AA;
    --reader-link: #8EC5FF;
    --reader-visited: #BFA1D8;

    /* The error-page code uses this red accent. */
    --reader-monk: #FF453A;
    --reader-rule: #3A3D37;
    --reader-control-border: #6A6E66;
    --reader-focus: #8EC5FF;
    --action-background: #D8D5CC;
    --action-color: #181A17;
  }

  .cover {
    border-color: #777;
    box-shadow: 0 0 0.35em rgba(0, 0, 0, 0.55);
    filter: brightness(1.25);
  }
}

@media (max-width: 48rem) {
  .page-content {
    max-width: none;
  }
}

@media (max-width: 712px) {
  .shell--collection .page-frame > nav.pagination,
  .shell--collection .action,
  .shell--collection .panel {
    border-inline: 0;
  }
}

@media (max-width: 35rem) {
  .error-page__choices {
    grid-template-columns: minmax(0, 1fr);
  }

  .error-page__content h1 span {
    display: block;
    margin-block-start: 0.25em;
    white-space: normal;
  }

  .error-page__content h1 span::before {
    content: none;
  }
}

@media (max-width: 22rem) {
  nav.pagination {
    grid-template-areas:
      "context context"
      "prev next";
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  nav.pagination > .prev,
  nav.pagination > .next {
    width: 100%;
  }

  .pagination__context {
    border-block-end: 1px solid var(--reader-rule);
  }
}

@media (forced-colors: active) {
  .document,
  .prose,
  .panel,
  .page-content,
  nav.pagination,
  .site-footer,
  .table-scroll {
    forced-color-adjust: auto;
    background: Canvas;
    color: CanvasText;
  }

  :where(.document, .prose, .panel, .site-footer) a,
  nav.pagination a {
    color: LinkText;
  }

  :where(a, [tabindex]):focus-visible {
    outline-color: Highlight;
  }
}

@media print {
  :root {
    --reader-canvas: #fff;
    --reader-surface: #fff;
    --reader-raised: #fff;
    --reader-text: #000;
    --reader-heading: #000;
    --reader-muted: #222;
    --reader-link: #000;
    --reader-visited: #000;
    --reader-monk: #000;
    --reader-rule: #777;
    --reader-control-border: #777;
    --reader-focus: #000;
    --action-background: #fff;
    --action-color: #000;
  }

  html {
    overflow-y: auto;
    background: #fff;
  }

  nav,
  nav.pagination,
  .site-footer {
    display: none;
  }

  body,
  .document,
  .page-content,
  .prose,
  .panel,
  .table-scroll {
    border-color: #777;
    background: white;
    color: black;
  }

  .page-content,
  .document,
  .prose {
    max-width: none;
  }

  body,
  .document,
  .prose {
    font-size: 11pt;
    line-height: 1.55;
  }

  .cover {
    border-color: #ddd;
  }

  .table-scroll {
    overflow: visible;
  }

  .table-scroll table {
    width: 100%;
  }
}
