:root {
  /* Design note: (Google Fonts) Barlow Condensed, Inter, and JetBrains Mono. IntersectionObserver handles all scroll-triggered fade-reveals. No scroll event listeners. No third-party animation libraries. Code blocks use rounded blob styling. */
  --background: #f0f2f5;
  --surface: #e2e5eb;
  --thread: #c4c8d0;
  --text: #2d3142;
  --muted: #6b7280;
  --steel: #5b7a9d;
  --glacier: #8fafc4;
  --frost: #e8eaef;
  --soft-shadow: rgba(91, 122, 157, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  color: var(--text);
  font-family: "Inter", sans-serif;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--background);
}

.site-mark {
  position: fixed;
  z-index: 20;
  top: 28px;
  left: 32px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(1.2rem, 2.1vw, 1.8rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text);
  opacity: 0.5;
  transition: opacity 0.35s ease;
}

.site-mark.is-faded {
  opacity: 0.3;
}

.timeline {
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding: 8vh 0 0;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 9vh;
  bottom: 38vh;
  left: 50%;
  width: 1px;
  background: rgba(196, 200, 208, 0.4);
  transform: translateX(-50%);
  z-index: 0;
}

.timeline-node {
  position: absolute;
  left: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #9ba4b5;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.node-one { top: 50vh; }
.node-two { top: 154vh; }
.node-three { top: 258vh; }
.node-four { top: 362vh; }
.node-five { top: 466vh; }
.node-six { top: 570vh; }
.node-seven { top: 674vh; }

.node-peak {
  width: 16px;
  height: 16px;
  background: var(--steel);
}

.epoch {
  position: relative;
  z-index: 1;
  min-height: 84vh;
  display: flex;
  align-items: center;
  padding: 8vh 6vw 12vh;
}

.epoch + .epoch {
  margin-top: 20vh;
}

.epoch-open {
  min-height: 94vh;
  padding-top: 4vh;
}

.epoch-right {
  justify-content: flex-end;
}

.epoch-left {
  justify-content: flex-start;
}

.epoch-close {
  justify-content: center;
  min-height: 72vh;
}

.chamber {
  position: relative;
  overflow: hidden;
  width: min(76vw, 940px);
  min-height: 80vh;
  padding: clamp(42px, 7vw, 84px);
  background: var(--surface);
  box-shadow: 0 8px 40px var(--soft-shadow);
  border: 1px solid rgba(196, 200, 208, 0.38);
}

.chamber-large {
  width: min(82vw, 1020px);
}

.chamber-center {
  margin: 0 auto;
  border-radius: 42% 58% 54% 46% / 50% 42% 58% 50%;
}

.chamber-right {
  margin-right: 8%;
}

.chamber-left {
  margin-left: 8%;
}

.blob-a { border-radius: 40% 60% 55% 45% / 50% 40% 60% 50%; }
.blob-b { border-radius: 57% 43% 48% 52% / 43% 55% 45% 57%; }
.blob-c { border-radius: 44% 56% 61% 39% / 58% 43% 57% 42%; }
.blob-d { border-radius: 61% 39% 52% 48% / 45% 58% 42% 55%; }
.blob-e { border-radius: 46% 54% 42% 58% / 54% 39% 61% 46%; }

.chamber-close {
  width: min(70vw, 760px);
  min-height: 56vh;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 54% 46% 52% 48% / 46% 58% 42% 54%;
}

.copy {
  position: relative;
  z-index: 4;
  max-width: 640px;
}

.hero-copy {
  margin: 22vh auto 0;
  text-align: center;
}

.closing-copy {
  text-align: center;
}

.kicker {
  margin: 0 0 18px;
  color: var(--steel);
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(0.78rem, 1vw, 0.9rem);
  letter-spacing: 0.04em;
}

h1,
h2 {
  margin: 0;
  color: var(--text);
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 0.92;
}

h1 {
  font-size: clamp(3rem, 8vw, 6rem);
}

h2 {
  max-width: 560px;
  font-size: clamp(2rem, 5vw, 4rem);
  text-transform: uppercase;
}

.closing-copy h2 {
  font-size: clamp(3rem, 7vw, 5.5rem);
  text-transform: none;
}

.subtitle,
p {
  color: var(--muted);
  font-size: clamp(0.95rem, 1.8vw, 1.125rem);
  line-height: 1.72;
}

.subtitle {
  margin: 22px 0 0;
  color: var(--muted);
}

p {
  margin: 22px 0 0;
}

a {
  color: var(--steel);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
  color: var(--text);
  text-decoration: underline;
}

code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9em;
  background: var(--frost);
  border-radius: 6px;
  padding: 2px 8px;
  color: var(--text);
}

pre {
  position: relative;
  z-index: 5;
  margin: 30px 0 0;
  padding: 24px 32px;
  overflow: auto;
  background: var(--frost);
  border-radius: 20px;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(196, 200, 208, 0.28);
}

pre code {
  display: block;
  padding: 0;
  background: transparent;
  border-radius: 0;
  line-height: 1.65;
}

.inline-line code {
  color: var(--steel);
}

.viz {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.type-tree {
  right: 4%;
  top: 8%;
  width: min(62%, 560px);
  height: auto;
  opacity: 0.12;
}

.opening-tree {
  left: 9%;
  top: 18%;
  right: auto;
  width: min(56%, 560px);
  opacity: 0.08;
}

.type-tree path,
.composition path,
.monad-flow path,
.lambda-spiral path {
  fill: none;
  stroke: var(--thread);
  stroke-width: 4;
  stroke-linecap: round;
}

.type-tree ellipse,
.composition circle,
.monad-flow rect {
  fill: var(--thread);
  stroke: none;
}

.composition {
  right: 2%;
  top: 16%;
  width: min(70%, 620px);
  opacity: 0.1;
}

.composition path {
  stroke-width: 5;
}

.composition .pulse {
  transform-origin: center;
  animation: breathe 4s ease-in-out infinite;
}

.composition .p2 { animation-delay: 0.4s; }
.composition .p3 { animation-delay: 0.8s; }
.composition .p4 { animation-delay: 1.2s; }
.composition .p5 { animation-delay: 1.6s; }

.monad-flow {
  right: 5%;
  bottom: 9%;
  width: min(66%, 620px);
  opacity: 0.1;
}

.monad-flow text {
  fill: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 20px;
  text-anchor: middle;
}

.lambda-spiral {
  right: 3%;
  top: 10%;
  width: min(50%, 440px);
  opacity: 0.09;
  transform-origin: center;
  animation: slowRotate 120s linear infinite;
}

.lambda-spiral path {
  stroke-width: 2;
}

.lambda-watermark {
  position: absolute;
  z-index: 0;
  right: 6%;
  bottom: -6%;
  color: var(--surface);
  filter: brightness(0.97);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 20vw;
  font-weight: 700;
  line-height: 1;
}

.bubble {
  position: absolute;
  z-index: 2;
  display: block;
  border-radius: 50%;
  background: var(--thread);
  opacity: 0.08;
}

.b1 { width: 42px; height: 42px; top: 16%; right: 14%; opacity: 0.08; }
.b2 { width: 28px; height: 28px; top: 21%; right: 10%; opacity: 0.06; }
.b3 { width: 16px; height: 16px; top: 27%; right: 17%; opacity: 0.09; }
.b4 { width: 34px; height: 34px; bottom: 18%; left: 13%; opacity: 0.06; }
.b5 { width: 48px; height: 48px; top: 12%; right: 12%; }
.b6 { width: 30px; height: 30px; top: 18%; right: 7%; opacity: 0.06; }
.b7 { width: 18px; height: 18px; top: 24%; right: 15%; opacity: 0.1; }
.b8 { width: 38px; height: 38px; bottom: 14%; left: 11%; opacity: 0.05; }
.b9 { width: 44px; height: 44px; top: 13%; left: 14%; opacity: 0.07; }
.b10 { width: 26px; height: 26px; top: 19%; left: 9%; opacity: 0.09; }
.b11 { width: 14px; height: 14px; top: 25%; left: 17%; opacity: 0.1; }
.b12 { width: 36px; height: 36px; bottom: 15%; right: 12%; opacity: 0.05; }
.b13 { width: 46px; height: 46px; top: 16%; right: 13%; opacity: 0.07; }
.b14 { width: 28px; height: 28px; top: 22%; right: 9%; opacity: 0.08; }
.b15 { width: 18px; height: 18px; top: 29%; right: 17%; opacity: 0.08; }
.b16 { width: 40px; height: 40px; bottom: 13%; left: 12%; opacity: 0.05; }
.b17 { width: 42px; height: 42px; top: 15%; left: 12%; opacity: 0.07; }
.b18 { width: 29px; height: 29px; top: 21%; left: 8%; opacity: 0.09; }
.b19 { width: 17px; height: 17px; top: 27%; left: 15%; opacity: 0.1; }
.b20 { width: 36px; height: 36px; bottom: 16%; right: 11%; opacity: 0.05; }
.b21 { width: 48px; height: 48px; top: 10%; right: 11%; opacity: 0.08; }
.b22 { width: 36px; height: 36px; top: 16%; right: 7%; opacity: 0.07; }
.b23 { width: 24px; height: 24px; top: 23%; right: 14%; opacity: 0.09; }
.b24 { width: 14px; height: 14px; top: 30%; right: 8%; opacity: 0.1; }
.b25 { width: 10px; height: 10px; top: 35%; right: 16%; opacity: 0.09; }
.b26 { width: 44px; height: 44px; bottom: 12%; left: 10%; opacity: 0.06; }
.b27 { width: 32px; height: 32px; bottom: 19%; left: 7%; opacity: 0.08; }
.b28 { width: 22px; height: 22px; bottom: 25%; left: 14%; opacity: 0.1; }
.b29 { width: 15px; height: 15px; bottom: 31%; left: 9%; opacity: 0.08; }
.b30 { width: 9px; height: 9px; bottom: 35%; left: 17%; opacity: 0.1; }
.b31 { width: 40px; height: 40px; top: 18%; right: 18%; opacity: 0.06; }
.b32 { width: 24px; height: 24px; top: 25%; right: 13%; opacity: 0.08; }
.b33 { width: 32px; height: 32px; bottom: 19%; left: 16%; opacity: 0.06; }

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.breath {
  height: 40vh;
}

@keyframes slowRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@media (max-width: 900px) {
  .timeline::before,
  .timeline-node {
    left: 28px;
  }

  .site-mark {
    left: 24px;
  }

  .epoch,
  .epoch-right,
  .epoch-left,
  .epoch-close {
    justify-content: center;
    padding-left: 42px;
    padding-right: 18px;
  }

  .chamber,
  .chamber-large,
  .chamber-close {
    width: min(100%, 760px);
    min-height: 74vh;
    margin-left: 0;
    margin-right: 0;
  }

  .type-tree,
  .composition,
  .monad-flow,
  .lambda-spiral {
    width: 82%;
    opacity: 0.08;
  }
}

@media (max-width: 560px) {
  .timeline {
    padding-top: 6vh;
  }

  .epoch + .epoch {
    margin-top: 12vh;
  }

  .chamber {
    padding: 38px 28px;
    border-radius: 34% 66% 58% 42% / 44% 38% 62% 56%;
  }

  .hero-copy {
    margin-top: 20vh;
  }

  pre {
    padding: 20px;
    white-space: pre-wrap;
  }

  .lambda-watermark {
    font-size: 52vw;
  }
}
