/* ============================================================
   PUMP THESIS — Manifesto stylesheet
   ============================================================ */

:root {
  --bg: #0a0a0c;
  --bg-soft: #111114;
  --bg-elev: #16161a;
  --text: #e8e2d2;
  --text-bright: #f5f0e0;
  --text-muted: #a39d92;
  --border: #22222a;
  --accent: #c25a2a;
  --accent-soft: rgba(194, 90, 42, 0.13);
  --accent-glow: rgba(194, 90, 42, 0.25);

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Menlo', monospace;

  --max-w: 720px;
  --gutter: 24px;
  --radius: 0;

  accent-color: var(--accent);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.7;
  font-weight: 380;
  font-variation-settings: "opsz" 24, "SOFT" 30;
  font-feature-settings: "liga" 1, "dlig" 1, "calt" 1, "kern" 1, "onum" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(ellipse at 15% 0%, #1a0e08 0%, transparent 45%),
    radial-gradient(ellipse at 85% 100%, #051a13 0%, transparent 45%);
  background-attachment: fixed;
  overflow-x: hidden;
}

::selection { background: var(--text-bright); color: var(--bg); }

img { max-width: 100%; display: block; }

a:focus-visible,
button:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ===== Subtle film grain overlay ===== */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== Scroll progress (single hairline, no gradient, no glow) ===== */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 1px;
  width: 0%;
  background: var(--accent);
  z-index: 1000;
  transition: width 0.08s ease-out;
}

/* ===== Chapter side nav ===== */
.chapter-nav {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

.chapter-nav ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }

.chapter-nav a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 12px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  transition: color 0.3s ease, background 0.3s ease;
  white-space: nowrap;
  position: relative;
}

.chapter-nav a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 1px;
  background: var(--text-muted);
  transform: translateY(-50%);
  transition: width 0.3s ease, background 0.3s ease;
}

.chapter-nav a:hover { color: var(--text-bright); }
.chapter-nav a:hover::before { width: 8px; background: var(--text-bright); }

.chapter-nav a.active { color: var(--accent); }
.chapter-nav a.active::before { width: 12px; background: var(--accent); }

.chapter-nav .num { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 18px; }

.chapter-nav .title {
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.chapter-nav:hover .title,
.chapter-nav a.active .title {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 1280px) { .chapter-nav { display: none; } }

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--gutter);
  position: relative;
  text-align: center;
  z-index: 2;
}

.hero-inner {
  max-width: var(--max-w);
  animation: fadeUp 1.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  opacity: 0;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 36px;
  font-variant-caps: all-small-caps;
  font-feature-settings: "smcp" 1, "c2sc" 1;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(64px, 13vw, 144px);
  line-height: 0.9;
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 60, "wght" 420;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  letter-spacing: -0.045em;
  color: var(--text-bright);
  margin-bottom: 36px;
  font-style: italic;
}

.hero-tagline {
  font-family: var(--serif);
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.5;
  font-weight: 380;
  color: var(--text);
  max-width: 580px;
  margin: 0 auto 52px;
  font-variation-settings: "opsz" 24, "SOFT" 70;
}

.hero-meta {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  font-variant-caps: all-small-caps;
  font-feature-settings: "smcp" 1, "c2sc" 1;
  display: flex;
  justify-content: center;
  gap: 14px;
}

.hero-scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: floatPulse 3.2s ease-in-out infinite;
}

.scroll-line {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
}

/* ===== Manifesto ===== */
.manifesto {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 2;
}

.chapter {
  padding: 140px 0;
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.4s ease, transform 1.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.chapter.in-view { opacity: 1; transform: translateY(0); }
.chapter:last-of-type { border-bottom: none; }

.chapter-header { margin-bottom: 56px; }

.chapter-num {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-bottom: 18px;
  font-variant-caps: all-small-caps;
}

.chapter-title {
  font-family: var(--serif);
  font-size: clamp(38px, 5.4vw, 56px);
  line-height: 1.05;
  font-weight: 400;
  font-variation-settings: "opsz" 72, "SOFT" 50;
  letter-spacing: -0.025em;
  color: var(--text-bright);
}

.chapter-body p { margin-bottom: 26px; }
.chapter-body em { color: var(--text-bright); font-style: italic; }

.lede {
  font-size: clamp(22px, 2.6vw, 28px) !important;
  line-height: 1.45 !important;
  font-weight: 380;
  color: var(--text-bright);
  font-variation-settings: "opsz" 36, "SOFT" 80;
  font-style: italic;
  margin-bottom: 36px !important;
}

/* Drop cap on Ch.01 lede only */
#ch01 .lede::first-letter {
  -webkit-initial-letter: 3 2;
  initial-letter: 3 2;
  font-style: italic;
  color: var(--accent);
  font-variation-settings: "opsz" 144, "SOFT" 30, "wght" 400;
  margin-right: 10px;
  padding-right: 4px;
}

.cap {
  font-size: 21px;
  font-weight: 450;
  color: var(--text-bright);
  margin-top: 36px !important;
  border-left: 2px solid var(--accent);
  padding-left: 22px;
  font-variation-settings: "opsz" 24, "SOFT" 60;
}

.cap.final {
  font-size: clamp(32px, 4.5vw, 48px);
  line-height: 1.15;
  border-left: none;
  padding-left: 0;
  text-align: center;
  margin-top: 72px !important;
  font-style: italic;
  color: var(--text-bright);
  font-variation-settings: "opsz" 60, "SOFT" 50;
  letter-spacing: -0.02em;
}

.pull-quote {
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.3;
  font-weight: 400;
  color: var(--accent);
  margin: 56px -28px;
  padding: 36px 36px 36px 32px;
  border-left: 3px solid var(--accent);
  font-style: italic;
  font-variation-settings: "opsz" 36, "SOFT" 50;
  background: linear-gradient(to right, var(--accent-soft), transparent);
  transform: scale(0.97);
  opacity: 0;
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pull-quote.in-view { transform: scale(1); opacity: 1; }

.stat-block {
  margin: 56px -28px;
  padding: 48px 32px;
  text-align: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.stat-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 100%, var(--accent-soft), transparent 60%);
  pointer-events: none;
}

.stat-number {
  font-family: var(--serif);
  font-size: clamp(64px, 10vw, 112px);
  line-height: 1;
  font-weight: 500;
  color: var(--text-bright);
  font-variation-settings: "opsz" 144, "SOFT" 30;
  font-feature-settings: "lnum" 1, "tnum" 1;
  letter-spacing: -0.05em;
  font-style: italic;
  position: relative;
}

.stat-label {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  margin-top: 18px;
  position: relative;
  font-variant-caps: all-small-caps;
}

/* ===== Reflexivity loop figure (Ch. 02) ===== */
.reflexivity-loop {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 56px auto;
  width: 100%;
  color: var(--accent);
}

.reflexivity-loop svg {
  width: 120px;
  height: auto;
  overflow: visible;
}

.reflexivity-loop svg path {
  stroke-dasharray: 700;
  stroke-dashoffset: 700;
  animation: drawLoop 8s ease-in-out infinite;
}

.reflexivity-loop figcaption {
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.32em;
  color: var(--text-muted);
  margin-top: 20px;
  font-variant-caps: all-small-caps;
}

@keyframes drawLoop {
  0%   { stroke-dashoffset: 700; opacity: 0.4; }
  50%  { stroke-dashoffset: 0;   opacity: 1; }
  100% { stroke-dashoffset: -700; opacity: 0.4; }
}

/* ===== Contract ===== */
.contract {
  max-width: var(--max-w);
  margin: 80px auto 0;
  padding: 96px var(--gutter);
  text-align: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 2;
}

.contract .eyebrow { margin-bottom: 28px; }

.contract-address {
  font-family: var(--mono);
  font-size: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 22px 28px;
  border-radius: var(--radius);
  color: var(--text-muted);
  margin: 0 auto 28px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  letter-spacing: 0.05em;
}

.address-text { font-style: italic; }

.copy-address {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  padding: 7px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
  line-height: 1;
  font-variant-caps: all-small-caps;
}

.copy-address:hover {
  background: var(--accent);
  color: var(--bg);
}

.copy-address[data-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
}

.copy-address[data-disabled="true"]:hover {
  background: transparent;
  color: var(--accent);
}

.copy-address.copied {
  background: var(--accent);
  color: var(--bg);
}

.contract-note {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
  font-style: italic;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 80px var(--gutter);
  text-align: center;
  position: relative;
  z-index: 2;
}

.footer-mark {
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 28px;
}

.footer-text {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-variant-caps: all-small-caps;
}

.footer-disclaimer {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  max-width: 400px;
  margin: 0 auto 24px;
}

.colophon {
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  max-width: 460px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  opacity: 0.7;
}

/* ===== Persistent refrain (fixed bottom-corner) ===== */
.refrain {
  position: fixed;
  bottom: 16px;
  left: 24px;
  z-index: 50;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--text-muted);
  font-variant-caps: all-small-caps;
  pointer-events: none;
  opacity: 0.6;
  mix-blend-mode: difference;
}

@media (max-width: 900px) {
  .refrain { display: none; }
}

/* ===== Animations ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(36px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes floatPulse {
  0%, 100% { opacity: 0.45; transform: translateX(-50%) translateY(0); }
  50% { opacity: 0.95; transform: translateX(-50%) translateY(-8px); }
}

/* ===== Mobile ===== */
@media (max-width: 640px) {
  body { font-size: 17px; line-height: 1.65; }

  :root { --gutter: 20px; }

  .pull-quote {
    margin: 40px 0;
    padding: 22px 18px 22px 20px;
    font-size: 21px;
    line-height: 1.35;
  }

  .stat-block {
    margin: 40px 0;
    padding: 36px 20px;
  }

  .stat-number {
    letter-spacing: -0.06em;
  }

  .chapter { padding: 90px 0; }
  .chapter-header { margin-bottom: 40px; }

  .hero-title {
    font-size: clamp(56px, 16vw, 96px);
    letter-spacing: -0.035em;
    overflow-wrap: break-word;
    word-break: keep-all;
    hyphens: none;
    font-variation-settings: "opsz" 96, "SOFT" 70, "wght" 440;
  }

  .hero-tagline { padding: 0 4px; }

  .hero-scroll-cue { display: none; }

  .cap { padding-left: 16px; }

  .contract-address {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 100%;
    word-break: break-all;
    padding: 18px 20px;
    font-size: 13px;
  }

  .reflexivity-loop { margin: 36px auto; }
  .reflexivity-loop svg { width: 96px; }

  .cap.final {
    font-size: clamp(28px, 8vw, 40px);
    margin-top: 56px !important;
  }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .chapter, .pull-quote { opacity: 1; transform: none; }
  .hero-scroll-cue,
  .reflexivity-loop svg path { animation: none !important; }
  .progress-bar { transition: none !important; }
}
