/* Hallmark · shape: home Marquee Hero; docs/personas Long Document; installs Narrative Workflow · genre: atmospheric · theme: brand · redesign: full
 * paper: oklch(12% 0.02 200) · accent: oklch(62% 0.10 85) · display: Neue Haas Grotesk · body: Neue Haas Grotesk · hero: kept · nav: kept · footer: kept · signature: live test-tape rotator
 * axes: dark/grotesk-sans/warm · posture: restrained · contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P_pass H_pass E_pass S_warn R_pass V_pass · weakest: S, tracked-uppercase labels and middle-dot meta remain to be cleared in sweep */
@import url("./tokens.css");
@import url("./base.css");

@font-face {
  font-family: "Neue Haas Grotesk Display Pro";
  src: url("fonts/neue-haas-roman.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Neue Haas Grotesk Display Pro";
  src: url("fonts/neue-haas-medium.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Neue Haas Grotesk Display Pro";
  src: url("fonts/neue-haas-bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

:root {
  /* Destiny 2 UI palette from the Destiny 2 UI token standard
     (measured from 1920x1080 reference sheets; inferred tokens flagged there).
     --bg/--surface/--text/--muted/--line map to base tokens; --gold maps to the
     exotic/bossGold tokens as the site's Vanguard accent; --accent maps to Arc.
     Deliberately no cyan: glimmerCyan is reserved for currency numerals only. */
  --d2-void: #0A0F12;
  --d2-ink: #121419;
  --d2-panel-purple: #2F2D45;
  --d2-header-purple: #31203F;
  --d2-tooltip-navy: #2B384B;
  --d2-steel-blue: #2C4F5B;
  --d2-text-primary: #F2F2F2;
  --d2-text-secondary: #A0A0A4;
  --d2-text-muted: #5C5860;
  --d2-border-light: #D0CFD2;
  --d2-arc: #7F9FB0;
  --d2-solar: #D0713A;
  --d2-void-purple: #54396F;
  --d2-crucible-red: #943034;
  --d2-crucible-red-dark: #5E2528;
  --d2-launch-green: #367444;
  --d2-health-red: #BB4F40;
  --d2-boss-orange: #A24736;
  --d2-boss-gold: #B08D2E;
  --d2-gambit-green: #2E7D5B;
  --d2-glimmer-cyan: #4FC3D9;
  --d2-rarity-common: #F2F2F2;
  --d2-rarity-uncommon: #7AC74F;
  --d2-rarity-superior: #4A90D9;
  --d2-rarity-exotic: #E8C547;
  --bg: #0A0F12;
  --surface: #121419;
  --surface-2: #2B384B;
  --text: #F2F2F2;
  --muted: #A0A0A4;
  --heading: #F2F2F2;
  --gold: #B08D2E;
  --gold-bright: #E8C547;
  --gold-dim: #8A7135;
  --accent: #7F9FB0;
  --line: rgba(208, 207, 210, 0.14);
  --line-strong: rgba(208, 207, 210, 0.28);
  --code-bg: #070708;
  --code-text: #D0CFD2;
  --hero-caption-bg: rgba(0, 0, 0, 0.62);
  --hero-caption-fg: #d8c6a3;
  --hero-caption-border: rgba(216, 198, 163, 0.28);
  --header-bg: rgba(10, 15, 18, 0.94);
  --panel-bg: rgba(18, 20, 25, 0.82);
  --glow: rgba(208, 113, 58, 0.22);
  --veil-top: rgba(10, 15, 18, 0.68);
  --veil-mid: rgba(10, 15, 18, 0.82);
  --measure: 68ch;
  --wrap: 72rem;
  --sans: "Neue Haas Grotesk Display Pro", "Neue Haas Grotesk", "Helvetica Neue", "Helvetica Now Display", Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

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

html {
  font-size: 20.67px;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  position: relative;
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  font-synthesis: none;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  /* The CDN maps 400 to Light (45) and 500 to Roman (55). Body text uses
     500 so it renders as the regular cut rather than the light one. */
  font-weight: 500;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(70rem 38rem at 50% -8%, var(--glow), transparent 62%),
    linear-gradient(to bottom, var(--veil-top), var(--veil-mid) 58%, var(--bg) 100%);
  background-position: center top, center;
  background-size: auto, auto;
  background-repeat: no-repeat;
}

::selection {
  background: color-mix(in srgb, var(--gold) 28%, transparent);
  color: var(--heading);
}

a {
  color: var(--gold-bright);
  text-decoration-color: color-mix(in srgb, var(--gold-bright) 40%, transparent);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--heading);
  text-decoration-color: currentColor;
}

/* External links: same colour, dashed underline, so they read as links
   without looking like part of the site. The icon-only GitHub button in
   the header keeps its plain look. */
a[href^="http"]:not(.nav-github) {
  text-decoration-line: underline;
  text-decoration-style: dashed;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--gold-bright);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
  border-radius: 0;
}

.skip-link:focus {
  top: 1rem;
}

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4rem;
  flex-wrap: wrap;
  padding-block: 0.65rem;
}

.brand {
  color: var(--heading);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-decoration: none;
  font-size: 0.95rem;
}

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

.header-end {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--heading);
  border-color: var(--gold-dim);
}

.theme-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
}


.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.nav-github {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-github svg {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
}

.site-nav > a,
.nav-menu > summary {
  display: inline-block;
  padding: 0.45rem 0.7rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0;
  cursor: pointer;
}

.site-nav > a:hover,
.nav-menu > summary:hover,
.site-nav > a[aria-current="page"],
.nav-menu[data-active="true"] > summary {
  color: var(--heading);
  background: var(--surface-2);
}

.nav-menu {
  position: relative;
}

.nav-menu > summary {
  list-style: none;
  position: relative;
}

.nav-menu > summary::-webkit-details-marker { display: none; }

/* Deliberate chevron marker, drawn from theme tokens so it stays visible and
   on-brand in every theme. A bordered corner rotated to a chevron, replacing
   the default disclosure triangle. The existing global reduced-motion rule
   zeroes the transition, so this never animates under prefers-reduced-motion. */
.nav-menu > summary::after {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  margin-left: 0.55em;
  margin-bottom: 0.12em;
  border-right: 2px solid var(--gold-bright);
  border-bottom: 2px solid var(--gold-bright);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.nav-menu[open] > summary::after {
  transform: rotate(-135deg);
  margin-bottom: -0.08em;
}

.nav-menu[open] > summary { color: var(--heading); }

.nav-submenu {
  margin: 0.35rem 0 0;
  padding: 0.45rem;
  list-style: none;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.55);
  min-width: 13rem;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
}

.nav-submenu .nav-sep {
  height: 1px;
  margin: 0.4rem 0.55rem;
  background: var(--line-strong);
}

.nav-submenu a {
  display: block;
  padding: 0.55rem 0.7rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 0;
  font-size: 0.92rem;
}

.nav-submenu a:hover,
.nav-submenu a[aria-current="page"] {
  background: var(--surface);
  color: var(--gold-bright);
}

/* Keyboard focus: a bright ring on the dark panels in every theme. The
   current item already shows a gold-tinted row, so the outline stays on a
   strong gold-bright for clear, contrast-passing focus visibility. */
.nav-menu > summary:focus-visible,
.nav-submenu a:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

@media (min-width: 900px) {
  .nav-submenu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0;
  }
}

@media (max-width: 1100px) {
  .header-inner { align-items: flex-start; }
  .header-end { width: 100%; align-items: center; gap: 0.4rem; flex-wrap: nowrap; }
  .site-nav {
    width: auto;
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav > a,
  .nav-menu { flex: none; white-space: nowrap; }
  .nav-submenu {
    position: fixed;
    top: var(--mobile-menu-top, 7.2rem);
    right: 1rem;
    left: 1rem;
    z-index: 45;
    min-width: 0;
    max-height: calc(100vh - var(--mobile-menu-top, 7.2rem) - 1rem);
    overflow-y: auto;
  }

  .nav-menu[open] > summary {
    background: var(--surface-2);
    color: var(--heading);
  }
}

/* Page and lore typography */

.page {
  padding-block: clamp(2.1rem, 5.1vw, 4.25rem);
}

/* Destiny 2 UI weights (Neue Haas Grotesk = Helvetica): 55 Display Roman (500),
   56 Italic, 65 Medium (600), 75 Bold (700). Body copy uses 500 (55),
   section headings use 600 (65), screen titles use 700 (75). */
.category-icon {
  display: block;
  width: 1.65rem;
  height: 1.65rem;
  margin: 0 0 0.55rem;
  color: var(--gold-bright);
}

.lore {
  width: min(100% - 2.5rem, 54rem);
  margin-inline: auto;
}

.lore-head {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}

.kicker {
  margin: 0 0 0.6rem;
  color: var(--gold-bright);
  font-size: 0.78rem;
  font-weight: 700;
}

.lore h1,
.lore-head h1 {
  margin: 0;
  color: var(--heading);
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.breadcrumbs a {
  color: inherit;
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--gold-bright);
  text-decoration: underline;
}

.breadcrumbs [aria-current="page"] {
  color: var(--muted);
}

.breadcrumb-sep {
  color: var(--gold-dim);
  margin-inline: 0.35rem;
}

.lede {
  max-width: var(--measure);
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.65;
}

.hero-art {
  position: relative;
  margin: 1.4rem 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
}
.hero-art img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  max-height: 32rem;
}
.hero-caption {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  padding: 0.35rem 0.55rem;
  background: var(--hero-caption-bg);
  color: var(--hero-caption-fg);
  font-size: 0.72rem;
  border: 1px solid var(--hero-caption-border);
  border-radius: 0;
}

.lore h2 {
  margin: 2.2rem 0 0.6rem;
  color: var(--heading);
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 600;
  scroll-margin-top: 5.5rem;
}

.lore h3 {
  margin: 1.6rem 0 0.4rem;
  color: var(--heading);
  font-size: 1.15rem;
  line-height: 1.35;
  font-weight: 600;
  scroll-margin-top: 5.5rem;
}

.lore p,
.lore li {
  max-width: var(--measure);
}

.lore p {
  margin: 0 0 1rem;
}

.lore ul,
.lore ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}

.lore li { margin-bottom: 0.35rem; }

.lore hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

.lore strong { color: var(--heading); }

.lore blockquote {
  margin: 1.25rem 0;
  padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}

.lore table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.95rem;
}

.lore th,
.lore td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.lore th {
  color: var(--heading);
  font-weight: 700;
}

/* Heading permalinks */

.heading-anchor {
  margin-left: 0.4em;
  color: var(--gold-bright);
  text-decoration: none;
  font-size: 0.871em;
  font-weight: 500;
  opacity: 0.7;
}

.heading-anchor:hover,
.heading-anchor:focus-visible {
  color: var(--gold-bright);
  opacity: 1;
}

/* Code */

pre {
  position: relative;
  margin: 1rem 0 1.4rem;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 0;
  line-height: 1.55;
}

code,
kbd,
samp {
  font-family: var(--mono);
  font-size: 0.79em;
}

:not(pre) > code {
  padding: 0.12em 0.38em;
  background: color-mix(in srgb, var(--gold) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 20%, transparent);
  border-radius: 0;
  color: var(--gold-bright);
}

pre code {
  display: block;
  color: var(--code-text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.copy-button {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  padding: 0.3rem 0.55rem;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease;
}

pre:hover .copy-button,
.copy-button:focus-visible {
  opacity: 1;
}

.copy-button:hover {
  color: var(--heading);
  border-color: var(--gold-dim);
}

/* Syntax-highlight token palette.
   Prism tokens rendered by @11ty/eleventy-plugin-syntaxhighlight.
   Colors are drawn from the theme tokens (--gold-bright / --accent /
   --heading / --muted / --code-text) so every token keeps WCAG AA
   contrast (>= 4.5:1) on the near-black code backgrounds of the
   dark, crucible and gambit themes. The bright tints are used for
   keywords/numbers/classes because the raw --gold token fails
   contrast for small text. */

.token {
  color: var(--code-text);
}

.token.keyword,
.token.boolean,
.token.number,
.token.class-name,
.token.tag,
.token.selector,
.token.important {
  color: var(--gold-bright);
}

.token.string,
.token.property,
.token.attr-name,
.token.entity,
.token.url {
  color: color-mix(in srgb, var(--accent) 88%, var(--code-text));
}

.token.comment {
  color: color-mix(in srgb, var(--muted) 58%, var(--code-text));
}

.token.function {
  color: color-mix(in srgb, var(--heading) 78%, var(--accent));
}

.token.operator,
.token.variable,
.token.attr-value,
.token.regex {
  color: var(--code-text);
}

.token.punctuation {
  color: var(--muted);
}

.token.important {
  font-weight: 700;
}

.token.bold {
  font-weight: 700;
}

.token.italic {
  font-style: italic;
}

/* Collapsible sections */

.section {
  border-top: 1px solid var(--line);
  padding: 0.35rem 0 0.9rem;
  margin-top: 1.4rem;
}

.section > summary {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.65rem 0;
  cursor: pointer;
  list-style: none;
  color: var(--heading);
}

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

.section > summary::before {
  content: "+";
  flex: none;
  width: 1.1rem;
  color: var(--gold-bright);
  font-weight: 600;
}

.section[open] > summary::before { content: "−"; }

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.005em;
  scroll-margin-top: 5.5rem;
}

.section > summary:hover .section-title { color: var(--gold-bright); }

.section > summary .heading-anchor {
  margin-left: 0.35em;
}

/* Install choices */

.choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.choice {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
}

.choice-icon {
  display: inline-block;
  margin-right: 0.45rem;
  color: var(--gold-bright);
  font-size: 1.15em;
  line-height: 1;
  vertical-align: -0.12em;
}

.choice-icon.choice-logo {
  width: auto;
  height: 1.3em;
  vertical-align: -0.25em;
}

.choice-label {
  display: flex;
  align-items: center;
  margin: 0 0 0.35rem;
  color: var(--gold-bright);
  font-size: 0.72rem;
  font-weight: 700;
}

.choice h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.choice p { margin-bottom: 0.6rem; }

@media (min-width: 700px) {
  .choice .choice-desc { min-height: 5.2rem; }
}

.choice pre {
  margin-top: 0;
  overflow-x: hidden;
}

.choice pre code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Home */

.hero {
  width: min(100% - 2.5rem, 68rem);
  margin-inline: auto;
  padding-block: clamp(2.55rem, 7.65vw, 5.95rem) clamp(2.5rem, 6vw, 4.5rem);
}

.hero-copy { min-width: 0; }

.setup-order {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.7rem;
  margin: 0 0 1.5rem;
  padding: 0.55rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
  font-size: 0.84rem;
}

.setup-order--hero { margin: 1.3rem 0 0; }

.setup-order--inline {
  margin: 0 0 0.4rem;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.setup-order--boxed { margin: 0 0 1.4rem; }

.setup-order--intro { margin: 1.4rem 0 0; }

.has-setup-order .lore-head + .section {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.setup-order--inline + .section,
.lore-head + .section {
  border-top: 0;
  padding-top: 0;
}

.setup-order-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.setup-order ol {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.setup-order li {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.setup-order li + li::before {
  content: "→";
  color: var(--muted);
}

.setup-order a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.setup-order a:hover {
  color: var(--gold-bright);
  text-decoration: underline;
}

.setup-order a[aria-current="step"] {
  color: var(--gold-bright);
}

.setup-optional {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

@media (min-width: 900px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(18rem, 0.6fr);
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: end;
  }
}

.transmission {
  margin-top: 2.2rem;
  padding: 1.2rem 1.25rem 1rem;
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-left: 2px solid var(--gold-dim);
  border-radius: 0;
  backdrop-filter: blur(8px);
}

@media (min-width: 900px) {
  .transmission { margin-top: 0; }
}

.transmission-label {
  margin: 0 0 0.8rem;
  color: var(--gold-bright);
  font-size: 0.72rem;
  font-weight: 700;
}

.transmission-window { min-height: 10.5rem; }

.transmission-item {
  display: none;
  margin: 0;
}

.transmission-item.is-active {
  display: block;
  animation: transmission-in 420ms ease;
}

.transmission-prompt {
  margin: 0 0 0.5rem;
  color: var(--gold-bright);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
  text-wrap: balance;
}

.transmission-prompt::before {
  content: "You say: ";
  color: var(--muted);
  font-weight: 500;
}

.transmission blockquote { margin: 0; }

.transmission blockquote p {
  margin: 0;
  max-width: none;
  font-size: 1.02rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.transmission-captured {
  color: var(--muted);
  font-weight: 500;
}

.tape-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  margin: 1rem 0 1.6rem;
  padding: 0;
  list-style: none;
}

@media (min-width: 700px) {
  .tape-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.tape {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--gold-dim);
  border-radius: 0;
}

.tape-prompt {
  margin: 0 0 0.5rem;
  color: var(--gold-bright);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
  text-wrap: balance;
}

.tape-prompt::before {
  content: "You ask: ";
  color: var(--muted);
  font-weight: 500;
}

.tape blockquote { margin: 0; }

.tape blockquote p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.tape-topic {
  display: block;
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.transmission-caption {
  margin-top: 0.9rem;
  color: var(--gold-bright);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.transmission-topic {
  color: var(--muted);
  font-weight: 500;
}

.transmission-caption a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--gold) 45%, transparent);
}

.transmission-caption a:hover {
  color: var(--heading);
}

.transmission-speaker {
  color: var(--gold-bright);
  font-weight: 600;
}

.transmission-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin: 0 0 0.55rem;
}

@media (max-width: 430px) {
  .transmission-filters { grid-template-columns: 1fr; }
}

.transmission-filter {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.transmission-filter select {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.45rem 0.55rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  font: inherit;
  font-size: 0.82rem;
  letter-spacing: normal;
  text-transform: none;
}

.transmission-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.transmission-controls button {
  min-height: 2.25rem;
  padding: 0.35rem 0.6rem;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.transmission-controls button:hover {
  color: var(--heading);
  border-color: var(--gold-dim);
}

.transmission-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.transmission-note {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

@keyframes transmission-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .transmission-item.is-active { animation: none; }
}

.hero h1 {
  margin: 0;
  max-width: 18ch;
  color: var(--heading);
  font-size: clamp(2.6rem, 8vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.hero .lede {
  margin-top: 1.4rem;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.button {
  display: inline-block;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--gold);
  border-radius: 0;
  color: var(--gold-bright);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  background: var(--gold-bright);
  color: var(--bg);
}

.button-primary {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  color: var(--bg);
}

.button-primary:hover {
  background: var(--heading);
  border-color: var(--heading);
  color: var(--bg);
}

.categories {
  width: min(100% - 2.5rem, 68rem);
  margin-inline: auto;
  padding-bottom: clamp(3rem, 8vw, 6rem);
}

.category {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1.25rem;
  padding: 1.6rem 0;
  border-top: 1px solid var(--line);
}

.category-index {
  color: var(--gold-bright);
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding-top: 0.35rem;
}

.category h2 {
  margin: 0 0 0.4rem;
  color: var(--heading);
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 600;
}

.category p {
  margin: 0 0 0.7rem;
  max-width: var(--measure);
  color: var(--muted);
}

.category-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.92rem;
  font-weight: 600;
}

@media (max-width: 600px) {
  .category { grid-template-columns: 1fr; gap: 0.4rem; }
}


/* On-page navigation */

.toc {
  margin: 1.6rem 0 2.2rem;
  padding: 1rem 0 1rem 1.15rem;
  border-left: 1px solid var(--line-strong);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 1rem 0 1.2rem;
}

@media (min-width: 700px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1000px) {
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.stat-grid div {
  padding: 0.8rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
}

.stat-grid strong {
  display: block;
  color: var(--heading);
  font-size: 1.35rem;
  line-height: 1.1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-grid span {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.toc-tiles {
  padding-left: 0;
  border-left: 0;
}

.toc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}

@media (min-width: 700px) {
  .toc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.toc-card {
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
}

.toc-card .toc-group { margin-top: 0; }

.toc-card ul {
  columns: 1;
}

.toc-title {
  margin: 0 0 0.5rem;
  color: var(--gold-bright);
  font-size: 0.72rem;
  font-weight: 700;
}

.toc-group {
  margin: 0.9rem 0 0.25rem;
  color: var(--heading);
  font-size: 0.78rem;
  font-weight: 700;
}

.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 2rem;
}

.toc-card ul {
  columns: 1;
  column-gap: 0;
}

.toc li {
  margin: 0 0 0.3rem;
  break-inside: avoid;
}

.toc a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}

.toc a:hover,
.toc a:focus-visible {
  color: var(--gold-bright);
  text-decoration: underline;
}

@media (max-width: 600px) {
  .toc ul { columns: 1; }
  .toc ol { columns: 1; }
}

/* Wiki table of contents (eleventy-plugin-toc) */

.wiki-toc {
  margin: 1.2rem 0 1.6rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--gold-bright);
}

.wiki-toc summary {
  cursor: pointer;
  color: var(--gold-bright);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  user-select: none;
}

.wiki-toc .toc {
  margin: 0.85rem 0 0;
  padding: 0;
  border-left: 0;
}

.wiki-toc .toc ol {
  margin: 0;
  padding-left: 1.1rem;
  columns: 1;
}

.wiki-toc .toc ol li {
  margin: 0 0 0.3rem;
  break-inside: avoid;
}

@media (min-width: 700px) {
  .wiki-toc .toc ol { columns: 2; column-gap: 2rem; }
}


/* Agent profiles and roster */

.agent-profile {
  padding: 1.7rem 0 1.4rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 5.5rem;
}

.agent-profile:first-of-type {
  border-top: 0;
  padding-top: 0.4rem;
}

.agent-role {
  margin: 0 0 0.35rem;
  color: var(--gold-bright);
  font-size: 0.74rem;
  font-weight: 700;
}

.agent-profile h2 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.agent-ask {
  margin-top: 1rem;
  color: var(--muted);
}

.agent-ask strong { color: var(--heading); }

.agent-source {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.agent-source span { margin-inline: 0.45rem; }

.agent-more {
  margin: 0.7rem 0 0;
}

.page-hero {
  margin: 0 0 2rem;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
}

.page-hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.agent-portrait {
  margin: 0 0 0.7rem;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
}

.art-credit {
  margin: 0 0 0.7rem;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
}
.art-credit img {
  display: block;
  width: 100%;
  height: auto;
}
.art-credit figcaption {
  padding: 0.6rem 0.8rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

.agent-portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center 20%;
}

@media (min-width: 700px) {
  .agent-portrait img { aspect-ratio: 2 / 1; }
}

.integration-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.92rem;
}

.integration-table th {
  padding: 0.45rem 0.6rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.integration-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.integration-table tr:last-child td { border-bottom: 0; }

@media (max-width: 700px) {
  .integration-table thead { display: none; }
  .integration-table,
  .integration-table tbody,
  .integration-table tr,
  .integration-table td {
    display: block;
    width: 100%;
  }
  .integration-table tr {
    margin-bottom: 0.7rem;
    padding: 0.8rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0;
  }
  .integration-table td {
    padding: 0.15rem 0;
    border: 0;
  }
  .integration-table td:first-child { font-weight: 700; color: var(--heading); }
  .integration-table td:nth-child(2)::before { content: "Rules: "; color: var(--muted); }
  .integration-table td:nth-child(3)::before { content: "MCP: "; color: var(--muted); }
}

.toc-filter {
  display: block;
  margin: 0.4rem 0 0.8rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.toc-filter input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.5rem 0.65rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  font: inherit;
  font-size: 0.9rem;
  letter-spacing: normal;
  text-transform: none;
}

.toc-filter-empty {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.agent-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0 0 1.6rem;
}

.agent-facts div {
  padding: 0.65rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
}

.agent-facts dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.agent-facts dd {
  margin: 0.2rem 0 0;
  color: var(--heading);
  font-weight: 600;
}

@media (max-width: 520px) {
  .agent-facts { grid-template-columns: 1fr; }
}

.lore .checklist {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
  padding-left: 0;
  list-style: none;
}

.checklist li {
  position: relative;
  padding-left: 1.6rem;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--gold-bright);
  font-weight: 700;
}

.callout {
  margin: 1.5rem 0;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 0;
}

.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.8rem;
  margin: 1rem 0 1.5rem;
  padding: 0;
  list-style: none;
}

.tile-grid li {
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
}

.tile-grid code {
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold-bright);
  font-size: 0.79rem;
  font-weight: 600;
}

.tile-grid strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--heading);
  font-size: 0.95rem;
  font-weight: 700;
}

.tile-grid p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.tile-grid .agent-role {
  margin-top: 0.35rem;
  font-size: 0.7rem;
}

.tile-grid .agent-more {
  margin-top: 0.55rem;
  color: var(--text);
}

.fit-map {
  margin: 1.5rem 0 1.8rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
}

.fit-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.fit-node {
  padding: 0.9rem 1rem;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 0;
}

.fit-node--client,
.fit-node--archive {
  width: min(100%, 30rem);
  margin: 0 auto;
  border-color: var(--gold-dim);
}

.fit-node--archive { width: min(100%, 26rem); }

.fit-kicker {
  margin: 0 0 0.2rem;
  color: var(--gold-bright);
  font-size: 0.66rem;
  font-weight: 700;
}

.fit-node strong {
  display: block;
  color: var(--heading);
  font-size: 1rem;
  font-weight: 700;
}

.fit-node p:last-child {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

/* Client to the two layers. */

.fit-split,
.fit-join {
  position: relative;
  height: 2.4rem;
}

.fit-split::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 50%;
  background: var(--line-strong);
}

.fit-split::after,
.fit-join::before {
  content: "";
  position: absolute;
  left: 25%;
  right: 25%;
  top: 50%;
  height: 1px;
  background: var(--line-strong);
}

.fit-split span,
.fit-join span {
  position: absolute;
  top: 50%;
  width: 1px;
  height: 50%;
  background: var(--line-strong);
}

.fit-split span:first-child,
.fit-join span:first-child { left: 25%; }

.fit-split span:last-child,
.fit-join span:nth-child(2) { right: 25%; }

.fit-split span::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: -3px;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 5px solid var(--gold-dim);
}

/* The two layers read down from the archive. */

.fit-join span {
  top: 0;
  height: 50%;
}

.fit-join span::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -3px;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-bottom: 5px solid var(--gold-dim);
}

.fit-join::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  bottom: 0;
  width: 1px;
  background: var(--line-strong);
}

.persona-thumb {
  margin: -0.85rem -1rem 0.8rem;
  overflow: hidden;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.persona-thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.tile-grid--personas {
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .tile-grid--personas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1000px) {
  .tile-grid--personas { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.tile-grid--personas li {
  display: flex;
  flex-direction: column;
}

.tile-grid--personas strong,
.tile-grid--personas .agent-role {
  text-wrap: balance;
}

.tile-grid--personas p {
  text-wrap: pretty;
}

.tile-grid--personas .agent-more {
  margin-top: auto;
  padding-top: 0.55rem;
}

.persona-tally {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 1.6rem;
  overflow: hidden;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: 0;
  font-size: 0.9rem;
  text-align: center;
}

.persona-tally span {
  padding: 0.9rem 1rem;
}

.persona-tally span + span {
  border-left: 1px solid var(--line);
}

.persona-tally strong {
  color: var(--heading);
  font-size: 1rem;
}

.field-table {
  width: 100%;
  margin: 1rem 0 1.6rem;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.field-table th {
  padding: 0.4rem 0.6rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.field-table td {
  padding: 0.5rem 0.6rem;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.field-table tr:last-child td { border-bottom: 0; }

.field-table td:first-child {
  color: var(--heading);
  font-family: var(--mono);
  font-size: 0.82rem;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .field-table thead { display: none; }

  .field-table,
  .field-table tbody,
  .field-table tr,
  .field-table td {
    display: block;
    width: 100%;
  }

  .field-table tr {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--line);
  }

  .field-table tr:last-child { border-bottom: 0; }

  .field-table td {
    padding: 0.1rem 0;
    border: 0;
  }

  .field-table td:first-child {
    color: var(--muted);
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: normal;
  }
}

.agent-record {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.45rem 1.2rem;
  margin: 1rem 0 1.8rem;
}

.agent-record dt {
  padding-top: 0.15rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.agent-record dd { margin: 0; }

.quote-grid {
  margin: 1rem 0 1.6rem;
}

.agent-quote {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(9rem, 12rem);
  gap: 1.5rem;
  align-items: start;
  margin: 0;
  padding: 1.1rem 0 1.1rem 2rem;
  border-top: 1px solid var(--line);
}

.agent-quote:first-child { border-top: 0; }

.agent-quote::before {
  content: "“";
  position: absolute;
  left: 0;
  top: 0.35rem;
  color: var(--gold-bright);
  font-size: 2rem;
  line-height: 1;
  opacity: 0.65;
}

.agent-quote blockquote {
  margin: 0;
}

.agent-quote blockquote p {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.5;
}

.agent-quote figcaption {
  margin: 0;
  padding-top: 0.2rem;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: right;
}

@media (max-width: 600px) {
  .agent-quote {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .agent-quote figcaption { text-align: left; }
}

.agent-roster-section {
  margin-top: 3rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line-strong);
}

.section-head p {
  max-width: var(--measure);
  margin: 0 0 1.2rem;
  color: var(--muted);
}

.agent-roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 0 2.4rem;
}

.agent-roster-item {
  padding: 1rem 0 1.1rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 5.5rem;
}

.agent-roster-item h3 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}

.agent-roster-item p {
  margin-bottom: 0.45rem;
}

.agent-roster-item .agent-source { margin-top: 0.6rem; }

.roster-empty {
  max-width: var(--measure);
  margin-top: 1.2rem;
  padding: 0.9rem 1rem;
  border-left: 1px solid var(--accent);
  color: var(--muted);
}

@media (max-width: 600px) {
  .agent-roster { grid-template-columns: 1fr; }
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-updated { white-space: nowrap; }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: baseline;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover { color: var(--gold-bright); }

/* Utility */

.muted { color: var(--muted); }

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

/* Crucible theme — D2 tokens: --gold = crucibleRed #943034,
   --gold-dim = crucibleRedDark #5E2528. --gold-bright is a derived
   light tint for small text (token red fails contrast on dark). */

:root[data-theme="crucible"] {
  color-scheme: dark;
  --bg: #0b0708;
  --surface: #170f11;
  --surface-2: #241518;
  --text: #F2F2F2;
  --muted: #B09A96;
  --heading: #FFF6F2;
  --gold: #943034;
  --gold-bright: #FF6F61;
  --gold-dim: #5E2528;
  --accent: #B9C0C7;
  --line: rgba(208, 207, 210, 0.14);
  --line-strong: rgba(208, 207, 210, 0.28);
  --code-bg: #120b0c;
  --code-text: #D0CFD2;
  --header-bg: rgba(11, 7, 8, 0.94);
  --panel-bg: rgba(23, 15, 17, 0.86);
  --glow: rgba(148, 48, 52, 0.24);
  --veil-top: rgba(11, 7, 8, 0.6);
  --veil-mid: rgba(11, 7, 8, 0.9);
}

/* Gambit theme — D2 tokens: --gold = gambitGreen #2E7D5B,
   --accent = bossGold #B08D2E. --gold-bright is a derived light tint
   (token green fails contrast for small text on dark). */

:root[data-theme="gambit"] {
  color-scheme: dark;
  --bg: #06110b;
  --surface: #0c1d13;
  --surface-2: #122a1c;
  --text: #F2F2F2;
  --muted: #96AC9E;
  --heading: #F4FBF5;
  --gold: #2E7D5B;
  --gold-bright: #7EE2B0;
  --gold-dim: #206B4A;
  --accent: #B08D2E;
  --line: rgba(208, 207, 210, 0.14);
  --line-strong: rgba(208, 207, 210, 0.28);
  --code-bg: #050d08;
  --code-text: #D0CFD2;
  --header-bg: rgba(6, 17, 11, 0.94);
  --panel-bg: rgba(12, 29, 19, 0.86);
  --glow: rgba(46, 125, 91, 0.2);
  --veil-top: rgba(6, 17, 11, 0.62);
  --veil-mid: rgba(6, 17, 11, 0.9);
}


/* Typographic balance for prose and headings. */
.lore h1,
.lore h2,
.lore h3,
.hero h1,
.category h2 {
  text-wrap: balance;
}

.lore p,
.lore li,
.category p {
  text-wrap: pretty;
}

strong,
b {
  font-weight: 700;
}

/* Try demo (/try/): chat thread + quest-style choices, respawn overlay. */
.try-ghost {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.try-story-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

.try-story-card {
  display: block;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: var(--text);
}

.try-story-card:hover {
  border-color: var(--gold);
}

.try-story-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.try-story-card h3 {
  margin: 0 0 0.25rem 0;
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.try-story-card p {
  margin: 0.25rem 0 0 0;
  color: var(--muted);
}

.try-beat {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.try-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #3d3d3f;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--muted);
}

.try-bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  max-width: 80%;
  font-size: 0.95rem;
  line-height: 1.5;
  overflow-wrap: break-word;
  min-width: 0;
}

.try-speaker {
  font-size: 0.75rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.try-replies {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.try-replies-label {
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
  letter-spacing: 0.1em;
}

.try-choice {
  display: block;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  text-align: left;
  font-size: 0.9rem;
  font-family: var(--sans);
  text-decoration: none;
  cursor: pointer;
}

.try-choice:hover {
  border-color: var(--gold);
}

.try-choice:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.try-choice--danger {
  border-color: var(--d2-crucible-red);
  color: var(--danger);
}

.try-end-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.try-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #0a0f12;
  color: #f2f2f2;
  font-family: var(--sans);
  overflow-y: auto;
}

.try-overlay:target {
  display: block;
}

.try-overlay-art {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 40%, rgba(120, 20, 20, 0.45) 100%),
    linear-gradient(180deg, #14161a, #0a0f12);
}

.try-banner {
  position: relative;
  background: linear-gradient(180deg, var(--d2-crucible-red), var(--d2-crucible-red-dark));
  border-bottom: 2px solid rgba(255, 255, 255, 0.25);
  padding: 1rem 1.5rem 0.75rem 1.5rem;
}

.try-banner-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  letter-spacing: 0.35em;
  font-weight: 600;
  font-size: 1.25rem;
}

.try-banner-strip {
  margin-top: 0.5rem;
  background: rgba(230, 230, 230, 0.9);
  color: #555555;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  padding: 0.2rem 0.75rem;
  display: inline-block;
}

.try-tracker {
  position: relative;
  margin: 1rem 0 0 1rem;
  max-width: 260px;
}

.try-tracker-head {
  background: var(--d2-steel-blue);
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.try-tracker-body {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  line-height: 1.4;
  background: rgba(0, 0, 0, 0.45);
}

.try-tracker-failed {
  color: var(--d2-health-red);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.try-quip {
  position: relative;
  text-align: center;
  margin: 4rem 1.5rem 0 1.5rem;
}

.try-quip-speaker {
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 0.15em;
  font-weight: 600;
}

.try-quip-text {
  font-size: 1.25rem;
  font-weight: 500;
  margin-top: 0.35rem;
}

.try-bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.6));
}

.try-countdown {
  font-size: 1rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.try-revives {
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-align: right;
}

.try-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  align-items: center;
}

.try-btn {
  background: rgba(20, 20, 22, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #f2f2f2;
  padding: 0.5rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--sans);
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}

.try-btn:hover {
  border-color: var(--gold);
}

.try-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.try-retry {
  color: var(--muted);
  font-size: 0.85rem;
}

@media (prefers-reduced-motion: reduce) {
  .try-overlay-art {
    background: #0a0f12;
  }
}

/* Wiki — the grimoire's docs/wiki pages rendered as a book.
   Authored markdown arrives byte-identical (scripts/sync-wiki.py); this is the
   only wiki-specific styling. Sidebar from _data/wiki-nav.json, prev/next from
   the same order, typography inherited from the docs pages above. */

.wiki {
  display: grid;
  grid-template-columns: minmax(13rem, 15rem) minmax(0, 1fr);
  gap: clamp(1.75rem, 3vw, 3rem);
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
  padding-block: clamp(1.8rem, 4vw, 3.2rem) clamp(2.6rem, 5vw, 4.5rem);
}

.wiki-rail {
  position: sticky;
  top: 5.5rem;
  align-self: start;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  padding-bottom: 1.5rem;
}

.wiki-index .kicker {
  padding-bottom: 0.55rem;
  border-bottom: var(--rule-hair) solid var(--line);
  margin-bottom: 0.75rem;
}

.wiki-index-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wiki-index-list li {
  border-left: 2px solid transparent;
}

.wiki-index-list a {
  display: block;
  padding: 0.5rem 0.7rem 0.5rem 0.85rem;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  transition: color var(--dur-micro) var(--ease-out),
    background var(--dur-micro) var(--ease-out);
}

.wiki-index-list a:hover {
  color: var(--gold-bright);
  background: var(--surface);
}

.wiki-index-list [aria-current="page"] {
  color: var(--gold-bright);
  background: var(--surface);
}

.wiki-index-list li:has([aria-current="page"]) {
  border-left-color: var(--gold);
}

.wiki-entry {
  min-width: 0;
}

.wiki-entry-head {
  padding-bottom: 1.1rem;
  border-bottom: var(--rule-hair) solid var(--line);
  margin-bottom: 1.9rem;
}

.wiki-body {
  width: 100%;
  max-width: 54rem;
  margin-inline: 0;
}

.wiki-body > h1:first-child {
  margin-top: 0;
}

.wiki-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2.6rem;
  padding-top: 1.4rem;
  border-top: var(--rule-hair) solid var(--line);
}

.wiki-pager-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.wiki-pager-item-next {
  text-align: right;
}

.wiki-pager-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.wiki-pager-item a {
  color: var(--gold-bright);
  font-weight: 600;
  text-decoration: none;
}

.wiki-pager-item a:hover {
  text-decoration: underline;
}

.wiki-pager-none {
  color: var(--muted);
  font-weight: 500;
}

@media (max-width: 860px) {
  .wiki {
    grid-template-columns: 1fr;
  }

  .wiki-rail {
    position: static;
    max-height: none;
    overflow: visible;
    padding-bottom: 0;
  }

  .wiki-index-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.15rem;
  }

  .wiki-index {
    padding-bottom: 1.2rem;
    border-bottom: var(--rule-hair) solid var(--line);
  }

  .wiki-index-list [aria-current="page"] {
    color: var(--gold-bright);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wiki-index-list a {
    transition: none;
  }
}
