/* ═══════════════════════════════════════════════════════════════════════════
   CHAPTERS — BASIC
   Editorial index that surfaces every plate of every chapter.
═══════════════════════════════════════════════════════════════════════════ */

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

html, body {
  background: #0a0908;
  color: #e8e2d6;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}
body.basic-body { overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.bs-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px clamp(24px, 4vw, 56px);
  background: rgba(10, 9, 8, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(196, 167, 108, 0.08);
}
.bs-mark {
  font-family: var(--font-display);
  font-size: 17px;
  color: #e8e2d6;
}
.bs-nav {
  display: flex;
  gap: 32px;
  font-family: var(--font-sc);
  font-size: 9px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}
.bs-nav a {
  color: rgba(232, 226, 214, 0.42);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.3s, border-color 0.3s;
}
.bs-nav a:hover,
.bs-nav a[aria-current="page"] {
  color: #c4a76c;
  border-color: rgba(196, 167, 108, 0.4);
}
@media (max-width: 700px) { .bs-nav { display: none; } }

.bs { padding-top: 90px; }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.bs-hero {
  padding: clamp(40px, 8vh, 90px) clamp(24px, 5vw, 72px) clamp(40px, 6vh, 70px);
  max-width: 1280px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}
.bs-hero::after {
  content: '';
  display: block;
  width: 42px;
  height: 1px;
  background: #c4a76c;
  margin: 40px auto 0;
  opacity: 0.4;
}
.bs-eyebrow {
  display: inline-block;
  font-family: var(--font-sc);
  font-size: 10px;
  letter-spacing: 0.48em;
  text-transform: uppercase;
  color: rgba(196, 167, 108, 0.62);
  margin-bottom: 26px;
}
.bs-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.2rem, 5.4vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin-bottom: 22px;
  color: #e8e2d6;
}
.bs-title em {
  font-style: italic;
  color: #c4a76c;
  font-weight: 400;
}
.bs-lede {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.7;
  color: rgba(232, 226, 214, 0.52);
  max-width: 64ch;
  margin: 0 auto;
}
.bs-hero-meta {
  margin-top: 34px;
  display: inline-flex;
  align-items: center;
  gap: 22px;
}
.bs-hero-meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.bs-num {
  font-family: var(--font-display);
  font-size: 28px;
  color: #c4a76c;
}
.bs-lbl {
  font-family: var(--font-sc);
  font-size: 9px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: rgba(232, 226, 214, 0.35);
}
.bs-hero-meta-sep {
  width: 1px; height: 34px;
  background: rgba(196, 167, 108, 0.18);
}

/* ══════════════════════════════════════════════════════════════════════════
   BODY — sticky index + stream
══════════════════════════════════════════════════════════════════════════ */
.bs-body {
  position: relative;
  max-width: 1520px;
  margin: 0 auto;
  padding: 40px clamp(24px, 5vw, 72px) 80px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(40px, 5vw, 80px);
  align-items: start;
}
@media (max-width: 1024px) {
  .bs-body { grid-template-columns: 1fr; gap: 24px; }
}

/* ── Sticky index ───────────────────────────────────────────────────── */
.bs-index {
  position: sticky;
  top: 100px;
  align-self: start;
  max-height: calc(100vh - 130px);
}
@media (max-width: 1024px) {
  .bs-index {
    position: sticky;
    top: 66px;
    background: rgba(10, 9, 8, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 14px 0;
    border-bottom: 1px solid rgba(196, 167, 108, 0.08);
    z-index: 100;
  }
}
.bs-index-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-right: 12px;
  overflow-y: auto;
  max-height: calc(100vh - 130px);
  scrollbar-width: thin;
  scrollbar-color: rgba(196, 167, 108, 0.22) transparent;
}
@media (max-width: 1024px) {
  .bs-index-inner {
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    max-height: none;
    padding: 4px 4px 6px;
    gap: 16px;
  }
}
.bs-index-label {
  font-family: var(--font-sc);
  font-size: 9px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(232, 226, 214, 0.28);
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(196, 167, 108, 0.10);
}
@media (max-width: 1024px) { .bs-index-label { border-bottom: 0; padding-bottom: 0; flex-shrink: 0; } }

.bs-index-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
@media (max-width: 1024px) {
  .bs-index-list { flex-direction: row; gap: 6px; flex-shrink: 0; }
}
.bs-ix {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  text-align: left;
  border-bottom: 1px solid rgba(196, 167, 108, 0.06);
  transition: color 0.3s, border-color 0.3s, padding-left 0.3s;
  color: rgba(232, 226, 214, 0.42);
  cursor: pointer;
}
.bs-ix:hover { padding-left: 6px; color: #e8e2d6; }
.bs-ix.is-active {
  color: #c4a76c;
  border-color: rgba(196, 167, 108, 0.32);
}
.bs-ix-roman {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  color: rgba(196, 167, 108, 0.72);
  min-width: 26px;
}
.bs-ix-title {
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.3;
  flex: 1;
}
.bs-ix-count {
  font-family: var(--font-sc);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: rgba(232, 226, 214, 0.22);
}
@media (max-width: 1024px) {
  .bs-ix { white-space: nowrap; padding: 6px 10px; border: 1px solid rgba(196, 167, 108, 0.10); border-radius: 2px; }
  .bs-ix:hover { padding-left: 10px; }
  .bs-ix-count { display: none; }
}

.bs-index-progress {
  height: 2px;
  background: rgba(196, 167, 108, 0.10);
  position: relative;
  overflow: hidden;
  border-radius: 1px;
  margin-top: 4px;
}
.bs-index-progress-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: #c4a76c;
  transition: width 0.2s linear;
}
@media (max-width: 1024px) { .bs-index-progress { display: none; } }

.bs-index-tools {
  display: flex;
  gap: 4px;
  margin-top: 10px;
}
.bs-tool {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(196, 167, 108, 0.14);
  color: rgba(232, 226, 214, 0.32);
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.bs-tool:hover { color: #e8e2d6; border-color: rgba(196, 167, 108, 0.42); }
.bs-tool.is-active {
  color: #c4a76c;
  border-color: rgba(196, 167, 108, 0.44);
  background: rgba(196, 167, 108, 0.07);
}
.bs-tool svg { fill: currentColor; }

/* ══════════════════════════════════════════════════════════════════════════
   STREAM — chapter blocks
══════════════════════════════════════════════════════════════════════════ */
.bs-stream {
  display: flex;
  flex-direction: column;
  gap: clamp(70px, 9vh, 120px);
  min-height: 60vh;
}

.bs-loading {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 80px 0;
}
.bs-loading-dot {
  width: 6px; height: 6px;
  background: var(--bronze);
  border-radius: 50%;
  opacity: 0.3;
  animation: bsLoad 1.2s ease-in-out infinite;
}
.bs-loading-dot:nth-child(2) { animation-delay: 0.15s; }
.bs-loading-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes bsLoad {
  0%, 100% { opacity: 0.2; transform: translateY(0); }
  50%      { opacity: 1;   transform: translateY(-6px); }
}

/* ── Chapter block ─────────────────────────────────────────────────── */
.bs-ch {
  scroll-margin-top: 110px;
  animation: bsFade 0.9s var(--ease-out, cubic-bezier(0.16,1,0.3,1)) both;
}
@keyframes bsFade {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
.bs-ch-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: baseline;
  padding-bottom: 18px;
  margin-bottom: 28px;
  border-bottom: 1px solid rgba(196, 167, 108, 0.12);
}
.bs-ch-roman {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(34px, 3.2vw, 46px);
  color: #c4a76c;
  line-height: 1;
  letter-spacing: -0.02em;
}
.bs-ch-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.1;
  color: #e8e2d6;
  letter-spacing: -0.01em;
}
.bs-ch-meta {
  font-family: var(--font-sc);
  font-size: 9px;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: rgba(232, 226, 214, 0.35);
  text-align: right;
  white-space: nowrap;
}
.bs-ch-meta span + span::before {
  content: ' · ';
  margin: 0 2px;
  color: rgba(196, 167, 108, 0.4);
}

/* Grid */
.bs-grid {
  display: grid;
  gap: clamp(10px, 1.2vw, 18px);
}
.bs-grid.is-md { grid-template-columns: repeat(3, 1fr); }
.bs-grid.is-sm { grid-template-columns: repeat(4, 1fr); }
.bs-grid.is-lg { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 780px) {
  .bs-grid.is-md,
  .bs-grid.is-sm,
  .bs-grid.is-lg { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .bs-grid.is-sm { grid-template-columns: repeat(2, 1fr); }
  .bs-grid.is-md,
  .bs-grid.is-lg { grid-template-columns: 1fr; }
}

.bs-tile {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #191612;
  cursor: zoom-in;
  border: 1px solid transparent;
  transition: border-color 0.4s, box-shadow 0.5s;
}
.bs-tile:hover { border-color: rgba(196, 167, 108, 0.35); box-shadow: 0 26px 60px -20px rgba(0, 0, 0, 0.7); }
.bs-tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease-out, cubic-bezier(0.16,1,0.3,1)), opacity 0.6s;
  opacity: 0;
}
.bs-tile img.is-loaded { opacity: 1; }
.bs-tile:hover img { transform: scale(1.04); }
.bs-tile-num {
  position: absolute;
  top: 10px; left: 10px;
  font-family: var(--font-sc);
  font-size: 9px;
  letter-spacing: 0.28em;
  color: rgba(232, 226, 214, 0.88);
  padding: 4px 8px;
  background: rgba(10, 9, 8, 0.72);
  backdrop-filter: blur(4px);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s, transform 0.3s;
}
.bs-tile:hover .bs-tile-num { opacity: 1; transform: none; }

/* Chapter footer cue */
.bs-ch-foot {
  margin-top: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-family: var(--font-sc);
  font-size: 9px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(232, 226, 214, 0.22);
}
.bs-ch-foot-line {
  width: 40px; height: 1px;
  background: rgba(196, 167, 108, 0.28);
}

/* ══════════════════════════════════════════════════════════════════════════
   CODA
══════════════════════════════════════════════════════════════════════════ */
.bs-coda {
  max-width: 900px;
  margin: clamp(40px, 8vh, 100px) auto 0;
  padding: clamp(50px, 8vh, 90px) clamp(24px, 5vw, 48px);
  text-align: center;
  border-top: 1px solid rgba(196, 167, 108, 0.10);
}
.bs-coda-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.1;
  margin: 18px 0 16px;
  color: #e8e2d6;
}
.bs-coda-lede {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  color: rgba(232, 226, 214, 0.48);
  margin-bottom: 32px;
}
.bs-coda-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.bs-btn {
  display: inline-flex;
  align-items: center;
  padding: 13px 28px;
  font-family: var(--font-sc);
  font-size: 10px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  border: 1px solid #c4a76c;
  color: #0a0908;
  background: #c4a76c;
  transition: background 0.35s, color 0.35s, border-color 0.35s;
}
.bs-btn:hover { background: transparent; color: #c4a76c; }
.bs-btn-ghost {
  background: transparent;
  color: rgba(232, 226, 214, 0.68);
  border-color: rgba(232, 226, 214, 0.18);
}
.bs-btn-ghost:hover { background: rgba(232, 226, 214, 0.06); color: #e8e2d6; border-color: rgba(232, 226, 214, 0.38); }

/* ══════════════════════════════════════════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════════════════════════════════════════ */
.bs-lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  padding: 0;
  margin: 0;
  border: 0;
  background: rgba(10,9,8,0.96);
  color: rgba(246,242,236,0.9);
  z-index: 1000;
}
.bs-lightbox::backdrop { background: rgba(10,9,8,0.85); }
.bs-lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.bs-lb-figure {
  max-width: 90vw;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.bs-lb-figure img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  box-shadow: 0 40px 120px -20px rgba(0,0,0,0.6);
}
.bs-lb-caption {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--font-sc);
  font-size: 10px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(246,242,236,0.58);
}
.bs-lb-chapter { color: var(--bronze-pale, #c4a76c); }
.bs-lb-close,
.bs-lb-nav {
  position: absolute;
  width: 48px; height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(246,242,236,0.85);
  border: 1px solid rgba(246,242,236,0.15);
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.bs-lb-close:hover,
.bs-lb-nav:hover {
  color: var(--warm-white, #f6f2ec);
  border-color: var(--bronze-pale, #c4a76c);
  background: rgba(196,167,108,0.12);
}
.bs-lb-close { top: 24px; right: 24px; }
.bs-lb-prev  { top: 50%; left: 24px;  transform: translateY(-50%); }
.bs-lb-next  { top: 50%; right: 24px; transform: translateY(-50%); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .bs-ch { animation: none; opacity: 1; }
  .bs-tile:hover img { transform: none; }
}


/* ══════════════════════════════════════════════════════════════════════════
   CHAPTER INDEX DRAWER (mobile floating trigger + right-side panel)
   The trigger button is display:none by default; mobile.css shows it.
══════════════════════════════════════════════════════════════════════════ */
.bs-ch-menu-btn { display: none; }   /* shown only via mobile.css */

.bs-ch-menu {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(85vw, 300px);
  z-index: 500;
  background: rgba(10, 9, 8, 0.98);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-left: 1px solid rgba(196, 167, 108, 0.10);
  transform: translateX(100%);
  transition: transform 0.34s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  pointer-events: none;
}
.bs-ch-menu.is-open {
  transform: translateX(0);
  pointer-events: auto;
}

.bs-ch-menu-overlay {
  position: fixed; inset: 0;
  z-index: 490;
  background: rgba(10, 9, 8, 0.52);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.34s;
}
.bs-ch-menu-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.bs-ch-menu-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bs-ch-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(196, 167, 108, 0.10);
  flex-shrink: 0;
}
.bs-ch-menu-title {
  font-family: var(--font-sc);
  font-size: 9px;
  letter-spacing: 0.40em;
  text-transform: uppercase;
  color: rgba(232, 226, 214, 0.45);
}
.bs-ch-menu-close {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(196, 167, 108, 0.12);
  color: rgba(232, 226, 214, 0.50);
  transition: color 0.2s, border-color 0.2s;
}
.bs-ch-menu-close:hover { color: var(--bronze-pale); border-color: rgba(196, 167, 108, 0.35); }

.bs-ch-menu-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
}

.bs-ch-menu-item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  width: 100%;
  padding: 15px 20px;
  text-align: left;
  color: rgba(232, 226, 214, 0.50);
  border-bottom: 1px solid rgba(196, 167, 108, 0.06);
  transition: color 0.2s, background 0.2s;
  min-height: 52px;   /* WCAG touch target */
}
.bs-ch-menu-item:active,
.bs-ch-menu-item:focus-visible {
  background: rgba(196, 167, 108, 0.07);
  color: var(--warm-white);
}
.bs-ch-menu-item.is-active { color: var(--bronze-pale); }

.bs-ch-menu-roman {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 12px;
  color: rgba(196, 167, 108, 0.60);
  min-width: 20px;
  flex-shrink: 0;
}
.bs-ch-menu-name {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.3;
}

/* ══════════════════════════════════════════════════════════════════════════
   MOBILE — ≤ 768px
   Structural overrides live in mobile.css (section 9, loads after this file).
   This block handles typography details, touch feedback, and narrow-screen
   refinements that mobile.css does not touch.
══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Header ─────────────────────────────────────────────────────────── */
  .bs-mark { font-size: 14px; letter-spacing: 0.01em; }

  /* ── Hero ────────────────────────────────────────────────────────────── */
  .bs-eyebrow { font-size: 9px; margin-bottom: 14px; }
  .bs-hero::after { margin-left: 0; width: 32px; }
  .bs-lede {
    font-size: 15px;
    line-height: 1.65;
    max-width: 100%;
  }
  .bs-num { font-size: 22px; }
  .bs-hero-meta-sep { height: 26px; }

  /* ── Index strip refinements ─────────────────────────────────────────── */
  .bs-ix-roman { font-size: 11px; min-width: 18px; }

  /* ── Chapter blocks ─────────────────────────────────────────────────── */
  .bs-ch-foot {
    margin-top: 22px;
    gap: 12px;
    font-size: 8px;
  }
  .bs-ch-foot-line { width: 28px; }

  /* ── Tile: always show plate number; touch active state ─────────────── */
  .bs-tile:active {
    border-color: rgba(196, 167, 108, 0.45);
    box-shadow: 0 0 0 1px rgba(196, 167, 108, 0.25);
  }
  /* Disable the pan-zoom cursor (meaningless on touch) */
  .bs-tile { cursor: pointer; }

  /* ── Coda ────────────────────────────────────────────────────────────── */
  .bs-coda-title { font-size: clamp(20px, 7vw, 30px); margin: 14px 0 12px; }
  .bs-coda-lede { font-size: 15px; line-height: 1.65; margin-bottom: 24px; }

  /* ── Lightbox caption: stack chapter name above counter ──────────────── */
  .bs-lb-caption {
    flex-direction: column;
    align-items: center;
    gap: 3px;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   ≤ 480px — COMPACT PHONES
══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .bs-hero { padding: 28px 16px 22px; }
  .bs-num { font-size: 18px; }
  .bs-hero-meta-sep { height: 22px; }
  .bs-lede { font-size: 14.5px; }

  /* Tighter stream on narrow screens */
  .bs-stream { padding: 24px 12px 72px; gap: 44px; }
  .bs-ch-roman { font-size: 22px; }
  .bs-ch-title { font-size: clamp(14px, 4.8vw, 20px); }

  /* Coda */
  .bs-coda { padding: 40px 16px 48px; }
  .bs-coda-title { font-size: clamp(18px, 7.5vw, 26px); }

  /* Lightbox: close & nav even closer to edges on tiny screens */
  .bs-lb-prev { left: 4px; }
  .bs-lb-next { right: 4px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   ≤ 360px — VERY NARROW PHONES
══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 360px) {
  .bs-stream { padding: 20px 10px 64px; gap: 38px; }
  .bs-ch-roman { font-size: 18px; }
  .bs-grid { gap: 4px; }
  .bs-coda { padding: 36px 12px 44px; }
}
