/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ---------- Tokens ---------- */
:root {
  --bg: #F4EEE4;            /* warm cream */
  --bg-soft: #EEE6D8;       /* deeper cream for bands */
  --ink: #1F1B17;           /* warm near-black */
  --ink-soft: #6A5F52;      /* warm muted */
  --accent: #B84A1E;        /* burnt sienna */
  --line: rgba(31,27,23,0.12);

  --f-serif: "Fraunces", "Times New Roman", serif;
  --f-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --page-x: clamp(1.25rem, 5vw, 4rem);
  --max: 1100px;
}

/* ---------- Base ---------- */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- Progress bar ---------- */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: transparent;
  z-index: 60;
}
.progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transform-origin: left;
  transition: width 0.05s linear;
}

/* ---------- Cursor follower ---------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 90;
  transition: width 0.2s ease, height 0.2s ease, background 0.2s ease, opacity 0.2s ease;
  opacity: 0;
  mix-blend-mode: multiply;
}
.cursor.active {
  width: 56px;
  height: 56px;
  background: rgba(184, 74, 30, 0.08);
}
@media (hover: none), (max-width: 800px) {
  .cursor { display: none; }
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem var(--page-x);
  z-index: 50;
  transition: background 0.3s ease, backdrop-filter 0.3s ease, padding 0.3s ease;
}
.nav.scrolled {
  background: rgba(244, 238, 228, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}
.mark {
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: 1.15rem;
  font-style: italic;
  letter-spacing: -0.02em;
}
.nav-links {
  display: flex;
  gap: 1.75rem;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}
.nav-links a {
  color: var(--ink-soft);
  transition: color 0.2s ease;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -3px; left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.25s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }
@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 6rem var(--page-x) 4rem;
  position: relative;
}
.hero-inner {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
}
.eyebrow {
  font-family: var(--f-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 2.5rem;
}
.hero h1 {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: clamp(3rem, 11vw, 8.5rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin-bottom: 2.5rem;
  font-variation-settings: "opsz" 144, "SOFT" 20;
}
.hero h1 .line { display: block; }
.hero h1 .italic {
  font-style: italic;
  color: var(--accent);
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
}
.lede {
  font-family: var(--f-serif);
  font-weight: 300;
  font-size: clamp(1.15rem, 2.2vw, 1.6rem);
  line-height: 1.45;
  max-width: 32ch;
  color: var(--ink);
  margin-bottom: 2.5rem;
  font-variation-settings: "opsz" 40;
}
.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  animation: bob 2.5s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ---------- Sections ---------- */
.section {
  padding: 8rem var(--page-x);
  max-width: var(--max);
  margin: 0 auto;
}
.section.band {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}
.section.band > * {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--page-x);
  padding-right: var(--page-x);
}
.section.band {
  background: var(--bg-soft);
}
.section-label {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2.5rem;
}
.dash {
  width: 32px;
  height: 1px;
  background: var(--accent);
}
.section h2 {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: clamp(2rem, 5.5vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 3rem;
  max-width: 22ch;
  font-variation-settings: "opsz" 100, "SOFT" 20;
}
.section h2 .italic {
  font-style: italic;
  color: var(--accent);
  font-variation-settings: "opsz" 100, "SOFT" 100, "WONK" 1;
}
.section h2 .arrow {
  display: inline-block;
  color: var(--accent);
  font-family: var(--f-sans);
  font-weight: 300;
  padding: 0 0.15em;
}
.prose {
  max-width: 60ch;
}
.prose p {
  font-family: var(--f-serif);
  font-weight: 300;
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  line-height: 1.55;
  margin-bottom: 1.5rem;
  font-variation-settings: "opsz" 40;
}
.prose p:last-child { margin-bottom: 0; }
.prose em, .prose strong { color: var(--accent); font-style: italic; font-weight: 400; }
.prose strong { font-weight: 500; font-style: normal; }

/* ---------- Chapters ---------- */
.chapters-wrap {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}
.chapter {
  padding-top: 3rem;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 720px) {
  .chapter {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}
.chapter-head {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
}
.chapter-num {
  font-family: var(--f-serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--accent);
  line-height: 1;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
}
.chapter h3 {
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  font-variation-settings: "opsz" 100;
}
.chapter-role {
  font-size: 0.85rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.chapter-body {
  font-family: var(--f-serif);
  font-weight: 300;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.6;
  color: var(--ink);
  font-variation-settings: "opsz" 40;
}
.chapter-body em {
  color: var(--accent);
  font-style: italic;
}

/* ---------- Off the page ---------- */
.off-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}
.off-list li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 2rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
@media (max-width: 620px) {
  .off-list li {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}
.off-year {
  font-family: var(--f-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.off-list p {
  font-family: var(--f-serif);
  font-weight: 300;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.55;
  font-variation-settings: "opsz" 40;
}
.off-list a { border-bottom: 1px solid var(--accent); color: var(--accent); }

/* ---------- Connect ---------- */
.connect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}
.connect-link {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  transition: transform 0.3s cubic-bezier(.2,.7,.3,1), border-color 0.3s ease, background 0.3s ease;
}
.connect-link:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: rgba(184, 74, 30, 0.04);
}
.connect-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.connect-value {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 100;
}
.arrow-inline {
  display: inline-block;
  transition: transform 0.25s ease;
}
.connect-link:hover .arrow-inline {
  transform: translateX(6px);
}
.connect-note {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-soft);
  font-variation-settings: "opsz" 40;
}

/* ---------- Foot ---------- */
.foot {
  padding: 4rem var(--page-x) 3rem;
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.foot-meta {
  font-family: var(--f-serif);
  font-style: italic;
  font-variation-settings: "opsz" 40;
}
@media (max-width: 620px) {
  .foot { flex-direction: column; gap: 0.5rem; text-align: center; }
}

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
}

/* Responsive helpers */
@media (max-width: 720px) {
  .br-desk { display: none; }
  .section { padding: 5rem var(--page-x); }
  .hero { padding: 5rem var(--page-x) 3rem; }
}
