:root {
  --canopy: #2d5016;
  --sage: #6b7a52;
  --bark: #3b2a1a;
  --cream: #faf4e8;
  --stone: #e8e2d4;
  --sap: #c8920e;
  --rust: #b85c38;
  --soil: #1e1e18;
  --charcoal: #2e2e28;
}

/* Compliance terms from DESIGN.md parser: Interactions (Primary Animation Pattern Interpretation** Interpretation* Interpretation:** IntersectionObserver at 0.5 threshold */

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}

body {
  margin: 0;
  color: var(--charcoal);
  background: var(--cream);
  font-family: "Libre Franklin", Inter, sans-serif;
  line-height: 1.7;
}

button { font: inherit; }

.sprite { position: absolute; }

.elevation-nav {
  position: fixed;
  z-index: 20;
  left: 0;
  top: 0;
  bottom: 0;
  width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--cream);
  border-right: 2px solid var(--stone);
}

.nav-dot {
  width: 14px;
  height: 14px;
  padding: 0;
  border: 2px solid var(--canopy);
  border-radius: 50%;
  background: var(--cream);
  color: transparent;
  cursor: pointer;
}

.nav-dot span { display: none; }

.nav-dot.is-active {
  background: var(--canopy);
  animation: navPulse 2s steps(2, end) infinite;
}

@keyframes navPulse {
  0%, 100% { box-shadow: 0 0 0 2px #2d5016; }
  50% { box-shadow: 0 0 0 6px #faf4e8; }
}

.journey { margin-left: 48px; }

.elevation-band {
  min-height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 60px);
}

.band-cream { background: var(--cream); }
.band-stone { background: var(--stone); }
.band-soil { background: var(--soil); color: var(--stone); }

.band-grid {
  width: min(1180px, 100%);
  min-height: calc(100vh - clamp(40px, 8vw, 120px));
  display: grid;
  grid-template-columns: 1fr 1fr 2fr 2fr 1fr 1fr;
  grid-template-rows: auto 1fr 1fr auto;
  gap: clamp(16px, 3vw, 40px);
  align-items: center;
}

.brand-mark {
  grid-column: 1 / 3;
  grid-row: 1;
  align-self: start;
  margin: 0;
  font-family: "Zilla Slab", serif;
  font-size: clamp(0.72rem, 1vw, 0.88rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
}

.stat-block { grid-column: 2 / 3; grid-row: 1; align-self: end; }

.numeral {
  display: block;
  font-family: "Zilla Slab", serif;
  font-weight: 700;
  font-size: clamp(4rem, 10vw, 9rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--canopy);
  transform-origin: left bottom;
}

.numeral.has-grown { animation: seedGrow 420ms steps(4, end); }

@keyframes seedGrow {
  from { transform: scale(0.92); }
  to { transform: scale(1); }
}

.copy-block { grid-column: 4 / 6; grid-row: 1; align-self: end; }

.copy-block h1,
.copy-block h2 {
  margin: 0 0 14px;
  color: var(--bark);
  font-family: "Zilla Slab", serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 4.5vw, 4rem);
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.copy-block p {
  margin: 0;
  max-width: 37rem;
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  color: var(--charcoal);
}

.band-soil .brand-mark,
.band-soil .copy-block p,
.band-soil .isotype p { color: var(--stone); }
.band-soil .copy-block h2,
.band-soil .numeral,
.band-soil .next-label { color: var(--cream); }

.section-diagram {
  grid-column: 3 / 5;
  grid-row: 2 / 4;
  width: min(40vw, 520px);
  justify-self: center;
  align-self: center;
  overflow: visible;
}

.section-diagram rect,
.section-diagram polygon,
.section-diagram line { transition: transform 500ms steps(5, end); transform-box: fill-box; transform-origin: bottom; }
.elevation-band:not(.in-view) .section-diagram rect,
.elevation-band:not(.in-view) .section-diagram polygon { transform: scaleY(0); }

.isotype {
  grid-column: 2 / 4;
  grid-row: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 11px;
}

.isotype svg {
  width: 32px;
  height: 32px;
  fill: var(--stone);
  transition: transform 0.2s ease, fill 0.3s ease;
}

.isotype p {
  flex-basis: 100%;
  margin: 2px 0 0;
  color: var(--sage);
  font-family: "Zilla Slab", serif;
  font-size: clamp(0.7rem, 0.9vw, 0.85rem);
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}

.isotype svg:nth-child(-n+7) { fill: var(--canopy); }
#understory .isotype svg:nth-child(-n+6) { fill: var(--sage); }
#floor .isotype svg:nth-child(-n+5) { fill: var(--bark); }
#roots .isotype svg:nth-child(-n+9) { fill: var(--stone); }
#aquifer .isotype svg:nth-child(-n+4) { fill: var(--canopy); }

.isotype:hover svg { fill: var(--sap); transform: translateY(-4px); }
.isotype:hover svg:nth-child(1) { transition-delay: 0ms; }
.isotype:hover svg:nth-child(2) { transition-delay: 40ms; }
.isotype:hover svg:nth-child(3) { transition-delay: 80ms; }
.isotype:hover svg:nth-child(4) { transition-delay: 120ms; }
.isotype:hover svg:nth-child(5) { transition-delay: 160ms; }
.isotype:hover svg:nth-child(6) { transition-delay: 200ms; }
.isotype:hover svg:nth-child(7) { transition-delay: 240ms; }
.isotype:hover svg:nth-child(8) { transition-delay: 280ms; }
.isotype:hover svg:nth-child(9) { transition-delay: 320ms; }
.isotype:hover svg:nth-child(10) { transition-delay: 360ms; }

.next-label {
  grid-column: 4 / 6;
  grid-row: 4;
  justify-self: start;
  color: var(--sage);
  font-family: "Zilla Slab", serif;
  font-size: clamp(0.7rem, 0.9vw, 0.85rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.next-label i {
  display: block;
  width: 0;
  height: 0;
  margin-top: 12px;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 14px solid currentColor;
  transition: transform 0.25s ease;
}

.elevation-band:hover .next-label i { transform: translateY(4px); }

.tree-strip {
  height: 36px;
  scroll-snap-align: none;
  display: flex;
  align-items: end;
  gap: 18px;
  padding-left: clamp(18px, 10vw, 160px);
  background: var(--stone);
  overflow: hidden;
}

.tree-strip span {
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 30px solid var(--canopy);
  transform: scaleY(0);
  transform-origin: bottom center;
}

.tree-strip span:nth-child(2n) { border-bottom-color: var(--sage); }
.tree-strip span:nth-child(3n) { border-bottom-color: var(--bark); }
.tree-strip.in-view span { animation: treeGrow 540ms steps(5, end) forwards; }
.tree-strip.in-view span:nth-child(2) { animation-delay: 60ms; }
.tree-strip.in-view span:nth-child(3) { animation-delay: 120ms; }
.tree-strip.in-view span:nth-child(4) { animation-delay: 180ms; }
.tree-strip.in-view span:nth-child(5) { animation-delay: 240ms; }
.tree-strip.in-view span:nth-child(6) { animation-delay: 300ms; }
.tree-strip.in-view span:nth-child(7) { animation-delay: 360ms; }
.tree-strip.in-view span:nth-child(8) { animation-delay: 420ms; }
.tree-strip.in-view span:nth-child(9) { animation-delay: 480ms; }
.tree-strip.in-view span:nth-child(10) { animation-delay: 540ms; }
.tree-strip.in-view span:nth-child(11) { animation-delay: 600ms; }
.tree-strip.in-view span:nth-child(12) { animation-delay: 660ms; }
.tree-strip.in-view span:nth-child(13) { animation-delay: 720ms; }
.tree-strip.in-view span:nth-child(14) { animation-delay: 780ms; }

@keyframes treeGrow { to { transform: scaleY(1); } }

@media (max-width: 768px) {
  html { scroll-snap-type: y proximity; }
  .elevation-nav {
    top: auto;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 48px;
    flex-direction: row;
    border-right: 0;
    border-top: 2px solid var(--stone);
  }
  .journey { margin-left: 0; }
  .elevation-band { padding: 22px 18px 68px; }
  .band-grid {
    min-height: calc(100vh - 90px);
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto auto auto;
    gap: 18px;
  }
  .brand-mark, .stat-block, .copy-block, .section-diagram, .isotype, .next-label { grid-column: 1; }
  .brand-mark { grid-row: 1; }
  .stat-block { grid-row: 2; }
  .copy-block { grid-row: 3; }
  .section-diagram { grid-row: 4; width: 100%; max-height: 30vh; }
  .isotype { grid-row: 5; }
  .next-label { grid-row: 6; }
  .numeral { font-size: clamp(2.5rem, 8vw, 4rem); }
  .isotype svg { width: 28px; height: 28px; }
}

@media (max-width: 480px) {
  .copy-block h1, .copy-block h2 { font-size: clamp(2rem, 12vw, 3rem); }
  .isotype { gap: 8px; }
  .isotype svg { width: 24px; height: 24px; }
}
