/* ==========================================================================
   Mu Next Wiki — visual system
   Inherits the live landing page world: pale sky ground, navy brand,
   Constantine display / Jost body, ornamental rules.
   ========================================================================== */

@font-face {
  font-family: 'Constantine';
  src: url('../fonts/Constantine/Constantine.woff2') format('woff2'), url('../fonts/Constantine/Constantine.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Jost';
  src: url('../fonts/Jost/Jost-Regular.woff2') format('woff2'), url('../fonts/Jost/Jost-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Jost';
  src: url('../fonts/Jost/Jost-Variable.woff2') format('woff2'), url('../fonts/Jost/Jost-Variable.ttf') format('truetype');
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --blue: #213971;
  --blue-deep: #16264c;
  --blue-soft: #4a6096;
  --heading: #394150;
  --text: #1f2123;
  --muted: #5b6474;

  --sky: #dfeaf4;
  --sky-deep: #c8daf0;
  --plate: #ffffff;
  --plate-warm: #f7fafd;

  --gold: #f5b84b;
  --gold-deep: #c98a1e;
  --ink-gold: #6b4a10;

  --line: rgba(33, 57, 113, 0.16);
  --line-soft: rgba(33, 57, 113, 0.09);

  --ok: #1d6c43;
  --warn: #9a6b00;
  --warn-ink: #7a5200;

  --shadow-sm: 0 2px 6px rgba(22, 38, 76, 0.06), 0 8px 20px rgba(22, 38, 76, 0.06);
  --shadow-md: 0 4px 12px rgba(22, 38, 76, 0.08), 0 18px 44px rgba(22, 38, 76, 0.10);
  --shadow-lg: 0 8px 24px rgba(22, 38, 76, 0.10), 0 32px 70px rgba(22, 38, 76, 0.14);
  --plate-glass: rgba(255, 255, 255, 0.94);
  --plate-edge: rgba(255, 255, 255, 0.95);
  --shadow-plate: 0 1px 0 #fff inset, 0 2px 6px rgba(22, 38, 76, 0.05), 0 24px 60px rgba(22, 38, 76, 0.12);

  --rail: 268px;
  --gutter: 48px;
  --radius: 16px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  /* Tracking scale: three steps, not eight scattered values. */
  --track-display: 0.06em;
  --track-ui: 0.1em;
  --track-micro: 0.16em;
}

/* The site's world. It is the wiki's default, set on <html> before the first
   paint; the reader can hold the daylight one instead, and that choice is
   remembered in their own browser. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --blue: #b3c4ea;
  --blue-deep: #e8eefb;
  --blue-soft: #8fa3cf;
  --heading: #dfe6f3;
  --text: #d5ddea;
  --muted: #8d99b1;

  --sky: #0c1424;
  --sky-deep: #0a1120;
  --plate: #141e33;
  --plate-warm: #18233b;

  --ink-gold: #f1c46a;

  --line: rgba(179, 196, 234, 0.16);
  --line-soft: rgba(179, 196, 234, 0.09);

  --ok: #62d49a;
  --warn: #e3b457;
  --warn-ink: #eec46e;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3), 0 8px 20px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35), 0 18px 44px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4), 0 32px 70px rgba(0, 0, 0, 0.45);
  --plate-glass: rgba(20, 30, 51, 0.9);
  --plate-edge: rgba(179, 196, 234, 0.1);
  --shadow-plate: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 2px 6px rgba(0, 0, 0, 0.25), 0 24px 60px rgba(0, 0, 0, 0.4);
  --veil: rgba(6, 12, 28, 0.42);
}



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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  font-family: 'Jost', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.62;
  color: var(--text);
  background: var(--sky);
  background-image: radial-gradient(ellipse 120% 60% at 50% 0%, var(--sky-deep), var(--sky) 62%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* --- Browser surfaces: these ship with the design, not the browser -------- */
::selection {
  background: rgba(33, 57, 113, 0.16);
  color: var(--blue-deep);
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 3px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(33, 57, 113, 0.3) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(33, 57, 113, 0.05);
}

*::-webkit-scrollbar-thumb {
  background: rgba(33, 57, 113, 0.28);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(33, 57, 113, 0.45);
  background-clip: content-box;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(33, 57, 113, 0.35);
  transition: color 0.18s var(--ease), text-decoration-color 0.18s var(--ease);
}

a:hover {
  color: var(--blue-deep);
  text-decoration-color: var(--blue);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 12px 20px;
  background: var(--blue);
  color: #fff;
  font-family: 'Constantine', 'Trajan Pro', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  letter-spacing: var(--track-ui);
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 0 0 8px 8px;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 0;
  color: #fff;
}

/* ==========================================================================
   Masthead
   ========================================================================== */

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(223, 234, 244, 0.92);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line-soft);
  transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

.masthead.is-stuck {
  box-shadow: 0 1px 0 var(--line), 0 10px 30px rgba(22, 38, 76, 0.09);
  border-bottom-color: var(--line);
}

.masthead__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 28px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand__emblem {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 5px rgba(22, 38, 76, 0.28));
}

.brand__name {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 3px;
}

.brand__title {
  font-family: 'Constantine', 'Trajan Pro', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  font-size: 19px;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--blue);
}

.brand__sub {
  font-size: 10.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--blue-soft);
}

.masthead__search {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 420px;
  margin-inline: auto;
  position: relative;
}

.masthead__search input {
  width: 100%;
  height: 40px;
  padding: 0 40px 0 40px;
  font-family: 'Jost', sans-serif;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--blue-deep);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.masthead__search input::placeholder {
  color: #6a7488;
}

.masthead__search input:hover {
  background: rgba(255, 255, 255, 0.92);
}

.masthead__search input:focus {
  background: #fff;
  border-color: var(--blue-soft);
}

/* The page's most important control keeps the page's focus ring. */
.masthead__search input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.masthead__search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--blue-soft);
  pointer-events: none;
}

.masthead__search kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  letter-spacing: var(--track-display);
  color: var(--muted);
  background: rgba(33, 57, 113, 0.07);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 2px 6px;
  pointer-events: none;
}

.masthead__links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mlink {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  font-size: 13.5px;
  letter-spacing: var(--track-ui);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--blue);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.mlink:hover {
  background: #fff;
  border-color: var(--blue-soft);
  color: var(--blue-deep);
}

.mlink svg {
  width: 15px;
  height: 15px;
}

.mlink--accent {
  color: var(--ink-gold);
  border-color: rgba(201, 138, 30, 0.42);
  background: rgba(245, 184, 75, 0.16);
}

.mlink--accent:hover {
  background: rgba(245, 184, 75, 0.3);
  border-color: var(--gold-deep);
  color: var(--ink-gold);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--blue);
  cursor: pointer;
}

.nav-toggle svg {
  width: 19px;
  height: 19px;
}

/* ==========================================================================
   Opening plate — the server's own record
   ========================================================================== */

.opening {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}

.opening__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url('../img/banner.webp?v=2') center 28% / cover no-repeat;
  opacity: 0.32;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.5) 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.5) 55%, transparent 100%);
}

.opening__inner {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 28px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  gap: 56px;
  align-items: center;
}

.opening__lede h1 {
  font-family: 'Constantine', 'Trajan Pro', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.06;
  letter-spacing: var(--track-display);
  text-transform: uppercase;
  color: var(--blue);
  text-wrap: balance;
  margin-bottom: 20px;
}

.opening__lede h1 em {
  display: block;
  font-style: normal;
  color: var(--heading);
  font-size: 0.52em;
  letter-spacing: var(--track-micro);
  margin-top: 12px;
}

.opening__lede p {
  font-size: 19px;
  line-height: 1.6;
  color: var(--text);
  max-width: 46ch;
}

.opening__rule {
  height: 13px;
  width: min(100%, 340px);
  margin: 26px 0;
  background: url('../img/join-decore.svg') left center / contain no-repeat;
  opacity: 0.75;
}

.opening__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

/* --- The record plate ---------------------------------------------------- */

.plate {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(247, 250, 253, 0.97));
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.plate__head {
  padding: 16px 24px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(33, 57, 113, 0.055), transparent);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.plate__head h2 {
  font-family: 'Constantine', 'Trajan Pro', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  font-size: 15px;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--blue);
}

.plate__head span {
  font-size: 11.5px;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--muted);
}

.plate__rows {
  padding: 6px 0;
}

.prow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: baseline;
  padding: 11px 24px;
  position: relative;
}

.prow + .prow::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: var(--line-soft);
}

.prow__key {
  font-size: 13px;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--muted);
}

.prow__val {
  font-family: 'Constantine', 'Trajan Pro', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  font-size: 19px;
  letter-spacing: var(--track-display);
  color: var(--blue-deep);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.prow__val small {
  display: block;
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  letter-spacing: var(--track-display);
  color: var(--muted);
  margin-top: 2px;
}

.prow--hero {
  padding-top: 18px;
  padding-bottom: 18px;
}

.prow--hero .prow__val {
  font-size: clamp(40px, 4vw, 52px);
  line-height: 1;
  color: var(--blue);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 16px 34px;
  font-family: 'Constantine', 'Trajan Pro', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  font-size: 17px;
  letter-spacing: var(--track-ui);
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease);
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  transition: opacity 0.22s var(--ease);
}

.btn span {
  position: relative;
  z-index: 2;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  transition: transform 0.22s var(--ease);
}

.btn--gold {
  color: #fff;
}

.btn--gold::before {
  background-image: url('../img/button-bg.svg');
}

.btn--gold:hover::before {
  opacity: 0.74;
}

.btn--ghost {
  color: var(--blue);
}

.btn--ghost::before {
  background-image: url('../img/transparent-button-decore.svg');
  opacity: 0.85;
}

.btn--ghost:hover::before {
  opacity: 1;
}

.btn:hover svg {
  transform: translateX(3px);
}

.btn:active {
  transform: translateY(1px);
}

/* ==========================================================================
   Layout: rail + article
   ========================================================================== */

.shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: var(--gutter);
  align-items: start;
}

/* --- Navigation rail ----------------------------------------------------- */

.rail {
  position: sticky;
  top: 68px;
  max-height: calc(100vh - 68px);
  overflow-y: auto;
  padding: 32px 0 60px;
  scrollbar-gutter: stable;
}

.rail__group + .rail__group {
  margin-top: 26px;
}

.rail__label {
  font-family: 'Constantine', 'Trajan Pro', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  font-size: 12px;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--blue-soft);
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 8px;
}

.rail a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--heading);
  text-decoration: none;
  border-radius: 7px;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}

.rail a:hover {
  background: rgba(33, 57, 113, 0.07);
  color: var(--blue-deep);
}

.rail a.is-current {
  background: rgba(33, 57, 113, 0.1);
  color: var(--blue);
  font-weight: 500;
}

/* The road's stops hang off its entry rather than forming their own group. */
.rail__sub {
  padding-left: 34px !important;
  font-size: 14px !important;
  color: var(--muted) !important;
}

.rail__sub:hover {
  color: var(--blue-deep) !important;
}

.rail a .dotm {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(33, 57, 113, 0.3);
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease);
}

.rail a.is-current .dotm {
  background: var(--blue);
  border-color: var(--blue);
}

/* --- Article ------------------------------------------------------------- */

.article {
  padding: 40px 0 100px;
  min-width: 0;
}

.section {
  scroll-margin-top: 92px;
  padding-block: 30px 46px;
}

.section + .section {
  border-top: 1px solid var(--line-soft);
}

.section__head {
  margin-bottom: 26px;
}

.section__head h2 {
  font-family: 'Constantine', 'Trajan Pro', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.16;
  letter-spacing: var(--track-ui);
  text-transform: uppercase;
  color: var(--blue);
  text-wrap: balance;
}

.section__head p {
  margin-top: 12px;
  font-size: 17.5px;
  color: var(--muted);
  max-width: 32em;
}

/* The ornament marks a change of territory, not every section. It appears only
   where the rail starts a new group, so it stays a signal instead of wallpaper. */
.section__ornament {
  display: none;
  height: 12px;
  width: 190px;
  margin-top: 14px;
  background: url('../img/join-decore.svg') left center / contain no-repeat;
  opacity: 0.6;
}

#road .section__ornament,
#rates .section__ornament,
#upgrading .section__ornament,
#currencies .section__ornament,
#events .section__ornament,
#maps .section__ornament {
  display: block;
}

/* A group opener also gets more air above it than a sibling section. */
#rates,
#upgrading,
#currencies,
#events,
#maps {
  padding-top: 54px;
}

.prose {
  max-width: 34em;
}

.prose p {
  margin-bottom: 16px;
}

.prose h3 {
  font-family: 'Constantine', 'Trajan Pro', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  font-size: 19px;
  letter-spacing: var(--track-ui);
  text-transform: uppercase;
  color: var(--heading);
  margin: 34px 0 12px;
}

.prose ul,
.prose ol {
  margin: 0 0 18px 0;
  padding-left: 0;
  list-style: none;
}

.prose li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 9px;
}

.prose ul > li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0.66em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--blue-soft);
}

.prose ol {
  counter-reset: n;
}

.prose ol > li {
  counter-increment: n;
}

.prose ol > li::before {
  content: counter(n);
  position: absolute;
  left: 0;
  top: 0.06em;
  width: 19px;
  text-align: center;
  font-family: 'Constantine', 'Trajan Pro', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  font-size: 13px;
  color: var(--blue);
}

/* Gold is reserved for two meanings only: this costs money, or this is still
   provisional. Emphasis therefore carries weight and ink, never a highlighter. */
.prose strong,
.stop__body strong,
.note strong {
  font-weight: 500;
  color: var(--blue-deep);
}

/* ==========================================================================
   The road — progression spine
   ========================================================================== */

.road {
  position: relative;
  margin-top: 8px;
  padding-left: 60px;
}

.road::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(180deg,
      rgba(33, 57, 113, 0.06),
      rgba(33, 57, 113, 0.26) 8%,
      rgba(33, 57, 113, 0.26) 92%,
      rgba(33, 57, 113, 0.06));
}

.stop {
  position: relative;
  padding-bottom: 40px;
}

.stop:last-child {
  padding-bottom: 4px;
}

.stop__mark {
  position: absolute;
  left: -60px;
  top: 2px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--plate);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-family: 'Constantine', 'Trajan Pro', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  font-size: 17px;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

.stop__mark--end {
  background: linear-gradient(180deg, #fff, rgba(245, 184, 75, 0.22)), var(--plate);
  border-color: rgba(201, 138, 30, 0.5);
  color: var(--ink-gold);
}

.stop__title {
  font-family: 'Constantine', 'Trajan Pro', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  font-size: 21px;
  letter-spacing: var(--track-ui);
  text-transform: uppercase;
  color: var(--heading);
  margin-bottom: 4px;
}

.stop__meta {
  font-size: 13px;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--blue-soft);
  margin-bottom: 12px;
}

.stop__body {
  max-width: 34em;
}

.stop__body p {
  margin-bottom: 12px;
}

/* ==========================================================================
   Data tables
   ========================================================================== */

/* A wide table scrolls inside its own frame. The edge shading appears only
   when there is more table to reach, so the reader knows to push sideways. */
.tablewrap {
  margin: 18px 0 24px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    linear-gradient(to right, var(--plate) 30%, rgba(255, 255, 255, 0)) left center,
    linear-gradient(to left, var(--plate) 30%, rgba(255, 255, 255, 0)) right center,
    linear-gradient(to right, rgba(33, 57, 113, 0.13), rgba(33, 57, 113, 0)) left center,
    linear-gradient(to left, rgba(33, 57, 113, 0.13), rgba(33, 57, 113, 0)) right center,
    var(--plate);
  background-repeat: no-repeat;
  background-size: 34px 100%, 34px 100%, 14px 100%, 14px 100%, 100% 100%;
  background-attachment: local, local, scroll, scroll, local;
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
}

caption {
  text-align: left;
  padding: 14px 18px 12px;
  font-family: 'Constantine', 'Trajan Pro', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  font-size: 13px;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--blue);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(33, 57, 113, 0.05), transparent);
}

th,
td {
  padding: 11px 18px;
  text-align: left;
  vertical-align: top;
}

thead th {
  font-family: 'Jost', sans-serif;
  font-weight: 400;
  font-size: 12.5px;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody tr + tr td {
  border-top: 1px solid var(--line-soft);
}

/* A row group's name spans its rows and reads as a label, not as data. */
tbody th[scope="rowgroup"] {
  font-weight: 400;
  color: var(--blue-deep);
  vertical-align: middle;
  white-space: nowrap;
  border-top: 1px solid var(--line);
  background: rgba(33, 57, 113, 0.028);
}

tbody tr:first-child th[scope="rowgroup"] {
  border-top: none;
}

tbody tr:hover td {
  background: rgba(33, 57, 113, 0.032);
}

td:first-child {
  color: var(--blue-deep);
}

/* Figures align by place value so magnitudes are comparable down the column. */
.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

td.fig,
th.fig {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Sentences in a table cell are still sentences: they wrap. */
td.say {
  white-space: normal;
  min-width: 15em;
}

/* ==========================================================================
   Figures
   ========================================================================== */

.shot {
  margin: 22px 0 26px;
}

.shot img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  background: var(--plate);
}

.shot figcaption {
  margin-top: 10px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 60ch;
}

/* ==========================================================================
   Notes, badges
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: 2px;
}

.badge--preview {
  color: var(--warn-ink);
  background: rgba(245, 184, 75, 0.2);
  border: 1px solid rgba(201, 138, 30, 0.4);
}

.note {
  position: relative;
  margin: 20px 0;
  padding: 16px 20px 16px 48px;
  background: var(--plate-warm);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 16px;
  color: var(--text);
}

.note svg {
  position: absolute;
  left: 18px;
  top: 17px;
  width: 18px;
  height: 18px;
  color: var(--blue-soft);
}

.note--preview {
  background: rgba(245, 184, 75, 0.08);
  border-color: rgba(201, 138, 30, 0.32);
}

.note--preview svg {
  color: var(--gold-deep);
}

.note strong {
  color: var(--blue-deep);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.4);
}

.footer__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 28px 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer__brand img {
  width: 34px;
  height: 34px;
}

.footer__brand div {
  font-family: 'Constantine', 'Trajan Pro', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  font-size: 15px;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--blue);
}

.footer__brand p {
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: none;
  color: var(--muted);
  margin-top: 2px;
}

.footer__meta {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.footer__meta .badge {
  vertical-align: 1px;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-size: 15px;
}

/* ==========================================================================
   Search results overlay
   ========================================================================== */

.results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 62vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
}

.results.is-open {
  display: block;
}

.results a {
  display: block;
  padding: 9px 12px;
  border-radius: 7px;
  text-decoration: none;
  color: var(--heading);
}

.results a:hover,
.results a.is-active {
  background: rgba(33, 57, 113, 0.08);
  color: var(--blue-deep);
}

.results__t {
  font-size: 15px;
  display: block;
}

.results__s {
  font-size: 12px;
  letter-spacing: var(--track-ui);
  text-transform: uppercase;
  color: var(--blue-soft);
  display: block;
  margin-top: 1px;
}

.results__empty {
  padding: 16px 14px;
  font-size: 15px;
  color: var(--muted);
}

/* ==========================================================================
   Motion — one authored moment: the record plate writes itself out on arrival.
   Sections themselves do not animate; 25 identical entrances is not a moment.
   ========================================================================== */

/* Content is visible by default. The motion only arms itself once JS has run,
   so a failed script leaves a readable page rather than a blank one. */
@media (prefers-reduced-motion: no-preference) {
  .js-reveal .plate .prow {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  }

  .js-reveal .plate.is-in .prow {
    opacity: 1;
    transform: none;
  }

  .js-reveal .plate.is-in .prow:nth-child(1)  { transition-delay: 0.05s }
  .js-reveal .plate.is-in .prow:nth-child(2)  { transition-delay: 0.11s }
  .js-reveal .plate.is-in .prow:nth-child(3)  { transition-delay: 0.17s }
  .js-reveal .plate.is-in .prow:nth-child(4)  { transition-delay: 0.23s }
  .js-reveal .plate.is-in .prow:nth-child(5)  { transition-delay: 0.29s }
  .js-reveal .plate.is-in .prow:nth-child(6)  { transition-delay: 0.35s }
  .js-reveal .plate.is-in .prow:nth-child(7)  { transition-delay: 0.41s }
  .js-reveal .plate.is-in .prow:nth-child(8)  { transition-delay: 0.47s }
}

/* ==========================================================================
   Landing marks — a jumped-to anchor has to look like an arrival
   ========================================================================== */

.section:target .section__head h2,
h3:target,
.stop:target .stop__title {
  animation: land 1.4s var(--ease);
}

.tablewrap:target {
  animation: land-plate 1.4s var(--ease);
}

@keyframes land {
  0%,
  55% {
    box-shadow: -14px 0 0 -11px var(--blue);
  }

  100% {
    box-shadow: -14px 0 0 -11px rgba(33, 57, 113, 0);
  }
}

@keyframes land-plate {
  0%,
  45% {
    border-color: var(--blue-soft);
    box-shadow: 0 0 0 3px rgba(33, 57, 113, 0.14), var(--shadow-md);
  }

  100% {
    border-color: var(--line);
    box-shadow: 0 0 0 3px rgba(33, 57, 113, 0), var(--shadow-sm);
  }
}

@media (prefers-reduced-motion: reduce) {

  .section:target .section__head h2,
  h3:target,
  .stop:target .stop__title,
  .tablewrap:target {
    animation: none;
  }
}

/* Hover-revealed link to any heading or table, so a reader can send a friend
   the grand-reset jewel table rather than the whole page. */
.anchor {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--blue-soft);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.16s var(--ease), color 0.16s var(--ease);
}

h3:hover > .anchor,
caption:hover > .anchor,
.anchor:focus-visible {
  opacity: 1;
}

.anchor:hover {
  color: var(--blue);
}

/* Chat commands are typed literally; give them their own ink. */
.cmd {
  font-family: 'Jost', sans-serif;
  font-size: 0.95em;
  letter-spacing: 0.02em;
  color: var(--blue-deep);
  background: rgba(33, 57, 113, 0.07);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 1px 7px;
  white-space: nowrap;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1180px) {
  :root {
    --rail: 232px;
    --gutter: 34px;
  }

  .opening__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
    gap: 36px;
  }

  .opening__lede p {
    font-size: 18px;
  }
}

/* Below this the plate can no longer sit beside the lede without crushing
   both, so it moves under it — and the lede tightens to keep it near the fold. */
@media (max-width: 1024px) {
  .opening__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .opening__lede {
    max-width: 640px;
  }

  .opening__rule {
    margin: 18px 0;
  }

  .opening__actions {
    margin-top: 22px;
  }
}

/* The main page carries six doors in the masthead. On a narrow laptop the
   three database doors drop their labels before the search box is squeezed
   out; below 900px the masthead wraps to two rows anyway. */
@media (min-width: 901px) and (max-width: 1279px) {
  .masthead__links--full .mlink {
    padding: 0 12px;
  }

  .masthead__links--full .mlink[href="/maps/"] .mlink__label,
  .masthead__links--full .mlink[href="/items/"] .mlink__label,
  .masthead__links--full .mlink[href="/monsters/"] .mlink__label {
    display: none;
  }
}

@media (max-width: 900px) {
  .masthead__search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
    margin: 0;
  }

  .masthead__inner {
    height: auto;
    padding-block: 12px;
    flex-wrap: wrap;
  }

  html {
    scroll-padding-top: 140px;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .masthead__links .mlink--main {
    display: none;
  }

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

  .rail {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(320px, 86vw);
    max-height: none;
    padding: 24px 16px 40px;
    background: #fff;
    border-right: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    transform: translateX(-102%);
    transition: transform 0.3s var(--ease);
    overflow-y: auto;
  }

  .rail.is-open {
    transform: none;
  }

  .rail__close {
    display: flex;
  }

  .scrim {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(22, 38, 76, 0.4);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s var(--ease);
  }

  .scrim.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .article {
    padding-top: 24px;
  }
}

.rail__close {
  display: none;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 16px;
  padding: 9px 12px;
  background: rgba(33, 57, 113, 0.06);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--blue);
  cursor: pointer;
}

.rail__close svg {
  width: 15px;
  height: 15px;
}

/* The offsite group only earns its place once the masthead link is hidden. */
.rail__group--offsite {
  display: none;
}

@media (max-width: 900px) {
  .rail__group--offsite {
    display: block;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 16.5px;
  }

  /* Keep the masthead to two rows: the Discord label is the first thing to go. */
  .mlink__label {
    display: none;
  }

  .mlink--accent {
    padding-inline: 12px;
  }

  .brand__title {
    font-size: 17px;
  }

  .masthead__inner,
  .shell,
  .footer__inner {
    padding-inline: 18px;
  }

  .opening__inner {
    padding: 36px 18px 40px;
  }

  .road {
    padding-left: 44px;
  }

  .road::before {
    left: 15px;
  }

  .stop__mark {
    left: -44px;
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .prow {
    padding-inline: 18px;
  }

  .prow + .prow::before {
    left: 18px;
    right: 18px;
  }

  .btn {
    width: 100%;
  }

  th,
  td {
    padding: 10px 14px;
  }
}

/* ==========================================================================
   Class matchups — the seven-by-seven standing grid (#matchups)
   Gold means your class wins the pair, navy means it loses; shape carries
   the same meaning as colour so the grid survives greyscale and colour blindness.
   ========================================================================== */

.mu-legend {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mu-legend li {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--plate);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px 13px;
  font-size: 14px;
  color: var(--muted);
  box-shadow: var(--shadow-sm);
}

.mu-pip,
.mu-cell {
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -1px;
  border-radius: 3px;
}

.mu-pip {
  width: 30px;
  height: 24px;
  flex: none;
}

.mu-win { background: var(--gold-deep); color: #fff; }
.mu-loss { background: #35508c; color: #fff; }

table.mu-grid {
  border-collapse: separate;
  border-spacing: 4px;
  margin: 0 auto;
}

table.mu-grid th[scope="col"] {
  width: 58px;
  text-align: center;
  padding: 6px 4px;
}

table.mu-grid th[scope="row"] {
  text-align: right;
  padding: 6px 12px 6px 4px;
  white-space: nowrap;
}

table.mu-grid td {
  padding: 0;
  text-align: center;
}

.mu-cell {
  width: 58px;
  height: 38px;
}

.mu-self {
  color: var(--line);
  font-weight: 400;
  letter-spacing: 0;
}

.mu-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.mu-card {
  background: var(--plate);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px 18px 18px;
  box-shadow: var(--shadow-sm);
}

.mu-card h3 {
  font-family: 'Constantine', Georgia, serif;
  font-size: 19px;
  letter-spacing: var(--track-display);
  color: var(--heading);
  margin: 0 0 6px;
}

.mu-card p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
}

.mu-row {
  margin-top: 12px;
}

.mu-row b {
  display: block;
  font-size: 11px;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.mu-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mu-chip {
  font-size: 13px;
  padding: 4px 9px;
  border-radius: 3px;
}

.mu-chip--win { background: #fdeec9; color: var(--ink-gold); }
.mu-chip--loss { background: #dce5f4; color: var(--blue-deep); }

@media (max-width: 560px) {
  table.mu-grid th[scope="col"],
  .mu-cell {
    width: 44px;
  }

  .mu-cell {
    height: 34px;
  }
}

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


/* ==========================================================================
   What each palette paints. The tokens above carry most of it; below are the
   surfaces that named a colour outright, and they are scoped to the palette
   they belong to.
   ========================================================================== */

/* --- The site's world ---------------------------------------------------- */
:root[data-theme="dark"] body {
  background-image: radial-gradient(ellipse 120% 60% at 50% 0%, #16213a, var(--sky) 62%);
}

:root[data-theme="dark"] ::selection { background: rgba(179, 196, 234, 0.22); color: var(--blue-deep); }

:root[data-theme="dark"] .masthead { background: rgba(15, 24, 41, 0.86); border-bottom-color: var(--line-soft); }
:root[data-theme="dark"] .masthead.is-stuck { box-shadow: 0 1px 0 var(--line), 0 10px 30px rgba(0, 0, 0, 0.5); }
:root[data-theme="dark"] .brand__emblem { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55)); }

:root[data-theme="dark"] .masthead__search input { color: var(--blue-deep); background: rgba(179, 196, 234, 0.06); }
:root[data-theme="dark"] .masthead__search input::placeholder { color: #6f7b93; }
:root[data-theme="dark"] .masthead__search input:hover { background: rgba(179, 196, 234, 0.1); }
:root[data-theme="dark"] .masthead__search input:focus { background: #0f1829; border-color: var(--blue-soft); }
:root[data-theme="dark"] .masthead__search kbd { background: rgba(179, 196, 234, 0.08); border-color: var(--line-soft); }

:root[data-theme="dark"] .mlink, :root[data-theme="dark"] .theme-toggle { background: rgba(179, 196, 234, 0.05); }
:root[data-theme="dark"] .mlink:hover, :root[data-theme="dark"] .theme-toggle:hover { background: rgba(179, 196, 234, 0.12); border-color: var(--blue-soft); color: var(--blue-deep); }
:root[data-theme="dark"] .mlink--accent { color: #f1c46a; background: rgba(245, 184, 75, 0.12); border-color: rgba(245, 184, 75, 0.4); }
:root[data-theme="dark"] .mlink--accent:hover { color: #ffd98a; background: rgba(245, 184, 75, 0.2); border-color: rgba(245, 184, 75, 0.62); }
:root[data-theme="dark"] .nav-toggle { background: rgba(179, 196, 234, 0.06); }

:root[data-theme="dark"] .results { background: #141e33; border-color: var(--line); box-shadow: var(--shadow-md); }
:root[data-theme="dark"] .results a:hover, :root[data-theme="dark"] .results a.is-active { background: rgba(179, 196, 234, 0.12); color: var(--blue-deep); }

/* The banner was drawn for a pale page; at night it is a sky, under the same
   veil the site puts beneath its own pictures. */
:root[data-theme="dark"] .opening__bg { opacity: 0.5; }
:root[data-theme="dark"] .opening::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 12, 28, 0.35) 0%, rgba(12, 20, 36, 0.72) 70%, var(--sky) 100%);
}
:root[data-theme="dark"] .opening__rule { opacity: 0.5; filter: brightness(1.6); }

:root[data-theme="dark"] .plate__head { background: linear-gradient(180deg, rgba(179, 196, 234, 0.07), transparent); }
:root[data-theme="dark"] caption { background: linear-gradient(180deg, rgba(179, 196, 234, 0.07), transparent); }
:root[data-theme="dark"] tbody th[scope="rowgroup"] { background: rgba(179, 196, 234, 0.045); }
:root[data-theme="dark"] tbody tr:hover td { background: rgba(179, 196, 234, 0.055); }

:root[data-theme="dark"] .rail a:hover { background: rgba(179, 196, 234, 0.08); color: var(--blue-deep); }
:root[data-theme="dark"] .rail a.is-current { background: rgba(179, 196, 234, 0.14); color: var(--blue-deep); }
:root[data-theme="dark"] .rail a .dotm { border-color: rgba(179, 196, 234, 0.32); }

:root[data-theme="dark"] .cmd { color: var(--blue-deep); background: rgba(179, 196, 234, 0.12); }
:root[data-theme="dark"] .road::before {
  background: linear-gradient(180deg,
      rgba(179, 196, 234, 0.02),
      rgba(179, 196, 234, 0.18) 8%,
      rgba(179, 196, 234, 0.18) 92%,
      rgba(179, 196, 234, 0.02));
}
:root[data-theme="dark"] .stop__mark--end {
  background: linear-gradient(180deg, rgba(245, 184, 75, 0.34), rgba(245, 184, 75, 0.1)), var(--plate-warm);
  border-color: rgba(245, 184, 75, 0.5);
}
:root[data-theme="dark"] .mu-win { background: rgba(245, 184, 75, 0.9); color: #2a1c04; }
:root[data-theme="dark"] .mu-loss { background: #35508c; color: #eef2fb; }
:root[data-theme="dark"] .mu-chip--win { background: rgba(245, 184, 75, 0.18); color: #ffd98a; }
:root[data-theme="dark"] .mu-chip--loss { background: rgba(179, 196, 234, 0.14); color: var(--blue-deep); }
:root[data-theme="dark"] .skip-link, :root[data-theme="dark"] .skip-link:focus { color: #0c1424; }

:root[data-theme="dark"] .footer { background: #0f1829; border-top-color: var(--line); }

/* ==========================================================================
   Shared: the site's plate language, its button family, and the road.
   ========================================================================== */

.plate {
  background: var(--plate-glass);
  border-color: var(--plate-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow-plate);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tablewrap { border-radius: var(--radius); border-color: var(--plate-edge); box-shadow: var(--shadow-sm); }
.note { border-radius: var(--radius-sm); border-color: var(--plate-edge); }
.results { border-radius: var(--radius-sm); }
.nav-toggle { border-radius: var(--radius-sm); }
.mu-chip { border-radius: 999px; }
.badge { border-color: var(--line); }

/* --- The theme switch ---------------------------------------------------- */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  padding: 0;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.16s var(--ease);
}

.theme-toggle:hover { background: #fff; border-color: var(--blue-soft); color: var(--blue-deep); transform: translateY(-1px); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .tt-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .tt-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .tt-moon { display: none; }

/* --- Buttons: the site's family, drawn in code, not from an image file ---- */
.btn {
  min-height: 48px;
  padding: 13px 28px;
  font-family: 'Jost', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: var(--track-ui);
  border: 1px solid transparent;
  border-radius: 999px;
  overflow: hidden;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.25s var(--ease), color 0.2s var(--ease), transform 0.16s var(--ease);
}

.btn::before { display: none; }

.btn--gold {
  color: #3a2708;
  background: linear-gradient(180deg, #ffd777, #f3b23f);
  border-color: rgba(120, 78, 10, 0.25);
  box-shadow: 0 10px 26px rgba(201, 138, 30, 0.28);
}

.btn--gold:hover {
  color: #2a1c04;
  background: linear-gradient(180deg, #ffe69e, #f7bd4f);
  border-color: #ffe08d;
  box-shadow: 0 0 0 3px rgba(255, 208, 102, 0.3), 0 12px 30px rgba(245, 170, 50, 0.38);
}

/* The shine the site's own primary button carries: one pass, on hover. */
.btn--gold::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  transform: skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  opacity: 0;
  pointer-events: none;
}

.btn--gold:hover::after { animation: btnShine 0.75s var(--ease-out); }

@keyframes btnShine {
  from { left: -60%; opacity: 0.9; }
  to { left: 115%; opacity: 0; }
}

.btn--ghost { color: var(--blue); background: rgba(179, 196, 234, 0.05); border-color: var(--line); }
.btn--ghost:hover { color: var(--blue-deep); background: rgba(179, 196, 234, 0.12); border-color: var(--blue-soft); }
.btn:active { transform: scale(0.97); }

/* ==========================================================================
   The road: a symbol per stop, its facts as marks, a line that fills behind
   the reader, and an end that says so.
   ========================================================================== */

.opening__actions { align-items: center; gap: 14px 18px; }

.opening__hint {
  font-size: 13px;
  letter-spacing: var(--track-ui);
  text-transform: uppercase;
  color: var(--muted);
}

/* The track and its fill stay under the marks: a line through a symbol is a
   line drawn on top of it. */
.road::before { z-index: 0; }

.road__fill {
  position: absolute;
  left: 21px;
  top: 12px;
  z-index: 0;
  width: 2px;
  height: 0;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(245, 184, 75, 0.15), rgba(245, 184, 75, 0.75));
  box-shadow: 0 0 12px rgba(245, 184, 75, 0.35);
  pointer-events: none;
}

/* A stop stands above the line it hangs off, whatever else is drawn. */
.stop, .road__finish { z-index: 1; }

.stop__mark {
  z-index: 2;
  width: 46px;
  height: 46px;
  left: -61px;
  background: var(--plate-warm);
  border-color: var(--line);
  color: var(--blue);
  /* The first shadow is a ring of the page's own ground: the road visibly
     stops at the circle instead of passing behind it. */
  box-shadow: 0 0 0 5px var(--sky), var(--shadow-sm);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.stop__mark svg { width: 21px; height: 21px; }

/* The number stays: the road is ordered, and a symbol alone does not say
   "fourth of six". It sits on the rim, out of the symbol's way. */
.stop__no {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--sky);
  border: 1px solid var(--line);
  font-family: 'Jost', system-ui, sans-serif;
  font-size: 11.5px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}

/* The stop the reader is standing on lights up, and only that one. */
.stop.is-live .stop__mark {
  color: var(--ink-gold);
  border-color: rgba(245, 184, 75, 0.55);
  /* The gold is a tint laid over the plate, not instead of it: a translucent
     mark would show the road line running behind it. */
  background: linear-gradient(180deg, rgba(245, 184, 75, 0.16), rgba(245, 184, 75, 0.05)), var(--plate-warm);
  box-shadow: 0 0 0 5px var(--sky), 0 0 0 8px rgba(245, 184, 75, 0.14), var(--shadow-sm);
}

.stop.is-live .stop__no { color: #2a1c04; background: #f5b84b; border-color: rgba(245, 184, 75, 0.7); }
.stop.is-live .stop__title { color: var(--blue-deep); }
.stop__title { transition: color 0.3s var(--ease); }
.stop__mark--end { color: var(--ink-gold); }

/* The facts under a title: three marks, not a sentence with dots. */
.stop__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  text-transform: none;
  letter-spacing: 0.02em;
}

.stop__meta span {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--plate-warm);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--blue);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.stop.is-live .stop__meta span { border-color: rgba(245, 184, 75, 0.3); color: var(--blue-deep); }

/* --- The end of the road ------------------------------------------------- */
.road__finish {
  position: relative;
  margin-top: 10px;
  padding: 18px 22px;
  border: 1px solid rgba(245, 184, 75, 0.34);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(245, 184, 75, 0.12), rgba(245, 184, 75, 0.02));
}

.road__finish b {
  display: block;
  font-family: 'Constantine', 'Trajan Pro', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  font-size: 19px;
  font-weight: 400;
  letter-spacing: var(--track-ui);
  text-transform: uppercase;
  color: var(--ink-gold);
  margin-bottom: 4px;
}

.road__finish p { font-size: 15.5px; line-height: 1.55; color: var(--text); margin: 0; }

.road__seal {
  position: absolute;
  left: -61px;
  top: 16px;
  z-index: 2;
  box-shadow: 0 0 0 5px var(--sky), 0 8px 22px rgba(201, 138, 30, 0.3);
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #2a1c04;
  background: linear-gradient(180deg, #ffd777, #f3b23f);
  border: 1px solid rgba(120, 78, 10, 0.3);
}

.road__seal svg { width: 23px; height: 23px; }

@media (prefers-reduced-motion: no-preference) {
  /* Nothing happens until the reader actually gets here — and it is held back
     only while the reveal machinery is known to be working (js-reveal drops
     off by itself if it is not), so the end of the road cannot go missing. */
  .js-reveal .road__finish { opacity: 0; transform: translateY(16px); transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out); }
  .js-reveal .road__finish.is-done { opacity: 1; transform: none; }

  .js-reveal .road__seal { transform: scale(0.6); opacity: 0; }
  .js-reveal .road__finish.is-done .road__seal { animation: sealPop 0.55s var(--ease-out) 0.12s forwards; }

  /* Two rings leave the seal once, the way a stamp settles. */
  .road__seal::before,
  .road__seal::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid rgba(245, 184, 75, 0.6);
    opacity: 0;
  }

  .js-reveal .road__finish.is-done .road__seal::before { animation: ringOut 1s var(--ease-out) 0.35s; }
  .js-reveal .road__finish.is-done .road__seal::after { animation: ringOut 1s var(--ease-out) 0.6s; }

  .js-reveal .road__tick { stroke-dasharray: 26; stroke-dashoffset: 26; }
  .js-reveal .road__finish.is-done .road__tick { animation: tickDraw 0.45s var(--ease-out) 0.45s forwards; }

  @keyframes sealPop {
    0% { transform: scale(0.6); opacity: 0; }
    65% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
  }

  @keyframes ringOut {
    from { transform: scale(1); opacity: 0.55; }
    to { transform: scale(2.1); opacity: 0; }
  }

  @keyframes tickDraw { to { stroke-dashoffset: 0; } }
}

@media (max-width: 640px) {
  .stop__mark, .road__seal { width: 40px; height: 40px; left: -52px; }
  .stop__mark svg { width: 18px; height: 18px; }
  .road__seal svg { width: 20px; height: 20px; }
  .road { padding-left: 52px; }
  .road::before, .road__fill { left: 19px; }
  .opening__hint { display: none; }
}

/* ==========================================================================
   Arrival — a section is drawn as the reader reaches it, once, and never
   again. Distance is small and the curve settles: reading must not wait on
   an animation, and a page of forty sections must not feel like a slideshow.
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  .js-reveal .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
  }

  .js-reveal .reveal.is-in { opacity: 1; transform: none; }

  .js-reveal .reveal[data-d="1"] { transition-delay: 0.06s; }
  .js-reveal .reveal[data-d="2"] { transition-delay: 0.12s; }
  .js-reveal .reveal[data-d="3"] { transition-delay: 0.18s; }

  /* The first screen does not wait to be scrolled to. */
  .opening__lede > * {
    opacity: 0;
    transform: translateY(16px);
    animation: openRise 0.7s var(--ease-out) forwards;
  }

  .opening__lede > *:nth-child(1) { animation-delay: 0.05s; }
  .opening__lede > *:nth-child(2) { animation-delay: 0.14s; }
  .opening__lede > *:nth-child(3) { animation-delay: 0.22s; }
  .opening__lede > *:nth-child(4) { animation-delay: 0.3s; }
  .opening__lede > *:nth-child(5) { animation-delay: 0.38s; }

  @keyframes openRise { to { opacity: 1; transform: none; } }

  .js-reveal .plate {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  }

  .js-reveal .plate.is-in { opacity: 1; transform: none; }

  .prow { transition: background 0.2s var(--ease); }
  .prow:hover { background: rgba(179, 196, 234, 0.05); }

  .mlink, .rail a { transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.16s var(--ease); }
  .mlink:hover { transform: translateY(-1px); }
  .rail a .dotm { transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease); }
  .rail a.is-current .dotm { transform: scale(1.25); }
}

/* Paper has no scroll: everything is on the page at once. */
@media print {
  .js-reveal .reveal,
  .js-reveal .plate,
  .road__finish,
  .road__seal,
  .opening__lede > * { opacity: 1 !important; transform: none !important; animation: none !important; }
}

/* --- The language pill, and the one-time offer ---------------------------- */
.wlang { position: relative; flex: none; }

.wlang__button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 10px;
  font: 600 13px/1 var(--sans);
  letter-spacing: 0.04em;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.16s var(--ease);
}
.wlang__button:hover { background: #fff; border-color: var(--blue-soft); color: var(--blue-deep); transform: translateY(-1px); }
.wlang__button svg { width: 16px; height: 16px; }
.wlang__arrow { width: 10px; height: 7px; transition: transform 0.2s var(--ease); }
.wlang.is-open .wlang__arrow { transform: rotate(180deg); }

.wlang__list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  min-width: 92px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  /* Nothing in the world appears out of nothing: the list grows from the
     button it belongs to rather than fading in from the middle of the page. */
  transform-origin: top right;
  transform: scale(0.96);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s var(--ease), transform 0.16s var(--ease), visibility 0.16s;
}
.wlang.is-open .wlang__list { opacity: 1; transform: scale(1); visibility: visible; }

.wlang__item {
  display: block;
  padding: 8px 12px;
  font: 600 13px/1.2 var(--sans);
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
  border-radius: 8px;
}
.wlang__item:hover { background: var(--sky); color: var(--blue-deep); }
.wlang__item.is-active { color: var(--blue-deep); background: var(--sky); font-weight: 600; }

.wlang-offer {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 6px 6px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  transform: translate(-50%, 12px);
  opacity: 0;
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
}
.wlang-offer.is-in { opacity: 1; transform: translate(-50%, 0); }
.wlang-offer a { font: 600 14px/1.2 var(--sans); color: var(--blue-deep); text-decoration: none; }
.wlang-offer a:hover { text-decoration: underline; }
.wlang-offer__close {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  padding: 0;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.wlang-offer__close:hover { background: var(--sky); color: var(--ink); }
.wlang-offer__close svg { width: 14px; height: 14px; }
.wlang-offer__close:active { transform: scale(0.94); }

:root[data-theme="dark"] .wlang__button { background: rgba(179, 196, 234, 0.05); }
:root[data-theme="dark"] .wlang__button:hover { background: rgba(179, 196, 234, 0.12); border-color: var(--blue-soft); color: var(--blue-deep); }
:root[data-theme="dark"] .wlang__list,
:root[data-theme="dark"] .wlang-offer { background: #141e33; border-color: var(--line); box-shadow: var(--shadow-md); }
:root[data-theme="dark"] .wlang__item:hover,
:root[data-theme="dark"] .wlang__item.is-active { background: rgba(179, 196, 234, 0.12); color: var(--blue-deep); }

@media (max-width: 620px) {
  .wlang__code { display: none; }
  .wlang__button { padding: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .wlang__list, .wlang-offer { transition-duration: 0.01ms; }
}

/* ---- stages: the road map block under "The server keeps growing" ---------------------- */
.stages {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.stages__next {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.stage {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  padding: 22px 22px 20px;
  background: var(--plate);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stage--now {
  border-color: rgba(245, 184, 75, 0.42);
  box-shadow: 0 0 0 1px rgba(245, 184, 75, 0.1), var(--shadow-md);
}
.stage--next {
  background: var(--plate);
  border: 1px dashed color-mix(in srgb, var(--blue-soft) 45%, transparent);
  box-shadow: none;
}
.stage__head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.stage__no {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--plate-warm);
  font-family: 'Constantine', 'Trajan Pro', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  font-size: 22px;
  line-height: 1;
  color: var(--blue);
}
.stage--now .stage__no {
  color: #2a1c04;
  background: var(--gold);
  border-color: rgba(245, 184, 75, 0.7);
}
.stage__chip {
  display: inline-block;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--blue-soft);
}
.stage__chip--now {
  color: var(--ink-gold);
  border-color: rgba(245, 184, 75, 0.5);
}
.stage__title {
  margin-top: 6px;
  font-family: 'Constantine', 'Trajan Pro', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: var(--track-ui);
  text-transform: uppercase;
  color: var(--heading);
}
.stage__rows {
  display: grid;
  gap: 14px;
}
.stage__row {
  display: grid;
  gap: 3px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.stage__row:first-child {
  padding-top: 0;
  border-top: 0;
}
.stage__row dt {
  font-size: 12px;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--blue-soft);
}
.stage__row dd {
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--text);
}
.stage__row--goal dd {
  color: var(--ink-gold);
}
.stage__list {
  list-style: none;
  display: grid;
  gap: 12px;
}
.stage__list li {
  position: relative;
  padding-left: 22px;
  font-size: 15.5px;
  line-height: 1.45;
  color: var(--text);
}
.stage__list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--blue-soft);
  border-radius: 2px;
  transform: rotate(45deg);
}
.stage__bosses {
  list-style: none;
  display: grid;
  gap: 6px;
}
.stage__bosses strong {
  color: var(--heading);
  font-weight: 500;
}
.stage__chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.stage__chips li {
  padding: 3px 10px;
  background: var(--plate-warm);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--blue);
}
.stage__foot {
  margin-top: auto;
  font-size: 13.5px;
  color: var(--muted);
}
.systems {
  display: grid;
  gap: 12px;
  padding: 18px 22px;
  background: var(--plate-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.systems__title {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--blue-soft);
}
.systems__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.systems__list li {
  padding: 5px 13px;
  background: var(--plate);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14.5px;
  color: var(--blue);
}
.systems__note {
  max-width: 46em;
  font-size: 14px;
  color: var(--muted);
}
@media (max-width: 1100px) {
  .stages { grid-template-columns: minmax(0, 1fr); }
  .stages__next { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stages__next .systems { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .stages__next { grid-template-columns: minmax(0, 1fr); }
  .stage { padding: 18px 16px; }
}
