/*
  Open Dungeon Master site. The palette, type and surface treatments are the
  app's arcane-night theme (src/app/globals.css in the server repo): deep
  indigo neutrals, aged gold accents, ember for heat. The ambient layers
  (topographic contours, dust motes, starfield) are the app's furniture too.
  Nothing here recreates the app UI; it dresses a marketing site in the same
  brand.
*/

@font-face {
  font-family: "Cinzel";
  src: url("../fonts/cinzel.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #0a0817;
  --bg-deep: #0d0b1c;
  --ink: #e9e6f4;
  --ink-bright: #edeaf7;
  --ink-2: #dedbec;
  --ink-3: #c9c6db;
  --ink-4: #aeaac6;
  --muted: #8f8aab;
  --faint: #575170;

  --gold: #d4ab3a;
  --gold-lit: #e3c15c;
  --gold-pale: #f4e0a6;
  --gold-white: #fff6da;
  --gold-deep: #b8922a;
  --gold-ink: #2b2008;
  --ember: #e0703a;
  --ember-lit: #ff9d5c;

  --gold-grad: linear-gradient(180deg, #fff6da 0%, #f4e0a6 28%, #e3c15c 58%, #b8922a 100%);

  --line: rgba(107, 99, 148, 0.3);
  --line-soft: rgba(107, 99, 148, 0.18);
  --panel: linear-gradient(180deg, rgba(48, 40, 83, 0.42), rgba(16, 13, 32, 0.85));
  --panel-flat: linear-gradient(180deg, rgba(33, 27, 58, 0.5), rgba(16, 13, 32, 0.6));
  --panel-lift: linear-gradient(180deg, rgba(41, 34, 71, 0.96), rgba(13, 11, 28, 0.98));

  --shadow-card: 0 1px 0 rgba(233, 230, 244, 0.08) inset, 0 2px 6px rgba(4, 2, 12, 0.55), 0 14px 36px rgba(4, 2, 12, 0.4);
  --shadow-drop: 0 2px 6px rgba(4, 2, 12, 0.55), 0 30px 80px rgba(4, 2, 12, 0.7);
  --glow-gold: 0 0 14px rgba(212, 171, 58, 0.35), 0 0 40px rgba(212, 171, 58, 0.12);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --display: Cinzel, Georgia, "Times New Roman", serif;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: Geist, -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --shell: 1200px;
  --gutter: 48px;
  --nav-h: 61px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  color-scheme: dark;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: clip;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(76, 60, 130, 0.28), transparent 65%),
    radial-gradient(ellipse 60% 45% at 85% 110%, rgba(48, 32, 90, 0.22), transparent 60%),
    radial-gradient(ellipse 40% 35% at 8% 65%, rgba(60, 38, 110, 0.14), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* Starfield and film grain, fixed behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 11% 24%, rgba(244, 224, 166, 0.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 27% 68%, rgba(233, 230, 244, 0.32), transparent 60%),
    radial-gradient(1px 1px at 38% 12%, rgba(244, 224, 166, 0.35), transparent 60%),
    radial-gradient(1px 1px at 52% 44%, rgba(233, 230, 244, 0.3), transparent 60%),
    radial-gradient(1.5px 1.5px at 64% 80%, rgba(244, 224, 166, 0.4), transparent 60%),
    radial-gradient(1px 1px at 71% 27%, rgba(233, 230, 244, 0.35), transparent 60%),
    radial-gradient(1px 1px at 83% 57%, rgba(244, 224, 166, 0.32), transparent 60%),
    radial-gradient(1.5px 1.5px at 92% 16%, rgba(233, 230, 244, 0.32), transparent 60%),
    radial-gradient(1px 1px at 18% 88%, rgba(244, 224, 166, 0.3), transparent 60%),
    radial-gradient(1px 1px at 45% 93%, rgba(233, 230, 244, 0.26), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E");
}

::selection {
  background: #6d5517;
  color: #fdf7e7;
}

a {
  color: var(--gold-lit);
  text-decoration: none;
}

a:hover {
  color: var(--gold-pale);
}

img {
  max-width: 100%;
  height: auto;
}

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 18px;
  background: var(--bg-deep);
  border: 1px solid var(--gold);
  border-radius: 0 0 10px 0;
}

.skip:focus {
  left: 0;
}

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

/* ---------- ambient layers ---------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: -11;
  overflow: hidden;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.16;
}

.ambient__dust {
  position: absolute;
  top: 0;
  left: 0;
  right: -360px;
  bottom: -720px;
  background-position: 0 0;
  background-size: 360px;
  filter: contrast(9) brightness(0.42) grayscale(1) sepia(1) saturate(2.2);
  will-change: transform;
}

.ambient__topo,
.ambient__sparks {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ambient__topo {
  z-index: -10;
}

.ambient__sparks {
  z-index: 70;
}

/* ---------- layout primitives ---------- */

main {
  padding-top: var(--nav-h);
}

.wrap {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  position: relative;
  z-index: 2;
  padding: 72px 0;
}

.section--tight {
  padding: 24px 0 68px;
}

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

.center {
  text-align: center;
}

.head {
  text-align: center;
  margin-bottom: 40px;
}

.eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-weight: 400;
  font-size: 12px;
  color: var(--gold);
  margin-bottom: 12px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  color: var(--ink-bright);
  margin: 0;
}

h1 {
  font-weight: 600;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.02;
  letter-spacing: 0.02em;
}

h2 {
  font-weight: 600;
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.15;
  letter-spacing: 0.02em;
}

h3 {
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.04em;
}

/* Gold leaf lettering, as on the app's title screen. */
.gild {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink-3);
  margin: 20px 0 0;
  max-width: 560px;
}

.sub {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink-4);
  line-height: 1.55;
  margin: 14px 0 0;
  max-width: 560px;
  text-wrap: pretty;
}

.head .sub {
  margin-inline: auto;
}

.fine {
  font-size: 13px;
  color: var(--muted);
}

.hl {
  color: var(--gold-pale);
}

/* Ornamental corner brackets, lifted from the app's framed panels. They
   reach a little further when the panel is hovered. */
.ornate {
  position: relative;
}

.ornate::before,
.ornate::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  pointer-events: none;
  border-color: rgba(244, 224, 166, 0.6);
  border-style: solid;
  z-index: 3;
  transition: width 260ms var(--spring), height 260ms var(--spring);
}

.ornate::before {
  top: 8px;
  left: 8px;
  border-width: 1px 0 0 1px;
}

.ornate::after {
  bottom: 8px;
  right: 8px;
  border-width: 0 1px 1px 0;
}

.ornate:hover::before,
.ornate:hover::after {
  width: 24px;
  height: 24px;
}

/* ---------- navigation ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: linear-gradient(180deg, rgba(10, 8, 23, 0.85), rgba(10, 8, 23, 0.35));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px clamp(16px, 3vw, 40px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: var(--gold-pale);
}

.brand:hover {
  color: var(--gold-white);
}

.brand img {
  border-radius: 8px;
}

.brand span {
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.nav__links {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 26px;
  font-size: 14px;
}

.nav__links a {
  color: var(--ink-4);
  line-height: 36px;
}

.nav__links a:hover,
.nav__links a.is-active {
  color: var(--gold-pale);
}

.nav__links a.is-active {
  text-shadow: 0 0 18px rgba(212, 171, 58, 0.35);
}

.nav__cta,
.nav__toggle {
  flex: none;
  cursor: pointer;
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-radius: 8px;
  color: var(--gold-pale);
  border: 1px solid rgba(212, 171, 58, 0.55);
  background: rgba(43, 32, 8, 0.55);
  transition: background 160ms ease, border-color 160ms ease;
}

.nav__cta:hover,
.nav__toggle:hover {
  color: var(--gold-pale);
  background: rgba(109, 85, 23, 0.6);
  border-color: var(--gold-lit);
}

.nav__toggle {
  display: none;
  border-color: rgba(107, 99, 148, 0.4);
  background: rgba(21, 18, 41, 0.6);
  color: var(--ink-2);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 22px;
  border-radius: 10px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid rgba(107, 99, 148, 0.4);
  background: rgba(21, 18, 41, 0.6);
  color: var(--ink);
  transition: border-color 160ms ease, color 160ms ease, filter 160ms ease;
}

.btn:hover {
  color: var(--gold-pale);
  border-color: rgba(212, 171, 58, 0.55);
}

.btn--gold {
  padding: 12px 20px;
  border: 0;
  background: linear-gradient(180deg, var(--gold-pale), var(--gold));
  color: var(--gold-ink);
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: var(--glow-gold);
}

.btn--gold:hover {
  color: var(--gold-ink);
  filter: brightness(1.06);
}

/* Secondary buttons that sit beside the gold one keep its height. */
.btn--quiet {
  padding: 12px 18px;
  background: var(--panel);
  text-align: left;
}

.btn__stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  line-height: 1.2;
}

.btn__stack small {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.75;
}

.btn--quiet .btn__stack small {
  color: var(--muted);
  opacity: 1;
}

/* Links whose target is not published yet still render, but inert. */
.is-soon {
  cursor: default;
  filter: saturate(0.65);
  opacity: 0.82;
}

.is-soon::after {
  content: "Soon";
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-pale);
  background: rgba(212, 171, 58, 0.14);
  border: 1px solid rgba(212, 171, 58, 0.4);
  white-space: nowrap;
}

.btn--gold.is-soon::after,
.btn--gold .is-soon::after {
  color: var(--gold-ink);
  background: rgba(26, 18, 6, 0.16);
  border-color: rgba(26, 18, 6, 0.4);
}

.is-soon:hover {
  color: inherit;
}

/* ---------- download control ---------- */

.dl {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-top: 32px;
  flex-wrap: wrap;
}

.dl__split {
  display: flex;
  border-radius: 10px;
}

.dl__split:first-child {
  box-shadow: var(--glow-gold);
}

.dl__split .btn {
  border-radius: 10px 0 0 10px;
  box-shadow: none;
}

.dl__caret {
  padding: 0 14px;
  border-radius: 0 10px 10px 0;
  border: 0;
  border-left: 1px solid rgba(43, 32, 8, 0.3);
  background: linear-gradient(180deg, #ecd287, var(--gold-deep));
  color: var(--gold-ink);
  cursor: pointer;
  font-size: 14px;
}

.dl__caret--quiet {
  border: 1px solid rgba(107, 99, 148, 0.4);
  border-left: 1px solid rgba(4, 2, 12, 0.4);
  background: linear-gradient(180deg, rgba(48, 40, 83, 0.8), rgba(21, 18, 41, 0.9));
  color: var(--ink-3);
}

.dl__caret--quiet:hover {
  color: var(--gold-pale);
}

/* The server sits beside the app downloads so nobody mistakes the app for
   the whole project. */
.dl__server {
  border-radius: 10px;
}

.dl__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(107, 99, 148, 0.28);
  background: rgba(13, 11, 28, 0.5);
  color: var(--ink);
  font-size: 14px;
  transition: border-color 160ms ease, background 160ms ease;
}

.dl__row:hover {
  border-color: rgba(212, 171, 58, 0.55);
  background: rgba(43, 32, 8, 0.4);
  color: var(--ink);
}

.dl__row span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.dl__row.is-soon::after {
  content: "Soon";
  margin-left: 0;
}

/* The platform picker: every build, one tap from any page. */
.dlpanel {
  width: min(640px, calc(100% - 40px));
  max-height: 88vh;
  padding: 28px;
  border-radius: 14px;
  border: 1px solid rgba(107, 99, 148, 0.35);
  background: var(--panel-lift);
  box-shadow: var(--shadow-drop);
  color: var(--ink);
  overflow: auto;
}

.dlpanel[open] {
  animation: panel-in 180ms cubic-bezier(0.2, 0.9, 0.25, 1);
}

.dlpanel::backdrop {
  background: rgba(4, 2, 12, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.dlpanel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.dlpanel__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-pale);
}

.dlpanel__close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(107, 99, 148, 0.4);
  background: transparent;
  color: var(--ink-4);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.dlpanel__close:hover {
  color: var(--gold-pale);
  border-color: rgba(212, 171, 58, 0.55);
}

/* The server gets its own strip above the app builds, not a row at the
   bottom of the list. */
.dlpanel__server {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 14px 18px;
  align-items: center;
  margin-bottom: 22px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(212, 171, 58, 0.35);
  background: rgba(212, 171, 58, 0.06);
}

.dlpanel__server p {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
}

.dlpanel__server-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dlpanel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.dlpanel__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dlpanel__label {
  font-family: var(--display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.dlpanel__label--gap {
  margin-top: 10px;
}

.dlpanel__fine {
  margin: 20px 0 0;
  font-size: 12px;
  color: var(--muted);
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- the d20 ---------- */

.d20 {
  position: fixed;
  right: clamp(14px, 2.5vw, 32px);
  bottom: clamp(14px, 2.5vw, 32px);
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 12px;
}

.d20__result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(41, 34, 71, 0.94), rgba(13, 11, 28, 0.97));
  border: 1px solid rgba(107, 99, 148, 0.4);
  box-shadow: 0 12px 30px rgba(4, 2, 12, 0.6);
  --tone: var(--gold-pale);
  --glow: rgba(212, 171, 58, 0.3);
}

.d20__result[hidden] {
  display: none;
}

.d20__result[data-tone="crit"] {
  --tone: var(--gold-white);
  --glow: rgba(212, 171, 58, 0.9);
}

.d20__result[data-tone="fumble"] {
  --tone: var(--ember-lit);
  --glow: rgba(224, 112, 58, 0.7);
}

.d20__kind {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.d20__num {
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  line-height: 1;
  min-width: 1.4em;
  text-align: center;
  color: var(--tone);
  text-shadow: 0 0 18px var(--glow);
}

.d20__label {
  font-family: var(--display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--tone);
}

.d20__btn {
  width: 64px;
  height: 64px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid rgba(212, 171, 58, 0.55);
  background: radial-gradient(circle at 50% 35%, rgba(109, 85, 23, 0.55), rgba(13, 11, 28, 0.95) 70%);
  box-shadow: 0 0 14px rgba(212, 171, 58, 0.35), 0 12px 30px rgba(4, 2, 12, 0.6);
  transition: transform 220ms var(--spring);
}

.d20__btn:hover {
  transform: translateY(-3px) scale(1.06);
}

.d20__btn:active {
  transform: scale(0.94);
}

.d20__btn img {
  width: 46px;
  height: 46px;
  pointer-events: none;
  transition: transform 50ms;
}

/* ---------- cards ---------- */

.grid {
  display: grid;
  gap: 22px;
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.card {
  padding: 30px 26px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}

.card h3 {
  margin: 0 0 6px;
  font-size: 20px;
  color: var(--gold-pale);
}

.card p {
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink-3);
  margin: 0;
}

/* ---------- numbered steps ---------- */

.steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step {
  display: flex;
  gap: 14px;
}

.step__n {
  flex: none;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  color: transparent;
  -webkit-text-stroke: 1px var(--gold-lit);
  text-shadow: 0 0 20px rgba(212, 171, 58, 0.3);
}

.step b {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--gold-pale);
  font-size: 16px;
}

.step p {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink-3);
}

.split {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-4);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 22px;
}

/* ---------- footer ---------- */

.foot {
  position: relative;
  z-index: 2;
  padding: 56px 0 36px;
  border-top: 1px solid rgba(107, 99, 148, 0.22);
  background: rgba(13, 11, 28, 0.7);
}

.foot .wrap {
  max-width: 1300px;
}

.foot__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px 60px;
  flex-wrap: wrap;
}

.foot__blurb {
  flex: 1 1 260px;
  max-width: 360px;
}

.foot .brand span {
  font-size: 13px;
}

.foot__blurb p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  margin: 14px 0 0;
}

.foot__cols {
  display: flex;
  gap: 40px 56px;
  flex-wrap: wrap;
}

.foot__col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}

.foot__col a {
  color: var(--ink-4);
}

.foot__col a:hover {
  color: var(--gold-pale);
}

.foot .eyebrow {
  font-family: var(--display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.22em;
  margin-bottom: 14px;
}

.foot__legal {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid rgba(107, 99, 148, 0.16);
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- page headers and long-form pages ---------- */

.pagehead {
  position: relative;
  padding: 64px 0 44px;
  border-bottom: 1px solid var(--line-soft);
}

.pagehead__inner {
  position: relative;
  z-index: 2;
}

.pagehead h1 {
  font-size: clamp(32px, 4.6vw, 56px);
  line-height: 1.05;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 rgba(92, 64, 12, 0.9)) drop-shadow(0 8px 18px rgba(212, 171, 58, 0.18));
  text-wrap: balance;
}

.guide {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding-block: 48px 90px;
  position: relative;
  z-index: 2;
}

.toc {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  font-size: 13.5px;
}

.toc ol {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc a {
  display: block;
  padding: 6px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--ink-4);
}

.toc a:hover {
  background: rgba(107, 99, 148, 0.14);
  color: var(--gold-pale);
}

.toc a.is-current {
  border-left-color: var(--gold);
  background: rgba(212, 171, 58, 0.08);
  color: var(--gold-pale);
}

.prose {
  min-width: 0;
}

.prose > section {
  padding-bottom: 44px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--line-soft);
}

.prose > section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.prose h2 {
  font-size: 27px;
  margin-bottom: 8px;
}

.prose h3 {
  font-size: 17px;
  margin: 30px 0 8px;
  color: var(--gold-pale);
}

.prose p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-3);
  margin: 12px 0;
}

.prose ul,
.prose ol {
  margin: 12px 0;
  padding-left: 22px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-3);
}

.prose li {
  margin: 7px 0;
}

.prose li b,
.prose p b {
  color: var(--ink-bright);
  font-weight: 600;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.87em;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(13, 11, 28, 0.8);
  border: 1px solid var(--line-soft);
  color: var(--gold-pale);
}

.code {
  position: relative;
  margin: 16px 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(8, 6, 19, 0.9);
  overflow: hidden;
}

.code pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-2);
}

.code code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

.code__copy {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 11px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(48, 40, 83, 0.75);
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11.5px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms linear;
}

.code:hover .code__copy,
.code__copy:focus-visible {
  opacity: 1;
}

.note {
  margin: 18px 0;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid rgba(212, 171, 58, 0.3);
  border-left: 3px solid var(--gold);
  background: rgba(212, 171, 58, 0.06);
}

.note--warn {
  border-color: rgba(224, 112, 58, 0.35);
  border-left-color: var(--ember);
  background: rgba(224, 112, 58, 0.07);
}

.note p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}

.note p + p {
  margin-top: 8px;
}

.note b {
  color: var(--ink-bright);
}

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

.faq summary {
  padding: 14px 2px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--gold);
  font-size: 18px;
  line-height: 1;
}

.faq[open] summary::after {
  content: "\2212";
}

.faq summary:hover {
  color: var(--gold-pale);
}

.faq > div {
  padding: 0 2px 16px;
}

.faq p {
  margin: 0 0 10px;
}

/* ---------- download page ---------- */

.dlcard {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 26px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}

.dlcard h3 {
  font-size: 21px;
  color: var(--gold-pale);
}

.dlcard p {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-3);
  margin: 0;
}

.dlcard p.fine {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}

.dlcard ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dlhead {
  max-width: 720px;
  margin-bottom: 28px;
}

.dlhead h2 {
  margin-top: 8px;
}

.dlhead .sub {
  margin-top: 12px;
}

.dlhead__ver {
  margin-left: 6px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0;
  color: var(--muted);
  vertical-align: middle;
}

/* ---------- responsive ---------- */

@media (max-width: 1040px) {
  :root {
    --gutter: 32px;
  }

  .split {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .toc {
    position: static;
    max-height: none;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    background: var(--panel-flat);
  }
}

/* Six nav links fit beside the brand and the button above 1080px; below it,
   down to the 980px menu toggle, they close up instead of wrapping. */
@media (max-width: 1080px) {
  .nav__links {
    gap: 16px;
  }
}

@media (max-width: 1010px) {
  .nav__links {
    gap: 10px;
  }
}

@media (max-width: 980px) {
  .nav__inner {
    gap: 12px;
  }

  .brand {
    margin-right: auto;
  }

  .nav__toggle {
    display: block;
  }

  .nav__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px var(--gutter) 20px;
    background: linear-gradient(180deg, #1d1836, var(--bg-deep));
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-drop);
  }

  .nav__links[data-open="1"] {
    display: flex;
  }

  .nav__links a {
    padding: 4px;
    font-size: 15px;
  }
}

@media (max-width: 760px) {
  :root {
    --gutter: 20px;
  }

  .section {
    padding: 52px 0;
  }

  .grid--3,
  .grid--2 {
    grid-template-columns: 1fr;
  }

  .dl {
    flex-direction: column;
  }

  .dl__split .btn {
    flex: 1;
  }

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

  .eyebrow {
    letter-spacing: 0.16em;
    font-size: 11px;
  }

  .d20__btn {
    width: 52px;
    height: 52px;
  }

  .d20__btn img {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 480px) {
  .nav__cta {
    display: none;
  }

  .brand span {
    font-size: 12px;
    letter-spacing: 0.12em;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
