:root {
  color-scheme: dark;
  --bg: #030305;
  --panel: #0c0d12;
  --ink: #eef0f5;
  --muted: #aaafbd;
  --line: #d4ddff29;
  --accent: #b8cbff;
  --mint: #abc9e1;
  --gold: var(--accent);
  --frame: 1320px;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 94px; scroll-behavior: smooth; }
html.motion-off { scroll-behavior: auto; }
body { margin: 0; color: var(--ink); background: var(--bg); font: 16px/1.65 var(--sans); }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
::selection { background: #c6d4fa; color: #080a13; }

.frame { width: min(var(--frame), calc(100% - 104px)); margin-inline: auto; }
.skip {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-160%);
}
.skip:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  background: #050507f0;
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.site-nav { display: flex; min-height: 68px; justify-content: space-between; align-items: center; gap: 24px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: 650 1rem/1.2 var(--sans);
  letter-spacing: .24em;
  white-space: nowrap;
}
.mark { position: relative; display: grid; width: 25px; height: 25px; place-items: center; color: #dde6ff; }
.mark::before, .mark::after { content: ''; position: absolute; border: 1px solid currentColor; }
.mark::before { width: 15px; height: 15px; transform: rotate(45deg); }
.mark::after { width: 9px; height: 9px; transform: translate(3px, -3px) rotate(45deg); opacity: .56; }
.mark i { display: block; width: 2px; height: 2px; background: currentColor; }
.site-nav nav { display: flex; align-items: center; gap: clamp(15px, 4vw, 58px); }
.site-nav nav a, .site-footer a:last-child, .cover-credit { color: var(--muted); font-size: .875rem; }
.site-nav nav a:hover, .site-footer a:hover { color: #fff; }
.site-nav nav .journal-link { color: var(--ink); }

.cover {
  position: relative;
  isolation: isolate;
  min-height: clamp(620px, calc(92svh - 69px), 900px);
  display: grid;
  overflow: hidden;
  background: #030305;
  border-bottom: 1px solid var(--line);
}
.cover-art {
  position: absolute;
  inset: 0 -2% 0 auto;
  width: 69%;
  overflow: hidden;
  background: #000;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 96%, transparent);
}
.cover-art::after {
  position: absolute;
  content: '';
  pointer-events: none;
  inset: 0;
  background: linear-gradient(0deg, #030305 0%, transparent 16%, transparent 91%, #030305 100%);
}
.cover-still, .entity-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.cover-still { object-fit: fill; }
.entity-canvas, .chapter-canvas { display: block; opacity: 0; pointer-events: none; }
.cover-inner {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: center;
  padding-block: 65px 95px;
}
.cover-copy { position: relative; z-index: 1; grid-column: 1 / 8; width: fit-content; }
.kicker {
  margin: 0 0 18px;
  color: var(--accent);
  font: 500 .875rem/1.5 var(--mono);
  text-transform: uppercase;
  letter-spacing: .13em;
}
.cover h1 {
  display: flex;
  gap: .085em;
  width: fit-content;
  margin: 0 0 19px -.052em;
  font-size: clamp(4.75rem, 11.5vw, 11.7rem);
  font-weight: 650;
  line-height: .83;
  letter-spacing: -.075em;
}
.cover h1 span { display: block; }
.cover h1:focus { outline: 0; }
.cover-subtitle {
  margin: 0;
  color: #d5def5;
  font: 500 clamp(.73rem, 1.2vw, .91rem)/1.5 var(--mono);
  text-transform: uppercase;
  letter-spacing: .12em;
}
.cover-verse {
  margin: clamp(22px, 4vw, 52px) 0 26px;
  font-size: clamp(1rem, 1.75vw, 1.42rem);
  letter-spacing: -.024em;
  line-height: 1.5;
  color: #c5c9d5;
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid #e0e8ff66;
  color: var(--ink);
  font-size: .9375rem;
  font-weight: 580;
  transition: color .25s, background .25s, border-color .25s;
}
.button:hover { background: #e8eeff; color: #090a11; border-color: #e8eeff; }
.cover-credit {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 61px;
  padding-block: 7px;
  border-top: 1px solid var(--line);
}
.scene-controls { display: flex; align-items: center; gap: clamp(12px, 4vw, 56px); }
.scene-name { color: var(--accent); font-family: var(--mono); }
.skip-contact {
  cursor: pointer;
  font: inherit;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  padding: 5px 0;
}
.skip-contact:hover { color: #fff; }
.skip-contact {
  z-index: 14;
  position: fixed;
  right: max(22px, calc((100vw - var(--frame)) / 2));
  top: 20px;
  color: #d1d7e7;
}
.first-contact { overflow: hidden; }
.first-contact .cover { position: fixed; z-index: 12; inset: 0; background: #000; }
.first-contact .cover-art { inset: 0; width: 100%; mask-image: none; }
.first-contact .cover-art::after, .first-contact .cover-still, .first-contact .cover-inner { visibility: hidden; }
.first-contact .skip { visibility: hidden; }

.introduction { background: #08090d; border-bottom: 1px solid var(--line); }
.intro-inner {
  display: grid;
  grid-template-columns: 1fr .88fr;
  align-items: center;
  gap: clamp(38px, 9vw, 148px);
  padding-block: clamp(70px, 11vw, 157px);
}
.intro-inner h2, .contents-head h2 {
  margin: 0;
  font-size: clamp(2.7rem, 6vw, 6.6rem);
  font-weight: 580;
  line-height: .98;
  letter-spacing: -.085em;
}
.intro-inner h2 em { color: var(--accent); font-style: normal; }
.intro-copy { max-width: 53ch; color: var(--muted); font-size: clamp(1rem, 1.55vw, 1.24rem); }
.intro-copy p { margin: 0 0 16px; }
.intro-copy p:last-child { margin-bottom: 0; }
.intro-copy strong { color: var(--ink); }

.contents { padding: clamp(65px, 8vw, 115px) 0; }
.contents-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 34px;
  margin-bottom: 44px;
}
.contents-head p { margin: 0; color: var(--muted); }
.chapter-group + .chapter-group { margin-top: 62px; }
.chapter-group h3 { margin: 0 0 17px; color: var(--accent); font: 500 1rem/1.45 var(--mono); }
.chapter-group ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(20px, 5vw, 72px); margin: 0; padding: 0; list-style: none; }
.chapter-group li { border-top: 1px solid var(--line); }
.chapter-card { display: grid; grid-template-columns: minmax(96px, .62fr) 1fr; height: 100%; align-items: center; }
.card-art { overflow: hidden; height: clamp(79px, 12vw, 156px); background: #000; }
.card-art img { width: 100%; height: 100%; object-fit: contain; transition: transform .55s cubic-bezier(.19,.66,.24,1); }
.chapter-card:hover img { transform: scale(1.12); }
.card-text { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 12px; padding: 15px 9px 15px 18px; }
.card-text span { color: var(--accent); font: 500 .875rem/1.4 var(--mono); }
.card-text h4 { margin: 0; font-size: clamp(1rem, 1.65vw, 1.4rem); font-weight: 540; line-height: 1.26; letter-spacing: -.034em; }
.chapter-card:hover h4 { color: var(--accent); }

.site-footer { border-top: 1px solid var(--line); background: #08090d; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 24px; }
.footer-inner p { color: var(--muted); font-size: .875rem; margin: 0; }

.reader .reading-bar { position: sticky; top: 69px; z-index: 9; border-bottom: 1px solid var(--line); background: #0b0c10f0; }
.reading-bar-inner { display: flex; align-items: center; gap: 14px; min-height: 55px; font-size: .875rem; color: var(--muted); }
.reading-bar-inner a { margin-inline-start: auto; color: var(--accent); white-space: nowrap; }
.reading-bar-inner a:hover { text-decoration: underline; }
.reading-bar select {
  appearance: none;
  max-width: min(65%, 24rem);
  text-overflow: ellipsis;
  border: 1px solid var(--line);
  background: linear-gradient(45deg, transparent 50%, var(--accent) 51%) right 17px center / 5px 5px no-repeat,
              linear-gradient(135deg, var(--accent) 50%, transparent 51%) right 12px center / 5px 5px no-repeat, #10121a;
  color: var(--ink);
  padding: 5px 30px 5px 9px;
  font: inherit;
}
.reader #progress { position: absolute; inset: auto auto -1px 0; height: 2px; z-index: 1; background: var(--accent); }
.reader-title { padding: 50px 0 18px; }
.reader-title h1 { margin: 0; font-size: clamp(1.7rem, 4.1vw, 3.7rem); font-weight: 590; line-height: 1.08; letter-spacing: -.07em; }
.reader-title p { margin: 8px 0 0; color: var(--muted); }
.reader .section, .reader .interlude { scroll-margin-top: 52px; overflow: clip; }
.reader .section { padding: 27px 0 69px; border-bottom: 1px solid var(--line); }
.reader .section + .section { padding-top: 64px; }
.reader .wrap { width: min(var(--frame), calc(100% - 104px)); }
.reader .section > .wrap { display: grid; grid-template-columns: .85fr 1.15fr; align-items: stretch; column-gap: clamp(24px, 5vw, 74px); }
.reader .section > .wrap > :not(.section-head, .chapter-art) { grid-column: 1 / -1; }
.reader .section-head { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: start; justify-content: center; gap: 17px; margin: 0 0 38px; }
.reader .section h2, .interlude h2 { margin: 0; font-size: clamp(2.1rem, 4.9vw, 5.3rem); font-weight: 590; line-height: .99; letter-spacing: -.08em; }
.reader .section-head p { max-width: 47ch; color: var(--muted); font-size: clamp(1rem, 1.45vw, 1.2rem); }
.chapter-art { position: relative; grid-area: 1 / 2; margin: 0 0 38px; overflow: hidden; background: #000; }
.chapter-art img { width: 100%; height: clamp(260px, 36vw, 470px); object-fit: contain; }
.chapter-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.reader .eyebrow, .reader .label, .reader .symbol { color: var(--accent); }
.reader .aside { border-left-color: var(--accent); }
.reader :is(.tile, .note, .formbox, .fact, .layer, .era, .era.future, details, .stage, .stage-detail) { background: var(--panel); border-radius: 0; }
.reader :is(.orbit-card, .converge, .unity-feature) { background: #0b0d16; border-radius: 0; }
.reader .tile .symbol { border-color: #b8c9f053; border-radius: 0; }
.reader .stage.active { background: #141a2a; border-color: #7893d4; }
.reader .stage.active b { color: var(--ink); }
.reader .formbox :is(input, textarea) { background: #090a10; border-color: var(--line); border-radius: 0; }
.reader .btn { background: #10111a; border-radius: 0; }
.reader .btn:hover { background: #1c2231; }
.reader .btn.primary { color: #070b16; background: var(--accent); }
.reader .btn.primary:hover { background: #dde7ff; }
.reader .step { background: linear-gradient(#101422, #05050900); border-top-color: #a1b6ec65; }
.reader .unity-words blockquote { color: var(--ink); }
.reader .unity-words blockquote span { color: var(--accent); }
.reader .orbit-node circle { fill: #161f38; stroke: #8cabea; }
.reader .orbit-node text { fill: #dde7ff; }
.reader .orbit-node:is(.active, :hover, :focus) circle { fill: #c5d5ff; stroke: #eaf0ff; }
.reader .orbit-node:is(.active, :hover, :focus) text { fill: #0a1023; }

.interlude {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  min-height: clamp(320px, 41vw, 540px);
  color: var(--ink);
  background: #08090f;
  border-block: 1px solid var(--line);
}
.interlude-art { position: relative; overflow: hidden; background: #000; }
.interlude img { width: 100%; height: 100%; object-fit: contain; }
.interlude-copy { display: flex; flex-direction: column; justify-content: center; padding: 44px clamp(24px, 5vw, 74px); }
.interlude h2 { margin: 0 0 18px; color: #c5d6ff; }
.interlude blockquote { margin: 0; font-size: clamp(1.12rem, 2.35vw, 2.24rem); line-height: 1.3; letter-spacing: -.036em; }
.interlude p { margin: 16px 0 0; color: var(--muted); }

@media (max-width: 960px) {
  .frame, .reader .wrap { width: calc(100% - 60px); }
  .cover { min-height: clamp(560px, calc(92svh - 69px), 800px); }
  .cover-art { width: 76%; right: -10%; }
  .cover h1 { font-size: clamp(4.6rem, 13.4vw, 9.4rem); }
}
@media (max-width: 700px) {
  html { scroll-padding-top: 75px; }
  .frame, .reader .wrap { width: calc(100% - 36px); }
  .site-nav { min-height: 57px; gap: 8px; }
  .brand { gap: 5px; font-size: .875rem; }
  .site-nav nav { gap: clamp(10px, 3vw, 21px); }
  .site-nav nav a { font-size: .8125rem; }
  .cover { min-height: max(615px, calc(92svh - 58px)); }
  .cover-art { inset: 0 -9% auto; height: 68%; width: auto; mask-image: none; }
  .cover-art::after { background: linear-gradient(0deg, #030305 4%, #03030500 42%); }
  .cover-still { object-fit: contain; }
  .cover-inner { display: flex; align-items: flex-end; padding-block: 250px 90px; }
  .cover-copy { grid-column: auto; }
  .cover h1 { font-size: clamp(3.85rem, 17vw, 7.4rem); }
  .cover-subtitle { letter-spacing: .095em; }
  .cover-verse { margin-block: 16px 19px; }
  .cover-credit { min-height: 53px; font-size: .8125rem; }
  .scene-name { display: none; }
  .first-contact .cover-art { width: 100%; height: 100%; }
  .intro-inner { grid-template-columns: 1fr; gap: 24px; }
  .contents-head { display: block; margin-bottom: 32px; padding-bottom: 21px; }
  .contents-head p { margin-top: 9px; }
  .chapter-group ol { grid-template-columns: 1fr; }
  .card-art { height: clamp(75px, 24vw, 137px); }
  .card-text { padding-inline: 10px; }
  .footer-inner { flex-wrap: wrap; justify-content: space-between; }
  .footer-inner p { order: 1; width: 100%; }
  .reader .reading-bar { top: 58px; }
  .reading-bar-inner { min-height: 49px; gap: 8px; flex-wrap: wrap; padding-block: 6px; }
  .reading-bar-inner label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .reading-bar select { flex: 1; max-width: min(69%, 24rem); min-width: 130px; }
  .reader .section, .reader .interlude { scroll-margin-top: 41px; }
  .reader .section, .reader .section + .section { padding-block: 35px 46px; }
  .reader .section > .wrap { display: flex; flex-direction: column; }
  .reader .section-head { order: -1; margin-bottom: 21px; }
  .reader-title { padding-block: 30px 0; }
  .chapter-art { margin-bottom: 23px; }
  .chapter-art img { height: clamp(220px, 67vw, 398px); }
  .interlude { grid-template-columns: 1fr; }
  .interlude-art { height: clamp(215px, 64vw, 362px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .site-header, .reading-bar, .site-footer, canvas { display: none !important; }
  .reader { background: #fff; color: #171822; }
  .reader .section h2, .reader .section-head p { color: #171822; }
}

/* During a phase crossing, individual strokes lead or lag without hiding the text. */
.cover h1 span:nth-child(2) { --phase-letter: .07em; }
.cover h1 span:nth-child(3) { --phase-letter: -.045em; }
.cover h1 span:nth-child(4) { --phase-letter: .055em; }
.cover h1 span:nth-child(5) { --phase-letter: -.07em; }
.contact-reconstruction span { animation: reconstruct .72s cubic-bezier(.18,.7,.26,1) both; }
.phase-fissure h1 span { animation: fissure .31s cubic-bezier(.35,.01,.76,1) both; }
@keyframes reconstruct {
  0% {
    transform: translate(var(--phase-letter, -.09em), var(--phase-letter, .07em)) skewY(-5deg);
    text-shadow: -.045em 0 #829cc880, .04em 0 #d1b9c470;
    clip-path: inset(9% 0 16% 0);
  }
  100% { transform: none; text-shadow: none; clip-path: inset(0); }
}
@keyframes fissure {
  45% {
    transform: translateY(var(--phase-letter, .045em)) scaleY(.97);
    text-shadow: -.012em 0 #afcaffb0, .018em 0 #d8b4be80;
  }
}
.motion-off .cover h1 span, .motion-off .card-art img { animation: none; transition: none; }
.motion-off .chapter-card:hover img { transform: none; }

