:root {
  --morning-fog: #e8e6e1;
  --potting-soil: #3b3a36;
  --ink-charcoal: #2c2b28;
  --dried-sage: #7a7d72;
  --pressed-lavender: #8b7ea8;
  --wild-thyme: #6b8f71;
  --dried-rose: #b08d8d;
  --linen-white: #f4f2ed;
  --trellis-gray: #c4c1ba;
  --font-display: "Cormorant Garamond", Cormorant, Georgia, serif;
  --font-body: Lora, Georgia, serif;
  --font-code: "Fira Code", "Courier New", monospace;
  --font-label: "Josefin Sans", Inter, Helvetica, sans-serif;
  --ease-grow: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Compliance lexicon from DESIGN.md: Fira Code' Fira Code" (400 (Google Fonts Georgia' Helvetica Neue' Interactive Section IntersectionObserver element 15% in view. The staggered delays create the feeling of a pen moving across paper. Lora' Lora" */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink-charcoal);
  background-color: var(--morning-fog);
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.015) 2px, rgba(0,0,0,0.015) 3px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,0.015) 2px, rgba(0,0,0,0.015) 3px);
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  line-height: 1.7;
  letter-spacing: 0.005em;
}

a { color: inherit; }
code { font-family: var(--font-code); }

.garden-gate {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 3rem;
  background: rgba(232, 230, 225, 0.94);
  border-bottom: 1px solid var(--trellis-gray);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.gate-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.2rem);
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.35rem 0;
  font-family: var(--font-label);
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  color: var(--dried-sage);
  transition: color 260ms var(--ease-grow);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--pressed-lavender);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 380ms var(--ease-grow);
}

.nav-link:hover { color: var(--ink-charcoal); }
.nav-link:hover::after { transform: scaleX(1); }

.nav-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gate-vine {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  width: 100%;
  height: 18px;
  pointer-events: none;
}

.gate-vine path, .vine-divider path, .botanical .draw-path, .draw-circle {
  fill: none;
  stroke: var(--wild-thyme);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gate-vine .vine-leaves path { fill: var(--wild-thyme); stroke: none; opacity: 0.72; transform-origin: center; animation: leafSway 3.8s ease-in-out infinite; }
.gate-vine .vine-leaves path:nth-child(2n) { animation-delay: -1.4s; }

@keyframes leafSway { 0%,100% { transform: rotate(-1deg); } 50% { transform: rotate(4deg); } }

.meadow {
  min-height: 90vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 4rem;
  align-items: center;
  padding: clamp(4rem, 8vw, 7rem) 3rem 4rem;
}

.hero-copy { align-self: start; padding-top: 5vh; max-width: 760px; }

.kicker {
  margin: 0 0 0.8rem;
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 300;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--pressed-lavender);
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2.4rem, 5vw, 4.8rem); max-width: 780px; }
h2 { font-size: clamp(1.4rem, 2.5vw, 2rem); }

.hero-text {
  max-width: 680px;
  margin: 1.5rem 0 0;
  color: var(--dried-sage);
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
}

.lambda-garden { margin: 0; text-align: center; }
.lambda-garden figcaption { margin-top: 1rem; font-family: var(--font-label); color: var(--dried-sage); font-size: 0.9rem; letter-spacing: 0.08em; text-transform: uppercase; }
.hero-botanical { width: min(100%, 520px); filter: drop-shadow(0 18px 40px rgba(59,58,54,0.08)); }

.botanical .stem { stroke: var(--wild-thyme); stroke-width: 3.3; }
.botanical .leaf { stroke: var(--wild-thyme); stroke-width: 1.7; fill: rgba(107, 143, 113, 0.13); }
.botanical .root { stroke: var(--dried-sage); stroke-width: 1.4; }
.soil { fill: rgba(122, 125, 114, 0.24); }
.draw-circle { stroke-width: 1.8; }
.petals circle { fill: rgba(176, 141, 141, 0.55); stroke: var(--dried-rose); stroke-width: 1; }
.trellis { stroke: var(--trellis-gray); stroke-width: 2; }
.rose { fill: rgba(176, 141, 141, 0.7); stroke: var(--dried-rose); stroke-width: 1; }

.vine-divider {
  display: block;
  width: 100%;
  height: 80px;
  margin: 0;
}

.concept-section {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 30%) minmax(0, 70%);
  gap: clamp(2rem, 5vw, 5rem);
  min-height: 80vh;
  padding: clamp(4rem, 8vw, 6rem) 3rem;
}

.concept-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 3rem;
  height: 1px;
  width: calc(100% - 6rem);
  background: var(--trellis-gray);
  transform: scaleX(0);
  transform-origin: left;
}

.concept-section.in-view::before { animation: borderGrow 800ms var(--ease-grow) forwards; }
@keyframes borderGrow { to { transform: scaleX(1); } }

.field-margin {
  position: sticky;
  top: 100px;
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  color: var(--dried-sage);
  text-align: center;
  font-style: italic;
}

.field-margin .botanical { width: min(100%, 250px); }
.field-margin p { margin: 0; max-width: 300px; }

.section-body { max-width: 880px; }
.section-body p { margin: 1.2rem 0; }
.section-body > code, .section-body p code, .seed-packet code {
  background: var(--linen-white);
  border: 1px solid rgba(196,193,186,0.7);
  border-radius: 5px;
  padding: 0.1rem 0.35rem;
  color: var(--pressed-lavender);
  font-size: 0.9em;
}

.code-block {
  position: relative;
  margin: 1.6rem 0;
  padding: 1.3rem 1.5rem;
  overflow-x: auto;
  color: var(--ink-charcoal);
  background-color: var(--linen-white);
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(44,43,40,0.018) 3px, rgba(44,43,40,0.018) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(44,43,40,0.018) 3px, rgba(44,43,40,0.018) 4px);
  border: 1px solid var(--trellis-gray);
  border-radius: 14px;
  font-family: var(--font-code);
  font-size: 0.94rem;
  line-height: 1.65;
}

.code-block code { background: transparent; border: 0; padding: 0; color: inherit; }

.seed-packet, .plant {
  position: relative;
  overflow: hidden;
  background: var(--linen-white);
  border: 1px solid rgba(196,193,186,0.62);
  border-radius: 14px;
  box-shadow: 0 16px 35px rgba(59,58,54,0.045);
}

.seed-packet {
  width: min(100%, 260px);
  padding: 1rem;
  text-align: left;
  font-style: normal;
}

.seed-packet b { display: block; font-family: var(--font-display); font-size: 1.2rem; color: var(--ink-charcoal); }
.seed-packet small { display: block; margin-top: 0.3rem; color: var(--dried-sage); }

.edge { position: absolute; background: var(--wild-thyme); transition: transform 380ms var(--ease-grow); }
.edge.top, .edge.bottom { height: 2px; left: 0; width: 100%; transform: scaleX(0); }
.edge.left, .edge.right { width: 2px; top: 0; height: 100%; transform: scaleY(0); }
.edge.top { top: 0; transform-origin: left; }
.edge.right { right: 0; transform-origin: top; transition-delay: 150ms; }
.edge.bottom { bottom: 0; transform-origin: right; transition-delay: 300ms; }
.edge.left { left: 0; transform-origin: bottom; transition-delay: 450ms; }
.seed-packet:hover .edge.top, .seed-packet:hover .edge.bottom, .plant:hover .edge.top, .plant:hover .edge.bottom { transform: scaleX(1); }
.seed-packet:hover .edge.left, .seed-packet:hover .edge.right, .plant:hover .edge.left, .plant:hover .edge.right { transform: scaleY(1); }

.greenhouse {
  min-height: 100vh;
  padding: clamp(4rem, 8vw, 7rem) 3rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 2rem;
  background:
    radial-gradient(circle at 28% 18%, rgba(244,242,237,0.92), transparent 18rem),
    radial-gradient(circle at 78% 44%, rgba(139,126,168,0.14), transparent 20rem),
    radial-gradient(circle at 50% 80%, rgba(107,143,113,0.12), transparent 22rem),
    var(--morning-fog);
  border-top: 1px solid var(--trellis-gray);
  border-bottom: 1px solid var(--trellis-gray);
}

.greenhouse-copy { max-width: 760px; margin-left: 30%; }
.greenhouse-copy p:last-child { color: var(--dried-sage); }

.type-garden {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 1.2rem;
  margin-top: 1rem;
}

.plant {
  width: min(100%, 245px);
  min-height: 260px;
  padding: 1.2rem;
  color: var(--ink-charcoal);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: background 300ms var(--ease-grow), transform 300ms var(--ease-grow), box-shadow 300ms var(--ease-grow);
}

.plant:hover { background: #f4f2ed; transform: translateY(-4px); box-shadow: 0 24px 50px rgba(59,58,54,0.09); }
.plant svg { height: 100px; width: 100px; }
.plant b { display: block; margin-top: 0.4rem; font-family: var(--font-display); font-size: 1.35rem; }
.plant code { display: block; margin-top: 0.5rem; color: var(--pressed-lavender); font-size: 0.78rem; opacity: 0; transform: translateY(8px); transition: opacity 300ms var(--ease-grow), transform 300ms var(--ease-grow); }
.plant:hover code, .plant.active code { opacity: 1; transform: translateY(0); }
.plant small { display: block; margin-top: 0.6rem; color: var(--dried-sage); font-family: var(--font-label); letter-spacing: 0.08em; text-transform: uppercase; }
.garden-note { max-width: 720px; min-height: 2.5rem; margin: 0 auto; text-align: center; color: var(--dried-sage); font-style: italic; }

.garden-plan { background: rgba(244,242,237,0.34); }
.plan-svg { width: 100%; margin: 1rem 0 1.3rem; }
.plan-svg .path-line { stroke: var(--trellis-gray); stroke-width: 2; stroke-dasharray: 6 9; }
.bed rect { fill: rgba(244,242,237,0.8); stroke: var(--wild-thyme); stroke-width: 1.5; }
.bed.canopy rect { stroke: var(--pressed-lavender); }
.bed text { fill: var(--ink-charcoal); font-family: var(--font-label); font-size: 18px; letter-spacing: 0.08em; text-anchor: middle; dominant-baseline: central; }

.root-cellar {
  position: relative;
  min-height: 40vh;
  display: grid;
  place-items: center;
  padding: 5rem 3rem;
  overflow: hidden;
  color: var(--morning-fog);
  background: var(--potting-soil);
  text-align: center;
}

.root-system { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.18; }
.root-system path { stroke: var(--c4c1ba, #c4c1ba); stroke-width: 2; }
.cellar-content { position: relative; z-index: 1; max-width: 720px; }
.cellar-content p { color: rgba(232,230,225,0.84); }

.seed-envelope {
  width: min(340px, 100%);
  margin: 2rem auto;
  padding: 1.4rem;
  color: var(--ink-charcoal);
  background: var(--linen-white);
  border: 1px solid var(--trellis-gray);
  border-radius: 10px;
  box-shadow: inset 0 0 0 8px rgba(196,193,186,0.22);
}

.seed-envelope span, .seed-envelope small { display: block; font-family: var(--font-label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dried-sage); }
.seed-envelope strong { display: block; margin: 0.4rem 0; font-family: var(--font-display); font-size: 1.65rem; }

.footer-links { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a { position: relative; color: var(--morning-fog); font-family: var(--font-label); text-decoration: none; letter-spacing: 0.08em; }
.footer-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -0.25rem; height: 1px; background: var(--dried-rose); transform: scaleX(0); transform-origin: center; transition: transform 300ms var(--ease-grow); }
.footer-links a:hover::after { transform: scaleX(1); }

.reveal-line { opacity: 0; transform: translateY(12px); transition: opacity 700ms var(--ease-grow), transform 700ms var(--ease-grow); }
.in-view .reveal-line, .reveal-line.in-view { opacity: 1; transform: translateY(0); }

.draw-path, .draw-circle { stroke-dasharray: var(--path-length, 1); stroke-dashoffset: var(--path-length, 1); transition: stroke-dashoffset var(--draw-duration, 1800ms) ease-in-out var(--draw-delay, 0ms); }
.drawn .draw-path, .drawn .draw-circle { stroke-dashoffset: 0; }

@media (max-width: 900px) {
  .garden-gate { padding: 0 1.1rem; }
  .gate-nav { gap: 0.7rem; }
  .nav-link { font-size: 0.72rem; }
  .nav-link svg { display: none; }
  .meadow, .concept-section { grid-template-columns: 1fr; padding-left: 1.35rem; padding-right: 1.35rem; }
  .field-margin { position: static; }
  .greenhouse { padding-left: 1.35rem; padding-right: 1.35rem; }
  .greenhouse-copy { margin-left: 0; }
  .concept-section::before { left: 1.35rem; width: calc(100% - 2.7rem); }
}

@media (max-width: 560px) {
  .brand { font-size: 1.35rem; }
  .garden-gate { gap: 0.5rem; }
  .gate-nav { margin-left: 0; }
  .nav-link { letter-spacing: 0.03em; }
  .type-garden { align-items: center; flex-direction: column; }
  .plant { width: 100%; }
}
