/**********
  Base
**********/

@font-face {
  font-family: "Vollkorn";
  src: url("/fonts/vollkorn/vollkorn-bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* Brand colors remain unchanged across themes per the locked logo specification. */
  --mw-logo-red: #C73E1D;
  --mw-logo-green: #006B3C;
  --mw-logo-foreground: #000000;
  --mw-border-red: var(--mw-logo-red);
  --mw-border-neutral: #666666;
  --mw-border-green: var(--mw-logo-green);
  --mw-section-divider: rgb(0 0 0 / 50%);
  --mw-cover-border-gradient: linear-gradient(
    90deg,
    var(--mw-border-red) 0 42%,
    var(--mw-border-neutral) 50%,
    var(--mw-border-green) 58% 100%
  );
}

body {
  display: block;
  margin: 0;
  padding: 0;
  background: white;
  color: black;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.18em;
  line-height: 1.55;
}

main {
  max-width: min(740px, 66ch);
  margin: 0 auto;
  padding: 1.25em;
  background: #f9f9f9;
  border-left: 2px solid #e9e9e9;
  border-right: 2px solid #e9e9e9;
}

main.landing-content {
  padding: 0;
  border-inline: 0;
  background: transparent;
}

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

/**********
  Navigation
**********/

nav.pagination {
  text-align: center;
  text-transform: uppercase;
  padding: 0.6em 0;
  border-bottom: 2px solid currentColor;
  font-size: 1.05em;
}

body:has(> main.landing-content) > nav.pagination:first-of-type {
  border-bottom: 0;
}

body > nav.pagination:last-of-type {
  border-top: 2px solid var(--mw-section-divider);
  border-bottom-color: var(--mw-section-divider);
}

body:has(> main.landing-content) > nav.pagination:last-of-type {
  padding-block-start: 1.2em;
  border-top: 0;
  border-bottom: 0;
}

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

.disabled {
  opacity: 0.25;
}

.sep {
  opacity: 0.4;
}

.sep.bar {
  position: relative;
  font-size: 0.75em;
  top: -2px;
}

.nav-icon {
  font-size: 0.9em;
  letter-spacing: -0.08em;
}

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

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

nav.pagination.actual-play-nav {
  font-size: 1.1em;
}

nav.pagination.actual-play-nav a {
  text-decoration: underline;
}

.reading-progress {
  height: 0.375rem;
  background: color-mix(in srgb, currentColor 18%, transparent);
}

.reading-progress__fill {
  display: block;
  width: var(--reading-progress);
  height: 100%;
  background: currentColor;
}

/**********
  Covers
**********/
.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 auto;
  border: 2px solid #ccc;
}

.cover.portrait {
  --cover-max-width: 600px;
  --cover-max-height: 800px;

  /* Brightness is applied to the border too; #aaa renders as #ccc at 1.2x. */
  border-color: #aaa;
  filter: brightness(1.2);
}

.cover.play {
  /* Brightness is applied to the border too; #aaa renders as #ccc at 1.2x. */
  border-color: #aaa;
  filter: brightness(1) !important;
}

.cover.portrait.rishi { border-color: var(--mw-border-red); }
.cover.portrait.maeril { border-color: var(--mw-border-green); }

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

.not-the-end {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  margin: 0 auto 1.5em;
}

.not-the-end img {
  display: block;
  width: min(calc(50% - 0.5rem), 16rem);
  height: auto;
}

.not-the-end img:first-child {
  margin-top: 0.25rem;
  width: min(calc(45% - 0.45rem), 12rem);
}

/***********************************
  Shared Home and Book Landing Pages
***********************************/

.landing-page {
  --landing-gap: 1.25em;
  --landing-panel-padding: 1.25em;
  --landing-panel-border: #e9e9e9;
  --landing-panel-background: #f9f9f9;
  --landing-action-background: #333;
  --landing-action-border: var(--landing-panel-border);
  --landing-action-color: #f5f5f5;
  --landing-action-hover-background: #444;
  --landing-action-hover-color: white;
  --landing-action-focus: #333;
  --landing-action-font-size: clamp(0.85rem, 2.1vw, 1.1rem);
}

.book-page {
  --book-cover-border: color-mix(in srgb, currentColor 28%, transparent);
}

.book-cover .cover {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  margin-bottom: 0;
  border: 0;
}

/******************************
  Book Cover Title Composition
******************************/

.book-page__cover {
  --book-title-safe-top: 1.75cqi;
  --book-title-safe-inline: 3cqi;
  --book-title-length: 16;
  --book-number-top: 13.5cqi;
  --book-title-shadow: 0 0.06em 0.14em rgb(0 0 0 / 0.22);

  container-type: inline-size;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  isolation: isolate;
  position: relative;
  padding-block-start: 0;
  padding-block-end: var(--landing-gap);
}

.book-page__cover--with-action {
  margin-block-end: var(--landing-gap);
  padding-block-end: 0;
}

.book-page__cover > .scene-header,
.book-page__cover > .book-cover,
.book-page__cover > .book-cover__read-link {
  grid-row: 1;
  grid-column: 1;
}

.book-page__cover > .book-page__cover-action {
  grid-row: 2;
  grid-column: 1;
}

.book-page__cover > picture.book-cover {
  position: relative;
  display: block;
  z-index: 0;
  margin: 0;
  line-height: 0;
}

.book-page__cover > .book-cover__read-link {
  position: relative;
  z-index: 0;
  display: block;
  line-height: 0;
}

.book-page__cover > .book-cover__read-link > picture.book-cover {
  position: relative;
  display: block;
  line-height: 0;
}

.book-page__cover--with-read-link > .scene-header {
  pointer-events: none;
}

.book-cover__read-link:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

.book-cover__read-link:is(:hover, :focus-visible)
  ~ .book-page__cover-action .landing-action {
  background: var(--landing-action-hover-background);
  color: var(--landing-action-hover-color);
}

.book-page picture.book-cover::before {
  position: absolute;
  z-index: 2;
  inset: 0;
  box-sizing: border-box;
  border: 2px solid var(--book-cover-border);
  content: "";
  pointer-events: none;
}

.book-page picture.book-cover::after {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  left: 0;
  height: 27cqi;
  content: "";
  background: linear-gradient(
    to bottom,
    rgb(241 235 223 / 0.92) 0%,
    rgb(241 235 223 / 0.56) 37%,
    transparent 100%
  );
  pointer-events: none;
}

.book-page__cover > .scene-header {
  z-index: 1;
  align-self: stretch;
  position: relative;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  color: var(--mw-logo-foreground);
  text-shadow: var(--book-title-shadow);
}

.book-page__cover > .scene-header .kicker {
  display: none;
}

.book-cover__number {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7em;
  position: absolute;
  z-index: 1;
  inset-inline: var(--book-title-safe-inline);
  top: var(--book-number-top);
  margin: 0;
  font-size: min(2.5cqi, 1.4rem);
  font-weight: 750;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

.book-cover__number::before,
.book-cover__number::after {
  content: "";
  width: clamp(1.125rem, 5.5cqi, 2.75rem);
  height: 2px;
  background: currentColor;
}

.book-page__cover > .scene-header h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset-inline: var(--book-title-safe-inline);
  top: var(--book-title-safe-top);
  height: calc(var(--book-number-top) - var(--book-title-safe-top));
  margin: 0;
  padding: 0;
  border: 0;
  color: inherit;
  font-size: clamp(
    1.1rem,
    min(8.91cqi, calc(160.6cqi / var(--book-title-length))),
    5.5rem
  );
  line-height: 1;
  letter-spacing: -0.018em;
  white-space: nowrap;
}

.landing-panel {
  box-sizing: border-box;
  padding: var(--landing-panel-padding);
  border: 2px solid var(--landing-panel-border);
  background: var(--landing-panel-background);
}

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

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

.landing-page .landing-action {
  display: flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  width: 100%;
  padding: 0.75em 1.25em;
  border: 2px solid var(--landing-action-border);
  border-block-start-width: 0;
  background: var(--landing-action-background);
  box-shadow: none;
  color: var(--landing-action-color);
  font-size: 1em;
  font-weight: 650;
  letter-spacing: 0.015em;
  line-height: 1.2;
  text-decoration: none;
}

.landing-page .landing-action__label {
  margin: 0;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-transform: none;
}

.book-page__status .release-notices {
  margin: 0;
}

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

.landing-page a.landing-action:focus-visible {
  outline-color: var(--landing-action-focus);
}

.landing-panel--contents {
  margin-block-start: var(--landing-gap);
}

.home-page__contents > h2,
.book-page__contents .book-toc h2 {
  margin-top: 0;
}

/**********
  Headings
**********/

.scene-header {
  margin-bottom: 0.75em;
}

.kicker {
  margin: 0 0 0.25em 0;
  opacity: 0.65;
  font-size: 0.75em;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  word-spacing: 0.1em;
}

h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  margin: 0.25em 0 0.75em 0;
  padding-bottom: 0.2em;
  border-bottom: 2px solid #ddd;
  font-size: 2.2em;
  line-height: 1.15;
  text-align: center;
}

/**********
  Home Hero
**********/

.home-page__cover {
  box-sizing: border-box;
  margin-block-end: var(--landing-gap);
}

.home-page__cover > .home-page__header {
  padding: 0.5em var(--landing-gap) 0;
}

.home-page__header h1 {
  margin-top: 0;
  margin-bottom: 0.35em;
  padding-bottom: 0;
  border: 0;
  background: transparent;
  font-size: 3.25em;
}

.home-banner {
  margin: 0;
  overflow: visible;
  line-height: 0;
}

.home-banner__link {
  isolation: isolate;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  color: inherit;
  text-decoration: none;
}

.home-banner__picture::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  background:
    var(--mw-cover-border-gradient) top / 100% 2px no-repeat,
    var(--mw-cover-border-gradient) bottom / 100% 2px no-repeat,
    linear-gradient(var(--mw-border-red) 0 0)
      left 0 top 2px / 2px calc(100% - 4px) no-repeat,
    linear-gradient(var(--mw-border-green) 0 0)
      right 0 top 2px / 2px calc(100% - 4px) no-repeat;
  pointer-events: none;
}

.home-banner__link:focus-visible {
  outline-offset: -0.18em;
}

.home-banner__picture {
  position: relative;
  z-index: 0;
  display: block;
  overflow: hidden;
  grid-row: 1;
  grid-column: 1;
}

.home-banner img {
  display: block;
  width: 100%;
  height: auto;
  filter: brightness(1.2);
}

/************************
  Attached Cover Actions
************************/

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

.home-banner__action {
  grid-row: 2;
  grid-column: 1;
}

.landing-page .landing-action--compact {
  align-items: baseline;
  gap: 0.45em;
  padding: 0.5em 0.9em;
  font-size: var(--landing-action-font-size);
  line-height: 1.25;
}

.home-banner__link:hover .home-banner__action {
  background: var(--landing-action-hover-background);
  color: var(--landing-action-hover-color);
}

/**********
  M&W Wordmark
**********/

h1,
.mw {
  color: var(--mw-logo-foreground);
  font-family: "Vollkorn", serif;
  font-style: normal;
  font-weight: 700;
  font-synthesis: none;
}

.mw {
  font-size: 4rem;
  line-height: 1;
}

.mw .first { color: var(--mw-logo-red); }
.mw .amp {
  color: currentColor;
  font-size: 0.95em;
}
.mw .second { color: var(--mw-logo-green); }
.mw .mono { color: currentColor; }

h1.rishi,
h1.maeril {
  margin-top: 0;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.actual-play-sheet h2 {
  margin-top: 0;
}

/* Apply on a black or dark surface. */
.mw.dark { --mw-logo-foreground: #FFFFFF; }
.mw.compact .amp { margin-inline-end: -.04em; }
.mw.inline,
.mw.heading {
  font-size: 1.1em;
  line-height: inherit;
}

.home-page__header .mw {
  font-size: inherit;
}

h2 {
  margin-top: 1.5em;
  border-bottom: 2px solid #ddd;
  font-size: 1.45em;
  line-height: 1.2;
  text-align: left;
}

h3 {
  margin-top: 1.5em;
  border-bottom: 2px solid #eee;
  font-size: 1.2em;
  line-height: 1.2;
  text-align: left;
}

/**********
  More
**********/

.more,
.home-page .language-switcher {
  margin: 1.75rem 0 2rem;
  padding: 0.95rem 1.15rem 0.95rem 1.25rem;
  border-left: 2px solid color-mix(in srgb, currentColor 35%, transparent);
  font-size: 1em;
  background: color-mix(in srgb, currentColor 7%, transparent);
}

.landing-page .more,
.home-page .language-switcher {
  margin-block: var(--landing-gap);
  border: 2px solid var(--landing-panel-border);
}

.landing-page > .more:last-child {
  margin-block-end: 0;
}

.home-page .language-switcher {
  padding: 0;
}

.home-page .language-switcher ul,
.home-page .language-switcher li {
  width: 100%;
}

.home-page .language-switcher ul {
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-page .language-switcher a {
  display: flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  width: 100%;
  padding: 0.475rem 0.575rem 0.475rem 0.625rem;
  color: inherit;
  font-size: 0.9em;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  text-underline-offset: 0.15em;
  transition:
    background-color 180ms ease,
    color 180ms ease;
}

.home-page .language-switcher a:hover {
  background: #444;
  color: #f5f5f5;
}

.language-switcher__spacer {
  visibility: hidden;
}

.more .more__title {
  margin: 0 0 0.45rem;
  font-size: 0.9em;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.more p {
  font-size: inherit;
}

.more p:last-child {
  margin-bottom: 0;
}

/**********
  Homepage Saga Book Rows
**********/

.saga-heading ~ h3 {
  margin-bottom: 0.5em;
}

.saga-book-row {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  width: 100%;
  margin: 0.3em 0;
  padding: 0.45em 0;
  text-align: left;
  text-decoration: none;
  font-size: 1em;
}

.saga-book-row--title-only {
  grid-template-columns: minmax(0, 1fr);
}

.saga-book-number {
  align-self: start;
  opacity: 0.8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.8em;
  text-transform: uppercase;
  word-spacing: normal;
  text-decoration: none;
}

.saga-book-title {
  font-size: 1em;
  line-height: 1.125;
}

.saga-book-awesome {
  margin-right: 0.4em;
  text-decoration: none;
}

.saga-book-title-text {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/**********************
  Homepage Play Sheets
**********************/

.play-sheets-row {
  grid-template-columns: 8rem minmax(0, 1fr);
}

/**********
  Release Status
**********/

.release-status {
  box-sizing: border-box;
  max-width: none;
  margin: 0;
  padding: 0.5em 0.5em 0.25em;

  border: 2px dashed rgb(0 0 0 / 0.24);
  background: linear-gradient(135deg, rgb(0 0 0 / 0.05), rgb(0 0 0 / 0.015));
  box-shadow: 0 0 0.25em rgb(0 0 0 / 0.06);

  color: rgb(0 0 0 / 0.90);
  font-size: 1.25rem;
  text-align: center;
  word-spacing: normal;
  letter-spacing: normal;
}

.release-status--grey {
  border-width: 1px;
  border-color: rgb(92 107 120 / 0.46);
  background: linear-gradient(
    115deg,
    rgb(87 105 120 / 0.06) 0%,
    rgb(184 197 207 / 0.14) 44%,
    rgb(232 238 242 / 0.24) 52%,
    rgb(77 96 112 / 0.08) 100%
  );
  color: rgb(43 53 61 / 0.92);
}

.release-status--silver {
  border-width: 1px;
  border-color: rgb(112 122 134 / 0.52);
  border-style: solid;
  background: linear-gradient(
    115deg,
    rgb(168 178 190 / 0.10) 0%,
    rgb(230 234 239 / 0.25) 44%,
    rgb(250 251 252 / 0.34) 52%,
    rgb(157 168 181 / 0.12) 100%
  );
  color: rgb(45 52 60 / 0.94);
}

.release-status__label {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 1em;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.release-progress {
  box-sizing: border-box;
  max-width: none;
  margin: 0;
  padding: 0.7em 0.85em 0.8em;

  border: 1px solid rgb(0 0 0 / 0.18);
  background: rgb(0 0 0 / 0.03);

  color: rgb(0 0 0 / 0.90);
  font-size: 1rem;
  text-align: center;
}

.release-notices {
  display: grid;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.scene-header + .shortcode-picture,
.release-notices + .shortcode-picture {
  display: block;
  margin-top: -0.3em;
}

.scene-header + .release-notices {
  margin-top: -0.6em;
}

@media (max-width: 600px) {
  .scene-header + .shortcode-picture,
  .release-notices + .shortcode-picture {
    margin-top: -0.5em;
  }
}

@media (min-width: 601px) {
  .scene-header + .release-notices {
    margin-top: -1em;
  }
}

.release-progress__track {
  height: 0.65rem;
  margin: 0;
  border: 1px solid rgb(0 0 0 / 0.20);
  overflow: hidden;
  background: rgb(0 0 0 / 0.10);
}

.release-progress__fill {
  display: block;
  width: var(--release-progress);
  height: 100%;
  background: repeating-linear-gradient(
    135deg,
    rgb(0 0 0 / 0.42) 0,
    rgb(0 0 0 / 0.42) 0.4rem,
    rgb(0 0 0 / 0.28) 0.4rem,
    rgb(0 0 0 / 0.28) 0.8rem
  );
}

.release-progress__label {
  margin: 0 0 0.45rem;
  font-size: 0.78em;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

/**********
  Scene Content
**********/

.scene hr {
  margin: 2em 0;
  border: none;
  border-top: 2px solid #ddd;
}

article p,
article > .saga-book-row {
  font-size: 1.1em;
}

article p {
  line-height: 1.6;
}

/*
  Keep main's bottom padding as the page's consistent final gutter.

  Paragraphs and tables have their own bottom margins; when either is the final
  direct article child, that margin would be added to main's padding and make
  the bottom gap larger than the other edges.
*/
article > :last-child {
  margin-bottom: 0;
}

article > p,
article > blockquote p {
  text-align: left;
  word-spacing: normal;
  letter-spacing: normal;
  hyphens: auto;
}

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

.term {
  font-size: 1.02em;
  font-variant-caps: all-small-caps;
  white-space: nowrap;
}

/**********
  Blockquotes / In-World Excerpts
**********/

.content blockquote {
  position: relative;
  margin: 1.75rem 0;
  padding: 1.5rem 0.25rem 1.5rem 2.5rem;
  border-top: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-bottom: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  font-size: 1.05em;
  line-height: 1.6;
  font-style: normal;
}

.content blockquote::before {
  position: absolute;
  top: 0.6rem;
  left: 0.25rem;
  color: color-mix(in srgb, currentColor 42%, transparent);
  content: "“";
  font-size: 3.4em;
  line-height: 0.8;
}

:lang(fr) .content blockquote::before {
  content: "«";
}

.content blockquote p {
  margin: 0.65rem 0;
}

.content blockquote p:first-child {
  margin-top: 0;
}

.content blockquote p:last-child {
  margin-bottom: 0;
}

/**********
  Generic Section Contents
**********/

.toc-list {
  margin: 0rem 1rem;
}

.toc-list ol {
  list-style: none;
  counter-reset: toc-list;
  margin: 0;
  padding: 0;
}

.toc-list li {
  counter-increment: toc-list;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 1.25rem;
  padding: 1rem 0;
  border-top: 1px solid #999;
}

.toc-list li:first-child {
  border-top: none;
}

.toc-list li::before {
  content: counter(toc-list);
  color: #777;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.toc-list a {
  font-weight: 700;
  text-decoration: none;
}

.toc-list a:hover,
.toc-list a:focus {
  text-decoration: underline;
}

/**********
  Book Table of Contents
**********/

.chapter-list {
  font-size: 1.1em;
  line-height: 1.55;
  margin: 0;
  padding-left: 1.5em;
}

.chapter-entry {
  margin: 1em 0;
}

.chapter-entry-unnumbered {
  list-style-type: disc;
}

.chapter-title {
  font-weight: 700;
}

.scene-list {
  margin: 0.35em 0 0.75em 0;
  padding-left: 1.5em;
}

.scene-list li {
  margin: 0.35em 0;
}

/**********
  Character Sheets
**********/
main table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

main th,
main td {
  padding: 0.50rem 0.75rem;
  border-bottom: 1px solid #444;
  text-align: left;
  vertical-align: top;
}

main th {
  font-weight: 700;
}

main td:last-child,
main th:last-child {
  text-align: right;
}

main table th:empty {
  display: none;
}

main table tr:hover {
  background: #ddd;
}

/***********************************
  Information and Navigation Panels
***********************************/

main table.book-actions {
  --book-actions-rule: color-mix(in srgb, currentColor 24%, transparent);
  --action-panel-border: #e9e9e9;

  box-sizing: border-box;
  margin: 1.25em 0 0;
  border: 2px solid var(--action-panel-border);
  background: #f9f9f9;
}

main table.book-actions {
  table-layout: fixed;
}

main table.book-actions th,
main table.book-actions td {
  width: 33.333%;
  padding-inline: 0.75rem;
  border-bottom: 0;
  text-align: center;
  vertical-align: middle;
}

main table.book-actions th {
  padding-block: 0.8rem 0.3rem;
  color: color-mix(in srgb, currentColor 62%, transparent);
  font-size: 0.72em;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

main table.book-actions td {
  padding-block: 0.3rem 0.85rem;
  font-size: 1.05em;
  font-weight: 600;
  line-height: 1.3;
}

main table.book-actions th + th,
main table.book-actions td + td {
  border-inline-start: 1px solid var(--book-actions-rule);
}

main table.book-actions td a {
  font-weight: 700;
  text-underline-offset: 0.16em;
}

main table.book-actions tr:hover {
  background: transparent;
}

@media (prefers-color-scheme: light) {
  .landing-page {
    --landing-panel-border: #ccc;
  }

  .book-page {
    --book-cover-border: #aaa;
  }

  .book-page table.book-actions {
    --action-panel-border: var(--landing-panel-border);
  }
}

/**********
  Attribution
**********/

.site-footer-inner {
  max-width: min(740px, 66ch);
  margin: 0 auto;
}

.site-community-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  width: fit-content;
  box-sizing: border-box;
  max-width: 100%;
  gap: 0.4em 1em;
  margin: 0 auto;
  position: relative;
  padding: 0.75em 0.5em calc(0.75em + 4px);
}

.site-community-links::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 100vw;
  border-bottom: 2px solid var(--mw-section-divider);
  transform: translateX(-50%);
}

body:has(> main.landing-content) > .site-footer .site-footer-inner {
  opacity: 0.5;
}

body:has(> main.landing-content) > .site-footer .site-community-links,
body:has(> main.landing-content) > .site-footer .attribs {
  padding-block: 0.5em;
}

body:has(> main.landing-content) > .site-footer .site-community-links::after {
  content: none;
}

.community-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  white-space: nowrap;
  font-size: 0.92em;
  line-height: 1.55;
  text-decoration: none;
  opacity: 0.9;
}

.community-link > span {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.community-link > i {
  font-size: 1.15em;
}

.attribs {
  max-width: 760px;
  margin: 0 auto;
  padding: 0.75em 0.5em;
}

.attribs p {
  opacity: 0.5;
  font-size: 0.78em;
  line-height: 1.25;
  text-align: justify;
  word-spacing: normal;
  letter-spacing: normal;
}

.attribs p:last-child {
  margin-bottom: 0;
}

/**********
  Dark Mode
**********/

@media (prefers-color-scheme: dark) {
  :root {
    --mw-logo-foreground: #FFFFFF;
    --mw-border-red: rgb(199 62 29 / 75%);
    --mw-border-neutral: rgb(102 102 102 / 75%);
    --mw-border-green: rgb(0 107 60 / 75%);
    --mw-section-divider: rgb(255 255 255 / 50%);
  }

  .landing-page {
    --landing-panel-border: #444;
    --landing-panel-background: #222;
    --landing-action-color: #eee;
    --landing-action-focus: #aaa;
  }

  .book-page picture.book-cover::after {
    background: linear-gradient(
      to bottom,
      rgb(0 0 0 / 0.82) 0%,
      rgb(0 0 0 / 0.48) 37%,
      transparent 100%
    );
  }

  .book-page__cover {
    --book-title-shadow: 0 0.06em 0.14em rgb(0 0 0 / 0.72);
  }

  .book-page__cover > .scene-header {
    color: #fff;
  }

  .home-banner {
    background: #181817;
    box-shadow: 0 1rem 2.25rem rgb(0 0 0 / 0.38);
  }

  .not-the-end img {
    filter: invert(1) brightness(0.9);
  }

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

  .cover.portrait {
    border-color: #777;
    filter: brightness(1);
  }

  .cover.portrait.rishi { border-color: rgb(199 62 29 / 75%); }

  .saga-book-row {
    border-color: #444;
  }

  .release-status {
    border-color: rgb(255 255 255 / 0.24);
    background: linear-gradient(135deg, rgb(255 255 255 / 0.065), rgb(255 255 255 / 0.02));
    box-shadow: 0 0 0.25em rgb(0 0 0 / 0.16);
    color: rgb(255 255 255 / 0.90);
  }

  .release-status--grey {
    border-color: rgb(164 181 194 / 0.46);
    background: linear-gradient(
      115deg,
      rgb(107 128 144 / 0.07) 0%,
      rgb(174 194 207 / 0.11) 44%,
      rgb(222 232 238 / 0.16) 52%,
      rgb(92 113 130 / 0.07) 100%
    );
    color: rgb(228 235 240 / 0.92);
  }

  .release-status--silver {
    border-color: rgb(184 194 206 / 0.52);
    background: linear-gradient(
      115deg,
      rgb(132 144 158 / 0.10) 0%,
      rgb(211 218 226 / 0.16) 44%,
      rgb(242 245 248 / 0.22) 52%,
      rgb(119 132 147 / 0.10) 100%
    );
    color: rgb(236 240 244 / 0.94);
  }

  .release-progress {
    border-color: rgb(255 255 255 / 0.18);
    background: rgb(255 255 255 / 0.03);
    color: rgb(255 255 255 / 0.90);
  }

  .release-progress__track {
    border-color: rgb(255 255 255 / 0.22);
    background: rgb(255 255 255 / 0.12);
  }

  .release-progress__fill {
    background: repeating-linear-gradient(
      135deg,
      rgb(255 255 255 / 0.56) 0,
      rgb(255 255 255 / 0.56) 0.4rem,
      rgb(255 255 255 / 0.34) 0.4rem,
      rgb(255 255 255 / 0.34) 0.8rem
    );
  }

  .toc-list ol,
  .toc-list li {
    border-color: #777;
  }

  .toc-list li::before {
    color: #aaa;
  }

  main table tr:hover {
    background: #555;
  }

  main table.book-actions {
    --action-panel-border: #444;

    background: #222;
  }

  body {
    background: black;
    color: white;
  }

  main {
    background: #222;
    border-left-color: #444;
    border-right-color: #444;
  }

  nav.pagination {
    border-color: white;
  }

  body > nav.pagination:last-of-type {
    border-color: white;
    border-top-color: var(--mw-section-divider);
    border-bottom-color: var(--mw-section-divider);
  }

  h1,
  h2,
  .toc-list,
  .attribs,
  .scene hr {
    border-color: #777;
  }

  h3 {
    border-color: #444;
  }

}

/**********
  Mobile
**********/

@media (max-width: 712px) {
  .landing-page .landing-action,
  .landing-page .landing-panel,
  .landing-page .more,
  .home-page .language-switcher,
  .book-page .book-cover .cover,
  .book-page .release-progress,
  .book-page table.book-actions {
    border-inline: 0;
  }

  .book-page picture.book-cover::before {
    border-inline: 0;
  }

}

@media (max-width: 600px) {
  .landing-page {
    --landing-gap: 0.85em;
    --landing-panel-padding: 0.85em;
  }

  .book-cover__number {
    font-size: min(3.125cqi, 1.75rem);
  }

  .book-cover__number::before,
  .book-cover__number::after {
    width: clamp(1.4rem, 6.9cqi, 3.45rem);
  }

  main table.book-actions th,
  main table.book-actions td {
    padding-inline: 0.35rem;
  }

  main table.book-actions th {
    letter-spacing: 0.08em;
  }

  main table.book-actions {
    margin-block-start: 0.85em;
  }

  .home-banner img {
    width: 130%;
    max-width: none;
    margin-inline: -15%;
  }

  .not-the-end {
    gap: 0.5rem;
  }

  .not-the-end img {
    width: min(calc(50% - 0.25rem), 10rem);
  }

  .not-the-end img:first-child {
    width: min(calc(45% - 0.225rem), 7.25rem);
  }

  .release-status {
    padding: 0.35em 0.4em 0.2em;
    font-size: 1.05rem;
  }

  .release-progress {
    padding: 0.5em 0.65em 0.55em;
    font-size: 0.9rem;
  }

  .cover {
    --cover-max-width: 100%;
    --cover-max-height: 70vh;
    margin-bottom: 0.75em;
  }

  .toc-list li {
    grid-template-columns: 3rem 1fr;
    gap: 0.85rem;
  }

  main th,
  main td {
    padding: 0.4rem 0.6rem;
  }

  body {
    font-size: 1em;
  }

  main {
    max-width: none;
    padding: 0.85em;
    border-left: none;
    border-right: none;
  }

  article p,
  article > .saga-book-row {
    font-size: 1.15em;
  }

  nav.pagination {
    font-size: 1.2em;
  }

  h2 {
    font-size: 1.35em;
  }

  h1,
  .home-page__header h1 {
    font-size: 2.4em;
  }

  .attribs p {
    font-size: 0.84em;
  }
}

@media (max-width: 480px) {
  h1,
  .home-page__header h1 {
    font-size: 2.2em;
  }

  h1.rishi,
  h1.maeril,
  .home-page__header h1 {
    margin-bottom: 0.5em;
  }
}

@media (max-width: 410px) {
  h1,
  .home-page__header h1 {
    font-size: 1.8em;
  }
}

/**********
  Saga Row Collapse
**********/

/* Keep saga rows in two columns until the viewport is genuinely narrow. */
@media (max-width: 300px) {
  .saga-book-row {
    grid-template-columns: 1fr;
    gap: 0.09em;
    padding: 0.55em 0;
  }

  .saga-book-number {
    align-self: auto;
  }

  .saga-book-title {
    font-size: 1em;
  }
}

/**********
  Print
**********/

@media print {
  .cover {
    border-color: #ddd;
  }

  .saga-book-row {
    border-color: #ddd;
  }

  .release-status--grey,
  .release-status--silver {
    border-color: #777;
    background: white;
    color: black;
    break-inside: avoid;
  }

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

  body {
    background: white;
    color: black;
    font-size: 11pt;
  }

  main {
    max-width: none;
    border: none;
    background: white;
  }

  .scene hr {
    border-top-color: #ddd;
  }

}

/******************
  Book Overrides
******************/

.book-page.book-1 picture.book-cover::before,
.book-page.book-2 picture.book-cover::before {
  border: 0;
  background:
    var(--mw-cover-border-gradient) top / 100% 2px no-repeat,
    var(--mw-cover-border-gradient) bottom / 100% 2px no-repeat,
    linear-gradient(var(--mw-border-red) 0 0)
      left 0 top 2px / 2px calc(100% - 4px) no-repeat,
    linear-gradient(var(--mw-border-green) 0 0)
      right 0 top 2px / 2px calc(100% - 4px) no-repeat;
}

@media (max-width: 712px) {
  .home-banner__picture::after,
  .book-page.book-1 picture.book-cover::before,
  .book-page.book-2 picture.book-cover::before {
    background:
      var(--mw-cover-border-gradient) top / 100% 2px no-repeat,
      var(--mw-cover-border-gradient) bottom / 100% 2px no-repeat;
  }
}

/* Book 7: shift the artwork down to restore the title safe zone. The taller
   theme-specific fade below conceals the narrow exposed strip at the top. */
.book-page.book-7 picture.book-cover {
  overflow: hidden;
}

.book-page.book-7 .book-cover .cover {
  transform: translateY(1.5%);
}

/* The Art of Being Seen */
.book-taobs picture.book-cover::after {
  content: none;
}

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

.book-taobs .book-page__cover > .scene-header h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-color-scheme: light) {
  /* Books 3–5 */
  .book-page.book-3,
  .book-page.book-4,
  .book-page.book-5 {
    --book-cover-border: #5f7d4b;
  }

  /* Books 6–7 */
  .book-page.book-6,
  .book-page.book-7 {
    --book-cover-border: #c43f7d;
  }

  .book-page.book-6 picture.book-cover::after,
  .book-page.book-7 picture.book-cover::after,
  .book-page.book-8 picture.book-cover::after,
  .book-page.book-9 picture.book-cover::after {
    background: linear-gradient(
      to bottom,
      rgb(228 219 202 / 0.98) 0%,
      rgb(228 219 202 / 0.68) 37%,
      transparent 100%
    );
  }

  /* Book 7 */
  .book-page.book-7 picture.book-cover::after {
    height: 34cqi;
    background: linear-gradient(
      to bottom,
      rgb(228 219 202) 0%,
      rgb(228 219 202) 18%,
      rgb(228 219 202 / 0.88) 48%,
      transparent 100%
    );
  }

  /* Book 8 */
  .book-page.book-8 {
    --book-cover-border: #c73e1d;
  }

  .book-page.book-8 picture.book-cover::after {
    background: linear-gradient(
      to bottom,
      rgb(214 202 181 / 0.99) 0%,
      rgb(214 202 181 / 0.78) 37%,
      transparent 100%
    );
  }

  /* Book 9 */
  .book-page.book-9 {
    --book-cover-border: #006b3c;
  }
}

@media (prefers-color-scheme: dark) {
  /* Books 3–5 */
  .book-page.book-3,
  .book-page.book-4,
  .book-page.book-5 {
    --book-cover-border: #3f6946;
  }

  /* Books 6–7 */
  .book-page.book-6,
  .book-page.book-7 {
    --book-cover-border: #7b2f64;
  }

  .book-page.book-6 picture.book-cover::after,
  .book-page.book-7 picture.book-cover::after,
  .book-page.book-8 picture.book-cover::after,
  .book-page.book-9 picture.book-cover::after {
    background: linear-gradient(
      to bottom,
      rgb(0 0 0 / 0.96) 0%,
      rgb(0 0 0 / 0.65) 37%,
      transparent 100%
    );
  }

  /* Book 7 */
  .book-page.book-7 picture.book-cover::after {
    height: 34cqi;
    background: linear-gradient(
      to bottom,
      black 0%,
      black 18%,
      rgb(0 0 0 / 0.82) 48%,
      transparent 100%
    );
  }

  .book-page.book-6 .book-cover .cover {
    filter: brightness(0.9);
  }

  /* Book 8 */
  .book-page.book-8 {
    --book-cover-border: #c73e1d;
  }

  .book-page.book-8 picture.book-cover::after {
    background: linear-gradient(
      to bottom,
      rgb(0 0 0 / 0.99) 0%,
      rgb(0 0 0 / 0.76) 37%,
      transparent 100%
    );
  }

  /* Book 9 */
  .book-page.book-9 {
    --book-cover-border: #006b3c;
  }
}
