/* ==========================================================================
   Visions of Superintelligence — Editorial Showcase & Trajectory Lab
   Bundled Series Fonts + Dark / Paper Prestige Palette
   ========================================================================== */

@font-face {
  font-family: "Inter Display";
  src: url("fonts/InterDisplay-ExtraLight.otf") format("opentype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter Display";
  src: url("fonts/InterDisplay-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter Display";
  src: url("fonts/InterDisplay-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TeX Gyre Heros Cn";
  src: url("fonts/texgyreheroscn-regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080c0e;
  --bg-elev: #0e1417;
  --bg-card: #121a1e;
  --bg-card-2: #172126;
  --ink: #eae5dc;
  --ink-bright: #f7f2e8;
  --muted: #8b9698;
  --muted-2: #626e71;
  --rule: rgba(239, 179, 109, 0.14);
  --rule-subtle: #1f2b30;
  --gold: #efb36d;
  --gold-soft: rgba(239, 179, 109, 0.14);
  --cyan: #80ded0;
  --cyan-soft: rgba(128, 222, 208, 0.14);
  --coral: #e86f68;
  --coral-soft: rgba(232, 111, 104, 0.15);
  --topbar-bg: rgba(8, 12, 14, 0.84);
  --shadow-lg: 0 28px 60px -20px rgba(0, 0, 0, 0.72);
  --shadow-cover: 0 24px 48px -12px rgba(0, 0, 0, 0.82), 0 0 0 1px rgba(255, 255, 255, 0.07);

  --display: "Inter Display", system-ui, -apple-system, sans-serif;
  --cond: "TeX Gyre Heros Cn", "Arial Narrow", sans-serif;
  --serif: "Literata", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4efe6;
  --bg-elev: #ebe4d8;
  --bg-card: #fdfbf7;
  --bg-card-2: #f1ece2;
  --ink: #1b2022;
  --ink-bright: #0f1416;
  --muted: #5b6467;
  --muted-2: #7e8688;
  --rule: rgba(138, 90, 28, 0.22);
  --rule-subtle: #dbd3c5;
  --gold: #8a5a1c;
  --gold-soft: rgba(138, 90, 28, 0.11);
  --cyan: #156b61;
  --cyan-soft: rgba(21, 107, 97, 0.12);
  --coral: #be3a31;
  --coral-soft: rgba(190, 58, 49, 0.12);
  --topbar-bg: rgba(244, 239, 230, 0.88);
  --shadow-lg: 0 24px 50px -22px rgba(22, 24, 24, 0.18);
  --shadow-cover: 0 22px 42px -14px rgba(20, 22, 24, 0.34), 0 0 0 1px rgba(0, 0, 0, 0.08);
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 3px;
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.cyan { color: var(--cyan) !important; }
.coral { color: var(--coral) !important; }
.gold { color: var(--gold) !important; }

.container {
  max-width: 76rem;
  margin: 0 auto;
  padding-inline: clamp(1rem, 3vw, 2.25rem);
}

/* ---------- Top Navigation Bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--topbar-bg);
  backdrop-filter: saturate(1.3) blur(14px);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
  border-bottom: 1px solid var(--rule-subtle);
}

.topbar-inner {
  max-width: 76rem;
  margin: 0 auto;
  padding-inline: clamp(1rem, 3vw, 2.25rem);
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
}

.brand-author {
  font-family: var(--display);
  font-weight: 300;
  letter-spacing: 0.32em;
  color: var(--gold);
  font-size: 0.85rem;
}

.brand-sep {
  color: var(--muted-2);
}

.brand-series {
  font-family: var(--cond);
  letter-spacing: 0.18em;
  font-size: 0.82rem;
  color: var(--cyan);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.topnav a {
  transition: color 0.18s ease;
}
.topnav a:hover {
  color: var(--ink-bright);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.repo-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.68rem;
  border-radius: 999px;
  border: 1px solid var(--rule-subtle);
  background: var(--bg-elev);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.icon-btn {
  appearance: none;
  border: 1px solid var(--rule-subtle);
  background: var(--bg-card);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.38rem 0.72rem;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.icon-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(3rem, 6vw, 5.2rem) 0 clamp(3rem, 5vw, 4.5rem);
  border-bottom: 1px solid var(--rule-subtle);
  overflow: hidden;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 60% at 76% 36%, rgba(239, 179, 109, 0.09), transparent 70%),
    radial-gradient(ellipse 45% 50% at 22% 20%, rgba(128, 222, 208, 0.07), transparent 68%);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero-title {
  margin: 0 0 1.2rem;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.15rem, 4.3vw, 3.55rem);
  line-height: 1.09;
  letter-spacing: -0.015em;
  color: var(--ink-bright);
}

.hero-lead {
  margin: 0 0 1.85rem;
  max-width: 40rem;
  font-size: clamp(1.02rem, 1.2vw, 1.14rem);
  color: var(--muted);
  line-height: 1.72;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 2.35rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.78rem 1.3rem;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.16s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-gold {
  background: var(--gold);
  color: #0b0f11;
  font-weight: 600;
  box-shadow: 0 10px 26px -10px rgba(239, 179, 109, 0.55);
}
:root[data-theme="light"] .btn-gold {
  color: #fdfbf7;
}
.btn-gold:hover {
  filter: brightness(1.07);
}

.btn-ghost {
  background: var(--bg-card);
  border-color: var(--rule-subtle);
  color: var(--ink-bright);
}
.btn-ghost:hover {
  border-color: var(--cyan);
}

.btn-sm {
  padding: 0.54rem 0.88rem;
  font-size: 0.71rem;
}

.mono-badge {
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  background: var(--cyan-soft);
  color: var(--cyan);
  font-size: 0.66rem;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule-subtle);
}

.hero-metric {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hm-val {
  font-family: var(--mono);
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  font-weight: 600;
  color: var(--ink-bright);
}

.hm-lbl {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Hero Spotlight Card */
.hero-spotlight {
  display: flex;
  justify-content: center;
}

.spotlight-wrap {
  width: min(100%, 340px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.spotlight-cover-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 8;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-cover);
  transform: perspective(1100px) rotateY(-6deg) rotateX(2deg);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  user-select: none;
  -webkit-user-drag: none;
}
.spotlight-cover-frame:hover {
  transform: perspective(1100px) rotateY(0deg) rotateX(0deg) translateY(-4px);
}

.spotlight-cover-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
}

.spotlight-caption {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(3.5rem, 6vw, 5.5rem) 0;
  border-bottom: 1px solid var(--rule-subtle);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.section-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  letter-spacing: -0.01em;
  color: var(--ink-bright);
}

.section-sub {
  margin: 0;
  max-width: 32rem;
  font-size: 0.96rem;
  color: var(--muted);
}

/* ---------- Canonical Series Shelf ---------- */
.shelf-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}

.book-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--rule-subtle);
  border-radius: 8px;
  padding: 1rem;
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.book-card:hover {
  border-color: var(--rule);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.cover-slot {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 8;
  border-radius: 5px;
  overflow: hidden;
  background: #070a0c;
  box-shadow: var(--shadow-cover);
  margin-bottom: 1.1rem;
  user-select: none;
  cursor: pointer;
}

.cover-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
}

/* Painted-Title Canonical Forthcoming Cover System (Books II–IV) */
.forthcoming-cover {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 9% 7% 7.5%;
  background:
    radial-gradient(circle at 50% 42%, rgba(249, 186, 114, 0.11), transparent 62%),
    linear-gradient(180deg, #050709 0%, #0d1418 46%, #0a1013 78%, #050709 100%);
  color: #f6eee0;
  text-align: center;
  overflow: hidden;
}

.fc-art-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.42;
  pointer-events: none;
}

.fc-author {
  position: relative;
  z-index: 2;
  font-family: var(--display);
  font-weight: 200;
  font-size: clamp(0.76rem, 1.15vw, 0.92rem);
  letter-spacing: 0.44em;
  padding-left: 0.44em;
  color: rgba(249, 186, 114, 0.88);
}

.fc-center-badge {
  position: relative;
  z-index: 2;
  margin-top: auto;
  margin-bottom: 0.65rem;
  align-self: center;
  padding: 0.18rem 0.55rem;
  border: 1px solid rgba(128, 222, 208, 0.28);
  background: rgba(6, 10, 12, 0.68);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(128, 222, 208, 0.86);
}

.fc-title-stack {
  position: relative;
  z-index: 2;
  margin-bottom: 14%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12em;
  font-family: var(--display);
  font-weight: 300;
  color: #f4ece0;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.75);
}

.fc-t-small {
  font-size: clamp(0.68rem, 0.95vw, 0.82rem);
  letter-spacing: 0.28em;
  padding-left: 0.28em;
  opacity: 0.84;
  margin-bottom: 0.15rem;
}

.fc-t-main {
  font-size: clamp(1.25rem, 1.9vw, 1.65rem);
  line-height: 1.03;
  letter-spacing: 0.05em;
  padding-left: 0.05em;
}

.fc-series {
  position: relative;
  z-index: 2;
  font-family: var(--cond);
  font-size: clamp(0.52rem, 0.7vw, 0.63rem);
  letter-spacing: 0.1em;
  padding-left: 0.1em;
  color: #80ded0;
  white-space: nowrap;
}

.book-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vol-tag {
  color: var(--gold);
  font-weight: 600;
}

.status-pill {
  padding: 0.16rem 0.48rem;
  border-radius: 3px;
  font-size: 0.63rem;
}
.status-pill.published {
  background: var(--gold-soft);
  color: var(--gold);
}
.status-pill.upcoming {
  background: var(--cyan-soft);
  color: var(--cyan);
}

.book-card-title {
  margin: 0 0 0.45rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--ink-bright);
}

.book-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.theme-chip {
  font-family: var(--mono);
  font-size: 0.63rem;
  padding: 0.14rem 0.44rem;
  border-radius: 3px;
  background: var(--bg-elev);
  border: 1px solid var(--rule-subtle);
  color: var(--muted);
}

.book-logline {
  margin: 0 0 1.1rem;
  font-size: 0.89rem;
  line-height: 1.6;
  color: var(--muted);
  flex: 1;
}

.book-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
}

.book-secondary-row {
  display: flex;
  gap: 0.5rem;
}
.book-secondary-row > * {
  flex: 1;
}

/* ---------- Trajectory Lab ---------- */
.lab-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
  flex-wrap: wrap;
}

.book-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.book-tab {
  appearance: none;
  border: 1px solid var(--rule-subtle);
  background: var(--bg-card);
  color: var(--muted);
  padding: 0.55rem 0.95rem;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  transition: all 0.18s ease;
}
.book-tab:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--ink-bright);
}
.book-tab.active {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--ink-bright);
}
.book-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tab-count {
  padding: 0.1rem 0.38rem;
  border-radius: 3px;
  background: var(--bg-elev);
  font-size: 0.65rem;
  color: var(--cyan);
}

.lab-filters {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.segmented {
  display: inline-flex;
  background: var(--bg-elev);
  border: 1px solid var(--rule-subtle);
  border-radius: 5px;
  padding: 2px;
}

.seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.71rem;
  letter-spacing: 0.06em;
  padding: 0.42rem 0.78rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.16s ease;
}
.seg-btn.active {
  background: var(--bg-card-2);
  color: var(--ink-bright);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.redact-toggle {
  border: 1px solid var(--rule-subtle);
  background: var(--bg-card);
}
.redact-toggle.active {
  border-color: var(--coral);
  color: var(--coral);
}

/* Console Shell */
.console-shell {
  background: var(--bg-card);
  border: 1px solid var(--rule-subtle);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
}

.transport-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.25rem;
  padding: 0.95rem 1.25rem;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--rule-subtle);
  border-radius: 10px 10px 0 0;
}

.transport-buttons {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.play-btn {
  appearance: none;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: #090d0f;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.52rem 0.95rem;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 158px;
  justify-content: center;
}
:root[data-theme="light"] .play-btn {
  color: #fff;
}
.play-btn.playing {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #061010;
}

.step-btn {
  appearance: none;
  width: 34px;
  height: 34px;
  border-radius: 5px;
  border: 1px solid var(--rule-subtle);
  background: var(--bg-card);
  color: var(--ink-bright);
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.step-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.scrubber-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  min-width: 180px;
}

.scrubber-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.7rem;
}

.milestone-pill {
  padding: 0.1rem 0.48rem;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.scrubber {
  width: 100%;
  accent-color: var(--gold);
  cursor: pointer;
  height: 6px;
}

.speed-group {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.speed-lbl {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-right: 0.25rem;
}

.speed-btn {
  appearance: none;
  border: 1px solid var(--rule-subtle);
  background: var(--bg-card);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
}
.speed-btn.active {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-soft);
}

/* Commit Stage & Kinetic Word Flux Canvas */
.commit-stage {
  position: relative;
  padding: 1.35rem 1.35rem 1.25rem;
  border-bottom: 1px solid var(--rule-subtle);
  overflow: hidden;
}

.word-flux-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.85;
}

.commit-banner {
  position: relative;
  z-index: 2;
  margin-bottom: 1.15rem;
}

.commit-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
  font-size: 0.72rem;
}

.commit-cat-badge {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.16rem 0.5rem;
  border-radius: 3px;
  background: var(--cyan-soft);
  color: var(--cyan);
}
.commit-cat-badge[data-cat="cover"] { background: var(--gold-soft); color: var(--gold); }
.commit-cat-badge[data-cat="matter"] { background: var(--cyan-soft); color: var(--cyan); }
.commit-cat-badge[data-cat="edition"] { background: rgba(140, 168, 224, 0.16); color: #8eb4e6; }
.commit-cat-badge[data-cat="bible"] { background: rgba(186, 152, 224, 0.16); color: #c4a3e8; }
.commit-cat-badge[data-cat="publishing"],
.commit-cat-badge[data-cat="production"] { background: var(--gold-soft); color: var(--gold); }

.commit-hash {
  padding: 0.12rem 0.45rem;
  border-radius: 3px;
  background: var(--bg-elev);
  border: 1px solid var(--rule-subtle);
  color: var(--gold);
}

.commit-date { color: var(--muted); }
.commit-sha {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 0.68rem;
}

.commit-subject {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  line-height: 1.3;
  color: var(--ink-bright);
}

/* Telemetry Strip */
.telemetry-strip {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.tele-card {
  background: rgba(12, 18, 21, 0.68);
  border: 1px solid var(--rule-subtle);
  border-radius: 6px;
  padding: 0.78rem 0.9rem;
  backdrop-filter: blur(6px);
}
:root[data-theme="light"] .tele-card {
  background: rgba(255, 255, 255, 0.78);
}

.tele-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.tele-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.48rem;
}

.tele-num {
  font-family: var(--mono);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-bright);
}

.tele-unit, .tele-sub {
  font-size: 0.7rem;
  color: var(--muted);
}

.tele-bar {
  height: 3px;
  border-radius: 2px;
  background: var(--rule-subtle);
  overflow: hidden;
}
.tele-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--ink-bright);
  transition: width 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.tele-bar > i.cyan-fill { background: var(--cyan); }
.tele-bar > i.coral-fill { background: var(--coral); }
.tele-bar > i.gold-fill { background: var(--gold); }

/* Trajectory Chart Panel */
.chart-panel {
  padding: 1.1rem 1.35rem 1.25rem;
  border-bottom: 1px solid var(--rule-subtle);
  background: var(--bg-elev);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.panel-kicker {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
}

.leg-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.leg-dot.gold { background: var(--gold); }
.leg-dot.cyan { background: var(--cyan); }
.leg-dot.coral { background: var(--coral); }

.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 235px;
  cursor: crosshair;
}

#trajectoryChartCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-tooltip {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  background: var(--bg-card);
  border: 1px solid var(--gold);
  border-radius: 5px;
  padding: 0.5rem 0.7rem;
  box-shadow: var(--shadow-lg);
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.45;
  max-width: 260px;
}

/* Full Manuscript Galley Spread + Typesetter's Loupe */
.spread-inspector {
  display: grid;
  grid-template-columns: 1fr 310px;
  align-items: stretch;
  min-height: 520px;
}

.spread-main {
  padding: 1.25rem 1.35rem 1.4rem;
  border-right: 1px solid var(--rule-subtle);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.loupe-panel {
  padding: 1.25rem 1.25rem 1.4rem;
  background: var(--bg-elev);
  display: flex;
  flex-direction: column;
  border-radius: 0 0 10px 0;
}

.loupe-sticky {
  position: sticky;
  top: 74px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
  flex-wrap: wrap;
}

.panel-title {
  margin: 0.15rem 0 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--ink-bright);
}

.small-note {
  font-size: 0.68rem;
  margin-left: 0.4rem;
}

.genome-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  color: var(--muted);
}

.g-swatch {
  display: inline-block;
  width: 9px;
  height: 5px;
  border-radius: 1.5px;
  margin-right: 0.3rem;
  vertical-align: middle;
}
.g-swatch.eq { background: rgba(232, 226, 214, 0.55); }
:root[data-theme="light"] .g-swatch.eq { background: rgba(28, 33, 36, 0.55); }
.g-swatch.add { background: var(--cyan); }
.g-swatch.del { background: var(--coral); }
.g-swatch.gold-cap { background: var(--gold); }

.spread-canvas-wrap {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 460px;
}

#manuscriptSpreadCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

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

.step-btn-xs {
  width: 28px;
  height: 28px;
  font-size: 0.9rem;
}

.loupe-frame-wrap {
  width: 100%;
  aspect-ratio: 5 / 8;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-cover);
  background: #0a0f12;
}
:root[data-theme="light"] .loupe-frame-wrap {
  background: #fbf8f1;
}

#pageLoupeCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.loupe-caption {
  margin: 0.75rem 0 0;
  font-size: 0.67rem;
  line-height: 1.5;
  color: var(--muted);
}

.empty-state-box {
  padding: 1.4rem;
  border: 1px dashed var(--rule-subtle);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

/* ---------- Manifesto & Author ---------- */
.manifesto-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.manifesto-prose p {
  margin: 0 0 1.15rem;
  font-size: 1.04rem;
  line-height: 1.78;
  color: var(--ink);
}

.author-card {
  background: var(--bg-card);
  border: 1px solid var(--rule-subtle);
  border-radius: 8px;
  padding: 1.6rem;
}

.author-name {
  margin: 0 0 0.65rem;
  font-family: var(--display);
  font-weight: 300;
  letter-spacing: 0.22em;
  font-size: 1.35rem;
  color: var(--gold);
}

.author-bio, .integrity-note {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.65;
}

.rule-line {
  height: 1px;
  background: var(--rule-subtle);
  margin: 1.25rem 0;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 2.4rem 0 3rem;
  background: var(--bg-elev);
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-series {
  font-family: var(--cond);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--cyan);
}

.footer-copy {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.footer-meta {
  font-size: 0.72rem;
  color: var(--muted-2);
  text-align: right;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(4, 7, 9, 0.82);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-card {
  position: relative;
  width: min(100%, 52rem);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: sticky;
  top: 0;
  float: right;
  appearance: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--rule-subtle);
  background: var(--bg-elev);
  color: var(--ink);
  cursor: pointer;
}
.modal-close:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.modal-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.8rem;
  align-items: start;
}

.modal-epigraph {
  margin: 1rem 0 1.25rem;
  padding-left: 1rem;
  border-left: 2px solid var(--gold);
  font-style: italic;
  font-size: 0.94rem;
  color: var(--muted);
}

.modal-blurb p {
  margin: 0 0 0.85rem;
  font-size: 0.96rem;
  line-height: 1.7;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 1.4rem;
  right: 1.4rem;
  z-index: 95;
  max-width: 26rem;
  background: var(--bg-card);
  border: 1px solid var(--gold);
  border-radius: 7px;
  padding: 0.85rem 1.1rem;
  box-shadow: var(--shadow-lg);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--ink-bright);
}

/* ---------- Responsive ---------- */
@media (max-width: 1060px) {
  .shelf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .spread-inspector {
    grid-template-columns: 1fr;
  }
  .spread-main {
    border-right: 0;
    border-bottom: 1px solid var(--rule-subtle);
  }
  .loupe-frame-wrap {
    max-width: 320px;
    margin-inline: auto;
  }
}

@media (max-width: 860px) {
  .hero-grid,
  .manifesto-grid {
    grid-template-columns: 1fr;
  }
  .hero-spotlight {
    order: -1;
  }
  .spotlight-wrap {
    width: min(100%, 250px);
  }
  .transport-bar {
    grid-template-columns: 1fr;
  }
  .telemetry-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .topnav {
    display: none;
  }
  .modal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .shelf-grid,
  .hero-metrics,
  .telemetry-strip {
    grid-template-columns: 1fr;
  }
  .brand-series {
    display: none;
  }
}
