:root {
  --parchment: #F5EDE0;
  --ink: #5C4A32;
  --moss: #A38B4F;
  --amber: #D4943A;
  --root: #8B6D47;
  --soil: #2E2418;
  --teal: #5B8A7A;
  --firefly: #E8C84A;
  --gap: clamp(1.5rem, 3vw, 3rem);
  --pad: clamp(2rem, 5vw, 6rem);
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--parchment);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Lora", serif;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.75;
  background:
    radial-gradient(circle at 18% 8%, rgba(232, 200, 74, 0.16), transparent 26rem),
    radial-gradient(circle at 84% 28%, rgba(91, 138, 122, 0.11), transparent 24rem),
    linear-gradient(180deg, #F5EDE0 0%, #efe1cb 54%, #F5EDE0 100%);
  overflow-x: hidden;
}

.compliance-lexicon { display: none; }
/* Interaction: Internet": */
.compliance-lexicon::before { content: "Interaction: Internet\": -15%"; margin-top: -15%; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.18;
  background-image:
    repeating-radial-gradient(circle at 12% 18%, rgba(46,36,24,0.18) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(104deg, rgba(139,109,71,0.08) 0 1px, transparent 1px 11px);
  mix-blend-mode: multiply;
}

.dandelions {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.seed {
  position: absolute;
  left: var(--x);
  bottom: -8vh;
  width: 22px;
  height: 22px;
  opacity: 0.42;
  color: var(--firefly);
  animation: float-up var(--dur) linear infinite;
  animation-delay: var(--delay);
}

.seed::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.seed::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 0;
  width: 1px;
  height: 20px;
  background: currentColor;
  box-shadow: 5px 4px 0 -0.3px currentColor, -5px 4px 0 -0.3px currentColor, 8px 10px 0 -0.3px currentColor, -8px 10px 0 -0.3px currentColor;
  transform: rotate(var(--rot));
}

main { position: relative; }

.chapter {
  min-height: 100vh;
  padding: var(--pad);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  align-items: center;
}

.pinboard {
  position: relative;
  border: 1px solid rgba(139, 109, 71, 0.15);
  border-radius: 3px;
  background: rgba(245, 237, 224, 0.72);
  transition: box-shadow 400ms ease, border-color 400ms ease, transform 800ms var(--ease), filter 800ms var(--ease), opacity 800ms var(--ease);
}

.pinboard::before,
.pinboard::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(139, 109, 71, 0.45);
  border-radius: 50%;
  background: var(--parchment);
}

.pinboard::before { top: 1rem; left: 1rem; }
.pinboard::after { right: 1rem; bottom: 1rem; }
.pinboard:hover { box-shadow: 0 0 30px rgba(212, 148, 58, 0.15); border-color: rgba(212, 148, 58, 0.35); }

.reveal { opacity: 0; transform: scale(0.92); filter: blur(2px); }
.reveal.in-view { opacity: 1; transform: scale(1); filter: blur(0); }

.hero-block {
  grid-column: 2 / span 10;
  min-height: 72vh;
  padding: clamp(2rem, 5vw, 5rem);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  overflow: hidden;
}

.eyebrow,
.label,
svg text {
  font-family: "Inconsolata", monospace;
  font-size: clamp(0.75rem, 1.2vw, 0.9rem);
  letter-spacing: 0.08em;
  color: var(--teal);
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: "Righteous", cursive;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--moss);
  line-height: 1.02;
  margin: 0;
}

h1 {
  font-size: clamp(3rem, 8vw, 7rem);
  color: var(--soil);
  text-shadow: 0.04em 0.04em 0 rgba(232, 200, 74, 0.42);
}

h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { font-size: clamp(1.4rem, 2.6vw, 2rem); color: var(--soil); margin-top: 1rem; }
p { margin: 0; }
.koan { margin-top: 1.618rem; font-size: clamp(1.35rem, 3vw, 2.1rem); color: var(--root); }

.circuit-tree { width: 100%; max-height: 64vh; }
svg { overflow: visible; }
.draw-line, .branch, .root-line, .rack-line, .vine, .my-path, .ocean-thread, .soil, .leader { fill: none; stroke: var(--root); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.rack, .server-led path:first-child { fill: rgba(163, 139, 79, 0.12); stroke: var(--root); stroke-width: 1.5; }
.leaf-cluster circle, .packet, .traveler, .glow-dots circle { fill: var(--firefly); filter: drop-shadow(0 0 8px rgba(232, 200, 74, 0.75)); }
.node, .nodes circle { fill: rgba(212, 148, 58, 0.18); stroke: var(--amber); stroke-width: 1.5; animation: pulse 3s ease-in-out infinite; }
.draw-line { stroke-dasharray: 520; stroke-dashoffset: 520; }
.in-view .draw-line { animation: draw 1.6s var(--ease) forwards; }
.in-view .trunk { animation-duration: 0.5s; }
.in-view .delay-1 { animation-delay: 0.45s; }
.in-view .delay-2 { animation-delay: 0.8s; }
.in-view .delay-3 { animation-delay: 1.15s; }
.in-view .delay-4 { animation-delay: 1.5s; }
.leaf-cluster { opacity: 0; }
.in-view .leaf-cluster { animation: appear 0.8s ease 2s forwards; }

.mushroom-divider {
  height: 5rem;
  margin: -2rem var(--pad);
  position: relative;
}

.mushroom-divider::before {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  top: 50%;
  height: 1px;
  background: var(--root);
  transform: rotate(-0.4deg);
}

.mushroom-divider span,
.mushroom-divider span::before,
.mushroom-divider span::after {
  position: absolute;
  top: 45%;
  width: 20px;
  height: 12px;
  border: 1px solid var(--root);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  background: rgba(163, 139, 79, 0.28);
}

.mushroom-divider span { left: 28%; }
.mushroom-divider span::before { content: ""; left: 23vw; top: -7px; transform: scale(0.7); }
.mushroom-divider span::after { content: ""; left: 48vw; top: 5px; transform: scale(1.15); }
.mushroom-divider.flip::before { transform: rotate(0.5deg); }

.chapter-header { grid-column: 1 / span 12; margin-bottom: -1rem; }
.grid.three { grid-column: 1 / span 12; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); align-items: stretch; }
.specimen { padding: clamp(1.4rem, 3vw, 2.618rem); min-height: 34rem; }
.botanical { width: 100%; height: auto; margin: 1rem 0; }
.botanical text, .world-canopy text { fill: var(--teal); font-family: "Inconsolata", monospace; font-size: 15px; letter-spacing: 0.08em; }
.rings path { fill: none; stroke: var(--root); stroke-width: 1.5; }
.soil { stroke-width: 2; }

.mycelium { align-items: center; }
.network-block { grid-column: 5 / span 8; grid-row: 1; padding: clamp(1rem, 3vw, 2.618rem); }
.prose-block { grid-column: 1 / span 4; grid-row: 1; padding: clamp(2rem, 4vw, 4.236rem); }
.mycelium-svg { width: 100%; min-height: 320px; }
.my-path { stroke-dasharray: 9 13; animation: flow 18s linear infinite; }
.traveler { fill: var(--amber); filter: drop-shadow(0 0 10px rgba(212,148,58,0.85)); }
.traveler.yellow { fill: var(--firefly); }

.canopy-block { grid-column: 1 / span 12; padding: clamp(2rem, 4vw, 4.236rem); overflow: hidden; }
.canopy-copy { max-width: 58rem; margin-bottom: 2.618rem; }
.world-canopy { width: 100%; min-height: 360px; }
.leafmass ellipse { fill: rgba(163, 139, 79, 0.18); stroke: var(--root); stroke-width: 1.5; }
.ocean-thread { stroke: var(--teal); stroke-dasharray: 12 12; animation: flow 21s linear infinite; opacity: 0.8; }
.ocean-thread.slow { animation-duration: 28s; opacity: 0.55; }

.stillness { min-height: 92vh; }
.closing-block { grid-column: 4 / span 6; text-align: center; padding: clamp(2rem, 5vw, 5rem); }
.moth-stage { position: relative; width: min(26rem, 90%); height: 17rem; margin: 1.618rem auto; }
.server-led { position: absolute; inset: 20% 24%; width: 52%; }
.server-led path { fill: none; stroke: var(--root); stroke-width: 1.5; stroke-linecap: round; }
.led { fill: var(--teal); filter: drop-shadow(0 0 12px var(--teal)); animation: led 2.5s ease-in-out infinite; }
.moth { position: absolute; left: calc(50% - 35px); top: calc(50% - 29px); width: 70px; height: 58px; animation: orbit 8s ease-in-out infinite; transform-origin: 50% 50%; }
.moth path { fill: rgba(245, 237, 224, 0.75); stroke: var(--root); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.moth circle { fill: var(--firefly); opacity: 0.8; }
.final-thought { max-width: 39rem; margin: 0 auto; }

.compass {
  position: fixed;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  width: 9rem;
  height: 9rem;
  z-index: 40;
  color: var(--soil);
}

.compass svg { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 4px 16px rgba(46,36,24,0.12)); }
.compass-ring, .compass-star { fill: rgba(245,237,224,0.78); stroke: var(--soil); stroke-width: 1.4; stroke-linejoin: round; }
.compass-star { fill: rgba(163,139,79,0.18); }
.needle { fill: var(--amber); stroke: var(--soil); stroke-width: 1; transform-origin: 80px 80px; transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.compass-center { fill: var(--soil); }
.point {
  position: absolute;
  border: 0;
  padding: 0.1rem 0.25rem;
  background: rgba(245,237,224,0.62);
  color: var(--soil);
  font-family: "Inconsolata", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.point:hover { color: var(--amber); }
.north { top: -0.25rem; left: 50%; transform: translateX(-50%); }
.east { right: -0.65rem; top: 50%; transform: translateY(-50%); }
.south { bottom: -0.25rem; left: 50%; transform: translateX(-50%); }
.west { left: -0.95rem; top: 50%; transform: translateY(-50%); }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }
@keyframes flow { to { stroke-dashoffset: -260; } }
@keyframes pulse { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(212,148,58,0)); } 50% { transform: scale(1.25); filter: drop-shadow(0 0 11px rgba(212,148,58,0.72)); } }
@keyframes float-up { from { transform: translate3d(0, 0, 0) rotate(0deg); } to { transform: translate3d(var(--drift), -118vh, 0) rotate(180deg); } }
@keyframes led { 0%,100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes orbit { 0% { transform: rotate(0deg) translateX(88px) rotate(0deg); } 50% { transform: rotate(190deg) translateX(70px) rotate(-190deg); } 100% { transform: rotate(360deg) translateX(88px) rotate(-360deg); } }

@media (max-width: 900px) {
  .chapter { grid-template-columns: 1fr; min-height: auto; padding-top: 7rem; }
  .hero-block, .chapter-header, .grid.three, .network-block, .prose-block, .canopy-block, .closing-block { grid-column: 1; grid-row: auto; }
  .hero-block { grid-template-columns: 1fr; }
  .grid.three { grid-template-columns: 1fr; }
  .compass { width: 7.5rem; height: 7.5rem; }
  .closing-block { text-align: left; }
}
