/* ─── Reset & Root ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:       #4a7c59;
  --green-light: #7aaa8a;
  --green-pale:  #b0c8b8;
  --sand:        #f7f5f0;
  --sand-mid:    #f0ede6;
  --sand-dark:   #e8e4dc;
  --border:      #d4cfc4;
  --ink:         #1a1a14;
  --ink-mid:     #2a2a24;
  --muted:       #5a5a4a;
  --quiet:       #6a6a5a;
  --whisper:     #7a7a6a;
  --serif:       'Cormorant Garamond', Georgia, serif;
  --sans:        Arial, sans-serif;
  --nav-h:       56px;
  --nav-scroll-h: 12px;
  --spool-flange: 12px;
  --spool-hub:    6px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
  height: 100%;
}

body {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  color: var(--ink-mid);
  background: linear-gradient(135deg, var(--sand) 0%, #faf8f3 100%);
  line-height: 1.7;
  min-height: 100%;
  height: 100vh;
  overflow: hidden;
}

/* ─── Navigation ─────────────────────────────────────────────── */
#main-nav {
  position: relative;
  z-index: 200;
  background: rgba(247, 245, 240, 0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1.5px solid var(--border);
  height: var(--nav-h);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  overflow: visible;
  /* Extra bottom padding so the spool sits on the border */
  padding-bottom: 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 2.5rem;
  gap: 0;
  overflow: visible;
  position: relative;
}

.logo {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--ink-mid);
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 2rem;
}
.logo span { color: var(--green); }

/* Chapter nav list */
.nav-chapters {
  display: flex;
  align-items: stretch;
  list-style: none;
  height: 100%;
  flex: 1 1 auto;
  min-width: 0;
  gap: 0;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: none;
}
.nav-chapters::-webkit-scrollbar {
  display: none;
}

/* ─── Spool Scrollbar ──────────────────────────────────────── */
/*
 * The track is a filament line; the thumb is a spool reel.
 * Two circular flanges (::before / ::after) flank the wound filament body.
 */

.nav-scrollbar {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -5px;
  height: 24px;
  pointer-events: none;
  z-index: 220;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-scrollbar[hidden] {
  display: none;
}

.nav-scrollbar-label {
  position: absolute;
  left: 50%;
  top: calc(100% + 1px);
  transform: translateX(-50%);
  color: var(--green);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0.72;
}

/* The two spool icons */
.nav-spool-svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  pointer-events: none;
  transition: transform 0.15s ease;
  transform-origin: center center;
}

/* Take-up spool grows — transform driven by JS inline style */
.nav-spool-take {
  transform-origin: center center;
}

/* The "filament line" track */
.nav-scrollbar-track {
  position: relative;
  flex: 1 1 auto;
  height: var(--nav-scroll-h);
  display: flex;
  align-items: center;
  pointer-events: auto;
}

/* Filament wire rendered as a pseudo-element so it sits behind the thumb */
.nav-scrollbar-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 1.5px;
  border-radius: 1px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(74,124,89,0.18) 0px,
      rgba(74,124,89,0.18) 3px,
      rgba(74,124,89,0.07) 3px,
      rgba(74,124,89,0.07) 8px
    );
  box-shadow:
    0 0.5px 0 rgba(255,255,255,0.6),
    0 -0.5px 0 rgba(0,0,0,0.06);
}

/* The spool thumb */
.nav-scrollbar-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  /* filament body is slimmer than the flanges */
  height: 6px;
  min-width: 28px;
  border: none;
  border-radius: 2px;
  transform: translateY(-50%);
  cursor: grab;
  pointer-events: auto;
  background: transparent;
}

/* Spool flanges — left and right circular discs, taller than the body */
.nav-scrollbar-thumb::before,
.nav-scrollbar-thumb::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: var(--spool-flange);
  height: var(--spool-flange);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #b0c8b8 0 1.5px, transparent 1.5px),
    radial-gradient(circle at center, transparent 2.5px, rgba(74,124,89,0.12) 2.5px 3px, transparent 3px),
    radial-gradient(circle at center, #d4e8da 0 3.5px, #c2d9cb 3.5px 5.5px, #a8c9b4 5.5px);
  border: 1px solid rgba(74,124,89,0.35);
  box-shadow:
    0 1px 3px rgba(0,0,0,0.18),
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -1px 0 rgba(0,0,0,0.08);
  z-index: 2;
}
.nav-scrollbar-thumb::before { left: -1px; }
.nav-scrollbar-thumb::after  { right: -1px; }

/* Filament body between flanges */
.nav-scrollbar-thumb {
  background:
    repeating-linear-gradient(
      92deg,
      rgba(255,255,255,0.25) 0px,
      rgba(255,255,255,0.25) 1px,
      transparent 1px,
      transparent 4px
    ),
    linear-gradient(180deg,
      #92c7a6 0%,
      #6aac85 30%,
      #5f9a72 50%,
      #6aac85 70%,
      #92c7a6 100%
    );
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.3),
    inset 0 -1px 0 rgba(0,0,0,0.1),
    0 1px 3px rgba(0,0,0,0.12);
}

.nav-scrollbar-thumb:active {
  cursor: grabbing;
  filter: brightness(0.96);
}

/* Flanges spin when actively dragging — the spool unwinds! */
@keyframes spool-spin {
  from { transform: translateY(-50%) rotate(0deg); }
  to   { transform: translateY(-50%) rotate(360deg); }
}
.nav-scrollbar-thumb.is-dragging::before,
.nav-scrollbar-thumb.is-dragging::after {
  animation: spool-spin 0.9s linear infinite;
}

/* Tooltip hint that appears on hover */
.nav-scrollbar-thumb::after {
  /* (flange styles already set above — no tooltip override needed) */
}

/* Progress indicator: how far through the nav you are */
.nav-scrollbar-track::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 1.5px;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--green-light), var(--green));
  opacity: 0.55;
  width: var(--spool-progress, 0%);
  pointer-events: none;
  transition: width 0.05s linear;
}

/* Individual chapter item */
.chapter-item {
  position: relative;
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
}

.chapter-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 0.9rem;
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--whisper);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
  border-top: 2px solid transparent;
  height: 100%;
}
.chapter-link:hover { color: var(--green); border-top-color: var(--green); }
.chapter-link.active { color: var(--green); border-top-color: var(--green); }

.ch-num {
  font-family: var(--serif);
  font-size: 11px;
  color: var(--green-light);
  margin-right: 2px;
}

.chevron {
  width: 8px;
  height: 5px;
  flex-shrink: 0;
  opacity: 0.5;
  transition: transform 0.2s;
}
.chapter-item.open .chevron,
.chapter-item:focus-within .chevron { transform: rotate(180deg); opacity: 1; }

/* Dropdown */
.dropdown {
  display: none;
  position: fixed;
  top: calc(var(--nav-h) + 2px);
  left: 0;
  min-width: 0;
  background: rgba(247, 245, 240, 0.98);
  backdrop-filter: blur(8px);
  border: 0.5px solid var(--border);
  border-top: none;
  list-style: none;
  z-index: 99999;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  padding: 0.5rem 0;
  max-height: min(70vh, 32rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.chapter-item.open .dropdown,
.chapter-item:focus-within .dropdown { display: block; }

.dropdown li a {
  display: block;
  padding: 0.5rem 1.25rem;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--quiet);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.dropdown li a:hover {
  background: var(--sand-mid);
  color: var(--green);
}
.dropdown li a.active {
  background: rgba(74, 124, 89, 0.08);
  color: var(--green);
}
.dropdown li a.sub2 {
  padding-left: 2rem;
  font-size: 11px;
  color: var(--whisper);
}
.dropdown li a.sub2::before {
  content: '—';
  margin-right: 6px;
  opacity: 0.4;
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 1px;
  background: var(--ink-mid);
  transition: transform 0.2s, opacity 0.2s;
}

/* ─── Chapter Viewer ─────────────────────────────────────────── */
.viewer-shell {
  height: calc(100vh - var(--nav-h));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 0;
  gap: 0;
}

.viewer-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
}

.viewer-kicker {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.45rem;
}

.viewer-heading {
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 400;
  line-height: 1.1;
  color: var(--ink);
}

.viewer-status {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--whisper);
}

.chapter-stage {
  min-height: 0;
  background: transparent;
  overflow: hidden;
}

.chapter-stage-inner {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.chapter-stage-inner > .hero,
.chapter-stage-inner > .content-section {
  min-height: 100%;
  border-bottom: none;
}

.chapter-stage-inner > .hero {
  min-height: 100%;
}

.chapter-loading {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 3rem;
  color: var(--whisper);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
}

.chapter-controls {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.25rem;
}

.chapter-control {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink-mid);
  border-radius: 999px;
  padding: 0.85rem 1.25rem;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.chapter-control:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(41, 39, 29, 0.08);
}

.chapter-control:disabled {
  cursor: not-allowed;
  opacity: 0.4;
  box-shadow: none;
}

.chapter-control-primary {
  border-color: var(--green);
  background: var(--green);
  color: #f7f5f0;
}

/* ─── Hero ────────────────────────────────────────────────────── */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto;
  min-height: calc(100vh - var(--nav-h));
  border-bottom: 0.5px solid var(--border);
  background: linear-gradient(135deg, var(--sand) 0%, #f5f2eb 100%);
  overflow: hidden;
  isolation: isolate;
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  inset: -30% 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.21;
  background-repeat: repeat;
  animation: pp-flake-rain 54s linear infinite;
}

.hero::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='360' viewBox='0 0 260 360'%3E%3Crect x='28' y='24' width='7' height='7' rx='1' fill='%23ffffff' fill-opacity='0.9'/%3E%3Crect x='145' y='58' width='10' height='5' rx='1' transform='rotate(-13 150 60)' fill='%2369a5cd' fill-opacity='0.64'/%3E%3Cpolygon points='214,88 222,100 208,101' fill='%237aaa8a' fill-opacity='0.5'/%3E%3Crect x='74' y='164' width='8' height='8' rx='1' transform='rotate(18 78 168)' fill='%23ffffff' fill-opacity='0.78'/%3E%3Crect x='198' y='226' width='12' height='6' rx='1' transform='rotate(22 204 229)' fill='%2369a5cd' fill-opacity='0.54'/%3E%3Cpolygon points='44,284 55,289 47,298' fill='%23ffffff' fill-opacity='0.7'/%3E%3C/svg%3E");
  background-position: 12% 8%;
  background-size: 260px 360px;
}

.hero::after {
  opacity: 0.14;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='430' viewBox='0 0 320 430'%3E%3Crect x='48' y='52' width='6' height='6' rx='1' transform='rotate(12 51 55)' fill='%23ffffff' fill-opacity='0.88'/%3E%3Cpolygon points='238,70 247,80 234,84' fill='%234a90be' fill-opacity='0.58'/%3E%3Crect x='152' y='138' width='11' height='5' rx='1' transform='rotate(-21 157 140)' fill='%23ffffff' fill-opacity='0.74'/%3E%3Crect x='270' y='226' width='7' height='7' rx='1' fill='%234a90be' fill-opacity='0.48'/%3E%3Cpolygon points='88,306 98,310 91,320' fill='%237aaa8a' fill-opacity='0.45'/%3E%3Crect x='188' y='368' width='12' height='6' rx='1' transform='rotate(17 194 371)' fill='%23ffffff' fill-opacity='0.68'/%3E%3C/svg%3E");
  background-position: 34% 14%;
  background-size: 320px 430px;
  animation-duration: 76s;
  animation-delay: -24s;
}

.hero > * {
  position: relative;
  z-index: 1;
}

@keyframes pp-flake-rain {
  from { transform: translate3d(0, -18%, 0); }
  to { transform: translate3d(0, 18%, 0); }
}

.hero-left {
  padding: 5rem 4rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.hero-intro {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 1.75rem;
  border-radius: 32px;
  background:
    radial-gradient(circle at top right, rgba(122, 170, 138, 0.16), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(244, 240, 233, 0.9));
  border: 1px solid rgba(74, 124, 89, 0.08);
  box-shadow: 0 20px 40px rgba(30, 30, 24, 0.05);
}

.hero-heading-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  align-items: center;
  gap: 2rem;
}

.hero-heading-copy {
  min-width: 0;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 1.75rem;
}

h1 {
  font-family: var(--serif);
  font-size: clamp(52px, 8vw, 76px);
  font-weight: 300;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 1.75rem;
  letter-spacing: -0.02em;
}
h1 em { font-style: italic; color: var(--green); font-weight: 400; }

.hero-desc {
  font-size: 15px;
  color: var(--quiet);
  line-height: 1.85;
  max-width: none;
  margin-bottom: 0;
}

.hero-meta {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--whisper);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.hero-meta .sep { opacity: 0.4; }

.hero-mark {
  width: 100%;
  max-width: 190px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  justify-self: end;
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.hero-summary {
  max-width: none;
  margin-top: 2rem;
}

.hero-summary p {
  font-size: 15px;
  color: var(--quiet);
  line-height: 1.85;
}

.hero-summary p + p {
  margin-top: 1rem;
}

.hero-right {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 0 4rem 3.5rem;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  background: transparent;
  gap: 1.1rem;
  border-top: none;
}

.hero-figure {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.hero-image-placeholder {
  min-height: 420px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(74, 124, 89, 0.4);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(232, 228, 220, 0.9)),
    radial-gradient(circle at top, rgba(122, 170, 138, 0.22), transparent 45%);
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
}

.hero-figure-image {
  width: 100%;
  aspect-ratio: 21 / 9;
  min-height: 0;
  display: block;
  object-fit: cover;
  border-radius: 24px;
  border: none;
  box-shadow: none;
}

.hero-figure figcaption {
  font-size: 12px;
  color: var(--quiet);
  max-width: 38ch;
}

.hero-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 0.85rem 1rem;
  width: fit-content;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(74, 124, 89, 0.12);
  box-shadow: 0 10px 24px rgba(30, 30, 24, 0.06);
}
.badge-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--whisper);
}
.badge-val {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--green);
}

.hero-team {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2.75rem 4rem 3.5rem;
  border-top: 0.5px solid var(--border);
  background:
    linear-gradient(180deg, rgba(247, 245, 240, 0), rgba(247, 245, 240, 0.94) 16%),
    linear-gradient(135deg, rgba(176, 200, 184, 0.18), rgba(247, 245, 240, 0.96));
}

.hero-team-kicker {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.7rem;
}

.hero-team-copy h2 {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 1rem;
}

.hero-team-copy > p:last-child {
  color: var(--quiet);
  max-width: 56ch;
}

.hero-team-label {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
}

.hero-team-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  width: 100%;
}

.team-card {
  padding: 1rem;
  border: 0.5px solid rgba(212, 207, 196, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(8px);
  text-align: center;
}

.team-photo-placeholder {
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  border-radius: 18px;
  margin-bottom: 1rem;
  background:
    linear-gradient(160deg, rgba(74, 124, 89, 0.16), rgba(255, 255, 255, 0.75)),
    repeating-linear-gradient(
      -45deg,
      rgba(74, 124, 89, 0.08),
      rgba(74, 124, 89, 0.08) 12px,
      transparent 12px,
      transparent 24px
    );
  color: var(--green);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.team-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 18px;
  margin-bottom: 1rem;
}

.team-card h3 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 0.45rem;
}

.team-card p {
  font-size: 13px;
  color: var(--quiet);
  max-width: 24ch;
  margin: 0 auto;
}

/* ─── Content Sections ────────────────────────────────────────── */
.content-section {
  padding: 5rem 4rem;
  border-bottom: 0.5px solid var(--border);
  background: linear-gradient(135deg, rgba(255,255,255,0.5) 0%, rgba(240,237,230,0.3) 100%);
}

.section-label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 0.5px;
  background: var(--border);
}

/* Abstract-style two-column layout */
.abstract-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 4rem;
  align-items: start;
}

.abstract-num {
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 300;
  color: var(--border);
  line-height: 1;
  user-select: none;
  padding-top: 0.25rem;
}

.acknowledgements-figure {
  align-self: center;
  display: flex;
  justify-content: center;
  width: clamp(80px, 12vw, 160px);
  padding-top: 0.25rem;
}

.acknowledgements-figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 34px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.abstract-body h2 {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.abstract-body p {
  font-size: 15px;
  line-height: 1.9;
  color: var(--muted);
}

/* Chapter section layout */
.chapter-header {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 3rem;
  align-items: start;
  margin-bottom: 3.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 0.5px solid var(--border);
}

.ch-number-large {
  font-family: var(--serif);
  font-size: 80px;
  font-weight: 300;
  color: var(--border);
  line-height: 1;
  user-select: none;
}

.ch-title-block h2 {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.ch-lead {
  font-size: 14px;
  color: var(--whisper);
  line-height: 1.75;
  max-width: 60ch;
}

/* Subsections */
.subsection {
  margin: 0 auto 2rem;
  padding-left: 0;
  max-width: 72ch;
  width: 100%;
}

.subsection h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 0.75rem;
  margin-top: 2rem;
}

.subsection h4 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--green);
  margin-bottom: 0.5rem;
  margin-top: 1.5rem;
  text-transform: uppercase;
}

.subsection p {
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--muted);
  text-align: justify;
}

#ch10 .subsection p {
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

.subsection p + p {
  margin-top: 1.1rem;
}

.paper-list {
  max-width: 72ch;
  margin: 0 auto 1.1rem;
  padding-left: 1.25rem;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.85;
}

.paper-list > li + li {
  margin-top: 0.8rem;
}

.paper-list ul {
  margin-top: 0.45rem;
  padding-left: 1.2rem;
}

.paper-list ul li + li {
  margin-top: 0.25rem;
}

.paper-list-numbered {
  padding-left: 1.5rem;
}

.paper-formula,
.subsection .paper-formula {
  max-width: 72ch;
  margin: 0 auto 1.1rem;
  padding-left: 0;
  text-align: center;
}

p.formula-inline,
.subsection p.formula-inline {
  display: block;
  text-align: center;
  margin: 0.9rem auto 1.1rem;
  max-width: 72ch;
}

.indented-block p.formula-inline {
  width: calc(100% + 2rem);
  max-width: none;
  margin-left: -2rem;
  margin-right: 0;
}

.formula-inline {
  white-space: nowrap;
}

.fraction {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  line-height: 1.1;
}

.fraction .top {
  display: block;
  padding: 0 0.25rem 0.08rem;
  border-bottom: 1px solid currentColor;
}

.fraction .bottom {
  display: block;
  padding-top: 0.08rem;
}

.radical {
  display: inline-flex;
  align-items: flex-start;
}

.radicand {
  display: inline-block;
  border-top: 1px solid currentColor;
  padding-left: 0.18rem;
  margin-left: 0.08rem;
}

.figure-block {
  margin-top: 1.5rem;
}

.figure-placeholder {
  min-height: 240px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(74, 124, 89, 0.35);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(240, 237, 230, 0.9)),
    radial-gradient(circle at top left, rgba(122, 170, 138, 0.16), transparent 42%);
  color: var(--green);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  width: 100%;
}

.figure-image {
  width: 100%;
  display: block;
  border-radius: 16px;
  border: 0.5px solid var(--border);
}

.figure-caption {
  margin: 0.8rem 0 1.4rem;
  text-align: center;
  font-size: 12px;
  color: var(--quiet);
}

.figure-block + .figure-caption,
.figure-block + .appendix-caption {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.table-label {
  text-align: center;
}

.table-label-top {
  text-align: left;
  margin-bottom: 0.65rem;
}

.table-divider {
  height: 1px;
  background: var(--border);
  margin: 1rem 0 1.2rem;
}

.appendix-figure-label {
  margin-top: 1rem;
  font-weight: 600;
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.06em;
}

.appendix-caption {
  margin: 0.55rem auto 1.4rem;
  text-align: center;
  font-size: 12px;
  color: var(--quiet);
}

.appendix-list {
  margin: 0.35rem 0 0 1.5rem;
  padding-left: 1rem;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.85;
}

.appendix-list li {
  margin: 0.08rem 0;
  text-align: justify;
}

.appendix-sublist {
  list-style-type: circle;
  margin-top: 0.3rem;
}

#appendices .subsection > p,
#appendices .appendix-list,
#appendices .table-label,
#appendices .appendix-figure-label,
#appendices .appendix-caption {
  max-width: 72ch;
  margin-left: auto;
  margin-right: auto;
}

#appendices .subsection h3 {
  max-width: 72ch;
  margin-left: auto;
  margin-right: auto;
}

#appendix-a .spec-table td {
  white-space: pre-line;
}

#appendix-i {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

#appendix-i h3 {
  grid-column: 1 / -1;
}

#appendix-i .figure-block {
  margin: 0;
  max-width: none;
}

#appendix-i .figure-image {
  height: 100%;
  object-fit: contain;
}

.indented-block {
  width: calc(100% - 2rem);
  margin: 0 0 1rem 2rem;
}

.subsection-2 {
  padding-left: 0;
  border-left: none;
  margin-left: 0;
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.stat {
  border-left: 2px solid var(--green);
  padding-left: 1.25rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.stat:hover {
  transform: translateX(4px);
}

.stat-num {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 300;
  color: var(--ink);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--whisper);
  margin-top: 0.4rem;
  line-height: 1.6;
}

/* Constraint grid */
.constraint-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 0.5px solid var(--border);
  margin-top: 1rem;
  max-width: 72ch;
}

.constraint-card {
  background: var(--sand);
  padding: 1.5rem;
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.constraint-card:hover {
  background: linear-gradient(135deg, #fefdfb 0%, #f9f7f2 100%);
  transform: translateY(-2px);
}

.constraint-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.5rem;
  background: var(--sand-mid);
  padding: 2px 8px;
  border-radius: 2px;
}

.constraint-card p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* Callout text */
.callout-text {
  position: relative;
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 300;
  font-style: normal;
  color: var(--ink);
  line-height: 1.85;
  text-align: left;
  border-left: none;
  margin: 1.75rem 0;
  max-width: none;
  background: linear-gradient(90deg, rgba(74, 124, 89, 0.08), rgba(255, 255, 255, 0));
  padding: 1.35rem 2.5rem 1.35rem 3rem;
  border-radius: 0;
}

.callout-text::before,
.callout-text::after {
  position: absolute;
  font-family: var(--serif);
  font-size: 56px;
  line-height: 1;
  color: var(--green);
  opacity: 0.9;
}

.callout-text::before {
  content: '“';
  top: 0.35rem;
  left: 0.35rem;
}

.callout-text::after {
  content: '”';
  right: 0.6rem;
  bottom: 0.05rem;
}

.callout-text strong {
  color: var(--green);
  font-weight: 700;
}

/* Spec table */
.spec-table-wrapper {
  overflow-x: auto;
  margin: 1rem auto 0;
  max-width: 72ch;
  border-radius: 4px;
  border: 0.5px solid var(--border);
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.spec-table th {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  text-align: left;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #f9f7f2 0%, #f5f2eb 100%);
}

.spec-table th[colspan] {
  text-align: center;
}

.spec-table .table-center {
  text-align: center;
}

.spec-table td {
  padding: 0.7rem 1rem;
  color: var(--muted);
  border-bottom: 0.5px solid var(--border);
  line-height: 1.5;
}

.table-cell-divider {
  border: 0;
  border-top: 0.5px solid rgba(212, 207, 196, 0.9);
  margin: 0.55rem 0;
}

.cell-highlight-green {
  background: rgba(130, 182, 108, 0.28);
}

.cell-highlight-yellow {
  background: rgba(236, 214, 120, 0.34);
}

.spec-table tr:last-child td { border-bottom: none; }
.spec-table tr:hover td { background: linear-gradient(90deg, rgba(74, 124, 89, 0.02) 0%, transparent 100%); }
.spec-table tr:hover td.cell-highlight-green,
.spec-table td.cell-highlight-green:hover {
  background: rgba(130, 182, 108, 0.28);
}

.spec-table tr:hover td.cell-highlight-yellow,
.spec-table td.cell-highlight-yellow:hover {
  background: rgba(236, 214, 120, 0.34);
}

/* Conclusion body */
.conclusion-body {
  max-width: 72ch;
  margin-left: calc(120px + 3rem);
}
.conclusion-body p {
  font-size: 15px;
  line-height: 1.9;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

/* ─── Footer ──────────────────────────────────────────────────── */
footer {
  padding: 2.5rem 4rem;
  border-top: 0.5px solid var(--border);
  background: linear-gradient(135deg, var(--sand) 0%, #faf8f3 100%);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.footer-logo {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink-mid);
}
.footer-logo span { color: var(--green); }

.footer-meta p {
  font-size: 12px;
  color: var(--whisper);
  line-height: 1.6;
}

.footer-links {
  font-size: 12px;
  color: var(--whisper);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.footer-links a {
  color: var(--whisper);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--green); }
.footer-links .sep { opacity: 0.4; }

.confetti-burst {
  position: fixed;
  inset: 0;
  z-index: 100002;
  pointer-events: none;
  overflow: hidden;
}

.confetti-burst span {
  position: absolute;
  top: var(--y-start);
  left: 50%;
  width: var(--size);
  height: var(--size);
  border-radius: var(--radius);
  background: var(--confetti-color);
  opacity: 0.64;
  transform: translate3d(0, 0, 0) rotate(0deg);
  animation: confetti-pop var(--fall-duration) ease-out forwards;
  animation-delay: var(--fall-delay);
}

@keyframes confetti-pop {
  18% {
    transform: translate3d(calc(var(--x-drift) * 0.42), -8vh, 0) rotate(calc(var(--spin) * 0.35));
    opacity: 0.72;
  }

  to {
    transform: translate3d(var(--x-drift), 108vh, 0) rotate(var(--spin));
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero::before,
  .hero::after,
  .confetti-burst span {
    animation: none;
  }
}

/* ─── Mobile nav overlay ─────────────────────────────────────── */
@media (max-width: 1024px) {
  #main-nav {
    z-index: 100000;
  }

  body.nav-open {
    overflow: hidden;
  }

  .nav-inner {
    padding: 0 1rem;
  }

  .nav-toggle { display: flex; }

  .nav-scrollbar { display: none; }

  .nav-chapters {
    display: none;
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    z-index: 100001;
    background: var(--sand);
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    border-top: 0.5px solid var(--border);
    padding: 1rem 0 2rem;
    height: auto;
    align-items: center;
    touch-action: pan-y;
    scrollbar-width: auto;
  }
  .nav-chapters.open,
  #main-nav.nav-open .nav-chapters {
    display: flex;
  }

  .chapter-item {
    width: 100%;
    max-width: 34rem;
    align-items: stretch;
    flex-direction: column;
    flex-shrink: 0;
  }

  .chapter-link {
    justify-content: center;
    padding: 0.85rem 1.5rem;
    height: auto;
    border-top: none;
    border-top-color: transparent;
    width: 100%;
    font-size: 11px;
    white-space: normal;
  }

  .chapter-link .ch-num {
    margin-right: 0;
  }

  .chapter-link .chapter-link-label,
  .chapter-link .ch-num + :not(.chevron) {
    text-align: center;
  }

  .chapter-link .chevron {
    position: absolute;
    right: 1.5rem;
  }

  .dropdown {
    display: none;
    position: static;
    top: auto !important;
    left: auto !important;
    border: none;
    border-top: none;
    border-left: none;
    box-shadow: none;
    margin: 0 auto;
    padding: 0.25rem 0 0.6rem;
    min-width: auto;
    width: 100% !important;
    max-height: none;
    overflow: visible;
    background: transparent;
    backdrop-filter: none;
    z-index: auto;
    text-align: center;
  }

  .dropdown li a.sub2 {
    padding-left: 1.25rem;
  }
  .nav-chapters.open .chapter-item.open .dropdown,
  #main-nav.nav-open .chapter-item.open .dropdown {
    display: block;
  }

  .chapter-item:hover .dropdown,
  .chapter-item:focus-within .dropdown {
    display: none;
  }

  .nav-chapters.open .chapter-item.open:hover .dropdown,
  .nav-chapters.open .chapter-item.open:focus-within .dropdown,
  #main-nav.nav-open .chapter-item.open:hover .dropdown,
  #main-nav.nav-open .chapter-item.open:focus-within .dropdown {
    display: block;
  }

  .chapter-item.open .chevron { transform: rotate(180deg); opacity: 1; }

  .viewer-shell {
    padding: 0;
    gap: 0;
  }

  .viewer-header {
    padding: 0.9rem 1rem;
  }
}

/* ─── Additional Enhancements ─────────────────────────────────── */
a {
  color: var(--green);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}
a:hover { color: var(--green-light); text-decoration: underline; }

.subsection h3 {
  font-size: 22px;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

/* Better paragraph styling */
.abstract-body p,
.subsection p,
.conclusion-body p {
  word-spacing: 0.02em;
  text-rendering: optimizeLegibility;
}

/* Link styling in content */
a.chapter-link {
  color: inherit;
}

.ch-title-block h2 {
  letter-spacing: -0.01em;
}

/* Improved constraint tag */
.constraint-tag {
  border: 1px solid var(--green);
  background: rgba(74, 124, 89, 0.05);
  color: var(--green);
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-left { padding: 4rem 2rem 2.5rem; border-right: none; border-bottom: none; }
  .hero-right { padding: 0 2rem 3rem; }
  .hero-intro { padding: 1.25rem; }
  .hero-heading-row { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero-mark { justify-self: start; max-width: 140px; }
  .hero-image-placeholder { min-height: 280px; }
  .hero-figure-image { aspect-ratio: 4 / 3; }
  .hero-team { padding: 2.5rem 2rem 3rem; }
  .hero-team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-section { padding: 3.5rem 2rem; }
  .abstract-grid { grid-template-columns: 80px 1fr; gap: 2rem; }
  .abstract-num { font-size: 48px; }
  .acknowledgements-figure { width: clamp(60px, 10vw, 90px); }
  .chapter-header { grid-template-columns: 64px 1fr; gap: 1.5rem; }
  .ch-number-large { font-size: 52px; }
  .stats-row { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .constraint-grid { grid-template-columns: 1fr; }
  .conclusion-body { margin-left: 0; }
  footer { padding: 2rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 1rem; }

  .viewer-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .chapter-controls {
    justify-content: stretch;
  }

  .chapter-control {
    flex: 1 1 0;
  }
}

@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr; }
  .nav-inner { padding: 0 1.25rem; }
  .abstract-grid { grid-template-columns: 1fr; }
  .abstract-num { display: none; }
  .acknowledgements-figure {
    display: flex;
    width: clamp(72px, 30vw, 120px);
    margin: 0 auto 1.5rem;
    padding-top: 0;
  }
  h1 { font-size: 44px; }
  .hero-team-grid { grid-template-columns: 1fr; }
  .team-card h3 { font-size: 22px; }

  .viewer-shell {
    padding: 0;
  }

  .chapter-stage {
    border-radius: 0;
  }

  .chapter-controls {
    gap: 0.5rem;
  }

  .chapter-control {
    padding: 0.75rem 0.9rem;
    font-size: 11px;
  }
}
