:root {
  color-scheme: dark;
  --green: #34a784;
  --green-deep: #0d352d;
  --green-shadow: #09231f;
  --gold: #f0ce7a;
  --gold-soft: rgba(240, 206, 122, 0.14);
  --gold-line: rgba(240, 206, 122, 0.34);
  --ink: #050807;
  --surface: rgba(10, 20, 18, 0.78);
  --surface-strong: rgba(12, 27, 24, 0.92);
  --text: #f5efe3;
  --text-soft: #e1d8ca;
  --text-muted: #9ea79f;
  --line: rgba(245, 239, 227, 0.11);
  --line-soft: rgba(245, 239, 227, 0.06);
  --page: min(100% - 2rem, 88rem);
  --measure: min(100% - 2rem, 66rem);
  --shadow: 0 32px 90px rgba(0, 0, 0, 0.38);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(52, 167, 132, 0.18), transparent 28%),
    linear-gradient(180deg, #07110f 0%, #0c1715 46%, #050807 100%);
  color: var(--text);
  font-family: "IBM Plex Sans", sans-serif;
}

body[data-character] {
  --green: var(--character-primary, #34a784);
  --gold: var(--character-secondary, #f0ce7a);
  --gold-line: color-mix(in srgb, var(--character-secondary, #f0ce7a) 42%, transparent);
  background:
    linear-gradient(135deg, var(--character-glow, rgba(52, 167, 132, 0.18)), transparent 30%),
    linear-gradient(180deg, var(--character-surface, rgba(10, 20, 18, 0.78)) 0%, #050807 100%);
}

body[data-character] .article-shell {
  background:
    linear-gradient(135deg, var(--character-glow, rgba(52, 167, 132, 0.18)), transparent 30rem),
    var(--character-surface, rgba(7, 14, 13, 0.86));
}

body[data-character] .article-series,
body[data-character] .article-meta,
body[data-character] .archive-card__label,
body[data-character] .character-ledger dt {
  color: color-mix(in srgb, var(--character-secondary, var(--gold)) 78%, var(--text-muted));
}

body[data-character] .article-header h1 {
  color: var(--character-secondary, #f5efe3);
}

body[data-character] .archive-card,
body[data-character] .entry,
body[data-character] .character-ledger div {
  border-color: color-mix(in srgb, var(--character-primary, var(--green)) 36%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--character-primary, var(--green)) 18%, transparent), transparent 54%),
    color-mix(in srgb, var(--character-surface, rgba(9, 17, 16, 0.76)) 88%, #050807);
}

body[data-character] .text-link,
body[data-character] code {
  color: var(--character-accent, var(--green));
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 100% 96px, 96px 100%;
  opacity: 0.16;
  pointer-events: none;
}

.page-chrome {
  display: none;
}

a {
  color: inherit;
}

.site-header,
.page-shell,
.site-footer {
  width: var(--page);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(245, 239, 227, 0.08);
  background: rgba(5, 8, 7, 0.72);
  backdrop-filter: blur(18px);
}

.site-mark,
.site-nav a,
.eyebrow,
.panel-label,
.seal,
.overline,
.section-index,
.archive-card__label,
.entry-meta,
.article-meta,
.article-series,
.character-ledger dt,
.footnotes-title,
.unknown-link {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

.site-mark,
.site-nav a {
  font-size: 0.72rem;
  text-decoration: none;
}

.site-mark {
  color: var(--text);
  font-weight: 600;
}

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

.site-nav a {
  padding: 0.5rem 0.72rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: rgba(245, 239, 227, 0.68);
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  color: #f7eedf;
  border-color: rgba(240, 206, 122, 0.22);
  background: rgba(245, 239, 227, 0.06);
}

.page-shell {
  position: relative;
  margin-bottom: 2.5rem;
  background:
    linear-gradient(180deg, rgba(240, 206, 122, 0.08), transparent 18rem),
    linear-gradient(180deg, rgba(10, 27, 23, 0.74), rgba(7, 16, 14, 0.92));
  overflow: hidden;
}

.page-shell::before {
  display: none;
}

.hero {
  position: relative;
  min-height: calc(100svh - 5rem);
  padding: 2rem;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero::before {
  inset: 1rem;
  border: 1px solid rgba(30, 110, 94, 0.18);
}

.hero::after {
  inset: 1.8rem;
  border: 1px solid rgba(227, 196, 131, 0.1);
}

.hero-corners {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-corners span {
  position: absolute;
  width: 10rem;
  height: 10rem;
  border: 1px solid rgba(227, 196, 131, 0.14);
}

.hero-corners span::before,
.hero-corners span::after {
  content: "";
  position: absolute;
  inset: 0.65rem;
  border: 1px solid rgba(30, 110, 94, 0.18);
}

.hero-corners span::after {
  inset: 2rem;
  transform: rotate(45deg);
  border-color: rgba(227, 196, 131, 0.24);
}

.hero-corners .tl {
  top: 1.15rem;
  left: 1.15rem;
}

.hero-corners .br {
  right: 1.15rem;
  bottom: 1.15rem;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(17rem, 22rem);
  gap: 1.5rem;
}

.hero-panel,
.archive-card,
.entry,
.signal-panel,
.article-shell {
  position: relative;
  border: 1px solid rgba(245, 239, 227, 0.1);
  border-radius: 0;
  overflow: hidden;
}

.hero-panel::before,
.archive-card::before,
.entry::before,
.signal-panel::before,
.article-shell::before {
  display: none;
}

.hero-panel--primary {
  padding: 2.5rem 2.35rem 2rem;
  background:
    linear-gradient(135deg, rgba(52, 167, 132, 0.2), transparent 48%),
    rgba(10, 24, 21, 0.86);
}

.hero-panel--secondary {
  padding: 1.2rem;
  background:
    linear-gradient(135deg, rgba(240, 206, 122, 0.12), transparent 50%),
    rgba(8, 16, 15, 0.82);
}

.eyebrow,
.panel-label,
.archive-card__label,
.entry-meta,
.article-meta,
.article-series,
.footnotes-title {
  margin: 0 0 0.85rem;
  color: color-mix(in srgb, var(--gold) 72%, var(--text-muted));
  font-size: 0.72rem;
}

.seal {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2rem;
  padding: 0 0.7rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(240, 206, 122, 0.32);
  border-radius: 999px;
  background: rgba(240, 206, 122, 0.1);
  color: #f2e7d2;
  font-size: 0.72rem;
}

.seal::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 0.18rem rgba(227, 196, 131, 0.14);
}

.overline {
  margin: 0 0 1rem;
  color: color-mix(in srgb, var(--gold) 72%, var(--text-muted));
  font-size: 0.72rem;
}

h1,
h2,
h3,
h4,
p,
dl,
dt,
dd,
blockquote,
ul,
ol {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
}

h2,
h3,
h4,
.section-head h1 {
  font-variant-caps: small-caps;
  letter-spacing: 0.04em;
}

.hero h1 {
  max-width: 8ch;
  color: #f2ecdf;
  font-size: clamp(4.2rem, 8vw, 7rem);
  line-height: 0.86;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.subtitle {
  max-width: 11ch;
  margin-top: 1rem;
  color: #e3dbcf;
  font-family: "EB Garamond", serif;
  font-size: clamp(1.35rem, 2.3vw, 1.8rem);
  line-height: 1.1;
}

.lede {
  max-width: 34rem;
  margin-top: 1.1rem;
  color: rgba(231, 228, 222, 0.74);
  line-height: 1.78;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.7rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(240, 206, 122, 0.34);
  border-radius: 999px;
  background: rgba(240, 206, 122, 0.12);
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease,
    color 160ms ease;
}

.button--ghost {
  border-color: rgba(245, 239, 227, 0.2);
  background: rgba(245, 239, 227, 0.05);
}

.button:hover,
.button:focus-visible,
.site-nav a:focus-visible,
.entry:focus-visible,
.signal-panel:focus-visible,
.text-link:focus-visible,
.site-mark:focus-visible {
  background: var(--green);
  border-color: var(--green);
  color: #f4f7f6;
  transform: translateY(-1px);
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.ledger {
  margin-top: 0.9rem;
}

.ledger div {
  padding: 0.85rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ledger div:first-child {
  padding-top: 0;
  border-top: 0;
}

.ledger dt {
  color: color-mix(in srgb, var(--gold) 68%, var(--text-muted));
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.ledger dd {
  margin-top: 0.35rem;
  color: var(--text-soft);
  line-height: 1.5;
}

.section {
  padding: 1.2rem 2rem 0;
}

.section--frontmatter {
  padding-top: 2rem;
}

.section-head {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 1rem;
  align-items: start;
  padding-top: 1.35rem;
  border-top: 1px solid rgba(245, 239, 227, 0.14);
}

.section-index {
  padding-top: 0.22rem;
  color: color-mix(in srgb, var(--gold) 72%, var(--green) 18%);
  font-size: 0.84rem;
}

.section-head h1,
.section-head h2 {
  font-size: clamp(1.95rem, 4vw, 3rem);
  line-height: 0.96;
}

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

.frontmatter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 24rem);
  gap: 1rem;
  margin-top: 1rem;
}

.archive-card {
  padding: 1.15rem;
  background:
    linear-gradient(135deg, rgba(52, 167, 132, 0.13), transparent 42%),
    var(--surface);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.18);
}

.archive-card h3 {
  margin-top: 0.25rem;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  line-height: 1;
}

.archive-card--frontmatter {
  padding: 1.35rem 1.2rem 1.2rem;
}

.archive-card--frontmatter .subtitle {
  max-width: 20ch;
  margin-top: 0.55rem;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 0.98;
  color: #f2ecdf;
}

.archive-card--frontmatter p:not(.archive-card__label):not(.overline):not(.subtitle) {
  max-width: 38rem;
  color: rgba(231, 228, 222, 0.8);
}

.archive-card--register {
  padding: 1.15rem 1rem;
}

.archive-card p:last-child {
  color: rgba(231, 228, 222, 0.74);
  line-height: 1.68;
}

.card-action {
  margin-top: 1rem;
}

.archive-grid--series {
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

.archive-grid--support {
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

.shelf-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.shelf-card {
  position: relative;
  min-height: 11.5rem;
  padding: 1rem;
  border: 1px solid rgba(245, 239, 227, 0.1);
  background:
    linear-gradient(145deg, rgba(52, 167, 132, 0.14), transparent 54%),
    rgba(9, 18, 17, 0.78);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.shelf-card::before {
  display: none;
}

.shelf-card h3 {
  margin-top: 0.2rem;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1;
}

.shelf-card p:last-child {
  margin-top: 0.75rem;
  color: rgba(231, 228, 222, 0.74);
  line-height: 1.58;
}

.shelf-card:hover,
.shelf-card:focus-visible {
  border-color: rgba(227, 196, 131, 0.34);
  background:
    linear-gradient(180deg, rgba(227, 196, 131, 0.11), transparent 20%),
    linear-gradient(180deg, rgba(30, 110, 94, 0.2), rgba(8, 16, 15, 0.94));
  transform: translateY(-2px);
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.series-title-link {
  text-decoration: none;
  border-bottom: 1px solid rgba(227, 196, 131, 0.34);
}

.entry-list {
  margin-top: 1rem;
}

.archive-note {
  max-width: 48rem;
  color: var(--text-muted);
}

.start-here-note {
  max-width: 48rem;
  margin-top: 0.85rem;
  margin-bottom: 1.1rem;
  padding: 0.8rem 0.95rem;
  border-left: 2px solid rgba(227, 196, 131, 0.4);
  background:
    linear-gradient(180deg, rgba(227, 196, 131, 0.04), transparent 55%),
    rgba(12, 19, 18, 0.72);
  color: var(--text-soft);
  line-height: 1.65;
}

.start-here-note a {
  color: #f4ead8;
  border-bottom: 1px solid rgba(227, 196, 131, 0.36);
  text-decoration: none;
}

.start-here-note a:hover,
.start-here-note a:focus-visible {
  color: var(--gold);
  border-bottom-color: rgba(227, 196, 131, 0.62);
}

.archive-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1.35rem 0 1rem;
}

.archive-filter-status {
  margin: -0.25rem 0 1rem;
  color: color-mix(in srgb, var(--gold) 50%, var(--text-muted));
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.archive-filter {
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(245, 239, 227, 0.14);
  border-radius: 999px;
  background: rgba(245, 239, 227, 0.05);
  color: var(--text-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.73rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.archive-filter:hover,
.archive-filter:focus-visible,
.archive-filter.is-active {
  border-color: rgba(240, 206, 122, 0.46);
  color: #f4ead8;
  background: rgba(52, 167, 132, 0.24);
  transform: translateY(-1px);
}

.entry {
  display: block;
  padding: 1.15rem;
  margin-top: 1rem;
  background:
    linear-gradient(135deg, rgba(240, 206, 122, 0.1), transparent 42%),
    rgba(9, 17, 16, 0.76);
  text-decoration: none;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.entry:hover,
.entry:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(240, 206, 122, 0.28);
}

.entry h3 {
  margin-top: 0.35rem;
  font-size: clamp(1.45rem, 2.3vw, 2.1rem);
  line-height: 1;
}

.entry-summary {
  max-width: 42rem;
  margin-top: 0.45rem;
  color: rgba(231, 228, 222, 0.74);
  line-height: 1.65;
}

.entry-intent,
.series-note {
  max-width: 42rem;
  margin-top: 0.55rem;
  color: color-mix(in srgb, var(--gold) 56%, var(--text-muted));
  font-size: 0.82rem;
  line-height: 1.55;
}

.entry[hidden] {
  display: none;
}

.entry-empty {
  margin-top: 1.4rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(245, 239, 227, 0.12);
  background: rgba(13, 19, 18, 0.72);
  color: var(--text-muted);
}

.series-group + .series-group {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(245, 239, 227, 0.12);
}

.series-entry-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.series-entry {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(245, 239, 227, 0.14);
  border-radius: 999px;
  background: rgba(245, 239, 227, 0.05);
  color: var(--text-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.series-entry:hover,
.series-entry:focus-visible {
  border-color: rgba(240, 206, 122, 0.36);
  color: #f4ead8;
}

.signal-panel {
  --beam-y: 50%;
  margin-top: 1rem;
  background:
    linear-gradient(135deg, rgba(52, 167, 132, 0.14), transparent 54%),
    rgba(7, 15, 14, 0.76);
}

.signal-beam {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--beam-y) - 30px);
  height: 60px;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(227, 196, 131, 0.04) 24%,
    rgba(227, 196, 131, 0.15) 48%,
    rgba(30, 110, 94, 0.08) 62%,
    transparent
  );
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.signal-panel.is-active .signal-beam,
.signal-panel:focus-visible .signal-beam {
  opacity: 1;
}

.signal-list {
  list-style: none;
  margin: 0;
  padding: 0.65rem 0;
}

.signal-list li {
  position: relative;
  padding: 0.95rem 1rem 0.95rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.signal-list li:first-child {
  border-top: 0;
}

.signal-list li::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 1.45rem;
  width: 0.42rem;
  height: 0.42rem;
  border: 1px solid var(--gold);
  background: rgba(227, 196, 131, 0.22);
}

.article-page {
  width: var(--page);
  margin: 0 auto 2.5rem;
}

.article-shell {
  background:
    linear-gradient(135deg, rgba(52, 167, 132, 0.14), transparent 34rem),
    rgba(7, 14, 13, 0.86);
}

.article-inner {
  width: min(100% - 2rem, 68rem);
  margin-inline: auto;
  padding: 2.4rem 0 2.6rem;
}

.article-header {
  padding: 1.6rem 0 1.7rem;
  border-bottom: 1px solid rgba(245, 239, 227, 0.14);
}

.article-header h1 {
  max-width: 18ch;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: clamp(2.9rem, 7vw, 6.4rem);
  font-weight: 600;
  line-height: 0.93;
  letter-spacing: 0;
}

.article-intro {
  max-width: 46rem;
  margin-top: 1rem;
  color: rgba(231, 228, 222, 0.74);
  line-height: 1.72;
  font-size: 1.02rem;
}

.character-header h1 {
  max-width: 18ch;
}

.character-portrait {
  max-width: 30rem;
  margin: 1.4rem 0 0;
}

.character-portrait img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid color-mix(in srgb, var(--character-primary, var(--green)) 34%, transparent);
  background: color-mix(in srgb, var(--character-surface, rgba(9, 17, 16, 0.76)) 88%, #050807);
}

.character-portrait figcaption {
  margin-top: 0.55rem;
  color: rgba(231, 228, 222, 0.62);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.76rem;
  line-height: 1.45;
}

.character-ledger {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  max-width: 42rem;
  margin: 1.25rem 0 0;
}

.character-ledger div {
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(245, 239, 227, 0.12);
  background: rgba(245, 239, 227, 0.045);
}

.character-ledger dt {
  margin-bottom: 0.35rem;
  color: color-mix(in srgb, var(--gold) 70%, var(--text-muted));
  font-size: 0.66rem;
}

.character-ledger dd {
  margin: 0;
  color: #f4ead8;
  line-height: 1.45;
}

.article-body {
  padding: 1.8rem 0 0;
  color: var(--text-soft);
  font-size: 1.06rem;
  line-height: 1.82;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  margin-top: 1.8rem;
  margin-bottom: 0.7rem;
  color: #f2ecdf;
  line-height: 1.05;
  font-weight: 600;
}

.article-body h2 {
  font-size: clamp(2rem, 4vw, 2.9rem);
}

.article-body h3 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body blockquote {
  margin-bottom: 1.2rem;
}

.article-body .article-inscription {
  position: relative;
  margin: 0 0 1.9rem;
  padding: 1rem 1.2rem 1.05rem;
  color: var(--gold);
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(0.78rem, 1.2vw, 0.92rem);
  line-height: 1.88;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-top: 1px solid rgba(240, 206, 122, 0.24);
  border-bottom: 1px solid rgba(240, 206, 122, 0.16);
  background: rgba(240, 206, 122, 0.045);
}

.article-body .article-inscription__attribution {
  display: block;
  margin-top: 0.55rem;
  color: color-mix(in srgb, var(--gold) 62%, var(--text-muted));
}

.article-body .article-inscription::before,
.article-body .article-inscription::after {
  display: none;
}

.article-body .article-inscription::before {
  top: 0.35rem;
}

.article-body .article-inscription::after {
  bottom: 0.35rem;
}

.article-body ul,
.article-body ol {
  padding-left: 1.2rem;
}

.article-body li + li {
  margin-top: 0.45rem;
}

.article-body .standalone-label {
  margin-bottom: 0.55rem;
  color: #f2ecdf;
  font-size: 1.02rem;
}

.article-body .list-note {
  margin: 0.4rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-style: italic;
}

.article-body li > ul,
.article-body li > ol {
  margin-top: 0.6rem;
}

.article-body blockquote {
  padding: 0.8rem 1rem;
  border-left: 2px solid var(--gold);
  background: rgba(227, 196, 131, 0.06);
  color: var(--text);
  font-family: "EB Garamond", serif;
  font-size: 1.2rem;
  line-height: 1.5;
}

.article-body code {
  padding: 0.08rem 0.28rem;
  background: rgba(227, 196, 131, 0.1);
  border: 1px solid rgba(227, 196, 131, 0.14);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9em;
}

.article-body hr {
  border: 0;
  border-top: 1px solid rgba(227, 196, 131, 0.22);
  margin: 1.7rem 0;
}

.article-body strong {
  color: #f2ecdf;
}

.article-body a,
.text-link {
  color: #f2e7d2;
  text-decoration: none;
  border-bottom: 1px solid rgba(227, 196, 131, 0.5);
}

.footnote-ref {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  min-height: 1.55rem;
  margin: 0 0.12rem;
  padding: 0 0.35rem;
  border: 1px solid rgba(227, 196, 131, 0.34);
  background: rgba(227, 196, 131, 0.08);
  color: #f2e7d2;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  line-height: 1;
  vertical-align: super;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  border-bottom: 0;
}

.footnote-ref:hover,
.footnote-ref:focus-visible {
  background: rgba(227, 196, 131, 0.16);
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.unknown-link {
  color: color-mix(in srgb, var(--gold) 48%, var(--text-muted));
  font-size: 0.72rem;
}

.article-body .footnotes {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(227, 196, 131, 0.22);
}

.article-body .protocol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
  margin: 1.4rem 0 1.8rem;
}

.article-body .protocol-card {
  margin: 0;
}

.article-body .protocol-card h3 {
  margin-top: 0.3rem;
  margin-bottom: 0.65rem;
}

.article-body .protocol-card p {
  margin-bottom: 0;
}

.article-body .protocol-nav,
.article-body .shelf-map {
  display: grid;
  gap: 0.55rem;
  margin: 1.25rem 0 1.8rem;
}

.article-body .protocol-nav {
  grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
}

.article-body .shelf-map {
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
}

.article-body .protocol-nav a,
.article-body .shelf-map a {
  display: grid;
  gap: 0.25rem;
  min-height: 5.6rem;
  padding: 0.75rem 0.8rem;
  border: 1px solid rgba(227, 196, 131, 0.18);
  background: rgba(227, 196, 131, 0.045);
  color: var(--text);
  text-decoration: none;
}

.article-body .protocol-nav a:hover,
.article-body .protocol-nav a:focus-visible,
.article-body .shelf-map a:hover,
.article-body .shelf-map a:focus-visible,
.article-body .protocol-nav a[aria-current="page"] {
  border-color: rgba(227, 196, 131, 0.52);
  background: rgba(227, 196, 131, 0.09);
}

.article-body .protocol-nav span,
.article-body .shelf-map span {
  color: #f2e7d2;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-body .protocol-nav small,
.article-body .shelf-map small {
  color: var(--text-muted);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.82rem;
  line-height: 1.45;
}

.article-body .article-aside,
.article-body .article-protocol,
.article-body .article-signal {
  margin: 1.4rem 0 1.8rem;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(227, 196, 131, 0.16);
  background:
    linear-gradient(180deg, rgba(227, 196, 131, 0.04), transparent 40%),
    linear-gradient(180deg, rgba(16, 34, 29, 0.88), rgba(10, 18, 16, 0.92));
}

.article-body .article-aside p:last-child,
.article-body .article-protocol p:last-child,
.article-body .article-signal p:last-child {
  margin-bottom: 0;
}

.article-body .article-aside {
  border-left: 2px solid rgba(227, 196, 131, 0.48);
}

.article-body .article-protocol {
  border-top: 1px solid rgba(227, 196, 131, 0.28);
}

.article-body .article-signal ul,
.article-body .article-protocol ul,
.article-body .article-aside ul {
  margin: 0.8rem 0 0;
}

.article-body .article-tail {
  display: grid;
  gap: 0.9rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(227, 196, 131, 0.22);
}

.article-tail-label {
  margin: 0 0 0.45rem;
  color: color-mix(in srgb, var(--gold) 62%, var(--text-muted));
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-tail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.article-tail-link {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(227, 196, 131, 0.16);
  color: #f2e7d2;
  text-decoration: none;
  border-bottom: 0;
  background: rgba(13, 22, 20, 0.82);
}

.placeholder-block {
  color: color-mix(in srgb, var(--text-soft) 68%, var(--gold) 18%);
  font-style: italic;
}

.article-body .scaffold-stack {
  display: grid;
  gap: 0.9rem;
  margin: 1rem 0 1.6rem;
}

.scaffold-panel {
  position: relative;
  padding: 1rem 1rem 1rem 1.2rem;
  border: 1px solid rgba(227, 196, 131, 0.16);
  background:
    linear-gradient(180deg, rgba(227, 196, 131, 0.04), transparent 40%),
    linear-gradient(180deg, rgba(30, 110, 94, 0.08), rgba(9, 18, 16, 0.88));
}

.scaffold-panel::before {
  content: "";
  position: absolute;
  top: 0.75rem;
  bottom: 0.75rem;
  left: 0.55rem;
  width: 1px;
  background: linear-gradient(180deg, rgba(227, 196, 131, 0.6), rgba(30, 110, 94, 0.4));
}

.scaffold-panel__label {
  margin: 0 0 0.45rem;
  color: color-mix(in srgb, var(--gold) 72%, var(--text-muted));
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.article-body .footnotes ol {
  margin: 0.8rem 0 0;
}

.footnote-popup {
  position: fixed;
  z-index: 20;
  max-width: min(26rem, calc(100vw - 1.5rem));
  padding: 0.9rem 1rem;
  border: 1px solid rgba(227, 196, 131, 0.34);
  background:
    linear-gradient(180deg, rgba(227, 196, 131, 0.08), rgba(30, 110, 94, 0.12)),
    rgba(8, 15, 14, 0.98);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.45);
  color: var(--text-soft);
}

.footnote-popup[hidden] {
  display: none;
}

.footnote-popup::before {
  content: "";
  position: absolute;
  inset: 0.55rem;
  border: 1px solid rgba(227, 196, 131, 0.08);
  pointer-events: none;
}

.footnote-popup__label {
  margin: 0 0 0.45rem;
  color: color-mix(in srgb, var(--gold) 68%, var(--text-muted));
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.footnote-popup__body {
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
  line-height: 1.65;
}

.site-footer {
  padding: 0 0 2.5rem;
  color: var(--text-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .hero-grid,
  .archive-grid,
  .shelf-map {
    grid-template-columns: 1fr;
  }

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

  .hero h1 {
    max-width: none;
  }

  .subtitle {
    max-width: 16ch;
  }

  .character-ledger {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --page: min(100% - 1rem, 86rem);
    --measure: min(100% - 1rem, 66rem);
  }

  body::before {
    inset: 0.35rem;
  }

  .page-chrome {
    inset: 0.75rem;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero,
  .section {
    padding-inline: 1rem;
  }

  .hero {
    min-height: auto;
    padding-top: 1.25rem;
  }

  .section-head {
    grid-template-columns: 1fr;
  }

  .site-nav {
    gap: 0.7rem;
  }

  .hero-panel--primary,
  .hero-panel--secondary,
  .entry,
  .archive-card {
    padding: 1rem;
  }

  .hero h1 {
    font-size: clamp(3rem, 14vw, 5rem);
  }

  .subtitle {
    max-width: none;
  }

  .article-inner {
    width: min(100% - 1rem, 68rem);
  }

  .article-header,
  .article-body {
    padding-inline: 1rem;
  }

  .footnote-popup {
    left: 0.75rem !important;
    right: 0.75rem;
    bottom: 0.75rem;
    top: auto !important;
    max-width: none;
  }

  .article-header h1 {
    max-width: none;
    font-size: clamp(2.35rem, 10vw, 4rem);
  }

  .archive-filter,
  .series-entry {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .hero-corners span {
    width: 6rem;
    height: 6rem;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
