main a:not(.note-button):not(.drawing-card) {
  color: var(--titan);
}
main p,
main li,
main dd,
main h1,
main h2,
main h3 {
  text-wrap: pretty;
}
/* Every notes page spaces its h2 the same */
main h2 {
  margin: 0.6rem 0;
}
.citations {
  list-style: disc;
  padding-left: 1.25rem;
}
.citations li {
  text-wrap: pretty;
}
.citations cite {
  font-style: italic;
}
.citation-button {
  display: inline-block;
  margin: 0.08rem 0;
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--rib);
  background: #1a1f22;
  color: var(--titan);
  font-size: 0.85em;
  line-height: 1.3;
  text-decoration: none;
}
main a.citation-button:hover,
main a.citation-button:focus-visible {
  background: var(--haze);
  color: var(--hall);
  outline: none;
}
.note-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.2rem 0 0;
}
/* Compact size shared with the tour's HIDE/SHOW button in the game */
.note-button {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  padding: 0.15em 0.55em;
  border: 1px solid var(--rib);
  color: var(--titan);
  font-size: 0.85em;
  line-height: 1.3;
  text-decoration: none;
}
.drawing-back {
  margin: 1rem 0 0;
}
.note-button:hover,
.note-button:focus-visible {
  background: var(--haze);
  color: var(--hall);
  outline: none;
}
.drawing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
}
.drawing-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.5rem;
  border: 1px solid var(--rib);
  color: var(--titan);
  text-decoration: none;
}
.drawing-card:hover,
.drawing-card:focus-visible {
  border-color: var(--titan);
  outline: 1px solid var(--titan);
}
.drawing-card img {
  display: block;
  width: 100%;
  height: 7rem;
  object-fit: contain;
  background: #1a1f22;
}
.drawing-card span:last-child {
  color: var(--dust);
  font-size: 0.8em;
}


/* Page styles. Rules shared by every notes page come first; the rest
   apply to one page through the page-<name> class on its <body>. */
body {
  margin: 0;
  background: var(--wall);
  color: var(--haze);
  font-family: var(--font-mono);
  line-height: 1.6;
}

/* concept.html */
.page-concept main {
  max-width: 74ch;
  margin: 0 auto;
  padding: 3rem 1.25rem 5rem;
}
.page-concept h1, .page-concept h2, .page-concept h3 {
  font-family: var(--font-crt);
  font-weight: 400;
  line-height: 1.1;
}
.page-concept h1 {
  font-size: 3rem;
  margin: 1rem 0;
}
.page-concept h2 {
  font-size: 1.9rem;
  border-bottom: 1px solid var(--rib);
  padding-bottom: 0.3rem;
}
.page-concept h3 {
  font-size: 1.4rem;
  margin: 0.75rem 0;
}
.page-concept .dim {
  color: var(--dust);
}
.page-concept .callout {
  border-left: 2px solid var(--titan);
  background: #1a1f22;
  padding: 0.6rem 0.9rem;
}
@media (max-width: 520px) {
  .page-concept main {
    padding: 2rem 1rem 3rem;
  }
  .page-concept h1 {
    font-size: 2.4rem;
  }
}

/* credits.html */
.page-credits main {
  max-width: 74ch;
  margin: 0 auto;
  padding: 2rem 1.25rem 2rem;
}
.page-credits h1, .page-credits h2 {
  font-family: var(--font-crt);
  font-weight: 400;
  line-height: 1.1;
}
.page-credits h1 {
  font-size: 3rem;
  margin: 1rem 0;
}
.page-credits h2 {
  font-size: 1.8rem;
  border-bottom: 1px solid var(--rib);
  padding-bottom: 0.3rem;
}
.page-credits p, .page-credits li {
  color: var(--haze);
}
.page-credits .dim {
  color: var(--dust);
}
.page-credits ul {
  padding-left: 1.2rem;
}

/* devnotes.html */
.page-devnotes main {
  max-width: 55rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 5rem;
}
.page-devnotes h1, .page-devnotes h2, .page-devnotes h3 {
  font-family: var(--font-crt);
  font-weight: 400;
  line-height: 1.1;
}
.page-devnotes h1 {
  font-size: 3rem;
  margin: 1rem 0;
}
.page-devnotes h2 {
  font-size: 1.9rem;
  border-bottom: 1px solid var(--rib);
  padding-bottom: 0.3rem;
}
.page-devnotes h3 {
  font-size: 1.4rem;
  margin: 0.75rem 0;
}
.page-devnotes .dim {
  color: var(--dust);
}
.page-devnotes .warn {
  border: 1px solid var(--flag);
  color: var(--flag);
  padding: 0.6rem 0.9rem;
}
.page-devnotes .sysfile {
  background: #1a1f22;
  border-left: 2px solid var(--rib);
  padding: 0.6rem 0.9rem;
  margin: 0.3rem 0;
}
.page-devnotes .sysfile p {
  margin: 0.2rem 0;
}
.page-devnotes .sys-sec {
  color: var(--titan);
  margin: 0.4rem 0;
}
.page-devnotes .etable.wraps td {
  overflow-wrap: anywhere;
}
.page-devnotes caption {
  text-align: left;
  color: var(--dust);
}
.page-devnotes table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}
.page-devnotes th, .page-devnotes td {
  text-align: left;
  padding: 0.25rem 0.6rem 0.25rem 0;
  border-bottom: 1px solid var(--rib);
  vertical-align: top;
}
.page-devnotes th {
  color: var(--titan);
  font-weight: 500;
}
.page-devnotes .graph {
  overflow-x: auto;
  background: #1a1f22;
  padding: 1rem;
}
.page-devnotes .graph svg {
  display: block;
  min-width: 680px;
  width: 100%;
  height: auto;
}
.page-devnotes .tag {
  color: var(--flag);
}
.page-devnotes .fields {
  display: grid;
  grid-template-columns: minmax(8em, max-content) 1fr;
  gap: 0.1rem 0.8rem;
  margin: 0.3rem 0;
  padding: 0.6rem 0.9rem;
  background: #1a1f22;
  border-left: 2px solid var(--rib);
}
.page-devnotes .fields dt {
  color: var(--dust);
}
.page-devnotes .fields dd {
  margin: 0;
}
.page-devnotes .etable-wrap {
  overflow-x: auto;
  background: #1a1f22;
  border-left: 2px solid var(--rib);
  padding: 0.4rem 0.9rem;
  margin: 0.3rem 0;
}
.page-devnotes .paras p {
  margin: 0.5rem 0;
}
@media (max-width: 520px) {
  .page-devnotes .fields {
    grid-template-columns: 1fr;
  }
  .page-devnotes .fields dd {
    margin: 0.2rem 0;
  }
}
.page-devnotes .notes-list {
  font-size: 0.9rem;
  color: var(--dust);
  margin: 0.2rem 0;
  padding-left: 1.2rem;
}
/* The hidden door past the end of the page (js/friday-door.js): a button
   ejected from under the bottom edge of the window, over the page */
.friday-door {
  position: fixed;
  left: 50%;
  bottom: 1.1rem;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--titan);
  background: var(--hall);
  color: var(--titan);
  text-decoration: none;
  box-shadow: 0 0 0 1px #000, 0 5px 0 #000, 0 10px 24px rgba(0, 0, 0, 0.55);
  transform: translate(-50%, calc(100% + 1.6rem));
}
.friday-door.is-out {
  transform: translate(-50%, 0);
}
html[data-motion="full"] .friday-door {
  transition: transform 0.5s cubic-bezier(0.18, 1.55, 0.4, 1);
}
.friday-door-title {
  font-family: var(--font-crt);
  font-size: 1.45rem;
  line-height: 1.1;
  letter-spacing: 0.06em;
}
.friday-door-sub {
  color: var(--dust);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}
.friday-door:hover,
.friday-door:focus-visible {
  background: var(--titan);
  color: var(--hall);
  outline: none;
}
.friday-door:hover .friday-door-sub,
.friday-door:focus-visible .friday-door-sub {
  color: var(--hall);
}
.friday-door[hidden] {
  display: none;
}

/* drawings.html */
.page-drawings main {
  max-width: 74ch;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}
.page-drawings h1, .page-drawings h2 {
  font-family: var(--font-crt);
  font-weight: 400;
  line-height: 1.1;
}
.page-drawings h1 {
  font-size: 3rem;
  margin: 1rem 0;
}
.page-drawings h2 {
  font-size: 1.8rem;
  border-bottom: 1px solid var(--rib);
  padding-bottom: 0.3rem;
}
.page-drawings p {
  color: var(--haze);
}
@media (max-width: 520px) {
  .page-drawings main {
    padding: 1.5rem 1rem 3rem;
  }
  .page-drawings h1 {
    font-size: 2.4rem;
  }
}

/* glossary.html */
.page-glossary main {
  max-width: 74ch;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}
.page-glossary h1, .page-glossary h2 {
  font-family: var(--font-crt);
  font-weight: 400;
  line-height: 1.1;
}
.page-glossary h1 {
  font-size: 3rem;
  margin: 1rem 0;
}
.page-glossary h2 {
  font-size: 1.8rem;
  border-bottom: 1px solid var(--rib);
  padding-bottom: 0.3rem;
}
.page-glossary .terms dt {
  margin: 0.15rem 0;
  padding-top: 0.85rem;
  color: var(--titan);
  font-family: var(--font-crt);
  font-size: 1.2rem;
}
.page-glossary .terms dd {
  margin: 0.15rem 0;
}
.page-glossary .note {
  border-left: 2px solid var(--titan);
  background: #1a1f22;
  padding: 0.6rem 0.9rem;
}
@media (max-width: 520px) {
  .page-glossary main {
    padding: 1.5rem 1rem 3rem;
  }
  .page-glossary h1 {
    font-size: 2.4rem;
  }
}

/* themes.html */
.page-themes main {
  max-width: 74ch;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}
.page-themes h1, .page-themes h2 {
  font-family: var(--font-crt);
  font-weight: 400;
  line-height: 1.1;
}
.page-themes h1 {
  font-size: 3rem;
  margin: 1rem 0;
}
.page-themes h2 {
  font-size: 1.8rem;
  border-bottom: 1px solid var(--rib);
  padding-bottom: 0.3rem;
}
.page-themes p, .page-themes li {
  color: var(--haze);
}
.page-themes .note {
  border-left: 2px solid var(--titan);
  background: #1a1f22;
  padding: 0.6rem 0.9rem;
}
@media (max-width: 520px) {
  .page-themes main {
    padding: 1.5rem 1rem 3rem;
  }
  .page-themes h1 {
    font-size: 2.4rem;
  }
}

/* warranty.html */
.page-warranty main {
  max-width: 74ch;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}
.page-warranty h1, .page-warranty h2 {
  font-family: var(--font-crt);
  font-weight: 400;
  line-height: 1.1;
}
.page-warranty h1 {
  font-size: 3rem;
  margin: 1rem 0;
}
.page-warranty h2 {
  font-size: 1.8rem;
  border-bottom: 1px solid var(--rib);
  padding-bottom: 0.3rem;
}
@media (max-width: 520px) {
  .page-warranty main {
    padding: 1.5rem 1rem 3rem;
  }
  .page-warranty h1 {
    font-size: 2.4rem;
  }
}

/* Language picker aligned with each notes page heading */
.notes-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.notes-head-row > h1 {
  min-width: 0;
  margin: 0 !important;
}
.lang-box {
  margin: 0 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}
.lang-bar {
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.6rem;
  color: var(--dust);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
/* The picker keeps its colors while it is pointed at, focused or open,
   so the list it opens stays dark with light text; the border and a tint
   mark the pointer and the focus */
.lang-bar select {
  font: inherit;
  color: var(--haze);
  background-color: var(--hall);
  border: 1px solid var(--rib);
  padding: 0.1rem 0.3rem;
  cursor: var(--cur-hand);
}
html[data-motion="full"] .lang-bar select {
  transition: border-color 100ms ease, box-shadow 100ms ease;
}
.lang-bar select:hover,
.lang-bar select:focus-visible {
  border-color: var(--titan);
  box-shadow: inset 0 0 0 999px rgba(199, 132, 58, 0.14);
  outline: none;
}
.lang-bar select option {
  color: var(--haze);
  background-color: var(--hall);
}
.lang-bar select option:checked {
  color: var(--hall);
  background-color: var(--haze);
}
/* The back button's row with the language box at its right, centered
   vertically; the Language label is kept for screen readers only */
.note-nav.with-lang {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.note-nav.drawing-back.with-lang {
  margin-top: 0;
}
.note-nav.with-lang .lang-box {
  margin-left: auto;
}
.lang-bar label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.lang-note {
  margin: 0;
  color: var(--dust);
  font-size: 0.8rem;
  text-align: right;
}
@media (max-width: 520px) {
  .notes-head-row {
    align-items: flex-start;
    gap: 0.5rem;
  }
  .notes-head-row > h1 {
    font-size: 2.1rem;
  }
  .lang-bar {
    justify-content: flex-end;
    font-size: 0.8rem;
  }
}

/* Ending scenes on the drawings page */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.6rem;
}
.scene-grid .scene {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--rib);
}
/* The scene's buttons lie on its picture, at the lower left corner, as
   scene-gallery.js places them */
.scene-item {
  position: relative;
}
.scene-item .scene {
  display: block;
}
.scene-controls {
  position: absolute;
  left: 0.4rem;
  bottom: 0.4rem;
  display: flex;
  gap: 0.3rem;
}
.scene-button {
  padding: 0.1em 0.5em;
  border: 1px solid var(--titan);
  background: rgba(21, 23, 25, 0.8);
  color: var(--titan);
  font-family: inherit;
  font-size: 0.75rem;
  line-height: 1.3;
  letter-spacing: 0.06em;
  cursor: var(--cur-hand);
}
.scene-button:hover,
.scene-button:focus-visible {
  background: var(--titan);
  color: var(--hall);
  outline: none;
}
/* ZOOM: the scene as large as the window allows, pixels kept square */
.scene-zoom {
  width: min(96vw, 160vh);
  max-width: none;
  padding: 0;
  border: 1px solid var(--rib);
  background: #000;
}
.scene-zoom::backdrop {
  background: rgba(0, 0, 0, 0.85);
}
.scene-zoom .scene {
  width: 100%;
  aspect-ratio: 16 / 9;
  image-rendering: pixelated;
}
.scene-zoom .scene-button {
  font-size: 0.9rem;
}

/* trailers.html: the two trailers in a player of the page's own (notes/
   trailer-player.js), in the colors of the game */
.page-trailers main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 3rem 1.25rem 5rem;
}
.page-trailers h1, .page-trailers h2 {
  font-family: var(--font-crt);
  font-weight: 400;
  line-height: 1.1;
}
.page-trailers h1 {
  font-size: 3rem;
  margin: 1rem 0;
}
.page-trailers h2 {
  font-size: 1.9rem;
  border-bottom: 1px solid var(--rib);
  padding-bottom: 0.3rem;
}
.page-trailers .dim {
  color: var(--dust);
}
.trailer-tabs {
  margin: 0;
}
.trailer-tabs .note-button[aria-current] {
  background: var(--titan);
  border-color: var(--titan);
  color: var(--hall);
}
.trailer-player {
  margin: 1rem 0;
  outline: none;
}
.trailer-player:focus-visible .trailer-screen {
  border-color: var(--titan);
}
.trailer-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--rib);
}
.trailer-video {
  display: block;
  width: 100%;
  height: 100%;
}
.trailer-big {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 0.5em 1.4em;
  border: 1px solid var(--titan);
  background: rgba(21, 23, 25, 0.85);
  color: var(--titan);
  font: inherit;
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  cursor: var(--cur-hand);
}
.trailer-big:hover,
.trailer-big:focus-visible {
  background: var(--titan);
  color: var(--hall);
  outline: none;
}
.trailer-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
  margin: 0.5rem 0;
}
.trailer-controls .note-button {
  box-sizing: border-box;
  height: 1.7rem;
  background: none;
  text-decoration: none;
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.3;
  cursor: var(--cur-hand);
}
/* The hover and the keyboard focus of the player's controls, as on every
   notes button */
.trailer-controls .note-button:hover,
.trailer-controls .note-button:focus-visible {
  background: var(--haze);
  color: var(--hall);
  outline: none;
}
.trailer-seek:focus-visible,
.trailer-volume:focus-visible {
  outline: 1px solid var(--titan);
  outline-offset: 2px;
}
.trailer-time {
  color: var(--dust);
  font-size: 0.85em;
  font-variant-numeric: tabular-nums;
  min-width: 7.5em;
}
.trailer-seek {
  flex: 1 1 12rem;
  accent-color: var(--titan);
}
.trailer-volume {
  width: 6rem;
  accent-color: var(--titan);
}
/* Full screen: the picture fills the whole screen and the bar lies over
   its foot; while the trailer plays untouched (trailer-player.js) the bar
   slides off the bottom and the pointer hides */
.trailer-player:fullscreen {
  margin: 0;
  background: #000;
}
.trailer-player:fullscreen .trailer-screen {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border: 0;
}
.trailer-player:fullscreen .trailer-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0.6rem 1rem;
  background: rgba(21, 23, 25, 0.85);
  transition: opacity 0.3s, transform 0.3s;
}
.trailer-player:fullscreen.idle .trailer-controls {
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
}
.trailer-player:fullscreen.idle,
.trailer-player:fullscreen.idle * {
  cursor: none;
}
