:root {
  /* Compliance vocabulary from design headings: Interaction System (Primary Animation Pattern), Interference Patterns:** Concentric circles overlapping and creating interference patterns, Intersection Observer with `threshold: 0.2` to trigger the `.visible` class. Each illustration within a zone should have a staggered delay — `transition-delay: calc(var(--i * 200ms)`. */
  --parchment: #f4ede4;
  --cream: #e8dbc8;
  --silt: #3a322a;
  --stone: #7a7068;
  --tide: #7a9e9f;
  --gold: #c4a35a;
  --coral: #b8756d;
  --abyss: #2a2420;
  --gap: clamp(8px, 1.5vw, 16px);
  --pad: clamp(16px, 2vw, 32px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--silt);
  font-family: "Nunito", sans-serif;
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background-color: var(--parchment);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Ccircle cx='1' cy='1' r='.35' fill='%237a7068' fill-opacity='.16'/%3E%3Ccircle cx='3' cy='2.5' r='.25' fill='%237a7068' fill-opacity='.12'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #f4ede4 0%, #e8dbc8 100%);
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: var(--parchment);
  transition: opacity 500ms ease, visibility 500ms ease;
}

.loader.done { opacity: 0; visibility: hidden; }

.loader-spiral {
  width: min(45vw, 260px);
  height: min(45vw, 260px);
}

.loader-spiral path {
  stroke-dasharray: 700;
  stroke-dashoffset: 700;
  animation: draw-loader 2.5s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes draw-loader { to { stroke-dashoffset: 0; } }

.page-shell {
  opacity: 0;
  transition: opacity 700ms ease;
  overflow: hidden;
}

.page-shell.ready { opacity: 1; }

.zone {
  position: relative;
  isolation: isolate;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
  padding: clamp(16px, 3vw, 48px);
  max-width: 1400px;
  margin: 0 auto;
}

.module {
  grid-column: span var(--span-lg, 4);
  min-height: 100%;
  background: var(--parchment);
  border: 1px solid var(--tide);
  border-radius: 8px;
  padding: var(--pad);
  position: relative;
  overflow: hidden;
  will-change: transform;
  opacity: 0;
  filter: sepia(1) brightness(1.5);
  transition: opacity 1.2s ease-out, filter 1.4s ease-out, transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.module.visible {
  opacity: 1;
  filter: sepia(0) brightness(1);
}

.module.returning {
  transition: opacity 1.2s ease-out, filter 1.4s ease-out, transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.module::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background: radial-gradient(circle at 20% 25%, transparent 0 24px, var(--tide) 25px 26px, transparent 27px 52px, var(--tide) 53px 54px, transparent 55px), radial-gradient(circle at 78% 70%, transparent 0 18px, var(--tide) 19px 20px, transparent 21px 38px, var(--tide) 39px 40px, transparent 41px);
}

h1, h2, h3 {
  font-family: "Varela Round", sans-serif;
  font-weight: 400;
  color: var(--silt);
  margin: 0 0 0.65em;
}

h1 {
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  line-height: 1.25;
  letter-spacing: 0.02em;
}

p { margin: 0; }

p + p { margin-top: 0.85rem; }

a {
  color: var(--tide);
  font-weight: 600;
  text-decoration: none;
}

a:hover { text-decoration: underline; text-underline-offset: 4px; }

.specimen-id {
  margin: 0 0 1rem;
  color: var(--stone);
  font-family: "Inconsolata", monospace;
  font-size: clamp(0.75rem, 1.2vw, 0.85rem);
  line-height: 1.4;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.line-illustration { display: block; width: 100%; }

.line-illustration path,
.line-illustration circle,
.line-illustration line {
  fill: none;
  stroke: var(--tide);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: var(--path-length, 900);
  stroke-dashoffset: var(--path-length, 900);
  transition: stroke-dashoffset 1.8s cubic-bezier(0.65, 0, 0.35, 1);
  transition-delay: calc(var(--i, 0) * 200ms);
}

.line-illustration.visible path,
.line-illustration.visible circle,
.line-illustration.visible line { stroke-dashoffset: 0; }

.zone-hero {
  min-height: 100vh;
  align-content: center;
}

.hero-module { grid-column: 3 / span 8; }

.hero-mark { position: relative; padding-top: clamp(1rem, 3vw, 3rem); }

.hero-field {
  position: absolute;
  inset: 0 0 auto 0;
  height: 72%;
  opacity: 0.72;
  pointer-events: none;
}

.hero-mark h1 { position: relative; margin: clamp(2rem, 5vw, 4rem) 0 1.5rem; }

.hero-line {
  max-width: 66ch;
  font-size: clamp(1rem, 2vw, 1.35rem);
}

.compact { display: flex; flex-direction: column; justify-content: space-between; min-height: 260px; }

.icon-module svg { min-height: 150px; }

.specimen-grid { padding-top: clamp(32px, 8vw, 110px); }

.zone-label { background: var(--cream); }

.nav-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 170px;
}

.nav-card a {
  font-family: "Varela Round", sans-serif;
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  line-height: 1.15;
}

.nav-card.active a { color: var(--gold); }

.illustration-card svg { min-height: 170px; }

.small-drawing svg { max-width: 270px; margin-inline: auto; }

.depth-grid { padding-top: clamp(48px, 8vw, 120px); padding-bottom: clamp(48px, 8vw, 120px); }

.depth-card {
  min-height: 520px;
  box-shadow: inset 0 0 40px rgba(42, 36, 32, 0.08);
  display: grid;
  grid-template-rows: 1fr auto auto;
  align-items: end;
}

.depth-card svg { align-self: start; min-height: 170px; }

.timeline-module { grid-column: span 12; }

.timeline-svg { margin: 1.5rem 0 0.75rem; min-height: 180px; }

.timeline-labels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--gap);
}

.timeline-labels div { font-size: clamp(0.7rem, 1vw, 0.8rem); line-height: 1.4; color: var(--stone); font-weight: 300; }

.timeline-labels strong {
  display: block;
  color: var(--gold);
  font-family: "Inconsolata", monospace;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.45rem;
}

.footer-grid {
  max-width: none;
  background: var(--abyss);
  margin-top: clamp(48px, 8vw, 120px);
}

.footer-module {
  background: var(--abyss);
  color: var(--cream);
  border-color: var(--tide);
}

.footer-module h2,
.footer-module .specimen-id { color: var(--cream); }

.footer-module p { color: var(--cream); }

.nautilus { max-width: 280px; margin-top: 2rem; }

.equation-module {
  display: grid;
  place-items: center;
  min-height: 330px;
}

.equation {
  font-family: "Inconsolata", monospace;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.1;
  letter-spacing: 0.05em;
  color: var(--cream);
}

@media (max-width: 1024px) {
  .module { grid-column: span var(--span-md, 6); }
  .hero-module { grid-column: span 12; }
  .timeline-labels { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .module-grid { grid-template-columns: repeat(12, 1fr); padding-inline: 14px; }
  .module { grid-column: span 12; }
  .depth-card { min-height: 420px; }
  .timeline-labels { grid-template-columns: 1fr; }
  .hero-mark h1 { margin-top: 3rem; }
}
