:root {
  --ink: #070806;
  --panel: #11130f;
  --paper: #e9e1c7;
  --paper-dim: #c9c09d;
  --acid: #c8ff00;
  --acid-soft: rgba(200, 255, 0, 0.14);
  --line: rgba(233, 225, 199, 0.22);
  --shadow: rgba(0, 0, 0, 0.45);
  --max: 1440px;
  --font-body: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --font-old: "IM Fell English", Georgia, "Times New Roman", serif;
  --font-head: "IM Fell English SC", Georgia, "Times New Roman", serif;
  --font-display: "UnifrakturCook", "IM Fell English SC", Georgia, serif;
  --font-stamp: "Special Elite", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(200, 255, 0, 0.12), transparent 26rem),
    linear-gradient(135deg, rgba(200, 255, 0, 0.04) 0 1px, transparent 1px 18px),
    #050604;
  color: var(--paper);
  font-family: var(--font-body);
  line-height: 1.65;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 88%);
}

a {
  color: var(--acid);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: #f2ff8b;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.75rem clamp(1rem, 3vw, 2.5rem);
  background: rgba(7, 8, 6, 0.9);
  border-bottom: 1px solid rgba(200, 255, 0, 0.22);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--paper);
  text-decoration: none;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(233, 225, 199, 0.55);
  background: #020302;
  object-fit: cover;
  box-shadow: 0 0 24px rgba(200, 255, 0, 0.18);
}

.brand-copy {
  display: grid;
  gap: 0.05rem;
}

.brand-copy strong {
  font-family: var(--font-head);
  font-size: 1.24rem;
  letter-spacing: 0;
}

.brand-copy span {
  color: var(--paper-dim);
  font-family: var(--font-old);
  font-size: 0.86rem;
  font-style: italic;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  font-family: var(--font-stamp);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.topnav a,
.sound-toggle,
.hero-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(200, 255, 0, 0.35);
  background: rgba(200, 255, 0, 0.07);
  color: var(--paper);
  text-decoration: none;
}

.topnav a:hover,
.sound-toggle:hover,
.hero-actions a:hover {
  background: var(--acid);
  color: var(--ink);
}

.sound-toggle {
  font-family: var(--font-stamp);
  font-size: 0.78rem;
  text-transform: uppercase;
  cursor: pointer;
}

.sound-toggle.is-playing {
  border-color: var(--acid);
  background: var(--acid);
  color: var(--ink);
}

.hero-actions .cta-primary {
  border-color: var(--acid);
  background: var(--acid);
  color: var(--ink);
  box-shadow: 0 0 26px rgba(200, 255, 0, 0.22);
  font-weight: 800;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  min-height: calc(100vh - 82px);
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) clamp(1rem, 4vw, 3rem);
  align-items: center;
}

.hero::after {
  position: absolute;
  right: 4%;
  bottom: 4%;
  width: min(38vw, 360px);
  aspect-ratio: 1;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(200, 255, 0, 0.18);
  transform: rotate(45deg);
}

.kicker,
.folio-label {
  margin: 0 0 0.8rem;
  color: var(--acid);
  font-family: var(--font-stamp);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  color: var(--acid);
  font-family: var(--font-display);
  font-size: 8.8rem;
  line-height: 0.86;
  letter-spacing: 0;
  text-shadow: 0 0 24px rgba(200, 255, 0, 0.2);
}

.hero-text,
.hero-art,
.wide-figure,
.entry,
.toc,
.infobox,
.infobox-card {
  min-width: 0;
}

.subtitle {
  max-width: 800px;
  margin: 1.25rem 0 0;
  color: var(--paper);
  font-family: var(--font-old);
  font-size: 1.7rem;
  line-height: 1.22;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 2rem;
  font-family: var(--font-stamp);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.hero-art {
  position: relative;
  margin: 0;
  border: 1px solid rgba(200, 255, 0, 0.35);
  background: #0b0c09;
  box-shadow: 0 24px 80px var(--shadow);
}

.hero-art::before {
  position: absolute;
  inset: 1rem;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(200, 255, 0, 0.55);
  mix-blend-mode: screen;
}

.hero-art img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  filter: contrast(1.06) saturate(1.04);
}

.hero-art figcaption,
.wide-figure figcaption {
  padding: 0.75rem 0.9rem;
  color: var(--paper-dim);
  border-top: 1px solid rgba(200, 255, 0, 0.22);
  font-family: var(--font-old);
  font-size: 0.84rem;
  font-style: italic;
  overflow-wrap: anywhere;
}

.token-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: clamp(1rem, 3vw, 2rem);
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.5rem);
  border-top: 1px solid rgba(200, 255, 0, 0.25);
  border-bottom: 1px solid rgba(200, 255, 0, 0.25);
  background:
    linear-gradient(90deg, rgba(200, 255, 0, 0.12), transparent 62%),
    rgba(9, 10, 8, 0.88);
}

.token-copy {
  min-width: 0;
  padding: clamp(1rem, 2.4vw, 2rem);
  border-left: 4px solid var(--acid);
}

.token-copy h2 {
  margin: 0;
  color: #f7ffd3;
  font-family: var(--font-head);
  font-size: 3.35rem;
  line-height: 0.98;
}

.token-copy p {
  max-width: 840px;
  margin: 1rem 0 0;
  color: var(--paper);
  font-family: var(--font-old);
  font-size: 1.1rem;
}

.token-actions {
  margin-top: 1.35rem;
}

.contract-card {
  display: grid;
  width: min(100%, 760px);
  gap: 0.28rem;
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(200, 255, 0, 0.45);
  background:
    linear-gradient(90deg, rgba(200, 255, 0, 0.13), transparent),
    rgba(0, 0, 0, 0.28);
  color: var(--paper);
  cursor: pointer;
  text-align: left;
}

.contract-card span,
.contract-card em {
  color: var(--paper-dim);
  font-family: var(--font-stamp);
  font-size: 0.72rem;
  font-style: normal;
  text-transform: uppercase;
}

.contract-card strong {
  color: var(--acid);
  font-family: var(--font-stamp);
  font-size: 0.94rem;
  overflow-wrap: anywhere;
}

.contract-card:hover,
.contract-card.is-copied {
  border-color: var(--acid);
  background: rgba(200, 255, 0, 0.16);
}

.token-ledger {
  display: grid;
  align-content: start;
  border: 1px solid rgba(200, 255, 0, 0.4);
  background:
    linear-gradient(135deg, rgba(200, 255, 0, 0.08), transparent 50%),
    rgba(17, 19, 15, 0.92);
}

.token-ledger div {
  display: grid;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(233, 225, 199, 0.14);
}

.contract-inline,
.contract-mini {
  width: max-content;
  max-width: 100%;
  padding: 0.42rem 0.58rem;
  border: 1px solid rgba(200, 255, 0, 0.42);
  background: rgba(200, 255, 0, 0.08);
  color: var(--acid);
  cursor: pointer;
  font-family: var(--font-stamp);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.contract-mini {
  font-size: 0.68rem;
}

.contract-inline:hover,
.contract-mini:hover,
.contract-inline.is-copied,
.contract-mini.is-copied {
  background: var(--acid);
  color: var(--ink);
}

.token-ledger span,
.stat-strip span {
  color: var(--paper-dim);
  font-family: var(--font-stamp);
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: uppercase;
}

.token-ledger strong,
.stat-strip strong {
  color: var(--acid);
  font-family: var(--font-head);
  font-size: 1.12rem;
}

.token-ledger p {
  margin: 0;
  padding: 1rem;
  color: var(--paper-dim);
  font-size: 0.92rem;
}

.article-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 310px;
  gap: 1.4rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.5rem);
}

.toc,
.infobox-card {
  position: sticky;
  top: 94px;
}

.toc {
  align-self: start;
  padding: 1rem;
  border: 1px solid var(--line);
  background: rgba(17, 19, 15, 0.82);
}

.toc-title,
.infobox-title {
  color: var(--acid);
  font-family: var(--font-stamp);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
}

.toc ol {
  display: grid;
  gap: 0.2rem;
  margin: 0.85rem 0 0;
  padding-left: 1.2rem;
  font-family: var(--font-old);
  font-size: 0.95rem;
}

.toc a {
  color: var(--paper-dim);
  text-decoration: none;
}

.entry {
  min-width: 0;
  padding: clamp(1.2rem, 3vw, 2.5rem);
  border: 1px solid rgba(233, 225, 199, 0.2);
  background:
    linear-gradient(180deg, rgba(200, 255, 0, 0.06), transparent 22rem),
    rgba(15, 16, 12, 0.94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

.entry-header {
  padding-bottom: 1.2rem;
  border-bottom: 1px solid rgba(233, 225, 199, 0.22);
}

.entry h2 {
  margin: 0;
  color: var(--paper);
  font-family: var(--font-head);
  font-size: 4.8rem;
  font-weight: 400;
  line-height: 1;
}

.lead {
  max-width: 880px;
  margin: 1rem 0 0;
  color: #f4edda;
  font-family: var(--font-old);
  font-size: 1.16rem;
}

.article-section {
  padding: 2rem 0;
  border-bottom: 1px solid rgba(233, 225, 199, 0.14);
}

.article-section:last-child {
  border-bottom: 0;
}

.article-section h3 {
  margin: 0 0 0.8rem;
  color: var(--acid);
  font-family: var(--font-head);
  font-size: 1.9rem;
  line-height: 1.1;
}

.article-section p {
  margin: 0 0 1rem;
}

sup a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35em;
  height: 1.35em;
  border: 1px solid rgba(200, 255, 0, 0.5);
  color: var(--acid);
  font-family: var(--font-stamp);
  font-size: 0.68rem;
  line-height: 1;
  text-decoration: none;
}

.callout {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 1rem;
  align-items: center;
  margin: 1.5rem 0 0;
  padding: 1rem;
  border: 1px solid rgba(200, 255, 0, 0.35);
  background: rgba(200, 255, 0, 0.07);
}

.callout p {
  margin: 0;
  color: #f7ffd3;
  font-style: italic;
}

.sigil {
  width: 44px;
  height: 44px;
  border: 1px solid var(--acid);
  background:
    linear-gradient(45deg, transparent 47%, var(--acid) 48% 52%, transparent 53%),
    linear-gradient(-45deg, transparent 47%, var(--acid) 48% 52%, transparent 53%);
}

.token-grid,
.character-list,
.stat-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

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

.token-grid section,
.character-list article,
.stat-strip div {
  min-height: 100%;
  padding: 1rem;
  border: 1px solid rgba(233, 225, 199, 0.18);
  background: rgba(255, 255, 255, 0.03);
}

.token-grid h4,
.character-list h4 {
  margin: 0 0 0.45rem;
  color: #f3ffd1;
  font-family: var(--font-head);
  font-size: 1.12rem;
}

.token-grid p,
.character-list p {
  margin: 0;
  color: var(--paper-dim);
  font-size: 0.95rem;
}

.wide-figure {
  margin: 1.5rem 0 0;
  border: 1px solid rgba(233, 225, 199, 0.2);
  background: #090a08;
}

.wide-figure img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  object-position: center 34%;
  filter: sepia(0.18) contrast(1.03) saturate(0.86);
}

.timeline {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(233, 225, 199, 0.12);
}

.timeline span {
  color: var(--acid);
  font-family: var(--font-stamp);
  font-size: 0.82rem;
  font-weight: 400;
}

.timeline p {
  margin: 0;
}

.references ol {
  display: grid;
  gap: 0.85rem;
  margin: 1rem 0 0;
  padding-left: 1.4rem;
}

.references span {
  display: block;
  color: var(--paper-dim);
  font-size: 0.92rem;
}

.infobox-card {
  overflow: hidden;
  border: 1px solid rgba(200, 255, 0, 0.35);
  background: rgba(17, 19, 15, 0.92);
}

.infobox-title {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(200, 255, 0, 0.25);
}

.infobox-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.infobox-card dl {
  margin: 0;
}

.infobox-card div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.7rem;
  padding: 0.65rem 0.9rem;
  border-top: 1px solid rgba(233, 225, 199, 0.12);
}

.infobox-card dt {
  color: var(--paper-dim);
  font-family: var(--font-stamp);
  font-size: 0.76rem;
  font-weight: 400;
}

.infobox-card dd {
  margin: 0;
  color: #fff7dc;
  font-size: 0.9rem;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 2rem 1rem 3rem;
  color: var(--paper-dim);
  font-family: var(--font-stamp);
  font-size: 0.78rem;
  text-align: center;
}

.footer-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(233, 225, 199, 0.45);
  object-fit: cover;
}

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(200, 255, 0, 0.6);
  background: rgba(7, 8, 6, 0.86);
  color: var(--acid);
  cursor: pointer;
  opacity: 0;
  transform: translateY(0.5rem);
  transition: opacity 160ms ease, transform 160ms ease, background 160ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .article-layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .infobox {
    grid-column: 2;
    grid-row: 1;
  }

  .infobox-card {
    position: static;
    display: grid;
    grid-template-columns: 240px 1fr;
  }

  .infobox-title {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    justify-content: flex-start;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero h1 {
    font-size: 5.4rem;
  }

  .subtitle {
    font-size: 1.3rem;
  }

  .entry h2 {
    font-size: 3.4rem;
  }

  .article-section h3 {
    font-size: 1.55rem;
  }

  .article-layout,
  .token-banner {
    grid-template-columns: 1fr;
  }

  .toc,
  .infobox-card {
    position: static;
  }

  .toc {
    order: -2;
  }

  .infobox {
    order: -1;
  }

  .infobox-card {
    display: block;
  }

  .token-grid,
  .character-list {
    grid-template-columns: 1fr;
  }

  .token-copy h2 {
    font-size: 2.35rem;
  }
}

@media (max-width: 520px) {
  .brand-copy span {
    display: none;
  }

  .topnav a,
  .sound-toggle,
  .hero-actions a {
    min-height: 34px;
    padding: 0.4rem 0.62rem;
    font-size: 0.74rem;
  }

  .hero h1 {
    font-size: 3.45rem;
  }

  .entry h2 {
    font-size: 2.65rem;
  }

  .entry {
    padding: 1rem;
  }

  .stat-strip,
  .timeline li {
    grid-template-columns: 1fr;
  }

  .callout {
    grid-template-columns: 1fr;
  }
}
