/* ============================================================
   Adaptation Forest — style.css
   Palette: humus · moss · lichen · amber · birch · cardinal
   Typography: Cormorant Garamond (headings) · Source Serif 4 (body)
   ============================================================ */

/* This stylesheet tends to the visual needs of a website
   about tending. The recursion is not lost on us. */

/* ============================================================
   Custom Properties
   ============================================================ */
:root {
  /* Palette */
  --clr-humus:    #0a0a08;
  --clr-moss:     #2d4a2d;
  --clr-moss-mid: #3d6040;
  --clr-lichen:   #8a917a;
  --clr-amber:    #c4883a;
  --clr-amber-lt: #d9a55e;
  --clr-birch:    #e8e4dc;
  --clr-cardinal: #8b2500;

  /* Surfaces */
  --clr-surface:  #0d0d0a;
  --clr-surface-2:#111110;
  --clr-border:   rgba(138, 145, 122, 0.14);

  /* Typography */
  --ff-display: 'Cormorant Garamond', 'Palatino Linotype', Georgia, serif;
  --ff-body:    'Source Serif 4', Georgia, 'Times New Roman', serif;

  /* Spacing */
  --sp-xs:  0.5rem;
  --sp-sm:  1rem;
  --sp-md:  2rem;
  --sp-lg:  4rem;
  --sp-xl:  8rem;
  --sp-2xl: 13rem;

  /* Layout */
  --container:      1120px;
  --container-wide: 1380px;
  --nav-h:          68px;

  /* Easing */
  --ease-out:  cubic-bezier(0.22, 1, 0.36, 1);
  --ease-draw: cubic-bezier(0.4, 0, 0.15, 1);
  --dur:       0.5s;
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 18px;
}

body {
  font-family: var(--ff-body);
  background-color: var(--clr-humus);
  color: var(--clr-birch);
  line-height: 1.8;
  overflow-x: hidden;
}

img, svg, canvas {
  display: block;
  max-width: 100%;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ============================================================
   Navigation — hidden until hero exits viewport
   ============================================================ */
#main-nav {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 900;
  height: var(--nav-h);
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
  transition:
    opacity 0.6s var(--ease-out),
    transform 0.6s var(--ease-out),
    background 0.4s var(--ease-out);
  border-bottom: 1px solid transparent;
}

#main-nav.nav--visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  background: rgba(10, 10, 8, 0.92);
  border-bottom-color: var(--clr-border);
  backdrop-filter: blur(20px) saturate(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
}

.nav-container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav-logo {
  font-family: var(--ff-display);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--clr-birch);
  white-space: nowrap;
  transition: color var(--dur) var(--ease-out);
}
.nav-logo:hover { color: var(--clr-amber); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.4rem;
}

.nav-links a {
  font-family: var(--ff-body);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clr-lichen);
  transition: color var(--dur) var(--ease-out);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--clr-amber);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease-out);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--clr-birch);
}

.nav-links a.active::after {
  transform: scaleX(1);
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  margin-right: -5px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--clr-birch);
  transition: transform var(--dur) var(--ease-out), opacity 0.25s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  height: 100svh;
  min-height: 620px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--clr-humus);
}

/* ---- Canopy orb layer ---- */
.hero-canopy {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.canopy-orb {
  position: absolute;
  border-radius: 50%;
  background: var(--clr-moss);
  transform: translate(-50%, -50%);
  animation: canopy-breathe var(--orb-dur, 20s) ease-in-out var(--orb-delay, 0s) infinite;
}

/* 18 orbs — distributed across the viewport */
.canopy-orb:nth-child(1)  { left:5%;  top:10%; width:380px; height:380px; opacity:0.28; --orb-dur:18s; --orb-delay:-2s }
.canopy-orb:nth-child(2)  { left:25%; top:3%;  width:260px; height:260px; opacity:0.20; --orb-dur:24s; --orb-delay:-9s }
.canopy-orb:nth-child(3)  { left:48%; top:12%; width:420px; height:420px; opacity:0.30; --orb-dur:16s; --orb-delay:-5s }
.canopy-orb:nth-child(4)  { left:70%; top:5%;  width:300px; height:300px; opacity:0.18; --orb-dur:21s; --orb-delay:-14s}
.canopy-orb:nth-child(5)  { left:90%; top:20%; width:360px; height:360px; opacity:0.24; --orb-dur:19s; --orb-delay:-7s }
.canopy-orb:nth-child(6)  { left:12%; top:35%; width:280px; height:280px; opacity:0.16; --orb-dur:26s; --orb-delay:-12s}
.canopy-orb:nth-child(7)  { left:35%; top:30%; width:320px; height:320px; opacity:0.22; --orb-dur:22s; --orb-delay:-4s }
.canopy-orb:nth-child(8)  { left:60%; top:38%; width:380px; height:380px; opacity:0.28; --orb-dur:17s; --orb-delay:-18s}
.canopy-orb:nth-child(9)  { left:82%; top:45%; width:240px; height:240px; opacity:0.14; --orb-dur:23s; --orb-delay:-3s }
.canopy-orb:nth-child(10) { left:3%;  top:60%; width:300px; height:300px; opacity:0.20; --orb-dur:20s; --orb-delay:-11s}
.canopy-orb:nth-child(11) { left:22%; top:65%; width:220px; height:220px; opacity:0.12; --orb-dur:28s; --orb-delay:-6s }
.canopy-orb:nth-child(12) { left:45%; top:58%; width:340px; height:340px; opacity:0.25; --orb-dur:18s; --orb-delay:-16s}
.canopy-orb:nth-child(13) { left:65%; top:65%; width:280px; height:280px; opacity:0.18; --orb-dur:22s; --orb-delay:-8s }
.canopy-orb:nth-child(14) { left:88%; top:70%; width:320px; height:320px; opacity:0.22; --orb-dur:15s; --orb-delay:-20s}
.canopy-orb:nth-child(15) { left:15%; top:82%; width:260px; height:260px; opacity:0.16; --orb-dur:25s; --orb-delay:-3s }
.canopy-orb:nth-child(16) { left:40%; top:85%; width:200px; height:200px; opacity:0.10; --orb-dur:27s; --orb-delay:-10s}
.canopy-orb:nth-child(17) { left:62%; top:78%; width:360px; height:360px; opacity:0.24; --orb-dur:19s; --orb-delay:-15s}
.canopy-orb:nth-child(18) { left:85%; top:88%; width:280px; height:280px; opacity:0.18; --orb-dur:21s; --orb-delay:-7s }

/* ---- Hero vignette ---- */
.hero-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,  rgba(10,10,8,0.5) 0%,  transparent 25%),
    linear-gradient(to bottom,  transparent 55%, rgba(10,10,8,0.92) 100%);
  z-index: 1;
}

/* ---- Hero content ---- */
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding-inline: 2rem;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.hero-eyebrow {
  font-family: var(--ff-body);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--clr-amber);
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--ff-display);
  font-size: clamp(4.5rem, 12vw, 10rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.01em;
  color: var(--clr-birch);
  margin-bottom: 1.6rem;
}

.hero-tagline {
  font-family: var(--ff-body);
  font-size: clamp(1rem, 2.2vw, 1.18rem);
  font-style: italic;
  font-weight: 400;
  color: var(--clr-lichen);
  letter-spacing: 0.01em;
  max-width: 520px;
}

/* Hero element stagger — JS adds .is-visible */
.hero-elem {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.hero-elem.is-visible {
  opacity: 1;
  transform: none;
}

/* Scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 2;
}

.hero-scroll__label {
  font-family: var(--ff-body);
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--clr-lichen);
  opacity: 0.6;
}

.hero-scroll__line {
  width: 1px;
  height: 46px;
  background: linear-gradient(to bottom, rgba(138,145,122,0.5), transparent);
  animation: scroll-pulse 2.4s ease-in-out 1.8s infinite;
}

/* Forest horizon silhouette */
.hero-silhouette {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.hero-silhouette path {
  fill: none;
  stroke: var(--clr-lichen);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.45;
}

/* ============================================================
   Section Base
   ============================================================ */
.section {
  padding-block: 8rem 9rem;
  position: relative;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 2rem;
  position: relative;
}

.container--wide {
  max-width: var(--container-wide);
}

/* Section number label */
.section-num {
  display: block;
  font-family: var(--ff-display);
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--clr-lichen);
  opacity: 0.45;
  margin-bottom: 3.5rem;
}

.section-num::after {
  content: '';
  display: inline-block;
  vertical-align: middle;
  width: 48px;
  height: 1px;
  background: var(--clr-lichen);
  opacity: 0.25;
  margin-left: 1rem;
}

/* Two-column grid */
.section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 6rem;
}

/* Flipped: visual goes first (left) */
.section-grid--flip .section-visual {
  order: -1;
}

/* Typography */
.section-title {
  font-family: var(--ff-display);
  font-size: clamp(2.8rem, 5vw, 4.6rem);
  font-weight: 400;
  line-height: 1.05;
  color: var(--clr-birch);
  margin-bottom: 1.4rem;
  letter-spacing: -0.01em;
}

.section-lead {
  font-family: var(--ff-body);
  font-size: 1.08rem;
  font-style: italic;
  color: var(--clr-lichen);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.section-text p {
  font-family: var(--ff-body);
  font-size: 0.95rem;
  color: rgba(232, 228, 220, 0.72);
  line-height: 1.9;
  margin-bottom: 1.15rem;
}

/* "Go Deeper →" link */
.go-deeper {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--ff-body);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--clr-amber);
  margin-top: 2.2rem;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}

.go-deeper::after {
  content: '→';
  transition: transform var(--dur) var(--ease-out);
}

.go-deeper:hover {
  border-bottom-color: var(--clr-amber);
}

.go-deeper:hover::after {
  transform: translateX(4px);
}

/* ============================================================
   Illustration containers
   ============================================================ */
.section-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.illus-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-illus {
  display: block;
  width: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

/* Individual illustration max-widths */
.illus--forest  { max-width: 560px; }
.illus--practice{ max-width: 480px; }
.illus--art     { max-width: 380px; }
.illus--garden  { max-width: 540px; }
.illus--gather  { max-width: 400px; }
.illus--science { max-width: 400px; }

/* SVG text labels inside illustrations */
.illus-label {
  font-family: var(--ff-body);
  font-size: 9px;
  letter-spacing: 0.08em;
  fill: currentColor;
  opacity: 0.55;
  text-transform: uppercase;
  stroke: none;
}

/* ============================================================
   Section — The Forest
   ============================================================ */
.section--forest {
  background: linear-gradient(180deg, var(--clr-humus) 0%, #0c1209 50%, var(--clr-humus) 100%);
  color: var(--clr-moss-mid);
}

.section--forest .section-title { color: #9fc49f; }
.section--forest .section-lead  { color: #7a9a7a; }

/* ============================================================
   Section — The Practice
   ============================================================ */
.section--practice {
  background: var(--clr-surface);
  color: var(--clr-lichen);
}

.section--practice .section-title { color: var(--clr-birch); }

/* ============================================================
   Section — Art in the Forest
   ============================================================ */
.section--art {
  background: linear-gradient(180deg, #0d0d0a 0%, #0a100a 60%, #0d0d0a 100%);
  color: var(--clr-moss-mid);
}

.section--art .section-title { color: var(--clr-amber); }
.section--art .section-lead  { color: var(--clr-amber-lt); opacity: 0.75; }

/* Art section centers the illustration above text on a full-width layout */
.section--art .section-grid {
  grid-template-columns: 1fr 1fr;
}

/* ============================================================
   Section — The Garden
   ============================================================ */
.section--garden {
  background: #0c1209;
  color: #7aab84;
}

.section--garden .section-title { color: #b0d4b0; }
.section--garden .section-lead  { color: #8aaa8a; }

/* ============================================================
   Section — Gather
   ============================================================ */
.section--gather {
  background: var(--clr-surface-2);
  color: var(--clr-lichen);
}

.section--gather .section-title { color: var(--clr-birch); }
.section--gather .section-lead  { color: var(--clr-lichen); }

/* ============================================================
   Section — The Science
   ============================================================ */
.section--science {
  background: var(--clr-surface);
  color: var(--clr-amber);
}

.section--science .section-title { color: var(--clr-amber); }
.section--science .section-lead  { color: var(--clr-amber-lt); opacity: 0.7; }

/* Science stats */
.science-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--clr-border);
}

.stat { display: flex; flex-direction: column; gap: 0.3rem; }

.stat-num {
  font-family: var(--ff-display);
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 400;
  color: var(--clr-amber);
  line-height: 1;
}

.stat-label {
  font-family: var(--ff-body);
  font-size: 0.78rem;
  color: var(--clr-lichen);
  line-height: 1.45;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: #070706;
  border-top: 1px solid var(--clr-border);
  padding-block: 5rem 4rem;
  text-align: center;
}

.footer-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.footer-logo {
  font-family: var(--ff-display);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--clr-birch);
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
  transition: color var(--dur) var(--ease-out);
}

.footer-logo:hover { color: var(--clr-amber); }

.footer-tagline {
  font-family: var(--ff-body);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--clr-lichen);
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-block: 1.5rem;
}

.footer-links a {
  font-family: var(--ff-body);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clr-lichen);
  transition: color var(--dur) var(--ease-out);
}

.footer-links a:hover { color: var(--clr-amber); }

.footer-note {
  font-family: var(--ff-body);
  font-style: italic;
  font-size: 0.82rem;
  color: var(--clr-lichen);
  opacity: 0.55;
  max-width: 440px;
  line-height: 1.6;
}

.footer-tending {
  font-family: var(--ff-body);
  font-size: 0.82rem;
  color: var(--clr-lichen);
  opacity: 0.65;
  margin-bottom: 0.4rem;
}

.footer-copy {
  font-family: var(--ff-body);
  font-size: 0.68rem;
  color: var(--clr-lichen);
  opacity: 0.25;
  margin-top: 1rem;
}

/* ============================================================
   Intro Passage
   ============================================================ */
.intro-passage {
  padding-block: 6rem 5rem;
  background: var(--clr-humus);
  text-align: center;
}

.intro-passage p {
  font-family: var(--ff-body);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: rgba(232, 228, 220, 0.78);
  line-height: 1.95;
  max-width: 760px;
  margin-inline: auto;
}

.text-amber {
  color: var(--clr-amber);
}

/* ============================================================
   SVG Draw Animation
   CSS provides transition; JS sets initial dasharray/dashoffset
   ============================================================ */
.svg-animate .draw {
  transition: stroke-dashoffset 1.8s var(--ease-draw);
}

/* Dashed helper lines inside illustrations */
.dash {
  stroke-dasharray: 3 5;
}

/* ============================================================
   Scroll Reveal
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ============================================================
   Keyframes
   ============================================================ */
@keyframes canopy-breathe {
  0%   { transform: translate(-50%, -50%) scale(1); }
  50%  { transform: translate(-50%, -50%) scale(1.07); }
  100% { transform: translate(-50%, -50%) scale(0.96); }
}

@keyframes scroll-pulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50%       { opacity: 0.7; transform: scaleY(0.88); }
}

/* The forest doesn't care about your viewport width,
   but we do. */

/* ============================================================
   Responsive — Tablet (≤ 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .section-grid { gap: 4rem; }

  .science-stats { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   Responsive — Mobile (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
  :root { --sp-xl: 5rem; }

  html { font-size: 16px; }

  /* Nav mobile */
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    background: rgba(10, 10, 8, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    transform: translateX(100%);
    transition: transform var(--dur) var(--ease-out);
    z-index: 850;
  }

  .nav-links.is-open { transform: none; }

  .nav-links a {
    font-size: 0.9rem;
    letter-spacing: 0.14em;
  }

  /* Sections */
  .section { padding-block: 5rem 6rem; }

  .section-grid,
  .section-grid--flip {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .section-grid--flip .section-visual {
    order: 0;
  }

  /* Science stats */
  .science-stats { grid-template-columns: 1fr; gap: 2rem; }

  /* Footer links */
  .footer-links { flex-direction: column; gap: 1.2rem; }
}

/* ============================================================
   Responsive — Small Mobile (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
  .hero-title { font-size: clamp(3.5rem, 15vw, 5.5rem); }

  .container { padding-inline: 1.25rem; }

  .section-num { margin-bottom: 2.5rem; }
}

/* ============================================================
   Accessibility — Reduced Motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html { scroll-behavior: auto; }

  .reveal,
  .hero-elem {
    opacity: 1;
    transform: none;
  }

  .svg-animate .draw {
    stroke-dashoffset: 0 !important;
  }
}
