.thought-world {
  --world-bg: #05070a;
  --world-bg-soft: #090d12;
  --world-ink: #d8dbe0;
  --world-muted: rgb(216 219 224 / 62%);
  --world-faint: rgb(216 219 224 / 58%);
  --world-accent: #91a7c0;
}

.thought-world .world-intro {
  position: relative;
  isolation: isolate;
}

.thought-world .world-intro::before {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: clamp(0rem, 8vw, 7rem);
  width: clamp(12rem, 32vw, 28rem);
  aspect-ratio: 1;
  border: 1px solid rgb(145 167 192 / 10%);
  border-radius: 50%;
  box-shadow:
    0 0 0 clamp(2rem, 5vw, 5rem) rgb(145 167 192 / 2.5%),
    inset 0 0 5rem rgb(145 167 192 / 3%);
  content: "";
  opacity: 0.75;
  transform: translateY(-50%);
}

.thought-world .world-intro::after {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: clamp(6rem, 24vw, 19rem);
  width: 0.22rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--world-accent);
  box-shadow: 0 0 1.4rem rgb(145 167 192 / 55%);
  content: "";
}

.threshold-list {
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: threshold;
}

.threshold-list li {
  border-top: 1px solid var(--hairline);
  counter-increment: threshold;
}

.threshold-list li:last-child {
  border-bottom: 1px solid var(--hairline);
}

.threshold-link {
  display: grid;
  grid-template-columns: 4rem minmax(9rem, 0.55fr) minmax(0, 1fr) auto;
  gap: clamp(1rem, 3vw, 2.75rem);
  align-items: baseline;
  padding: clamp(1.65rem, 3.2vw, 2.75rem) 0;
  color: inherit;
  text-decoration: none;
}

.threshold-link::before {
  color: var(--world-faint);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  content: "0" counter(threshold);
}

.threshold-name {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.8vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.threshold-note {
  max-width: 34rem;
  color: var(--world-muted);
  font-family: var(--font-serif);
  font-size: 0.93rem;
  line-height: 1.75;
}

.threshold-arrow {
  color: var(--world-faint);
  transition: color var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.threshold-link:hover .threshold-name,
.threshold-link:focus-visible .threshold-name {
  color: var(--world-accent);
}

.threshold-link:hover .threshold-arrow,
.threshold-link:focus-visible .threshold-arrow {
  color: var(--world-ink);
  transform: translateX(0.3rem);
}

.concept-river {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  list-style: none;
}

.concept-river li {
  min-height: 7.5rem;
  padding: 1.4rem 1rem 1.2rem 0;
  color: var(--world-muted);
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2vw, 1.5rem);
  line-height: 1.2;
}

.concept-river li::before {
  display: block;
  width: 0.2rem;
  height: 0.2rem;
  margin-bottom: 1.2rem;
  border-radius: 50%;
  background: var(--world-accent);
  box-shadow: 0 0 0.9rem rgb(145 167 192 / 35%);
  content: "";
}

.concept-river a {
  text-decoration-color: rgb(145 167 192 / 45%);
  text-underline-offset: 0.35em;
}

.epistemic-ledger {
  border-top: 1px solid var(--hairline);
}

.ledger-entry {
  display: grid;
  grid-template-columns: minmax(10rem, 0.42fr) minmax(0, 1fr);
  gap: clamp(2rem, 7vw, 8rem);
  padding: clamp(2.4rem, 5vw, 4.5rem) 0;
  border-bottom: 1px solid var(--hairline);
}

.ledger-entry h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2.8rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.ledger-entry h3 small {
  display: block;
  margin-bottom: 0.8rem;
  color: var(--world-faint);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-weight: 400;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.ledger-entry p {
  max-width: 42rem;
  margin: 0;
  color: var(--world-muted);
  font-family: var(--font-serif);
  font-size: clamp(0.98rem, 1.3vw, 1.12rem);
  line-height: 1.9;
}

.boundary-note {
  max-width: 50rem;
  margin: clamp(4rem, 9vw, 8rem) 0 0;
  padding-left: clamp(1.25rem, 3vw, 2.5rem);
  border-left: 1px solid var(--world-accent);
  color: var(--world-muted);
  font-family: var(--font-serif);
  font-size: clamp(1.08rem, 2vw, 1.45rem);
  line-height: 1.8;
}

.question-index {
  border-top: 1px solid var(--hairline);
}

.question-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(13rem, 0.45fr);
  gap: clamp(2rem, 7vw, 7rem);
  padding: clamp(2.5rem, 5vw, 4.5rem) 0;
  border-bottom: 1px solid var(--hairline);
  scroll-margin-top: 2rem;
}

.question-entry h2 {
  max-width: 15ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4.6rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.question-entry h2 a {
  text-decoration: none;
}

.question-entry h2 a:hover,
.question-entry h2 a:focus-visible {
  color: var(--world-accent);
}

.thinker-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  align-content: start;
  padding: 0;
  margin: 0.35rem 0 0;
  color: var(--world-muted);
  font-family: var(--font-serif);
  font-size: 0.92rem;
  line-height: 1.6;
  list-style: none;
}

.thinker-line li::before {
  margin-right: 0.65rem;
  color: var(--world-faint);
  content: "·";
}

.self-sequence {
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--hairline);
  list-style: none;
  counter-reset: self-question;
}

.self-sequence li {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 3rem);
  align-items: start;
  padding: clamp(2rem, 4.5vw, 4rem) 0;
  border-bottom: 1px solid var(--hairline);
  counter-increment: self-question;
}

.self-sequence li::before {
  padding-top: 0.45rem;
  color: var(--world-faint);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  content: "0" counter(self-question);
}

.self-sequence p {
  max-width: 27ch;
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 3.5vw, 2.8rem);
  line-height: 1.45;
  letter-spacing: -0.02em;
}

.honesty-note {
  max-width: 42rem;
  padding: 1.5rem 0;
  color: var(--world-faint);
  font-size: 0.78rem;
  line-height: 1.85;
}

.paper-world {
  --world-accent: #5e6b7b;
}

html[data-page-theme="paper"] {
  color-scheme: light;
  background: #eeece5;
}

.paper-world .site-header,
.paper-world .site-footer {
  border-color: rgb(25 26 28 / 12%);
}

.literature-leaf {
  position: relative;
}

.literature-leaf::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: clamp(1.25rem, 5vw, 5rem);
  width: 1px;
  background: rgb(25 26 28 / 7%);
  content: "";
  pointer-events: none;
}

.literature-leaf .page-shell {
  position: relative;
}

.literature-structure {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--hairline);
  list-style: none;
  counter-reset: literature-part;
}

.literature-structure li {
  min-height: 10rem;
  padding: 1.5rem clamp(1rem, 4vw, 3rem) 2rem 0;
  border-bottom: 1px solid var(--hairline);
  counter-increment: literature-part;
  color: var(--world-muted);
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  line-height: 1.5;
}

.literature-structure li::before {
  display: block;
  margin-bottom: 2.2rem;
  color: var(--world-faint);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.12em;
  content: "0" counter(literature-part);
}

.residue-lines {
  padding: 0;
  margin: 0;
  list-style: none;
}

.residue-lines li {
  max-width: 39rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--world-muted);
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.6;
}

.paper-world .fate-cat img {
  opacity: 0.75;
}

.shadow-world {
  --world-bg: #010102;
  --world-bg-soft: #030406;
  --world-ink: #d7d9dc;
  --world-muted: rgb(215 217 220 / 68%);
  --world-faint: rgb(215 217 220 / 58%);
  --world-accent: #93a9c0;
  background: #010102;
}

.shadow-world .site-header {
  position: relative;
  z-index: 20;
}

.shadow-room {
  --light-x: 52%;
  --light-y: 34%;
  position: relative;
  min-height: max(56rem, calc(100svh - 4.5rem));
  overflow: hidden;
  isolation: isolate;
}

.shadow-room:focus-visible {
  outline: 2px solid var(--world-accent);
  outline-offset: -6px;
}

.shadow-room::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    radial-gradient(
      circle 13rem at var(--light-x) var(--light-y),
      rgb(164 184 207 / 10%),
      rgb(95 118 143 / 4%) 38%,
      transparent 72%
    );
  content: "";
  pointer-events: none;
}

.shadow-room::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 49.94%, rgb(255 255 255 / 2.5%) 50%, transparent 50.06%),
    radial-gradient(circle at 50% 45%, transparent 0 24%, rgb(0 0 0 / 52%) 78%);
  content: "";
  pointer-events: none;
}

.shadow-room__inner {
  width: min(100%, calc(var(--measure) + var(--page-gutter) * 2));
  margin: 0 auto;
  padding: clamp(4.5rem, 10vh, 8rem) var(--page-gutter) clamp(7rem, 15vh, 12rem);
}

.shadow-room__heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: end;
}

.shadow-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 15vw, 12rem);
  font-weight: 400;
  line-height: 0.78;
  letter-spacing: -0.075em;
}

.shadow-controls {
  display: grid;
  max-width: 17rem;
  gap: 0.9rem;
  justify-items: start;
}

.shadow-instruction,
.shadow-status {
  margin: 0;
  color: var(--world-faint);
  font-size: 0.69rem;
  line-height: 1.75;
}

.shadow-status {
  min-height: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shadow-passages {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(3rem, 9vw, 8rem) clamp(1rem, 3vw, 2.5rem);
  margin-top: clamp(8rem, 18vh, 15rem);
}

.shadow-passage {
  margin: 0;
  transition: opacity var(--motion-normal) ease;
}

.shadow-passage:focus-visible {
  outline: 2px solid var(--world-accent);
  outline-offset: 0.75rem;
}

.shadow-passage--quote {
  grid-column: 2 / 10;
  max-width: 31ch;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4.4vw, 3.8rem);
  line-height: 1.5;
  letter-spacing: -0.025em;
}

.shadow-passage--symbol {
  grid-column: 7 / 13;
}

.shadow-passage--history {
  grid-column: 1 / 7;
}

.shadow-passage--evidence {
  grid-column: 5 / 12;
}

.shadow-passage h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.8rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.shadow-passage h2 small {
  display: block;
  margin-bottom: 0.7rem;
  color: var(--world-faint);
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.shadow-passage p {
  max-width: 37rem;
  margin: 0;
  color: var(--world-muted);
  font-family: var(--font-serif);
  line-height: 1.9;
}

.js .shadow-world:not(.shadow-reveal-all):not(.shadow-reduced) [data-shadow-passage] {
  opacity: var(--shadow-reveal, 0.16);
}

.js .shadow-world:not(.shadow-reveal-all):not(.shadow-reduced) [data-shadow-passage]:focus-visible,
.js .shadow-world:not(.shadow-reveal-all):not(.shadow-reduced) [data-shadow-passage]:focus-within {
  opacity: 1;
}

.shadow-reveal-all [data-shadow-passage],
.shadow-reduced [data-shadow-passage] {
  opacity: 1 !important;
}

.shadow-reduced [data-shadow-reveal-all] {
  display: none;
}

.shadow-reveal-all .shadow-room::before,
.shadow-reduced .shadow-room::before {
  opacity: 0.35;
}

.shadow-after {
  background: #030406;
}

@media (max-width: 52rem) {
  .threshold-link {
    grid-template-columns: 2.25rem minmax(0, 1fr) auto;
  }

  .threshold-note {
    grid-column: 2 / -1;
  }

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

  .ledger-entry,
  .question-entry {
    grid-template-columns: 1fr;
    gap: 1.7rem;
  }

  .shadow-room__heading {
    grid-template-columns: 1fr;
  }

  .shadow-controls {
    max-width: 25rem;
  }

  .shadow-passage--quote,
  .shadow-passage--symbol,
  .shadow-passage--history,
  .shadow-passage--evidence {
    grid-column: 1 / -1;
  }

  .shadow-passage--symbol {
    margin-left: 14%;
  }

  .shadow-passage--history {
    margin-right: 12%;
  }

  .shadow-passage--evidence {
    margin-left: 7%;
  }
}

@media (max-width: 36rem) {
  .thought-world .world-intro::before,
  .thought-world .world-intro::after {
    opacity: 0.35;
  }

  .concept-river,
  .literature-structure {
    grid-template-columns: 1fr;
  }

  .concept-river li,
  .literature-structure li {
    min-height: 7rem;
  }

  .self-sequence li {
    grid-template-columns: 2.25rem minmax(0, 1fr);
  }

  .literature-leaf::before {
    display: none;
  }

  .shadow-room {
    min-height: 60rem;
  }

  .shadow-passages {
    gap: 5rem;
    margin-top: 7rem;
  }

  .shadow-passage--symbol,
  .shadow-passage--history,
  .shadow-passage--evidence {
    margin-inline: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thought-world .world-intro::after {
    box-shadow: none;
  }

  .shadow-room::before {
    display: none;
  }

  .shadow-passage {
    opacity: 1 !important;
  }
}
