/* boushev.ru — CRT terminal look. Values follow the Claude Design handoff (kept locally in _bak/). */

/* ==== Tokens =========================================================================== */

:root {
  --bg: #17181b;
  --bg-reader: #141518;
  --bg-input: #121315;
  --bg-card: #1b1c20;
  --line: #2a2c31;
  --line-btn: #2f3136;
  --text: #d9d6cf;
  --text-body: #bdb9b0;
  --text-reader: #d4d0c8;
  --text-tag: #a9a59d;
  --text-muted: #8d8a83;
  --text-dim: #6f6c66;
  --slash: #4a4c52;
  --error: #e0675a;
  --death: #de404c;
  --ink: #17181b; /* text on accent backgrounds */

  /* system fonts stand in while the site's own load (or if they never do) */
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, 'DejaVu Sans Mono', monospace;
  --serif: 'Literata', Georgia, 'Times New Roman', serif;

  /* phosphor theme: amber (default) */
  --c: #f0a640;
  --c-hi: #ffd08a;
  --c-dim: #8a6730;
  --c-line: #3a3528;
  --c-alt: #75a032;
  --glow: rgba(240, 166, 64, .4);
  --phosphor: 255 176 0; /* photo pixels, read by phosphor.js */

  --c-35: color-mix(in srgb, var(--c) 35%, transparent);
  --c-shadow: 0 0 18px var(--c-35);
}

:root[data-theme="green"] {
  --c: #75a032;
  --c-hi: #a6cf63;
  --c-dim: #56752a;
  --c-line: #2e3a24;
  --c-alt: #a8803e;
  --glow: rgba(117, 160, 50, .45);
  --phosphor: 157 214 67;
}

/* ==== Base ============================================================================= */

html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--c); text-decoration: none; }
a:hover { color: var(--c-hi); }
button { font-family: inherit; }
input::placeholder { color: var(--text-dim); }
body:not(.page-home) ::selection { background: var(--c); color: var(--ink); }
[hidden] { display: none !important; }

@keyframes flick { 0% { opacity: 1; } 50% { opacity: .94; } 100% { opacity: 1; } }
@keyframes flick-soft { 0% { opacity: 1; } 50% { opacity: .96; } 100% { opacity: 1; } }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes jit {
  0%, 93%, 100% { transform: none; }
  94% { transform: translate(2px, 0) skewX(-4deg); }
  95% { transform: translate(-2px, 0); }
  96% { transform: translate(1px, 0) skewX(3deg); }
  97% { transform: none; }
}
@keyframes glow {
  0%, 100% { text-shadow: 0 0 10px var(--g), 0 0 26px var(--g); }
  50% { text-shadow: 0 0 14px var(--g), 0 0 38px var(--g); }
}

.flick { animation: flick .14s infinite; }
.blink { animation: blink .8s steps(1) infinite; }
.fx-jit {
  animation: jit var(--jit, 7s) infinite;
  transform-origin: left center;
  text-shadow: 1px 0 0 rgba(255, 90, 70, .35), -1px 0 0 rgba(90, 200, 255, .3);
}

/* Entrance: blocks wait hidden until intro.js adds .is-in (only when JS runs). */
.js [data-fade] { transition: opacity var(--fade, .5s) ease-out, transform var(--fade, .5s) ease-out; }
.js [data-fade]:not(.is-in) { opacity: 0; transform: translateY(6px); }
/* If the scripts never start (blocked on the way — see .site-note), show the blocks anyway */
.js:not(.booted) [data-fade] { animation: show-anyway 0s 4s forwards; }
@keyframes show-anyway { to { opacity: 1; transform: none; } }

/* «The site didn't load completely — use a VPN» (partials.mjs → siteNote). Without
   site.css it is plain text at the top of the page; with it, it appears after a delay
   unless the scripts started (page.js adds .booted). */
.site-note {
  position: fixed;
  z-index: 70;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 560px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--c);
  box-shadow: 0 0 24px color-mix(in srgb, var(--c) 20%, transparent);
  font: 14px/1.5 var(--mono);
  color: var(--text);
  opacity: 0;
  visibility: hidden;
  animation: note-in .5s 8s forwards;
}
.booted .site-note { display: none; }
@keyframes note-in { to { opacity: 1; visibility: visible; } }

/* CRT scanlines over the whole page */
.crt {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, var(--crt, .1)) 2px, rgba(0, 0, 0, var(--crt, .1)) 3px);
}

@media (prefers-reduced-motion: reduce) {
  .flick, .blink, .fx-jit, .photo, .cover, .home__book, .home__cursor { animation: none !important; }
}

/* ==== Type ============================================================================= */

/* Header label (BOUSHEV.RU, FRAGMENTED CONNECTIONS, ПОЛНЫЙ ТЕКСТ…); letters flicker */
.mark {
  font: 500 12px/1.4 var(--mono);
  letter-spacing: .3em;
  color: var(--c-dim);
  white-space: pre;
}
.mark > span { transition: color .6s, text-shadow .6s; }
.mark > span.lit {
  color: var(--c);
  text-shadow: 0 0 8px var(--c), 0 0 16px color-mix(in srgb, var(--c) 60%, transparent);
  transition-duration: .04s;
}
.mark--soft > span.lit { text-shadow: 0 0 8px var(--c); }

/* Sub-label (РОМАН · ТВЁРДАЯ…, ОТРЫВОК 01 / 02…) */
.kicker {
  font: 500 12px/1.4 var(--mono);
  letter-spacing: .18em;
  color: var(--text-muted);
}

.panel-text,
.modal__text {
  font: clamp(16px, 1.2vw, 18px)/1.45 var(--serif);
  color: var(--text-body);
  text-wrap: pretty;
}

/* ==== Buttons ========================================================================== */

/* Secondary: everything that isn't the main action */
.btn,
.btn:hover {
  font: 500 13px/1 var(--mono);
  letter-spacing: .06em;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid var(--c);
  color: var(--c);
  cursor: pointer;
}
.btn:hover { background: color-mix(in srgb, var(--c) 8%, transparent); }
.btn.is-off, .btn.is-off:hover { border-color: var(--line-btn); color: var(--text-muted); }
.btn--static, .btn--static:hover { display: inline-block; background: transparent; }
.btn--neutral, .btn--neutral:hover { border-color: var(--line-btn); color: var(--text-muted); }
.btn--neutral:hover { background: transparent; border-color: var(--text-muted); color: var(--text); }

/* Primary: the important action */
.btn-primary,
.btn-primary:hover {
  display: inline-flex;
  align-items: center;
  height: 48px;
  box-sizing: border-box;
  font: 500 13px/1 var(--mono);
  letter-spacing: .1em;
  background: var(--c);
  color: var(--ink);
  border: none;
  padding: 0 22px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary:hover { box-shadow: 0 0 24px color-mix(in srgb, var(--c) 45%, transparent); }
.btn-primary:disabled { cursor: progress; }

/* ← back */
.btn-back {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-btn);
  font: 14px/1 var(--mono);
  color: var(--text-tag);
}
.btn-back:hover { border-color: var(--c); color: var(--c); }

/* ==== Header (book, chronology) ======================================================== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: clamp(14px, 2.6vh, 28px) 0;
  border-bottom: 1px solid var(--line);
  font: 13px/1.3 var(--mono);
}
.topbar { position: relative; z-index: 20; } /* anchors the ☰ drop-down */
.topbar--book { letter-spacing: .04em; }
.topbar__left { display: flex; align-items: center; gap: 12px; min-width: 0; }

/* FRAGMENTED CONNECTIONS / CODE — the slash sits exactly between the two parts */
.crumb {
  --crumb-fs: 12px;
  --crumb-ls: .3em;
  display: inline-flex;
  align-items: baseline;
  gap: .6em;
  min-width: 0;
  font: 500 var(--crumb-fs)/1.4 var(--mono);
}
.crumb__en { font: inherit; letter-spacing: var(--crumb-ls); margin-right: calc(-1 * var(--crumb-ls)); min-width: 0; overflow: hidden; text-overflow: ellipsis; } /* on the narrowest phones the title yields to the buttons */
.crumb__slash, .crumb__code { flex: none; }
.crumb__slash { color: var(--slash); letter-spacing: 0; }
.crumb__code { color: var(--text-muted); letter-spacing: var(--crumb-ls); white-space: pre; }

/* ==== Request form ===================================================================== */

.cf { display: flex; flex-direction: column; gap: clamp(10px, 1.6vh, 18px); }
.cf__body { position: relative; }
.cf__controls {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.6vh, 18px);
  transition: opacity .45s ease-out;
}
.cf.is-sent .cf__controls { opacity: 0; pointer-events: none; }
.cf.is-sent-shown .cf__controls { visibility: hidden; }
.cf__types { display: flex; gap: 6px; flex-wrap: wrap; }
.cf__row { display: flex; flex-wrap: wrap; row-gap: 10px; } /* side by side on wide screens; when the button wraps under the field (phones), a gap between them */
.cf__input {
  flex: 1 1 200px;
  min-width: 0;
  height: 48px;
  box-sizing: border-box;
  padding: 0 14px;
  background: var(--bg-input);
  border: 1px solid var(--line-btn);
  border-radius: 0;
  color: var(--text);
  font: 15px/1 var(--mono);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.cf__input:focus { border-color: var(--c); }
.cf__input[aria-invalid="true"] { border-color: var(--error); }
.cf__hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.cf__error { font: 13px/1.4 var(--mono); color: var(--error); }
.cf__hint { font: 12px/1.4 var(--mono); color: var(--text-dim); }
.cf__done {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font: 14px/1.6 var(--mono);
  color: var(--c);
  text-shadow: 0 0 10px var(--c-35);
}
.cf__done > div { opacity: 0; transition: opacity .5s ease-out; }
.cf__done > div.is-on { opacity: 1; }
.cf__cursor {
  display: inline-block;
  width: .6em;
  height: 1em;
  margin-left: 4px;
  vertical-align: -.15em;
  background: var(--c);
  box-shadow: 0 0 8px var(--c);
  animation: blink .8s steps(1) infinite;
}

/* ==== Dialogs ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(10, 10, 12, .82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal__box {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100svh - 32px);
  overflow-y: auto;
  box-sizing: border-box;
  padding: clamp(20px, 4vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg);
  border: 1px solid var(--c);
  box-shadow: 0 0 40px color-mix(in srgb, var(--c) 15%, transparent);
  outline: none;
}
.modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font: 15px/1 var(--mono);
  cursor: pointer;
}
.modal__close:hover { color: var(--c); }
.modal__title {
  font: 500 clamp(24px, 3vw, 32px)/1.1 var(--mono);
  color: var(--c);
  text-shadow: var(--c-shadow);
  padding-right: 32px;
}
.modal__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.modal__foot--split { justify-content: space-between; align-items: center; }
.modal__text p { margin: 0; }
.modal__text p + p { margin-top: .6em; }

/* «ПОЛНЫЙ ТЕКСТ» blocks (partials.mjs → fullText): the button that opens the request dialog */
.full-text__action { display: flex; }

/* ==== Home ============================================================================= */

.home {
  min-height: 100svh;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(32px, 6vw, 104px);
  padding: clamp(24px, 5vw, 96px) clamp(20px, 5vw, 96px);
  position: relative;
}

/* Photo on the CRT: --scan (set by home.js) = one scanline per source pixel row */
.photo {
  position: relative;
  flex: none;
  background: var(--bg-input);
  cursor: pointer;
  animation: flick-soft .14s infinite;
}
.photo canvas { display: block; image-rendering: pixelated; width: 300px; height: 400px; }
.photo::before,
.photo::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.photo::before {
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) calc(var(--scan, 4px) * .55), rgba(0, 0, 0, .5) calc(var(--scan, 4px) * .75), rgba(0, 0, 0, .5) var(--scan, 4px));
}
.photo::after { background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, .35) 100%); }

.home__col { flex: 0 1 520px; min-width: 0; display: flex; flex-direction: column; gap: clamp(24px, 4vh, 40px); }
.home__intro { display: flex; flex-direction: column; gap: 10px; }
.home__name {
  margin: 0;
  font: 500 clamp(30px, 3vw, 40px)/1.15 var(--mono);
  color: var(--c);
  text-shadow: 0 0 16px var(--glow);
}
.home__cursor { text-shadow: 0 0 14px var(--glow); animation: blink .8s steps(1) infinite; }
.home__tag { margin: 0; font: 400 clamp(16px, 1.3vw, 18px)/1.5 var(--serif); color: var(--text-tag); }

.home__menu { display: flex; flex-direction: column; border-top: 1px solid transparent; margin-top: 12px; }
.home__row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.home__row--active,
.home__row--active:hover {
  border-top: 1px solid var(--line);
  padding: 20px 10px 20px 4px;
  color: var(--c);
  text-shadow: 0 0 12px var(--glow);
}
.home__row--active:hover { background: rgba(255, 255, 255, .03); }
.home__row--soon { padding: 16px 10px 16px 4px; color: var(--text-dim); font: 16px/1.25 var(--mono); }
.home__caret { font: 500 18px/1 var(--mono); }
.home__item { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.home__book {
  --g: var(--glow);
  font: 500 clamp(17px, 1.5vw, 20px)/1.25 var(--mono);
  animation: glow 2.8s ease-in-out infinite;
}
.home__path { font: 13px/1.2 var(--mono); color: var(--text-muted); text-shadow: none; }
.home__soon { font-size: 11px; letter-spacing: .12em; }
.home__social { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }

/* ==== Book ============================================================================= */

.book {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(20px, 4.5vw, 72px);
  box-sizing: border-box;
  position: relative;
}
/* Header navigation (partials.mjs → topNav): buttons, or a ☰ drop-down below 720px */
.topnav { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.topnav__burger {
  flex: none;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--line-btn);
  color: var(--text);
  font: 14px/1 var(--mono);
  cursor: pointer;
}
.topnav__menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--line);
  font: 15px/1 var(--mono);
  letter-spacing: .04em;
}
.topnav__menu a { padding: 16px; border-bottom: 1px solid var(--line); }
.topnav__menu button {
  text-align: left;
  background: none;
  border: none;
  padding: 16px;
  color: var(--c);
  font: inherit;
  cursor: pointer;
}
@media (min-width: 720px) { .topnav__burger, .topnav__menu { display: none !important; } }
@media (max-width: 719.98px) { .topnav { display: none; } .topbar { column-gap: 12px; } }
/* the book's header label shrinks on phones like the breadcrumbs do (README: <720px → 10.5px, .08em) */
@media (max-width: 719.98px) { .topbar--book .mark { font-size: 10.5px; letter-spacing: .08em; } }

.book__main {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: center;
  justify-content: space-between;
  gap: 40px clamp(48px, 7vw, 120px);
  padding: clamp(16px, 3vh, 72px) 0;
}
.book__col {
  flex: 1 1 440px;
  min-width: 0;
  max-width: 880px; /* wide enough that the annotation leaves room for the bottom panels on 1280×800 / 1366×768 */
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2vh, 28px);
}
.book__head { display: flex; flex-direction: column; gap: 12px; }
.book__title {
  margin: 0;
  white-space: nowrap;
  font: 500 clamp(22px, min(calc((100vw - 48px) / 10.4), calc(3.8vw + 14px), 6vh), 54px)/1.06 var(--mono);
  color: var(--c);
  text-shadow: var(--c-shadow);
  letter-spacing: -.01em;
  animation: flick .14s infinite;
}
.book__quote {
  margin: 4px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 24px;
  border-left: 1px solid var(--c-line);
}
.book__quote blockquote {
  margin: 0;
  font: italic 400 clamp(16px, min(1.15vw, 2.1vh), 18px)/1.5 var(--serif);
  color: var(--text);
  text-wrap: pretty;
}
.book__annotation {
  margin: 0;
  font: 400 clamp(15px, min(1.1vw, 2vh), 17px)/1.62 var(--serif);
  color: var(--text-body);
  text-wrap: pretty;
}
.book__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.book__read { --jit: 6.3s; }

.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font: 12px/1 var(--mono);
  color: var(--text-tag);
  border: 1px solid var(--line-btn);
  padding: 7px 10px;
  cursor: default;
  transition: color 1.8s ease-out, border-color 1.8s ease-out, text-shadow 1.8s ease-out;
}
.tag:hover {
  color: var(--c);
  border-color: var(--c);
  text-shadow: 0 0 10px color-mix(in srgb, var(--c) 40%, transparent);
  transition: color .15s, border-color .15s, text-shadow .15s;
}
.tags--aside { margin-top: calc(clamp(12px, 2vh, 28px) - 12px); } /* lines up with .book__col's gap */

/* Cover column only from 1000px; below it the tags move under the button */
.book__aside {
  flex: 0 1 340px;
  max-width: 380px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 auto;
}
@media (min-width: 1000px) { .tags--inline { display: none; } }
@media (max-width: 999.98px) { .book__aside { display: none; } }

.cover {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: max(280px, calc(100svh - 470px));
  background: var(--bg-input);
  animation: flick .14s infinite;
}
.cover canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  image-rendering: pixelated;
  cursor: pointer;
}
.cover::before,
.cover::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.cover::before { background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, .45) 2px, rgba(0, 0, 0, .45) 4px); }
.cover::after { background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, .45) 100%); }

/* Bottom: «ПОЛНЫЙ ТЕКСТ» | «ПЕРЕВОД» — two columns from 960px, divided by a 1px gap */
.book__bottom {
  --pad-in: clamp(32px, 4vw, 64px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  margin-bottom: clamp(12px, 3vh, 48px);
}
@media (max-width: 959.98px) {
  .book__bottom { --pad-in: 0px; grid-template-columns: minmax(0, 1fr); }
}
.book__panel {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.6vh, 18px);
}
.book__panel--form { padding: clamp(14px, 3vh, 52px) var(--pad-in) clamp(14px, 3vh, 52px) 0; }
.book__panel--donate { padding: clamp(14px, 3vh, 52px) 0 clamp(14px, 3vh, 52px) var(--pad-in); }
.book__panel--donate .panel-text { max-width: 560px; }
/* Both panels share a grid row; each one's button sits at its bottom, so the two
   buttons stay level whichever panel is taller. */
.book__donate,
.book__panel .full-text__action { display: flex; margin-top: auto; }

/* ==== Reader =========================================================================== */

html:has(.page-reader),
.page-reader { background: var(--bg-reader); }
.page-reader { --crt: .08; } /* lighter scanlines while reading */

.reader { min-height: 100svh; display: flex; flex-direction: column; background: var(--bg-reader); }
.reader__bar { position: sticky; top: 0; z-index: 10; background: var(--bg-reader); }
.reader__progress { height: 2px; background: #24262a; }
.reader__progress-fill { width: 0; height: 2px; background: var(--c); box-shadow: 0 0 8px var(--c); }
.reader__head {
  --gap: 12px;
  --gap-tools: 6px;
  --tool: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px clamp(16px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
  font: 13px/1 var(--mono);
}
.reader__left { display: flex; align-items: center; gap: var(--gap); min-width: 0; }
.reader__tools { flex: none; display: flex; gap: var(--gap-tools); align-items: center; }
.reader__fs {
  width: var(--tool);
  height: var(--tool);
  padding: 0;
  background: none;
  border: 1px solid var(--line-btn);
  color: var(--text);
  font: 12px/1 var(--mono);
  cursor: pointer;
}
.reader__fs--up { font-size: 14px; }
.reader__fs:hover { border-color: var(--c); color: var(--c); }

.reader__main { flex: 1; padding: clamp(36px, 7vh, 80px) clamp(20px, 5vw, 40px) 140px; }
.reader__article {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vh, 32px);
}
.reader__tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.reader__titles { display: flex; flex-direction: column; gap: 12px; }
.reader__title {
  margin: 0;
  font: 500 clamp(28px, min(3.4vw, 6vh), 46px)/1.1 var(--mono);
  color: var(--c);
  text-shadow: var(--c-shadow);
  letter-spacing: -.01em;
  animation: flick .14s infinite;
  text-wrap: balance;
}
/* Book typesetting: paragraphs follow each other with a first-line indent and no gap;
   only a blank line in the manuscript (.reader__break) leaves one empty line. */
.reader__text {
  --line: calc(var(--reader-fs, 17px) * 1.72); /* one line of text */
  display: flex;
  flex-direction: column;
}
.reader__text p {
  margin: 0;
  font-family: var(--serif);
  font-size: var(--reader-fs, 17px);
  line-height: 1.72;
  text-indent: 1.5em;
  color: var(--text-reader);
  text-wrap: pretty;
  hyphens: auto;
}
.reader__sub { margin: var(--line) 0 calc(var(--line) / 2); font: 500 13px/1.4 var(--mono); letter-spacing: .16em; color: var(--c); }
.reader__break { height: var(--line); }
.reader__sep { text-align: center; font: 14px/1 var(--mono); letter-spacing: 1em; color: var(--text-dim); padding: calc(var(--line) / 2) 0; }
.reader__next { display: flex; justify-content: flex-end; padding-top: 8px; }
.reader__form {
  margin-top: clamp(16px, 4vh, 40px);
  border-top: 1px solid var(--line);
  padding-top: clamp(24px, 4vh, 40px);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.6vh, 18px);
}

/* Floating «read the whole novel»: right edge of the text column; full width on phones */
.reader__cta {
  position: fixed;
  z-index: 20;
  bottom: 24px;
  right: max(clamp(12px, 5vw, 32px), calc(50vw - 348px));
  display: flex;
  justify-content: flex-end;
  padding: 8px;
  background: rgba(20, 21, 24, .82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: opacity .5s ease-out, transform .5s ease-out;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}
.reader__cta.is-shown { opacity: 1; transform: none; pointer-events: auto; }
.reader__cta .btn-primary { justify-content: center; }

@media (max-width: 719.98px) {
  .reader__head { --gap: 10px; --gap-tools: 4px; --tool: 28px; }
  .reader .crumb { --crumb-fs: 10.5px; --crumb-ls: .08em; gap: .35em; }
  .reader__cta { bottom: 12px; left: 12px; right: 12px; }
  .reader__cta .btn-primary { width: 100%; }
}

/* ==== Chronology ======================================================================= */

.chrono {
  min-height: 100svh;
  padding: 0 clamp(16px, 4.5vw, 72px);
  box-sizing: border-box;
  position: relative;
}
.chrono__body { max-width: 1180px; margin: 0 auto; }
.chrono__intro {
  padding: clamp(36px, 7vh, 72px) 0 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 760px;
}
.chrono__title {
  margin: 0;
  font: 500 clamp(30px, 4vw, 56px)/1.08 var(--mono);
  color: var(--c);
  text-shadow: var(--c-shadow);
  animation: flick .14s infinite;
}
.chrono__lead { margin: 0; font: 400 clamp(16px, 1.25vw, 18px)/1.6 var(--serif); color: var(--text-body); text-wrap: pretty; }
.chrono__toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.chrono__chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Colour of an event kind: .tone-* sets --ev */
.tone-fed { --ev: var(--c-alt); }
.tone-col { --ev: var(--c); }
.tone-death { --ev: var(--death); }
.tone-pivot { --ev: #f3efe6; }

.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 500 13px/1 var(--mono);
  letter-spacing: .06em;
  padding: 9px 12px;
  cursor: pointer;
  background: transparent;
  border: 1px solid #3a3c42;
  color: var(--text);
}
.chip__dot { width: 8px; height: 8px; background: var(--ev); }
.chip[aria-pressed="false"] { border-color: #24262a; color: var(--text-dim); }
.chip[aria-pressed="false"] .chip__dot { background: transparent; }

/* Timeline: ≥860px — Federation left, colony right, dates on the centre spine;
   narrower — date on the left, card on the right. */
.tl__sides {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1fr);
  padding: 24px 0 4px;
  font: 500 12px/1 var(--mono);
  letter-spacing: .16em;
}
.tl__sides .tone-fed { text-align: right; color: var(--ev); }
.tl__sides .tone-col { color: var(--ev); }

.tl { position: relative; padding: 8px 0 40px; }
.tl__spine { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--line-btn); }
.tl__year {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  padding: 18px 0 12px;
  background: var(--bg);
}
.tl__year span {
  font: 500 12px/1.3 var(--mono);
  letter-spacing: .14em;
  color: var(--ink);
  background: var(--c);
  padding: 8px 12px;
}

.ev {
  display: grid;
  align-items: center;
  margin: 10px 0;
  grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1fr);
}
.ev__date { grid-row: 1; grid-column: 2; display: flex; justify-content: center; position: relative; z-index: 2; }
.ev__date span {
  font: 500 12px/1 var(--mono);
  background: var(--bg);
  padding: 6px 7px;
  white-space: nowrap;
  color: var(--ev);
  border: 1px solid var(--ev);
}
.ev__cell { grid-row: 1; grid-column: 3; display: flex; min-width: 0; justify-content: flex-start; }
.ev--L .ev__cell { grid-column: 1; justify-content: flex-end; }

.ev__card,
.ev__secret {
  width: 100%;
  max-width: 460px;
  box-sizing: border-box;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}
.ev__card { gap: 5px; background: var(--bg-card); border: 1px solid var(--line); text-align: left; }
.ev--L .ev__card { text-align: right; }
.ev__card--pivot { background: #201f1c; border-color: #6b5d40; }
.ev__label { font: 500 11px/1.2 var(--mono); letter-spacing: .14em; color: var(--ev); }
.ev__title { font: 400 16px/1.35 var(--serif); color: #e2ded6; text-wrap: pretty; }
.ev__star { font-size: 17px; line-height: 0; vertical-align: -1px; margin-right: 5px; color: var(--ev); text-shadow: 0 0 10px var(--ev); }
.ev__desc { font: 12px/1.45 var(--mono); color: var(--text-muted); }
.ev__who { font: 12px/1.45 var(--mono); color: var(--text-tag); }

/* Spoiler: a classified placeholder until revealed (.is-open) */
.ev[data-sp]:not(.is-open) .ev__card,
.ev.is-open .ev__secret { display: none; }
.ev__secret {
  gap: 8px;
  align-items: flex-start;
  background: #151618;
  border: 1px dashed var(--c-line);
  cursor: pointer;
}
.ev--L .ev__secret { align-items: flex-end; }
.ev__secret:hover { border-color: var(--c); background: #1b1a17; }
.ev__secret-label { font: 500 11px/1.2 var(--mono); letter-spacing: .14em; color: var(--c); }
.ev__bar { display: block; height: 10px; width: 88%; background: var(--line); }
.ev__bar--short { width: 62%; }
.ev__secret-hint { font: 11px/1.2 var(--mono); color: var(--text-muted); }

@media (max-width: 859.98px) {
  .chrono .crumb { --crumb-fs: 10.5px; --crumb-ls: .08em; gap: .35em; }
  .tl__sides { display: none; }
  .tl__spine { left: 38px; }
  .tl__year { justify-content: flex-start; }
  .ev { grid-template-columns: 76px minmax(0, 1fr); }
  .ev__date { grid-column: 1; }
  .ev__cell,
  .ev--L .ev__cell { grid-column: 2; justify-content: flex-start; }
  .ev--L .ev__card { text-align: left; }
  .ev--L .ev__secret { align-items: flex-start; }
}

.chrono__form { border-top: 1px solid var(--line); padding: clamp(28px, 5vh, 52px) 0 clamp(40px, 7vh, 72px); }
.chrono__form-inner { display: flex; flex-direction: column; gap: clamp(10px, 1.6vh, 18px); max-width: 560px; }
