/* Kramer Media — "Archival Literary Bureau" theme.
   Tokens mirror the Stitch design system (Kramer Media Author Hub). */
:root {
  --paper: #fef9f0;            /* background / surface */
  --paper-low: #f8f3ea;        /* surface-container-low */
  --paper-mid: #f2ede4;        /* surface-container */
  --paper-high: #ece8df;       /* surface-container-high */
  --paper-highest: #e7e2d9;    /* surface-container-highest */
  --paper-white: #ffffff;
  --ink: #1d1c16;              /* on-surface */
  --ink-dim: #4c4640;          /* on-surface-variant */
  --ink-black: #181512;        /* primary action */
  --copper: #8e4e16;           /* secondary — accent text */
  --copper-bright: #c87d42;    /* hover fill */
  --copper-glow: #ffdcc5;      /* secondary-fixed */
  --gold: #f0d68a;             /* award text — light gold on the dark award panel */
  --gold-panel: #1f1a12;       /* award panel background */
  --gold-bright: #b8860b;      /* award trophy icon */
  --rule: rgba(24, 21, 18, 0.15);

  --shadow-sm: 0 1px 3px rgba(24, 21, 18, 0.08), 0 4px 12px rgba(24, 21, 18, 0.04);
  --shadow-md: 0 8px 24px rgba(24, 21, 18, 0.10), 0 2px 6px rgba(24, 21, 18, 0.05);
  --shadow-inset: inset 0 1px 3px rgba(24, 21, 18, 0.12);

  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Merriweather", Georgia, serif;
  --font-mono: "Courier Prime", "Courier New", monospace;

  --max-width: 80rem;
  --margin: 3rem;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.75rem;
  --space-xl: 2.5rem;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 26px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; color: var(--ink); }
p { margin: 0; }
[hidden] { display: none !important; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--margin);
}

.stack-xl { display: flex; flex-direction: column; gap: var(--space-xl); }

/* ---------- Type utilities ---------- */
.label-sm, .label-md,
.division-eyebrow, .division-meta, .catalog-tag,
.btn, .marginalia, .nav-links a {
  font-family: var(--font-mono);
  text-transform: uppercase;
}
.label-sm { font-size: 10px; line-height: 14px; letter-spacing: 0.1em; }
.label-md { font-size: 12px; line-height: 16px; letter-spacing: 0.1em; }
.accent { color: var(--copper); }
.dim { color: var(--ink-dim); }
.bold { font-weight: 700; }
.center { text-align: center; }

.msym {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 1.05em;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  -webkit-font-feature-settings: "liga";
  font-feature-settings: "liga";
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--copper);
  margin-right: var(--space-sm);
  vertical-align: middle;
}
.dot-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.08em;
  border: 0;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.btn .msym { font-size: 16px; }
.btn-ink { background: var(--ink-black); color: var(--paper); box-shadow: var(--shadow-sm); }
.btn-ink:hover { background: var(--copper-bright); }
.btn-slip { background: var(--paper-mid); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-slip:hover, .btn-paper:hover { background: var(--paper-high); }
.btn-paper { background: var(--paper-white); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-tab { background: var(--paper-high); color: var(--ink); font-size: 10px; padding: var(--space-sm); }
.btn-tab:hover { background: var(--paper-highest); }
.btn-sm { font-size: 10px; padding: 6px var(--space-sm); }
.btn-block { width: 100%; }

.marginalia-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--copper);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.marginalia-link:hover { color: var(--ink); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(254, 249, 240, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 8px rgba(24, 21, 18, 0.06);
}
.header-inner {
  height: 5rem;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.brand { display: flex; align-items: center; gap: var(--space-sm); flex-shrink: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--ink-black);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
  outline: 1px solid var(--ink-black);
  outline-offset: 2px;
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: var(--font-display); font-size: 22px; line-height: 26px; font-weight: 600; letter-spacing: -0.01em; }
.brand-sub { font-family: var(--font-mono); font-size: 10px; line-height: 14px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--copper); }

.header-status {
  display: none;
  align-items: center;
  padding: 4px var(--space-sm);
  background: var(--paper-mid);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
}

.nav { margin-left: auto; }
.nav-links { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-xs); }
.nav-links a {
  display: block;
  white-space: nowrap;
  padding: 6px var(--space-sm);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  transition: background-color 0.15s, color 0.15s;
}
.nav-links a:hover { color: var(--ink); background: var(--paper-high); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: 0;
  padding: var(--space-sm);
  cursor: pointer;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); }

.header-id { display: flex; align-items: center; gap: var(--space-sm); flex-shrink: 0; }
.header-id-text { display: flex; flex-direction: column; text-align: right; }
.header-id-name { font-family: var(--font-mono); font-size: 12px; line-height: 16px; letter-spacing: 0.08em; }
.header-id-role { font-family: var(--font-mono); font-size: 10px; line-height: 14px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); }
.header-avatar {
  width: 36px;
  height: 36px;
  padding: 2px;
  background: var(--paper-highest);
  flex-shrink: 0;
}
.header-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ---------- Marginalia banner ---------- */
.marginalia {
  background: var(--paper-high);
  padding: var(--space-xs) 0;
  font-size: 10px;
  line-height: 14px;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
  box-shadow: 0 1px 2px rgba(24, 21, 18, 0.05);
}
.marginalia-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-xs) var(--space-md); }
.marginalia-right { display: flex; flex-wrap: wrap; gap: var(--space-md); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: var(--space-xl) 0; }
.hero-glow { position: absolute; border-radius: 50%; pointer-events: none; }
.hero-glow-a { right: 1.5rem; top: 2rem; width: 24rem; height: 24rem; background: var(--paper-mid); opacity: 0.4; filter: blur(64px); }
.hero-glow-b { left: -3rem; bottom: 0; width: 20rem; height: 20rem; background: var(--copper-glow); opacity: 0.3; filter: blur(40px); }
.hero .wrap { position: relative; }

.hero-topline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.catalog-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px var(--space-sm);
  background: var(--paper-mid);
  color: var(--copper);
  font-size: 10px;
  line-height: 14px;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.hero-grid { display: grid; grid-template-columns: 7fr 5fr; gap: var(--space-lg); align-items: start; }
.hero-text { display: flex; flex-direction: column; gap: var(--space-md); }
.hero-text h1 { font-size: 40px; line-height: 48px; letter-spacing: -0.01em; }

.pull-quote { margin: 0; padding: var(--space-md); background: var(--paper-low); box-shadow: var(--shadow-sm); }
.pull-quote p { font-size: 18px; line-height: 30px; font-style: italic; }
.pull-quote footer {
  margin-top: var(--space-xs);
  text-align: right;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.hero-bio { display: flex; flex-direction: column; gap: var(--space-sm); color: var(--ink-dim); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); padding-top: var(--space-sm); }

.dossier { background: var(--paper-low); padding: var(--space-md); box-shadow: var(--shadow-md); }
.dossier-head { display: flex; justify-content: space-between; padding-bottom: var(--space-sm); }
.dossier-portrait {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--paper-mid);
  box-shadow: var(--shadow-inset);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 72px;
  color: var(--ink-dim);
}
.dossier-portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.03) sepia(0.12);
  opacity: 0;
  transition: transform 0.5s, opacity 1.2s ease-in-out;
}
.dossier-portrait img.is-active { opacity: 1; }
.dossier-portrait:hover img { transform: scale(1.05); }
.dossier-caption {
  position: absolute;
  z-index: 1;
  left: var(--space-sm);
  bottom: var(--space-sm);
  padding: 2px var(--space-xs);
  background: rgba(254, 249, 240, 0.9);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}
.dossier-manifest {
  margin-top: var(--space-md);
  padding: var(--space-sm);
  background: var(--paper-mid);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.manifest-head, .manifest-stats {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.manifest-head { font-weight: 700; }
.manifest-stats { color: var(--ink-dim); padding-top: 2px; }
.dossier-manifest p { font-size: 13px; line-height: 20px; font-weight: 300; color: var(--ink-dim); }

/* ---------- Bulletin (under the hero) ---------- */
.bulletin-band { padding: 0 0 var(--space-xl); }
.bulletin {
  position: relative;
  background: var(--paper-white);
  padding: var(--space-lg);
  border-left: 4px solid var(--copper);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.bulletin-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-xs) var(--space-sm); }
.bulletin-meta .msym { font-size: 16px; vertical-align: -3px; margin-right: var(--space-xs); }
.bulletin h2 { font-size: 26px; line-height: 34px; }
.bulletin-body { display: flex; flex-direction: column; gap: var(--space-sm); max-width: 72ch; color: var(--ink-dim); }
.bulletin-body p { margin: 0; }
.bulletin .marginalia-link { align-self: flex-start; }

/* ---------- Divisions (sections) ---------- */
.division { padding: var(--space-xl) 0; }
.division-alt { background: var(--paper-low); box-shadow: inset 0 2px 4px rgba(24, 21, 18, 0.04); }
.division-continued { padding-top: 0; box-shadow: none; }
.division-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
  padding-bottom: var(--space-sm);
}
.division-eyebrow { font-size: 10px; line-height: 14px; letter-spacing: 0.14em; font-weight: 700; color: var(--copper); }
.division-head h2 { font-size: 40px; line-height: 48px; letter-spacing: -0.01em; margin-top: var(--space-xs); }
.division-meta { font-size: 12px; letter-spacing: 0.08em; color: var(--ink-dim); text-align: right; }

/* ---------- Shelf: series cards ---------- */
.shelf { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--space-lg); }

.saga {
  grid-column: span 6;
  background: var(--paper);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.saga-alt { background: var(--paper-mid); }
.saga-wide { grid-column: 1 / -1; }
.saga-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.saga-head-left { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); }
.saga-badge {
  padding: 2px var(--space-xs);
  background: var(--copper);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}
.saga h3 { font-size: 30px; line-height: 38px; }
.saga-blurb { color: var(--ink-dim); }
.saga .saga-blurb { color: var(--ink); }

/* Story-first series copy: genres, emotional hook, "perfect for" */
.genre-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.genre-tag {
  padding: 5px 12px;
  background: rgba(255, 220, 197, 0.55);
  box-shadow: inset 0 0 0 1px rgba(142, 78, 22, 0.35);
  color: var(--copper);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}
.saga-hook {
  padding-left: var(--space-md);
  border-left: 3px solid var(--copper);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 22px;
  line-height: 31px;
  color: var(--ink);
}
.saga-perfect {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--paper-mid);
  font-size: 14px;
  line-height: 22px;
}
.saga-alt .saga-perfect { background: var(--paper); }
.saga-perfect > .msym { color: var(--copper); font-size: 20px; line-height: 22px; font-variation-settings: "FILL" 1; }
.saga-perfect .label-sm { display: block; }

/* "Where to Buy" panel */
.buy-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--paper-low);
  box-shadow: var(--shadow-sm), inset 3px 0 0 var(--copper);
}
.saga-alt .buy-panel { background: var(--paper); }
.buy-panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-sm); }
.buy-panel-lead { font-size: 14px; line-height: 22px; color: var(--ink-dim); }
.buy-panel-lead strong { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--ink); }
.buy-panel-actions, .buy-panel-links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); }
.buy-panel-links { gap: var(--space-xs) var(--space-md); }
.awards { list-style: none; margin: 0; padding: var(--space-sm) var(--space-md); background: var(--gold-panel); border: 1px solid var(--gold-bright); box-shadow: inset 0 0 0 3px var(--gold-panel), inset 0 0 0 4px rgba(184, 134, 11, 0.4); display: flex; flex-direction: column; gap: var(--space-xs); }
.awards li { display: flex; align-items: flex-start; gap: var(--space-sm); font-weight: 700; font-size: 14px; line-height: 20px; color: var(--gold); }
.awards .msym { color: var(--gold-bright); font-size: 18px; line-height: 20px; }
.saga-note {
  padding: var(--space-sm) var(--space-md);
  background: var(--paper-mid);
  box-shadow: var(--shadow-inset);
  font-size: 13px;
  line-height: 20px;
  color: var(--ink-dim);
}
.saga-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); }

/* Flagship (first series): full width, text + covers mosaic */
.saga-flagship { grid-column: 1 / -1; gap: var(--space-lg); }
.saga-flagship-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); gap: var(--space-lg); align-items: start; }
.saga-flagship-side { display: flex; flex-direction: column; gap: var(--space-md); }
.saga-text { display: flex; flex-direction: column; gap: var(--space-md); min-width: 0; }

/* Single-book series: one large cover beside the story */
.saga-solo-body { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: var(--space-lg); align-items: start; }

.volumes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: var(--space-sm); }
.volume {
  background: var(--paper-mid);
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
button.volume:hover { box-shadow: var(--shadow-md); }
.volume-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--paper-highest);
  box-shadow: var(--shadow-inset);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-sm);
}
.volume-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
button.volume:hover .volume-cover img { transform: scale(1.04); }
.volume-cover-title { position: relative; z-index: 1; }
.volume-cover-meta {
  text-align: center;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--paper-highest);
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.volume-cover-title {
  padding: 4px;
  background: rgba(231, 226, 217, 0.95);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  line-height: 20px;
  text-align: center;
}
.volume-cover.is-placeholder { background: repeating-linear-gradient(135deg, var(--paper-highest) 0 10px, var(--paper-high) 10px 20px); }
.volume-caption {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* Compact volume rows (non-flagship series) */
.volume-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-sm); }
.volume-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--paper-mid);
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s;
}
.saga-alt .volume-row { background: var(--paper); }
button.volume-row:hover { background: var(--paper-high); }
.volume-thumb {
  width: 64px;
  height: 96px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--paper-highest);
}
.volume-thumb img { width: 100%; height: 100%; object-fit: cover; }
.volume-thumb.is-placeholder { background: repeating-linear-gradient(135deg, var(--paper-highest) 0 6px, var(--paper-high) 6px 12px); }
.volume-row-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.volume-row-title { font-family: var(--font-display); font-weight: 600; font-size: 15px; line-height: 19px; }
.volume-row-meta { font-size: 12px; line-height: 16px; color: var(--ink-dim); }

/* ---------- Project Lab ---------- */
.telemetry {
  background: var(--paper-mid);
  padding: var(--space-sm);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.lab-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
.specimen {
  background: var(--paper-low);
  padding: var(--space-md);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-md);
}
.specimen-body { display: flex; flex-direction: column; gap: var(--space-sm); }
.specimen-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); }
.specimen-kind {
  padding: 2px var(--space-xs);
  background: var(--paper-mid);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.specimen-media {
  position: relative;
  height: 12rem;
  overflow: hidden;
  background: var(--paper-highest);
  box-shadow: var(--shadow-inset);
}
.specimen-media > img { width: 100%; height: 100%; object-fit: cover; }
.specimen-media.is-placeholder {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 38%, rgba(24, 21, 18, 0.06) 38% 39%, transparent 39%),
    repeating-linear-gradient(0deg, transparent 0 19px, rgba(24, 21, 18, 0.06) 19px 20px),
    repeating-linear-gradient(90deg, transparent 0 19px, rgba(24, 21, 18, 0.06) 19px 20px),
    var(--paper-high);
}
.specimen-media.is-placeholder .msym { font-size: 56px; color: var(--copper); opacity: 0.55; }
.specimen-status {
  position: absolute;
  z-index: 3;
  top: var(--space-sm);
  right: var(--space-sm);
  padding: 2px var(--space-xs);
  background: rgba(254, 249, 240, 0.92);
  color: var(--copper);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}
.specimen h3 { font-size: 22px; line-height: 30px; }
.specimen p { font-size: 13px; line-height: 20px; font-weight: 300; color: var(--ink-dim); }
.specimen-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); }

/* Carousel (BookCircle screenshots) */
.carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s;
}
.carousel-slide.is-active { opacity: 1; }
.carousel-arrow {
  position: absolute;
  z-index: 2;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  background: rgba(254, 249, 240, 0.9);
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background-color 0.15s;
}
.carousel-arrow-prev { left: var(--space-sm); }
.carousel-arrow-next { right: var(--space-sm); }
.specimen-media:hover .carousel-arrow, .carousel-arrow:focus-visible { opacity: 1; }
.carousel-arrow:hover { background: var(--copper-bright); color: #fff; }
.carousel-dots {
  position: absolute;
  z-index: 2;
  bottom: var(--space-sm);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
}
.carousel-dots span { width: 6px; height: 6px; background: rgba(254, 249, 240, 0.7); box-shadow: 0 0 0 1px rgba(24, 21, 18, 0.3); }
.carousel-dots span.is-active { background: var(--copper-bright); }

/* ---------- Dispatches ---------- */
.dispatch-grid { display: grid; grid-template-columns: 8fr 4fr; gap: var(--space-lg); align-items: start; }
.dispatch-list { display: flex; flex-direction: column; gap: var(--space-md); }
.dispatch {
  background: var(--paper);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  transition: box-shadow 0.2s;
}
.dispatch:hover { box-shadow: var(--shadow-md); }
.dispatch-meta { display: flex; justify-content: space-between; gap: var(--space-sm); }
.dispatch h3 { font-size: 22px; line-height: 30px; }
.dispatch p { color: var(--ink-dim); }
.dispatch-foot { padding-top: var(--space-xs); }

.dispatch-side { display: flex; flex-direction: column; gap: var(--space-lg); }
.courier {
  background: var(--paper);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.courier-head, .ledger-head { display: flex; justify-content: space-between; align-items: center; }
.courier h3 { font-size: 28px; line-height: 36px; }
.courier p { font-size: 13px; line-height: 20px; font-weight: 300; color: var(--ink-dim); }

.ledger { background: var(--paper); padding: var(--space-md); box-shadow: var(--shadow-sm); }
.ledger-head { padding-bottom: var(--space-sm); border-bottom: 3px double var(--rule); }
.ledger ul { list-style: none; margin: 0; padding: 0; }
.ledger li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px dashed rgba(24, 21, 18, 0.2);
  font-size: 13px;
  line-height: 20px;
}
.ledger li:last-child { border-bottom: 0; }
.ledger-date { font-family: var(--font-mono); font-size: 12px; color: var(--copper); font-weight: 700; text-transform: uppercase; }
.ledger-title { font-family: var(--font-display); font-weight: 600; }
a.ledger-title:hover { color: var(--copper); }
.ledger-loc { grid-column: 2; font-size: 12px; color: var(--ink-dim); }

.empty-note {
  color: var(--ink-dim);
  font-style: italic;
  font-size: 13px;
}
.dispatch-list > .empty-note { background: var(--paper); padding: var(--space-md); box-shadow: var(--shadow-sm); }

/* ---------- Reader's Circle ---------- */
.circle {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: var(--space-xl);
  align-items: center;
  background: var(--paper-high);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  border-top: 3px double var(--copper);
}
.circle-pitch { display: flex; flex-direction: column; gap: var(--space-md); }
.circle-pitch h2 { font-size: 40px; line-height: 48px; letter-spacing: -0.01em; }
.circle-lede { font-size: 16px; line-height: 28px; color: var(--ink-dim); }
.circle-perks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-xs); }
.circle-perks li { position: relative; padding-left: 1.5rem; font-size: 14px; line-height: 22px; }
.circle-perks li::before { content: "§"; position: absolute; left: 0; color: var(--copper); font-weight: 700; }
.circle-magnet {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  background: var(--paper);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
}
.circle-magnet h3 { font-size: 22px; line-height: 30px; }
.circle-magnet p { font-size: 13px; line-height: 20px; font-weight: 300; color: var(--ink-dim); }
.circle-magnet-cover {
  flex: 0 0 72px;
  aspect-ratio: 2 / 3;
  display: grid;
  place-items: center;
  background: var(--paper-mid);
  box-shadow: var(--shadow-sm);
  color: var(--copper);
  font-size: 28px;
  overflow: hidden;
}
.circle-magnet-cover img { width: 100%; height: 100%; object-fit: cover; }

.circle-form {
  background: var(--paper);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.circle-field { display: flex; flex-direction: column; gap: var(--space-xs); }
.circle-field input {
  font: inherit;
  font-size: 15px;
  padding: var(--space-sm) var(--space-md);
  background: var(--paper-white);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 0;
  box-shadow: var(--shadow-inset);
}
.circle-field input:focus-visible { outline: 2px solid var(--copper-bright); outline-offset: 1px; }
.circle-interests { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-sm) var(--space-md); }
.circle-interests legend { padding: 0; margin-bottom: var(--space-xs); }
.circle-check { display: inline-flex; align-items: center; gap: var(--space-xs); font-size: 13px; cursor: pointer; }
.circle-check input { accent-color: var(--copper); }
.circle-form .btn { padding: var(--space-md); }
.circle-form .btn:disabled { opacity: 0.6; cursor: wait; }
.circle-status { font-size: 13px; line-height: 20px; min-height: 20px; color: var(--ink-dim); }
.circle-status:empty { display: none; }
.circle-status.is-success { color: var(--copper); font-weight: 700; }
.circle-status.is-error { color: #a3261b; }

/* ---------- Curio Cabinet ---------- */
.curio-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-md); }
.curio {
  background: var(--paper-mid);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.curio-head { display: flex; justify-content: space-between; align-items: center; color: var(--copper); }
.curio h4 { font-size: 22px; line-height: 30px; }
.curio p { font-size: 13px; line-height: 20px; font-weight: 300; color: var(--ink-dim); }

/* ---------- Colophon strip ---------- */
.colophon {
  background: var(--paper-high);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  align-items: center;
}
.colophon:has(.colophon-wire[hidden]) { grid-template-columns: repeat(2, 1fr); }
.colophon-col { display: flex; flex-direction: column; gap: var(--space-xs); align-items: flex-start; }
.colophon h4 { font-size: 22px; line-height: 30px; }
.colophon p { font-size: 13px; line-height: 20px; font-weight: 300; color: var(--ink-dim); }
.colophon-col .marginalia-link { margin-top: var(--space-xs); }
.colophon-wire {
  background: var(--paper);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  text-align: center;
}
.colophon-wire-title { font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 30px; }

/* ---------- Section tints: a faint, distinct wash on each section's cards ---------- */
#bulletin .bulletin { background: #fff7ee; }                       /* apricot */
#shelf .saga { background: #f6f7ee; }                               /* sage */
#shelf .saga-alt { background: #eef0e3; }
#circle .circle { background: #eee9f1; }                            /* lavender */
#circle .circle-form, #circle .circle-magnet { background: #f8f5fa; }
#zines .saga { background: #fcf2ef; }                               /* blush */
#zines .saga-alt { background: #f6e9e4; }
#screenplays .screenplay { background: #f1f4f5; }                   /* slate */
#lab .specimen { background: #edf5f1; }                             /* mint */
#dispatches .dispatch,
#dispatches .courier,
#dispatches .ledger,
#dispatches .dispatch-list > .empty-note { background: #fdf6e2; }   /* butter */
#curios .curio { background: #f5ede6; }                             /* clay */
.division-colophon .colophon { background: #ecedf4; }               /* periwinkle */
.division-colophon .colophon-wire { background: #f6f7fb; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: var(--space-xl);
  background: var(--paper-low);
  box-shadow: 0 -1px 12px rgba(24, 21, 18, 0.03);
  padding: var(--space-xl) 0 var(--space-lg);
}
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-xl); padding-bottom: var(--space-lg); }
.footer-brand, .footer-col, .footer-classification { display: flex; flex-direction: column; gap: var(--space-sm); }
.footer-name { font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 30px; }
.footer-brand p, .footer-classification p { font-size: 13px; line-height: 20px; font-weight: 300; color: var(--ink-dim); }
.footer-col-title { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.footer-col a {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.footer-col a:hover { color: var(--copper); }
.footer-classification { background: var(--paper-mid); padding: var(--space-md); }
.footer-bottom {
  padding-top: var(--space-md);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* ---------- Focus ---------- */
a:focus-visible, button:focus-visible { outline: 2px solid var(--copper-bright); outline-offset: 2px; }

/* ---------- Responsive ---------- */
@media (min-width: 1280px) {
  .header-status { display: inline-flex; }
}

@media (max-width: 1100px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 5rem;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: var(--space-sm) var(--margin) var(--space-md);
    background: var(--paper);
    box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: var(--space-sm) 0; border-bottom: 1px dashed rgba(24, 21, 18, 0.15); }
  .nav { order: 3; margin-left: 0; }
  .header-id { margin-left: auto; }

  .saga { grid-column: 1 / -1; }
  .lab-grid { grid-template-columns: repeat(2, 1fr); }
  .curio-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  :root { --margin: 1.25rem; }
  .hero-grid, .saga-flagship-body, .dispatch-grid, .colophon, .circle { grid-template-columns: 1fr; }
  .circle { padding: var(--space-lg) var(--space-md); gap: var(--space-lg); }
  .circle-pitch h2 { font-size: 28px; line-height: 36px; }
  .hero-text h1 { font-size: 32px; line-height: 40px; }
  .division-head { flex-direction: column; align-items: flex-start; }
  .division-head h2 { font-size: 28px; line-height: 36px; }
  .division-meta { text-align: left; }
  .dossier { max-width: 32rem; }
}

@media (max-width: 640px) {
  .header-id-text { display: none; }
  .brand-name { font-size: 18px; line-height: 22px; }
  .lab-grid, .curio-grid, .footer-grid { grid-template-columns: 1fr; }
  .saga { padding: var(--space-md); }
  .saga h3 { font-size: 24px; line-height: 30px; }
  .saga-hook { font-size: 19px; line-height: 27px; }
  .volumes { grid-template-columns: repeat(2, 1fr); }
  .saga-solo-body { grid-template-columns: 1fr; }
  .saga-solo-body > .volume { max-width: 200px; }
  .marginalia-right > span:first-child { display: none; }
  .hero-actions .btn { flex: 1 1 100%; }
  .bulletin { padding: var(--space-md); }
  .bulletin h2 { font-size: 22px; line-height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dot-pulse { animation: none; }
  .carousel-slide, .dossier-portrait img, .volume-cover img { transition: none; }
  button.volume:hover .volume-cover img { transform: none; }
}

/* Real covers already carry their title — only label placeholder covers. */
.volume-cover:not(.is-placeholder) .volume-cover-title { display: none; }

/* Companion series sit indented under their parent series. */
.saga-companion { margin-left: var(--space-xl); }
@media (max-width: 640px) {
  .saga-companion { margin-left: var(--space-md); }
}

/* ---------- Screenplays ---------- */
.screenplay-list { display: flex; flex-direction: column; gap: var(--space-lg); }
.screenplay {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--paper);
  box-shadow: var(--shadow-md);
}
/* A typed script title page: Courier, centred, lots of white space. */
.screenplay-page {
  position: relative;
  aspect-ratio: 8.5 / 11;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-lg);
  background: #fffdf8;
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--paper-high);
  font-family: var(--font-mono);
  text-align: center;
  color: var(--ink);
}
.screenplay-page.has-art { padding: 0; }
.screenplay-page img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.screenplay-page-title { font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 4px; }
.screenplay-page-format { font-size: 13px; line-height: 18px; margin-bottom: var(--space-lg); }
.screenplay-page-credit { font-size: 12px; line-height: 16px; color: var(--ink-dim); }
.screenplay-page-author { font-size: 13px; line-height: 18px; }
.screenplay-body { display: flex; flex-direction: column; gap: var(--space-md); min-width: 0; }
.screenplay-body h3 { font-size: 28px; line-height: 36px; }
.screenplay-sheet {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-xs) var(--space-md);
  margin: 0;
  padding: var(--space-sm) var(--space-md);
  background: var(--paper-mid);
  box-shadow: var(--shadow-inset);
  font-size: 13px;
  line-height: 20px;
}
.screenplay-sheet dt { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--copper); font-weight: 700; }
.screenplay-sheet dd { margin: 0; color: var(--ink-dim); }
/* Scripts with wide key art: art + crew strip on the left, details on the right. */
.screenplay.has-keyart { grid-template-columns: 7fr 5fr; }
.screenplay-aside { display: flex; flex-direction: column; gap: var(--space-md); min-width: 0; }
.screenplay-keyart {
  display: block;
  padding: 0;
  border: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--paper-highest);
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
}
.screenplay-keyart img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.screenplay-keyart:hover img { transform: scale(1.02); }
.crew-strip { display: flex; flex-direction: column; gap: var(--space-sm); }
.crew-strip-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--space-sm); }
.crew-chip {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  min-width: 0;
}
.crew-chip img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top center;
  background: var(--paper-white);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
}
.crew-chip:hover img { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.crew-chip-name {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crew-chip:hover .crew-chip-name { color: var(--copper); }

@media (max-width: 900px) {
  .screenplay, .screenplay.has-keyart { grid-template-columns: 1fr; }
  .screenplay-page { max-width: 280px; width: 100%; margin: 0 auto; }
  .crew-strip-row { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Series bible modal ---------- */
.book-modal.script-modal { width: min(68rem, calc(100% - 2 * var(--margin))); }
.script-modal-bar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-sm) var(--space-sm) var(--space-lg);
  background: var(--paper);
  border-bottom: 3px double var(--rule);
}
.script-modal-bar .book-modal-close { position: static; flex: none; }
.script-modal-nav { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-left: auto; }
.script-modal-link {
  padding: 6px var(--space-sm);
  border: 0;
  background: var(--paper-mid);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.script-modal-link:hover { background: var(--copper-bright); color: var(--paper); }
.script-modal-body { display: flex; flex-direction: column; gap: var(--space-xl); padding: 0 var(--space-xl) var(--space-xl); }
.bible-hero { width: calc(100% + 2 * var(--space-xl)); max-width: none; margin: 0 calc(-1 * var(--space-xl)); aspect-ratio: 21 / 9; object-fit: cover; }
.bible-head { display: flex; flex-direction: column; gap: var(--space-sm); }
.bible-head h3 { font-size: 44px; line-height: 52px; }
.bible-section { display: flex; flex-direction: column; gap: var(--space-md); scroll-margin-top: 4rem; }
.bible-section h4 {
  font-size: 26px;
  line-height: 34px;
  padding-bottom: var(--space-xs);
  border-bottom: 1px dashed var(--rule);
}
.bible-prose { max-width: 46rem; }
.bible-note { font-size: 13px; line-height: 20px; color: var(--ink-dim); font-style: italic; }

.bible-crew { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-md); }
.bible-crew.is-compact { grid-template-columns: repeat(3, 1fr); }
.bible-person {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--paper-low);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 4.5rem;
  transition: box-shadow 0.3s;
}
.bible-person.is-highlighted { box-shadow: 0 0 0 2px var(--copper-bright), var(--shadow-md); }
.bible-person:first-child { grid-column: 1 / -1; grid-template-columns: 12rem 1fr; }
.bible-crew.is-compact .bible-person:first-child { grid-template-columns: 9rem 1fr; }
.bible-person.is-compact { grid-template-columns: 1fr; }
.bible-person-art {
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  background: var(--paper-white);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.bible-person-art img { width: 100%; height: 100%; object-fit: contain; }
.bible-person-art.is-placeholder { background: repeating-linear-gradient(135deg, var(--paper-highest) 0 12px, var(--paper-high) 12px 24px); color: var(--copper); }
.bible-person-art.is-placeholder .msym { font-size: 48px; }
.bible-person-text { display: flex; flex-direction: column; gap: var(--space-xs); min-width: 0; }
.bible-person-text h5 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 28px; }
.bible-person-text p { font-size: 13px; line-height: 22px; color: var(--ink-dim); }

.bible-world {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: var(--space-md) var(--space-lg);
  margin: 0;
  padding: var(--space-md) var(--space-lg);
  background: var(--paper-mid);
  box-shadow: var(--shadow-inset);
}
.bible-world dt { font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 26px; color: var(--copper); }
.bible-world dd { margin: 0; font-size: 14px; line-height: 24px; }

.bible-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-sm); }
.bible-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: var(--paper-white);
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
}
.bible-tile img, .bible-tile video { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.bible-tile:hover img, .bible-tile:hover video { transform: scale(1.04); }
.bible-tile.is-video::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  margin: -14px 0 0 -9px;
  border-style: solid;
  border-width: 14px 0 14px 22px;
  border-color: transparent transparent transparent rgba(254, 249, 240, 0.95);
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.5));
}
.bible-tile-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px var(--space-sm) 6px;
  background: linear-gradient(transparent, rgba(24, 21, 18, 0.75));
  color: var(--paper);
  text-align: left;
}
.bible-credit { text-align: center; }

/* Full-screen viewer for gallery images (lives inside the dialog). */
.script-viewer {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 3.5rem 4rem;
  background: rgba(24, 21, 18, 0.92);
}
.script-viewer-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: var(--space-sm); max-width: 100%; max-height: 100%; }
.script-viewer-media img, .script-viewer-media video {
  display: block;
  max-width: min(100%, 1400px);
  max-height: calc(100dvh - 9rem);
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.script-viewer-figure figcaption { color: var(--paper); white-space: pre; }
.script-viewer .carousel-arrow { opacity: 1; width: 44px; height: 44px; }
.script-viewer-close { top: var(--space-md); right: var(--space-md); }

@media (max-width: 900px) {
  .bible-crew.is-compact, .bible-gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .script-modal-bar { padding-left: var(--space-md); flex-wrap: wrap; }
  .script-modal-bar > .label-sm { display: none; }
  .script-modal-nav { margin-left: 0; }
  .script-modal-body { padding: 0 var(--space-md) var(--space-lg); }
  .bible-hero { width: calc(100% + 2 * var(--space-md)); margin: 0 calc(-1 * var(--space-md)); aspect-ratio: 16 / 9; }
  .bible-head h3 { font-size: 32px; line-height: 40px; }
  .bible-crew { grid-template-columns: 1fr; }
  .bible-person, .bible-person:first-child { grid-template-columns: 6.5rem 1fr; }
  .bible-crew.is-compact .bible-person:first-child { grid-column: 1 / -1; grid-template-columns: 6.5rem 1fr; }
  .bible-world { grid-template-columns: 1fr; gap: var(--space-xs); padding: var(--space-md); }
  .bible-world dd { margin-bottom: var(--space-sm); }
  .script-viewer { padding: 3.5rem var(--space-sm); }
}

/* ---------- Project detail modal (reuses the series bible layout) ---------- */
.specimen-media.is-trigger { cursor: zoom-in; }
.specimen-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.project-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-md); margin-top: var(--space-xs); }
.project-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xs) var(--space-xl);
  margin: 0;
  padding-left: 1.25rem;
  font-size: 14px;
  line-height: 24px;
}
.project-features li::marker { color: var(--copper); }
.project-gallery .bible-tile img { object-position: top; }
/* Phone screenshots keep their natural height instead of a 4:3 crop. */
.project-gallery.is-phone { grid-template-columns: repeat(6, 1fr); align-items: start; }
.project-gallery.is-phone .bible-tile { aspect-ratio: auto; }
.project-gallery.is-phone .bible-tile img { display: block; height: auto; }
.project-gallery-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 12rem;
  background:
    repeating-linear-gradient(0deg, transparent 0 19px, rgba(24, 21, 18, 0.06) 19px 20px),
    repeating-linear-gradient(90deg, transparent 0 19px, rgba(24, 21, 18, 0.06) 19px 20px),
    var(--paper-high);
  box-shadow: var(--shadow-inset);
  color: var(--ink-dim);
}
.project-gallery-empty .msym { font-size: 48px; color: var(--copper); opacity: 0.55; }
@media (max-width: 900px) {
  .project-gallery.is-phone { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .project-features { grid-template-columns: 1fr; }
}


/* ---------- Book detail modal ---------- */
.book-trigger {
  width: 100%;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
body:has(.book-modal[open]) { overflow: hidden; }
.book-modal {
  width: min(56rem, calc(100% - 2 * var(--margin)));
  max-height: calc(100dvh - 4rem);
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(24, 21, 18, 0.35);
  overflow: auto;
}
.book-modal[open] { animation: book-modal-in 0.2s ease-out; }
.book-modal::backdrop { background: rgba(24, 21, 18, 0.6); backdrop-filter: blur(2px); }
@keyframes book-modal-in { from { opacity: 0; transform: translateY(12px); } }
.book-modal-inner {
  position: relative;
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: var(--space-xl);
  padding: var(--space-xl);
}
.book-modal-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  background: var(--paper-mid);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.15s;
}
.book-modal-close:hover { background: var(--paper-highest); }
.book-modal-close .msym { font-size: 20px; }
/* Left column: cover with the buy / follow actions beneath it. */
.book-modal-aside { align-self: start; display: flex; flex-direction: column; gap: var(--space-md); min-width: 0; }
.book-modal-cover {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-highest);
  box-shadow: var(--shadow-md);
}
.book-modal-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-modal-cover.is-placeholder { background: repeating-linear-gradient(135deg, var(--paper-highest) 0 12px, var(--paper-high) 12px 24px); }
.book-modal-cover-title {
  margin: var(--space-md);
  padding: var(--space-sm);
  background: rgba(231, 226, 217, 0.95);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  line-height: 28px;
  text-align: center;
}
.book-modal-body { display: flex; flex-direction: column; gap: var(--space-md); min-width: 0; }
.book-modal-body .saga-head { padding-right: 44px; }
.book-modal-body h3 { font-size: 32px; line-height: 40px; }
.book-modal-desc { color: var(--ink-dim); font-size: 12px; line-height: 23px; white-space: pre-line; }
.book-modal-reviews, .book-review-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.book-review {
  margin: 0;
  padding: var(--space-sm) var(--space-md);
  border-left: 3px solid var(--copper);
  background: var(--paper-low);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.book-review p { font-style: italic; font-size: 12px; line-height: 20px; }
.book-review footer { display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: center; }
.book-review-stars { color: var(--copper); letter-spacing: 0.15em; font-size: 12px; }
.book-modal-actions { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-sm); text-align: center; }
.book-modal-actions .marginalia-link { justify-content: center; }
@media (max-width: 720px) {
  .book-modal { width: calc(100% - 1.5rem); max-height: calc(100dvh - 1.5rem); }
  .book-modal-inner { grid-template-columns: 1fr; gap: var(--space-lg); padding: var(--space-lg) var(--space-md); }
  .book-modal-cover { width: 100%; max-width: 220px; align-self: center; }
  .book-modal-body h3 { font-size: 26px; line-height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .book-modal[open] { animation: none; }
}
