:root {
  --ink: #070609;
  --ink-2: #101016;
  --ink-3: #171018;
  --paper: #e2d0a3;
  --paper-dark: #b9945a;
  --bone: #f5ead2;
  --ash: rgba(245, 234, 210, 0.72);
  --gold: #d0a54a;
  --red: #9f2a2c;
  --red-deep: #5e151b;
  --teal: #2f6159;
  --violet: #443257;
  --line: rgba(245, 234, 210, 0.16);
  --paper-line: rgba(22, 14, 14, 0.18);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.52);
  --torn-edge-clearance: 46px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--bone);
  background:
    linear-gradient(90deg, rgba(245, 234, 210, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(245, 234, 210, 0.02) 1px, transparent 1px),
    radial-gradient(circle at 10% 8%, rgba(159, 42, 44, 0.34), transparent 28rem),
    radial-gradient(circle at 92% 12%, rgba(208, 165, 74, 0.18), transparent 26rem),
    radial-gradient(circle at 60% 62%, rgba(68, 50, 87, 0.42), transparent 34rem),
    var(--ink);
  background-size: 36px 36px, 36px 36px, auto, auto, auto, auto;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body:before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 7px),
    radial-gradient(circle at 50% 50%, transparent 0 42%, rgba(0, 0, 0, 0.52));
  mix-blend-mode: screen;
}

body:after {
  content: "";
  position: fixed;
  inset: -8%;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(7, 6, 9, 0.2), rgba(7, 6, 9, 0.2)),
    url("assets/occult-plates.png");
  background-size: auto, 980px 980px;
  background-position: center top;
  opacity: 0.08;
  filter: grayscale(0.8) contrast(1.35);
}

a {
  color: inherit;
}

button,
a,
summary {
  -webkit-tap-highlight-color: transparent;
}

.site-shell {
  width: min(1460px, 100%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 48px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 6, 9, 0.86);
  backdrop-filter: blur(16px);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--bone);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  text-decoration: none;
}

.aletheion-return {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid rgba(208, 165, 74, 0.42);
  color: var(--gold);
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}

.aletheion-return:hover,
.aletheion-return:focus-visible {
  border-color: rgba(244, 229, 199, 0.72);
  color: var(--bone);
}

.brand-sigil {
  position: relative;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(208, 165, 74, 0.78);
  transform: rotate(45deg);
}

.brand-sigil:before,
.brand-sigil:after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(208, 165, 74, 0.54);
  border-radius: 50%;
}

.brand-sigil:after {
  inset: 14px;
  background: var(--red);
  box-shadow: 0 0 20px rgba(159, 42, 44, 0.7);
}

.side-nav {
  position: fixed;
  right: 18px;
  top: 88px;
  bottom: auto;
  z-index: 45;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 202px;
  max-height: calc(100vh - 112px);
  overflow: hidden;
  border: 1px solid rgba(245, 234, 210, 0.15);
  background:
    linear-gradient(135deg, rgba(159, 42, 44, 0.12), transparent 36%),
    rgba(8, 7, 10, 0.92);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(14px);
}

.side-nav-toggle {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  padding: 0 16px;
  border: 0;
  border-bottom: 1px solid rgba(245, 234, 210, 0.13);
  color: var(--bone);
  background: rgba(245, 234, 210, 0.06);
  cursor: pointer;
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.side-nav-toggle-icon,
.side-nav-toggle-icon:before,
.side-nav-toggle-icon:after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--gold);
  transition: transform 160ms ease, opacity 160ms ease;
}

.side-nav-toggle-icon {
  position: relative;
}

.side-nav-toggle-icon:before,
.side-nav-toggle-icon:after {
  content: "";
  position: absolute;
  left: 0;
}

.side-nav-toggle-icon:before {
  top: -6px;
}

.side-nav-toggle-icon:after {
  top: 6px;
}

.side-nav.is-nav-open .side-nav-toggle-icon {
  transform: rotate(45deg);
}

.side-nav.is-nav-open .side-nav-toggle-icon:before {
  opacity: 0;
}

.side-nav.is-nav-open .side-nav-toggle-icon:after {
  top: 0;
  transform: rotate(-90deg);
}

.nav-links {
  display: grid;
  align-content: start;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: max-height 180ms ease, opacity 160ms ease;
}

.side-nav.is-nav-open .nav-links {
  max-height: 100%;
  overflow-y: auto;
  opacity: 1;
  pointer-events: auto;
}

.site-map-title {
  padding: 16px 16px 10px;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  line-height: 1;
}

.nav-links a,
.nav-links button {
  position: relative;
  display: block;
  width: 100%;
  padding: 11px 16px;
  border: 0;
  border-top: 1px solid rgba(245, 234, 210, 0.08);
  color: rgba(245, 234, 210, 0.74);
  background: transparent;
  cursor: pointer;
  font-family: "Courier New", monospace;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0;
  text-align: left;
  text-decoration: none;
  text-transform: uppercase;
}

.nav-links a.is-active,
.nav-links a:hover,
.nav-links button:hover {
  color: var(--gold);
  background: rgba(245, 234, 210, 0.06);
}

.nav-links a.is-active:after {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--red);
}

.section-frame {
  position: relative;
  width: min(1360px, calc(100% - 28px));
  margin: 0 auto;
  padding: 70px 0;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: 0;
}

h1 {
  font-size: 7.2rem;
  line-height: 0.82;
  text-transform: uppercase;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.28);
}

h1 span {
  display: block;
}

h1 span:first-child {
  color: rgba(245, 234, 210, 0.8);
  font-size: 0.46em;
}

h2 {
  font-size: 4rem;
  line-height: 0.95;
}

h3 {
  font-size: 2rem;
  line-height: 1;
}

p {
  line-height: 1.68;
}

.field-label {
  margin: 0 0 14px;
  color: var(--gold);
  font-family: "Courier New", monospace;
  font-size: 0.86rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero {
  min-height: 720px;
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(520px, 1.1fr);
  gap: 44px;
  align-items: stretch;
  margin-top: 18px;
  padding: 54px;
  overflow: hidden;
  border: 1px solid rgba(245, 234, 210, 0.16);
  background:
    linear-gradient(90deg, rgba(7, 6, 9, 0.98) 0 42%, rgba(7, 6, 9, 0.68) 58%, rgba(7, 6, 9, 0.22) 100%),
    radial-gradient(circle at 16% 82%, rgba(159, 42, 44, 0.3), transparent 20rem),
    var(--ink);
  box-shadow: var(--shadow);
}

.hero:before {
  content: "";
  position: absolute;
  left: -90px;
  bottom: -105px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 43% 43%, transparent 0 48px, rgba(226, 208, 163, 0.92) 49px 52px, transparent 53px),
    radial-gradient(circle at 50% 50%, rgba(226, 208, 163, 0.42), transparent 72px),
    #191011;
  opacity: 0.78;
}

.hero-copy {
  position: relative;
  z-index: 8;
  align-self: center;
}

.hero-subtitle {
  max-width: 620px;
  margin: 28px 0 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.42rem;
  line-height: 1.35;
}

.hero-lede {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--ash);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button-primary,
.button-secondary {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid rgba(245, 234, 210, 0.24);
  color: var(--ink);
  background: var(--paper);
  cursor: pointer;
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 8px 8px 0 rgba(159, 42, 44, 0.55);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button-secondary {
  color: var(--bone);
  background: rgba(245, 234, 210, 0.07);
  box-shadow: none;
}

.button-primary:hover,
.button-secondary:hover,
.filter-button:hover {
  transform: translateY(-2px);
}

.button-primary:focus-visible,
.button-secondary:focus-visible,
.filter-button:focus-visible,
.nav-links a:focus-visible,
.nav-links button:focus-visible,
.side-nav-toggle:focus-visible,
.warning-x:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.hero-board,
.accusation-board,
.cave-panel {
  position: relative;
  min-height: 560px;
  filter: drop-shadow(0 28px 90px rgba(0, 0, 0, 0.55));
}

.plate-crop {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(245, 234, 210, 0.22);
  background-image: url("assets/occult-plates.png");
  background-size: 200% 200%;
  background-repeat: no-repeat;
  box-shadow: var(--shadow);
}

.plate-crop:after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 18%),
    radial-gradient(circle at 50% 50%, transparent 0 48%, rgba(0, 0, 0, 0.54));
}

.plate-firmament {
  background-position: left top;
  clip-path: polygon(5% 0, 100% 0, 99% 91%, 82% 96%, 60% 92%, 41% 100%, 17% 96%, 0 82%, 4% 56%, 0 30%);
}

.plate-mandala {
  background-position: right top;
  clip-path: polygon(0 5%, 9% 0, 33% 3%, 52% 0, 75% 4%, 100% 0, 98% 96%, 83% 100%, 63% 96%, 36% 100%, 12% 96%, 0 100%);
}

.plate-cave {
  background-position: right bottom;
  clip-path: polygon(1% 0, 25% 4%, 47% 0, 71% 3%, 99% 1%, 100% 92%, 86% 100%, 56% 96%, 36% 100%, 9% 95%, 0 100%);
}

.paperclip {
  position: absolute;
  z-index: 4;
  left: 22px;
  top: 18px;
  width: 60px;
  height: 112px;
  border: 5px solid rgba(208, 165, 74, 0.72);
  border-bottom-color: transparent;
  border-radius: 28px 28px 0 0;
  transform: rotate(-13deg);
}

.red-thread {
  position: absolute;
  z-index: 6;
  height: 2px;
  background: var(--red);
  box-shadow: 0 0 0 1px rgba(159, 42, 44, 0.2), 0 0 26px rgba(159, 42, 44, 0.48);
  transform-origin: left center;
}

.thread-hero {
  left: -52%;
  top: 58%;
  width: 148%;
  transform: rotate(-6deg);
}

.scrap {
  position: relative;
  color: #171014;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.35), transparent 28%),
    var(--paper);
  border: 1px solid rgba(30, 22, 18, 0.22);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
}

.scrap:before,
.chapter-page:before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(30, 22, 18, 0.055) 0 1px, transparent 1px 9px),
    radial-gradient(circle at 18% 12%, rgba(159, 42, 44, 0.14), transparent 8rem);
  mix-blend-mode: multiply;
}

.hero-note {
  position: absolute;
  right: -12px;
  bottom: 28px;
  z-index: 9;
  width: 250px;
  padding: 20px;
  transform: rotate(-4deg);
}

.hero-note strong,
.hero-note span,
.warning-note strong,
.warning-note span,
.margin-note strong,
.margin-note span {
  display: block;
}

.hero-note span,
.warning-note span,
.margin-note span {
  margin-top: 8px;
  font-family: "Courier New", monospace;
  font-size: 0.92rem;
  line-height: 1.45;
}

.warning-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 180ms ease;
}

.warning-modal[aria-hidden="true"] {
  opacity: 0;
  pointer-events: none;
}

.warning-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 34%, rgba(159, 42, 44, 0.28), transparent 26rem),
    rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
}

.warning-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  width: min(760px, 100%);
  max-height: min(720px, calc(100vh - 44px));
  overflow: auto;
  padding: 38px;
  border: 1px solid rgba(245, 234, 210, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(245, 234, 210, 0.045), transparent 42%),
    rgba(11, 12, 17, 0.98);
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.74);
}

.warning-x {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(245, 234, 210, 0.22);
  border-radius: 6px;
  background: rgba(245, 234, 210, 0.05);
  cursor: pointer;
}

.warning-x:before,
.warning-x:after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 18px;
  height: 2px;
  background: var(--gold);
}

.warning-x:before {
  transform: rotate(45deg);
}

.warning-x:after {
  transform: rotate(-45deg);
}

.warning-heading {
  max-width: 620px;
  padding-right: 52px;
}

.warning-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(159, 42, 44, 0.52);
  border-radius: 999px;
  color: #f0b6a1;
  background: rgba(159, 42, 44, 0.16);
  font-family: "Courier New", monospace;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.warning-heading h2 {
  margin-top: 16px;
  color: var(--bone);
}

.warning-copy {
  max-width: 660px;
  padding: 0;
}

.warning-copy p {
  margin: 0 0 14px;
  color: rgba(245, 234, 210, 0.74);
  font-size: 0.98rem;
  line-height: 1.64;
}

.warning-copy p:last-child {
  margin-bottom: 0;
}

.warning-note {
  max-width: 660px;
  padding: 16px 18px;
  border: 1px solid rgba(208, 165, 74, 0.24);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  color: rgba(245, 234, 210, 0.82);
  background: rgba(245, 234, 210, 0.055);
}

.warning-note span {
  color: rgba(245, 234, 210, 0.7);
}

.warning-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-start;
  padding-top: 8px;
}

body.modal-open {
  overflow: hidden;
}

.first-accusation {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(420px, 1.08fr);
  gap: 52px;
  align-items: center;
}

.accusation-copy {
  position: relative;
  z-index: 2;
  padding: 38px;
  border-left: 2px solid var(--red);
  background: linear-gradient(90deg, rgba(159, 42, 44, 0.12), transparent 70%);
}

.accusation-copy p {
  color: var(--ash);
  font-size: 1.08rem;
}

blockquote {
  margin: 28px 0;
  padding: 22px 24px;
  color: var(--paper);
  border-top: 1px solid rgba(208, 165, 74, 0.38);
  border-bottom: 1px solid rgba(208, 165, 74, 0.38);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  line-height: 1.32;
}

.margin-note {
  position: absolute;
  z-index: 5;
  left: -24px;
  bottom: 44px;
  width: 240px;
  padding: 20px;
  transform: rotate(-5deg);
}

.section-title {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(260px, 0.22fr);
  gap: 24px;
  align-items: end;
  margin-bottom: 34px;
}

.section-title .field-label {
  grid-column: 1 / -1;
}

.section-title p:not(.field-label) {
  max-width: 720px;
  margin: 0;
  color: var(--ash);
}

.essay {
  padding-top: 44px;
}

.reader-arc {
  position: relative;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  margin: 22px 0;
  padding: 22px;
  border: 1px solid rgba(245, 234, 210, 0.13);
  background:
    linear-gradient(130deg, rgba(159, 42, 44, 0.13), transparent 36%),
    rgba(12, 10, 14, 0.78);
  box-shadow: var(--shadow);
}

.reader-arc:before {
  content: "";
  position: absolute;
  left: 282px;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: linear-gradient(var(--red), rgba(159, 42, 44, 0));
  box-shadow: 0 0 20px rgba(159, 42, 44, 0.4);
}

.arc-header {
  position: sticky;
  top: 96px;
  align-self: start;
  min-height: 230px;
  padding: 24px;
  border: 1px solid rgba(208, 165, 74, 0.24);
  background:
    radial-gradient(circle at 80% 12%, rgba(208, 165, 74, 0.12), transparent 8rem),
    rgba(7, 6, 9, 0.84);
}

.arc-header span {
  display: block;
  margin-bottom: 18px;
  color: var(--red);
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.arc-header h3 {
  color: var(--gold);
}

.arc-header p {
  color: var(--ash);
  font-size: 0.98rem;
}

.chapter-page {
  position: relative;
  grid-column: 2;
  margin: 0 0 14px;
  padding-block-end: calc(var(--torn-edge-clearance) * 0.7);
  color: #171014;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.32), transparent 28%),
    var(--paper);
  border: 1px solid rgba(30, 22, 18, 0.22);
  clip-path: polygon(0 4%, 8% 1%, 18% 3%, 29% 0, 43% 2%, 61% 0, 76% 3%, 91% 1%, 100% 5%, 99% 97%, 88% 99%, 72% 98%, 54% 100%, 35% 98%, 18% 99%, 1% 97%);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.36);
  transform: rotate(var(--tilt, -0.2deg));
}

.chapter-page:nth-of-type(even) {
  --tilt: 0.3deg;
}

.chapter-page:nth-of-type(3n) {
  --tilt: -0.4deg;
}

.chapter-page[open] {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.38), transparent 25%),
    radial-gradient(circle at 84% 18%, rgba(159, 42, 44, 0.12), transparent 9rem),
    var(--paper);
}

.chapter-page summary {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 72px;
  gap: 16px;
  align-items: center;
  min-height: 84px;
  padding: 20px 24px;
  cursor: pointer;
  list-style: none;
}

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

.chapter-number {
  color: var(--red);
  font-family: "Courier New", monospace;
  font-size: 1.18rem;
  font-weight: 700;
}

.chapter-title {
  color: #161016;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.72rem;
  line-height: 1.1;
}

.chapter-toggle {
  display: inline-grid;
  min-height: 32px;
  place-items: center;
  border: 1px solid rgba(159, 42, 44, 0.42);
  color: var(--red);
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.chapter-content {
  position: relative;
  z-index: 1;
  padding: 0 28px var(--torn-edge-clearance) 98px;
}

.chapter-content:before {
  content: "";
  position: absolute;
  left: 72px;
  top: 4px;
  bottom: calc(var(--torn-edge-clearance) + 2px);
  width: 2px;
  background: rgba(159, 42, 44, 0.34);
}

.chapter-content p {
  max-width: 860px;
  margin: 0 0 15px;
  color: rgba(23, 16, 20, 0.82);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.13rem;
  line-height: 1.62;
}

.chapter-content p:last-child {
  margin-bottom: 0;
}

.quote-slip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  max-width: 640px;
  margin: 18px 0;
  padding: 12px 14px;
  border-left: 2px solid rgba(159, 42, 44, 0.62);
  color: #170f15;
  background: rgba(208, 165, 74, 0.16);
  box-shadow: 6px 7px 0 rgba(82, 43, 31, 0.09);
}

.quote-slip span {
  color: #6c191c;
  font-family: "Courier New", monospace;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.quote-slip q {
  color: rgba(23, 16, 20, 0.84);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
}

.evidence-room {
  position: relative;
  margin: 38px 0;
  padding: 24px;
  border: 1px solid rgba(208, 165, 74, 0.28);
  background:
    radial-gradient(circle at 16% 12%, rgba(208, 165, 74, 0.18), transparent 15rem),
    radial-gradient(circle at 82% 4%, rgba(159, 42, 44, 0.24), transparent 17rem),
    linear-gradient(135deg, rgba(245, 234, 210, 0.08), transparent 28%),
    rgba(5, 5, 8, 0.92);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
  overflow: hidden;
}

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

.evidence-room:before {
  inset: 22px;
  border: 1px dashed rgba(208, 165, 74, 0.18);
}

.evidence-room:after {
  left: -10%;
  right: -10%;
  top: 148px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(159, 42, 44, 0.84), transparent);
  box-shadow:
    0 220px 0 rgba(159, 42, 44, 0.34),
    0 510px 0 rgba(159, 42, 44, 0.22);
  transform: rotate(-2deg);
}

.evidence-hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 24px;
}

.evidence-hero > div:first-child,
.evidence-stamp {
  border: 1px solid rgba(208, 165, 74, 0.24);
  background:
    linear-gradient(135deg, rgba(159, 42, 44, 0.12), transparent 36%),
    rgba(8, 7, 10, 0.86);
}

.evidence-hero > div:first-child {
  padding: 28px;
}

.evidence-hero h3 {
  max-width: 680px;
  color: var(--gold);
  font-size: clamp(2.4rem, 5vw, 5.1rem);
  line-height: 0.9;
}

.evidence-hero p:not(.field-label) {
  max-width: 820px;
  color: var(--ash);
  font-size: 1.04rem;
}

.evidence-stamp {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 24px;
  transform: rotate(2deg);
}

.evidence-stamp span {
  color: var(--red);
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.evidence-stamp strong {
  color: var(--bone);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.42rem;
  line-height: 1.1;
}

.evidence-board {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.case-card,
.evidence-page {
  grid-column: span 6;
}

.case-card-wide {
  grid-column: span 12;
}

.evidence-tile {
  min-width: 0;
  padding: 22px 22px var(--torn-edge-clearance);
  border: 1px solid rgba(82, 43, 31, 0.26);
  color: #170f15;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), transparent 32%),
    var(--paper);
  clip-path: polygon(0 4%, 10% 1%, 30% 3%, 50% 0, 72% 2%, 93% 1%, 100% 5%, 99% 97%, 84% 99%, 63% 98%, 43% 100%, 21% 98%, 1% 97%);
  box-shadow: 10px 14px 0 rgba(82, 43, 31, 0.12);
  transform: none;
}

.case-card h4 {
  margin: 14px 0 12px;
  color: #170f15;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.85rem;
  line-height: 1.05;
}

.case-card p {
  color: rgba(23, 16, 20, 0.8);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.55;
}

.evidence-page {
  margin: 0;
}

.evidence-room .chapter-page.evidence-tile {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), transparent 32%),
    var(--paper);
  border: 1px solid rgba(82, 43, 31, 0.26);
  box-shadow: 10px 14px 0 rgba(82, 43, 31, 0.12);
}

.evidence-room .chapter-page.evidence-tile[open] {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), transparent 32%),
    var(--paper);
}

.evidence-room .chapter-page.evidence-tile summary {
  grid-template-columns: 58px minmax(0, 1fr) 72px;
  min-height: 78px;
  padding: 0 0 18px;
}

.evidence-room .chapter-page.evidence-tile .chapter-content {
  padding: 0;
}

.evidence-room .chapter-page.evidence-tile .chapter-content:before {
  display: none;
}

.numogram-card {
  background:
    radial-gradient(circle at 52% 46%, rgba(159, 42, 44, 0.2), transparent 8rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), transparent 32%),
    var(--paper);
}

.numogram-map {
  position: relative;
  width: min(100%, 330px);
  aspect-ratio: 1;
  margin: 20px auto;
  border: 1px solid rgba(159, 42, 44, 0.36);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 49%, rgba(159, 42, 44, 0.24) 50%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(159, 42, 44, 0.24) 50%, transparent 51%),
    radial-gradient(circle, rgba(208, 165, 74, 0.2), transparent 66%);
}

.numogram-map:before,
.numogram-map:after {
  content: "";
  position: absolute;
  inset: 15%;
  border: 1px solid rgba(159, 42, 44, 0.28);
  transform: rotate(36deg);
}

.numogram-map:after {
  inset: 28%;
  transform: rotate(-24deg);
}

.numogram-node {
  position: absolute;
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(23, 16, 20, 0.36);
  border-radius: 50%;
  color: var(--bone);
  background: #6c191c;
  font-family: "Courier New", monospace;
  font-weight: 700;
  box-shadow: 0 0 0 5px rgba(208, 165, 74, 0.16);
}

.numogram-node.n0 { left: 45%; top: 4%; }
.numogram-node.n1 { right: 20%; top: 14%; }
.numogram-node.n2 { right: 6%; top: 42%; }
.numogram-node.n3 { right: 18%; bottom: 15%; }
.numogram-node.n4 { left: 45%; bottom: 4%; }
.numogram-node.n5 { left: 18%; bottom: 15%; }
.numogram-node.n6 { left: 6%; top: 42%; }
.numogram-node.n7 { left: 20%; top: 14%; }
.numogram-node.n8 { left: 35%; top: 42%; }
.numogram-node.n9 { right: 35%; top: 42%; }

.evidence-arc {
  background:
    linear-gradient(140deg, rgba(208, 165, 74, 0.12), transparent 30%),
    linear-gradient(25deg, rgba(159, 42, 44, 0.13), transparent 42%),
    rgba(12, 10, 14, 0.82);
}

.frame-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.formula-panel,
.quote-card,
.source-ledger {
  position: relative;
  border: 1px solid rgba(82, 43, 31, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), transparent 30%),
    rgba(249, 239, 213, 0.68);
  box-shadow: 8px 10px 0 rgba(82, 43, 31, 0.11);
}

.formula-panel {
  min-width: 0;
  padding: 18px;
}

.formula-panel.wide {
  margin: 22px 0;
}

.formula-panel code {
  display: block;
  max-width: 100%;
  margin: 14px 0 12px;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid rgba(159, 42, 44, 0.28);
  color: #170f15;
  background: rgba(255, 255, 255, 0.46);
  font-family: "Courier New", monospace;
  font-size: 0.96rem;
  line-height: 1.35;
  white-space: nowrap;
}

.formula-panel p {
  margin-bottom: 0;
  font-size: 0.99rem;
  line-height: 1.48;
}

.source-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid rgba(159, 42, 44, 0.42);
  color: #5f1619;
  background: rgba(159, 42, 44, 0.08);
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
}

a.source-chip:hover,
a.source-chip:focus-visible {
  color: #170f15;
  background: rgba(208, 165, 74, 0.3);
}

.quote-card {
  margin: 22px 0;
  padding: 18px 20px;
}

.quote-card blockquote {
  margin: 0 0 14px;
  padding: 0 0 0 18px;
  border-top: 0;
  border-bottom: 0;
  border-left: 2px solid rgba(159, 42, 44, 0.56);
  color: #170f15;
  font-size: 1.28rem;
  line-height: 1.35;
}

.quote-card figcaption {
  margin: 0;
}

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

.enneagram-grid .formula-panel {
  min-height: 138px;
}

.matrix-table {
  width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  color: #170f15;
  background: rgba(249, 239, 213, 0.76);
  box-shadow: 8px 10px 0 rgba(82, 43, 31, 0.1);
}

.matrix-table caption {
  margin-bottom: 10px;
  color: #5f1619;
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
}

.matrix-table th,
.matrix-table td {
  padding: 14px;
  border: 1px solid rgba(82, 43, 31, 0.24);
  text-align: left;
  vertical-align: top;
}

.matrix-table th {
  color: #5f1619;
  background: rgba(159, 42, 44, 0.09);
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.source-ledger {
  display: grid;
  grid-template-columns: minmax(280px, 0.36fr) minmax(0, 0.64fr);
  gap: 22px;
  margin: 30px 0 8px;
  padding: 24px 24px var(--torn-edge-clearance);
  color: #170f15;
  clip-path: polygon(0 3%, 10% 0, 30% 2%, 52% 0, 73% 3%, 92% 1%, 100% 5%, 99% 97%, 88% 99%, 68% 98%, 46% 100%, 25% 98%, 2% 97%);
}

.source-ledger h3 {
  color: #170f15;
}

.source-ledger p {
  color: rgba(23, 16, 20, 0.78);
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: start;
}

.source-list a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(159, 42, 44, 0.32);
  color: #5f1619;
  background: rgba(255, 255, 255, 0.32);
  font-family: "Courier New", monospace;
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

.source-list a:hover,
.source-list a:focus-visible {
  color: #170f15;
  background: rgba(208, 165, 74, 0.24);
}

.source-table-wrap {
  overflow-x: auto;
}

.source-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  color: #170f15;
  background: rgba(255, 255, 255, 0.22);
}

.source-table th,
.source-table td {
  padding: 12px 13px;
  border: 1px solid rgba(82, 43, 31, 0.24);
  text-align: left;
  vertical-align: top;
}

.source-table th {
  color: #5f1619;
  background: rgba(159, 42, 44, 0.1);
  font-family: "Courier New", monospace;
  font-size: 0.74rem;
  text-transform: uppercase;
}

.source-table td {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.96rem;
  line-height: 1.42;
}

.source-table a {
  color: #5f1619;
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.glossary {
  padding-top: 62px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.filter-button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(245, 234, 210, 0.22);
  color: var(--bone);
  background: rgba(245, 234, 210, 0.06);
  cursor: pointer;
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.filter-button.is-active {
  color: var(--ink);
  background: var(--gold);
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.term {
  min-height: 230px;
  padding: 22px;
  transform: rotate(var(--term-tilt, -0.5deg));
  transition: opacity 160ms ease, transform 160ms ease;
}

.term:nth-child(2n) {
  --term-tilt: 0.7deg;
}

.term:nth-child(3n) {
  --term-tilt: -1deg;
}

.term h3 {
  color: #171014;
}

.term p {
  color: rgba(23, 16, 20, 0.78);
}

.term.is-hidden {
  display: none;
}

.invitation {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(360px, 1.05fr);
  gap: 52px;
  align-items: center;
  padding-bottom: 120px;
}

.cave-panel {
  min-height: 520px;
}

.invitation-copy {
  position: relative;
  padding: 44px;
  border: 1px solid rgba(245, 234, 210, 0.18);
  background:
    linear-gradient(135deg, rgba(159, 42, 44, 0.2), transparent 34%),
    rgba(12, 10, 14, 0.88);
  box-shadow: var(--shadow);
}

.invitation-copy:before {
  content: "";
  position: absolute;
  right: 28px;
  top: -31px;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 15px, rgba(23, 16, 20, 0.48) 16px 17px, transparent 18px),
    var(--red);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}

.invitation-copy p {
  color: var(--ash);
  font-size: 1.08rem;
}

.blood {
  margin-top: 18px;
  color: var(--bone);
  background: var(--red);
  box-shadow: 8px 8px 0 rgba(208, 165, 74, 0.34);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

  .reveal,
  .button-primary,
  .button-secondary,
  .filter-button {
    transition: none;
  }
}

@media (min-width: 1321px) {
  .site-shell {
    width: 100%;
  }

  body.nav-open main {
    padding-right: 252px;
  }

  body.nav-open .section-frame {
    width: min(1280px, calc(100% - 28px));
  }

  body.nav-open .site-header {
    padding-right: 300px;
  }

  .side-nav {
    right: 24px;
    width: 220px;
  }
}

@media (max-width: 1320px) {
  .side-nav {
    right: 14px;
    top: 84px;
    width: 218px;
    max-height: calc(100vh - 108px);
  }

  .side-nav:not(.is-nav-open) {
    width: auto;
  }
}

@media (max-width: 1180px) {
  h1 {
    font-size: 5.8rem;
  }

  h2 {
    font-size: 3.25rem;
  }

  .site-header {
    padding-inline: 28px;
  }

  .side-nav {
    right: 14px;
    top: 84px;
    width: 218px;
    max-height: calc(100vh - 108px);
  }

  .side-nav:not(.is-nav-open) {
    width: auto;
  }

  .hero,
  .first-accusation,
  .invitation {
    grid-template-columns: 1fr;
  }

  .hero-board,
  .accusation-board,
  .cave-panel {
    min-height: 520px;
  }

  .reader-arc {
    grid-template-columns: 1fr;
  }

  .reader-arc:before {
    left: 24px;
    right: 24px;
    top: auto;
    bottom: 20px;
    width: auto;
    height: 2px;
  }

  .arc-header {
    position: relative;
    top: auto;
    min-height: auto;
  }

  .chapter-page {
    grid-column: 1;
  }

  .evidence-hero {
    grid-template-columns: 1fr;
  }

  .case-card,
  .evidence-page,
  .case-card-wide {
    grid-column: 1 / -1;
  }

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

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

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

@media (max-width: 760px) {
  .site-header {
    position: relative;
    align-items: center;
    flex-direction: row;
    gap: 14px;
    padding: 16px 18px;
  }

  .side-nav {
    right: 12px;
    top: 16px;
    width: auto;
    max-height: calc(100vh - 32px);
  }

  .side-nav:not(.is-nav-open) {
    left: auto;
  }

  .section-frame {
    width: min(100% - 22px, 1360px);
    padding: 48px 0;
  }

  h1 {
    font-size: 3.65rem;
  }

  h2 {
    font-size: 2.42rem;
  }

  h3 {
    font-size: 1.62rem;
  }

  .hero {
    min-height: auto;
    padding: 30px 22px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-board,
  .accusation-board,
  .cave-panel {
    min-height: 390px;
  }

  .hero-note,
  .margin-note {
    position: relative;
    right: auto;
    left: auto;
    bottom: auto;
    width: auto;
    margin: 18px;
    transform: none;
  }

  .paperclip,
  .thread-hero {
    display: none;
  }

  .warning-modal {
    padding: 18px;
  }

  .warning-dialog {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px;
  }

  .warning-heading {
    padding-right: 42px;
  }

  .warning-copy {
    padding: 0;
  }

  .warning-actions {
    justify-content: stretch;
  }

  .warning-actions .button-primary,
  .warning-actions .button-secondary {
    width: 100%;
  }

  .accusation-copy {
    padding: 26px 20px;
  }

  blockquote {
    font-size: 1.18rem;
  }

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

  .reader-arc {
    padding: 14px;
  }

  .chapter-page {
    clip-path: none;
    padding-block-end: 0;
  }

  .chapter-page summary {
    grid-template-columns: 46px minmax(0, 1fr);
    min-height: 74px;
    padding: 18px;
  }

  .chapter-toggle {
    grid-column: 2;
    justify-self: start;
  }

  .chapter-title {
    font-size: 1.34rem;
  }

  .chapter-content {
    padding: 0 18px 22px 18px;
  }

  .chapter-content:before {
    display: none;
  }

  .chapter-content p {
    font-size: 1.04rem;
  }

  .quote-slip {
    grid-template-columns: 1fr;
  }

  .evidence-room {
    padding: 14px;
  }

  .evidence-room:before,
  .evidence-room:after {
    display: none;
  }

  .evidence-hero > div:first-child,
  .evidence-stamp {
    padding: 20px;
  }

  .evidence-hero > div:first-child {
    padding-top: 70px;
  }

  .evidence-hero h3 {
    font-size: 2.65rem;
  }

  .evidence-board {
    grid-template-columns: 1fr;
  }

  .case-card {
    clip-path: none;
  }

  .case-card h4 {
    font-size: 1.42rem;
  }

  .numogram-map {
    width: min(100%, 270px);
  }

  .frame-grid,
  .enneagram-grid {
    grid-template-columns: 1fr;
  }

  .formula-panel,
  .quote-card,
  .source-ledger {
    box-shadow: 5px 7px 0 rgba(82, 43, 31, 0.1);
  }

  .formula-panel code {
    font-size: 0.84rem;
  }

  .quote-card blockquote {
    font-size: 1.08rem;
  }

  .matrix-table {
    display: block;
    width: 100%;
    overflow: visible;
    white-space: normal;
  }

  .matrix-table thead {
    display: none;
  }

  .matrix-table tbody {
    display: grid;
    gap: 10px;
  }

  .matrix-table tr {
    display: grid;
    gap: 9px;
    padding: 12px;
    border: 1px solid rgba(82, 43, 31, 0.22);
    background: rgba(255, 255, 255, 0.24);
  }

  .matrix-table td {
    display: grid;
    grid-template-columns: minmax(76px, 0.32fr) minmax(0, 1fr);
    gap: 10px;
    padding: 0;
    border: 0;
    overflow-wrap: anywhere;
  }

  .matrix-table td:before {
    color: #5f1619;
    font-family: "Courier New", monospace;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
  }

  .matrix-table td:nth-child(1):before {
    content: "Rule";
  }

  .matrix-table td:nth-child(2):before {
    content: "Meaning";
  }

  .matrix-table td:nth-child(3):before {
    content: "Reading";
  }

  .source-ledger {
    clip-path: none;
    padding: 18px;
  }

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

  .invitation-copy {
    padding: 34px 22px;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.08rem;
  }

  .nav-links a,
  .nav-links button {
    font-size: 0.74rem;
  }

  .hero-board,
  .accusation-board,
  .cave-panel {
    min-height: 320px;
  }
}

/* Readability pass: brighten long-form text without flattening the scrapbook look. */

:root {
  --ash: rgba(245, 234, 210, 0.88);
  --line: rgba(245, 234, 210, 0.24);
}

body {
  font-size: 17px;
}

.site-header {
  background: rgba(7, 6, 9, 0.94);
}

.side-nav {
  border-color: rgba(245, 234, 210, 0.24);
  background:
    linear-gradient(135deg, rgba(159, 42, 44, 0.16), transparent 36%),
    rgba(8, 7, 10, 0.97);
}

.nav-links a,
.nav-links button {
  color: rgba(245, 234, 210, 0.9);
  font-size: 0.78rem;
  line-height: 1.35;
}

.nav-links a.is-active,
.nav-links a:hover,
.nav-links button:hover {
  color: var(--bone);
  background: rgba(245, 234, 210, 0.09);
}

.warning-dialog,
.invitation-copy,
.reader-arc,
.evidence-room {
  background:
    linear-gradient(180deg, rgba(245, 234, 210, 0.055), transparent 42%),
    rgba(11, 12, 17, 0.985);
}

.hero-lede,
.accusation-copy p,
.section-title p:not(.field-label),
.arc-header p,
.evidence-hero p:not(.field-label),
.invitation-copy p,
.warning-copy p,
.warning-note,
.warning-note span {
  color: rgba(245, 234, 210, 0.9);
}

.chapter-content p,
.case-card p,
.formula-panel p,
.source-ledger p,
.term p,
.source-table td {
  color: rgba(23, 16, 20, 0.92);
}

.chapter-content p {
  font-size: 1.16rem;
  line-height: 1.68;
}

.case-card p {
  font-size: 1.08rem;
  line-height: 1.62;
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .nav-links a,
  .nav-links button {
    font-size: 0.8rem;
  }
}
