:root {
  --bg-paper:    #FAFAF7;
  --bg-paper-2:  #F4F2EC;
  --ink:         #14181F;
  --ink-soft:    #3A4150;
  --ink-mute:    #6B7280;
  --line:        #E5E1D8;
  --line-soft:   #EDE9DF;
  --accent:      #9A2A1E;
  --accent-soft: #B23E2E;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-paper);
  color: var(--ink);
}

body {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-variation-settings: 'opsz' 14;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 400;
}

/* ── Type sizes (all Fraunces, opsz-adjusted) ───────────────── */
.t-display {
  font-size: clamp(56px, 8vw, 96px);
  line-height: 1.0;
  font-variation-settings: 'opsz' 144;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.t-h2 {
  font-size: clamp(32px, 3.4vw, 42px);
  line-height: 1.1;
  font-variation-settings: 'opsz' 48;
  font-weight: 400;
  letter-spacing: -0.015em;
}
.t-lead {
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.5;
  font-variation-settings: 'opsz' 24;
  font-weight: 400;
  color: var(--ink-soft);
}
.t-body {
  font-size: 17px;
  line-height: 1.65;
  font-variation-settings: 'opsz' 17;
  font-weight: 400;
  color: var(--ink-soft);
}
.t-wordmark {
  font-size: 17px;
  font-variation-settings: 'opsz' 24;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.t-meta {
  font-size: 14px;
  font-variation-settings: 'opsz' 14;
  font-weight: 400;
  font-style: italic;
  color: var(--ink-mute);
}
.t-number {
  font-size: clamp(40px, 4.5vw, 56px);
  line-height: 1;
  font-variation-settings: 'opsz' 48;
  font-weight: 300;
  font-style: italic;
  color: var(--accent);
}
.t-caption {
  font-size: 13px;
  font-variation-settings: 'opsz' 14;
  font-weight: 400;
  color: var(--ink-mute);
}

/* ── Views (full-screen) ────────────────────────────────────── */
.view {
  position: fixed;
  inset: 0;
  width: 100vw;
  will-change: transform, opacity;
}
#ship-view  { z-index: 10; }
#patho-view { z-index: 20; overflow-y: auto; }

/* ── Subtle paper texture: very faint warm grid ─────────────── */
.paper-grid {
  background-color: var(--bg-paper);
  background-image:
    linear-gradient(rgba(20, 24, 31, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 24, 31, 0.018) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: 0 0;
}

/* ── Top bar shared across both views ───────────────────────── */
.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 40px;
  pointer-events: none;
}
.top-bar > * { pointer-events: auto; }

.wordmark-block {
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.wordmark-block .dot {
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  transform: translateY(-3px);
}

.nav-link {
  font-family: 'Fraunces', serif;
  font-size: 15px;
  font-style: italic;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nav-link:hover { color: var(--accent); }
.nav-link .arrow { transition: transform 0.25s ease; }
.nav-link:hover .arrow { transform: translateX(-3px); }

/* ── Ship view ──────────────────────────────────────────────── */
.ship-main {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ship-stage {
  position: relative;
  width: min(92vw, calc(80vh * 2357 / 1333));
  aspect-ratio: 2357 / 1333;
}

.ship-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  /* On white paper background: gentle desaturation, slight lift */
  filter: saturate(0.55) contrast(0.96) brightness(1.02);
  transition: filter 0.7s ease;
  user-select: none;
  -webkit-user-drag: none;
}

.ship-halo {
  display: none;
}

/* Caption beneath the ship */
.ship-caption {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: max-content;
  max-width: 80vw;
}

/* ── Breathing light (red dot) ──────────────────────────────── */
.breathing-light {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #FFC107;
  cursor: pointer;
  z-index: 10;
  will-change: transform, box-shadow;
  border: none;
  padding: 0;
}
.breathing-light::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(154, 42, 30, 0.5) 0%, transparent 70%);
  pointer-events: none;
}

/* Annotation line + label that emerges from the dot (academic engraving feel) */
.annotation {
  position: absolute;
  left: 50%;
  top: 50%;
  pointer-events: none;
  z-index: 9;
}
.annotation-line {
  position: absolute;
  width: 90px;
  height: 1px;
  background: #14181F;
  top: 50%;
  left: 0;
  transform-origin: left center;
  opacity: 0;
  transition: background-color 0.25s ease;
}
.annotation-label {
  position: absolute;
  left: 100px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Fraunces', serif;
  font-size: 13px;
  font-style: italic;
  color: #14181F;
  background: #FFFFFF;
  border: 1px solid #14181F;
  padding: 6px 10px;
  box-shadow: 0 2px 8px rgba(20, 24, 31, 0.08);
  white-space: nowrap;
  opacity: 0;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}
/* Hover联动:呼吸灯被悬停时,标注框和引线变学术红 */
.breathing-light:hover ~ .annotation .annotation-label {
  border-color: #9A2A1E;
  color: #9A2A1E;
  box-shadow: 0 4px 14px rgba(154, 42, 30, 0.18);
}
.breathing-light:hover ~ .annotation .annotation-line {
  background: #9A2A1E;
}


/* ── Pathogen detail view ───────────────────────────────────── */
#patho-view {
  background: var(--bg-paper);
  opacity: 0;
  pointer-events: none;
}
#patho-view.is-open {
  pointer-events: auto;
}

.patho-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 120px 32px 96px;
}

.patho-hero {
  margin-bottom: 72px;
}

.patho-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.patho-eyebrow .rule {
  height: 1px;
  width: 32px;
  background: var(--accent);
}
.patho-eyebrow .label {
  font-family: 'Fraunces', serif;
  font-size: 14px;
  font-style: italic;
  color: var(--accent);
}

.patho-subtitle {
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.3;
  font-style: italic;
  color: var(--ink-mute);
  font-weight: 300;
  margin-top: 12px;
  font-variation-settings: 'opsz' 24;
}

.patho-lead {
  margin-top: 36px;
}

/* Microscope illustration container */
.scope-figure {
  margin: 64px auto 0;
  max-width: 680px;
}
.scope-figure svg,
.scope-figure img { display: block; width: 100%; height: auto; }
.scope-caption {
  margin-top: 16px;
  text-align: center;
  font-style: italic;
}

/* Module sections */
.module {
  padding: 56px 0;
  border-top: 1px solid var(--line);
}
.module:last-of-type { border-bottom: 1px solid var(--line); }

.module-header {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 28px;
}
.module-number-cell {
  padding-top: 6px;
}
.module-meta {
  font-style: italic;
  color: var(--ink-mute);
  font-size: 16px;
  margin-top: 8px;
}

.module-body p {
  margin: 0 0 18px;
}
.module-body p:last-child { margin-bottom: 0; }

/* Pull-quote / callout inside modules */
.callout {
  margin: 32px 0;
  padding: 24px 28px;
  background: var(--bg-paper-2);
  border-left: 2px solid var(--accent);
  font-style: italic;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
}

/* Recommended-technology block in module 3 */
.recommendation {
  margin-top: 36px;
  padding: 28px 28px 32px;
  border: 1px solid var(--line);
  background: var(--bg-paper);
  position: relative;
}
.recommendation::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px;
  width: 36px; height: 1px;
  background: var(--accent);
}
.recommendation::after {
  content: '';
  position: absolute;
  top: -1px; left: -1px;
  width: 1px; height: 36px;
  background: var(--accent);
}
.rec-label {
  font-size: 14px;
  font-style: italic;
  color: var(--accent);
  margin-bottom: 10px;
}
.rec-title {
  font-size: 22px;
  line-height: 1.25;
  margin-bottom: 12px;
  font-variation-settings: 'opsz' 24;
}
.rec-body {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* Sources footer */
.sources {
  margin-top: 80px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.sources-title {
  font-style: italic;
  color: var(--ink-mute);
  font-size: 14px;
  margin-bottom: 12px;
}
.sources-list {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-mute);
}

@media (max-width: 640px) {
  .top-bar { padding: 18px 22px; }
  .patho-content { padding: 100px 22px 72px; }
  .module-header { grid-template-columns: 60px 1fr; gap: 16px; }
  .scope-figure { margin: 48px auto 0; }
}
/* ── Atlas main menu page (gallery) ─────────────────────────── */
.atlas-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 140px 40px 80px;
}

.volume {
  margin-bottom: 80px;
}
.volume:last-child {
  margin-bottom: 0;
}

.volume-header {
  margin-bottom: 32px;
}
.volume-rule {
  height: 1px;
  background: var(--line);
  margin-bottom: 18px;
}
.volume-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
}
.volume-title {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 400;
  font-variation-settings: 'opsz' 24;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0;
}
.volume-status {
  font-family: 'Fraunces', serif;
  font-size: 14px;
  font-style: italic;
  color: var(--ink-mute);
  white-space: nowrap;
}
.volume-status--active {
  color: var(--accent);
}

.atlas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.atlas-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.atlas-card-thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-paper-2);
  border: 1px solid var(--line);
  position: relative;
}
.atlas-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  filter: saturate(0.6) contrast(0.96);
  transition: transform 0.4s ease, filter 0.4s ease;
}
.atlas-card--active:hover .atlas-card-thumb img {
  transform: scale(1.03);
  filter: saturate(0.85) contrast(1);
}

.atlas-card-thumb--empty {
  background: var(--bg-paper);
  border: 1px dashed var(--line);
}

.atlas-card-meta {
  margin-top: 14px;
}
.atlas-card-title {
  font-family: 'Fraunces', serif;
  font-size: 17px;
  font-variation-settings: 'opsz' 24;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
}
.atlas-card--placeholder .atlas-card-title {
  color: var(--ink-mute);
  font-weight: 400;
}
.atlas-card-status {
  font-family: 'Fraunces', serif;
  font-size: 13px;
  font-style: italic;
  color: var(--ink-mute);
}
.atlas-card--active .atlas-card-status {
  color: var(--accent);
}

.atlas-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 60px 40px 40px;
  text-align: center;
  border-top: 1px solid var(--line);
}

/* Mobile: single column, stack Volume meta */
@media (max-width: 720px) {
  .atlas-main {
    padding: 100px 22px 60px;
  }
  .atlas-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .volume {
    margin-bottom: 60px;
  }
  .volume-meta {
    flex-direction: column;
    gap: 6px;
  }
  .atlas-footer {
    padding: 40px 22px 30px;
  }
}
/* ── Breadcrumb navigation ──────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: 'Fraunces', serif;
  font-size: 17px;
  font-variation-settings: 'opsz' 24;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.breadcrumb .crumb {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  transition: color 0.2s ease;
}
.breadcrumb a.crumb:hover {
  color: var(--accent);
}
.breadcrumb .crumb-sep {
  color: var(--ink-mute);
  font-weight: 300;
}
.breadcrumb .crumb--current {
  font-style: italic;
  font-weight: 400;
  color: var(--ink-soft);
}
