@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400;1,700&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400&display=swap');

:root {
  --forest: #1a3a2a;
  --moss: #2d5a3d;
  --sage: #7a9e7e;
  --sage-light: #a8c5aa;
  --lichen-yellow: #c4b45c;
  --lichen-gold: #a89638;
  --bark: #6b4c3b;
  --bark-light: #a07e6a;
  --stone: #6a6d6f;
  --stone-light: #b8bbbe;
  --cream: #f4efe4;
  --warm-white: #faf8f3;
  --text: #1a1a1a;
  --text-mid: #4a4a4a;
  --text-light: #6a6a6a;
  --accent: #d4803b;
  --teal: #2a6b6b;
  --teal-light: #3a8f8f;
  --deep-green: #0d2818;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--warm-white);
  line-height: 1.75;
  font-size: 17px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1.2;
  font-weight: 700;
}

.sci { font-family: 'Playfair Display', Georgia, serif; font-style: italic; }
.mono { font-family: 'JetBrains Mono', monospace; font-size: 0.85em; }
.label {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ============================================
   NAVIGATION
   ============================================ */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--forest);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
}

.site-nav .nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.site-nav .logo {
  font-family: 'Playfair Display', serif;
  color: white;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 1rem 0;
  white-space: nowrap;
}

.site-nav .logo span { color: var(--sage-light); font-weight: 400; }

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}

.site-nav a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 1.2rem 1rem;
  display: block;
  transition: color 0.2s;
  white-space: nowrap;
}

.site-nav a:hover, .site-nav a.active {
  color: white;
}

.site-nav a.active {
  border-bottom: 2px solid var(--sage-light);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* ============================================
   PAGE HERO
   ============================================ */

.page-hero {
  padding: 8rem 2rem 6rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero.dark {
  background: var(--forest);
  color: white;
}

.page-hero.hero-bg {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: white;
}

.page-hero.hero-bg::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(30,42,28,0.72) 0%, rgba(30,42,28,0.85) 100%);
  z-index: 0;
}

.page-hero.hero-bg > * {
  position: relative;
  z-index: 1;
}

.page-hero.moss {
  background: linear-gradient(160deg, var(--forest) 0%, var(--moss) 100%);
  color: white;
}

.page-hero.teal {
  background: linear-gradient(160deg, #1a3a3a 0%, var(--teal) 100%);
  color: white;
}

.page-hero.warm {
  background: linear-gradient(160deg, var(--bark) 0%, #8a5e42 100%);
  color: white;
}

.page-hero.stone {
  background: linear-gradient(160deg, #3a3d40 0%, var(--stone) 100%);
  color: white;
}

.page-hero .hero-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 1.5rem;
}

.page-hero h1 {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 900;
  margin-bottom: 1.5rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.page-hero .hero-desc {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  max-width: 650px;
  margin: 0 auto;
  opacity: 0.8;
  line-height: 1.8;
  font-weight: 300;
}

/* Texture overlay for heroes */
.page-hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */

.content-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.content-section.wide {
  max-width: 1100px;
}

.content-section.full {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.content-section p {
  margin-bottom: 1.2rem;
  color: var(--text-mid);
}

.content-section h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--forest);
  margin-bottom: 1.5rem;
}

.content-section h3 {
  font-size: 1.5rem;
  color: var(--moss);
  margin: 3rem 0 1rem;
}

.content-section h4 {
  font-size: 1.15rem;
  color: var(--bark);
  margin: 2rem 0 0.8rem;
}

/* ============================================
   FULL-WIDTH BANDS
   ============================================ */

.band {
  padding: 5rem 2rem;
}

.band-cream { background: var(--cream); }
.band-dark { background: var(--forest); color: white; }
.band-dark p { color: rgba(255,255,255,0.75); }
.band-dark h2, .band-dark h3 { color: white; }
.band-moss { background: var(--moss); color: white; }
.band-moss p { color: rgba(255,255,255,0.8); }
.band-moss h2, .band-moss h3 { color: white; }

.band-bg {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  color: white;
}
.band-bg::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(30,42,28,0.75) 0%, rgba(30,42,28,0.85) 100%);
  z-index: 0;
}
.band-bg > * {
  position: relative;
  z-index: 1;
}
.band-bg p { color: rgba(255,255,255,0.8); }
.band-bg h2, .band-bg h3, .band-bg h4 { color: white; }

.band .band-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.band .band-inner.narrow {
  max-width: 800px;
}

/* ============================================
   PULL QUOTE
   ============================================ */

.pull-quote {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-style: italic;
  color: var(--moss);
  line-height: 1.5;
  padding: 2.5rem 0;
  margin: 2rem 0;
  border-top: 3px solid var(--sage-light);
  border-bottom: 1px solid #e0dbd0;
  text-align: center;
}

.pull-quote.light {
  color: rgba(255,255,255,0.9);
  border-top-color: rgba(255,255,255,0.3);
  border-bottom-color: rgba(255,255,255,0.1);
}

/* ============================================
   BIG NUMBER / STAT
   ============================================ */

.big-stat {
  text-align: center;
  padding: 1rem;
  overflow: hidden;
}

.big-stat .number {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--forest);
  display: block;
}

.big-stat .unit {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-top: 0.5rem;
  display: block;
}

.big-stat.light .number { color: white; }
.big-stat.light .unit { color: rgba(255,255,255,0.6); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem 2rem;
  margin: 3rem 0;
}

/* ============================================
   TWO-COLUMN FEATURE
   ============================================ */

.feature-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin: 3rem 0;
}

.feature-split.reverse { direction: rtl; }
.feature-split.reverse > * { direction: ltr; }

.feature-visual {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.feature-visual svg,
.feature-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.figure-visual img {
  max-width: 100%;
  height: auto;
}

.feature-text h3 {
  margin-top: 0;
}

/* ============================================
   INLINE FIGURE / DIAGRAM
   ============================================ */

.figure {
  margin: 3rem 0;
  background: var(--cream);
  border-radius: 16px;
  overflow: hidden;
}

.figure-visual {
  padding: 2rem;
  display: flex;
  justify-content: center;
}

.figure-caption {
  padding: 1.5rem 2rem;
  font-size: 0.9rem;
  color: var(--text-light);
  border-top: 1px solid #e0dbd0;
}

.figure-caption strong { color: var(--text); }

/* ============================================
   SPECIES ENTRY
   ============================================ */

.species-entry {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "header header"
    "photo  body"
    "footer footer";
  gap: 0 2rem;
  padding: 2rem;
  margin-bottom: 1.5rem;
  background: rgba(255,255,255,0.55);
  border-radius: 12px;
  border: 1px solid #e0dbd0;
}

.species-entry:last-child { margin-bottom: 0; }

.species-header {
  grid-area: header;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.2rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid #e8e3d8;
}

.species-entry .common-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--forest);
  line-height: 1.3;
}

.species-entry .sci-name {
  font-size: 0.8rem;
  font-style: italic;
  letter-spacing: 0.03em;
  color: var(--text-mid);
  margin-top: 0.2rem;
}

.species-filter-wrap {
  max-width: 540px;
  margin: 0 auto 2.5rem;
  position: relative;
}

.species-filter {
  width: 100%;
  padding: 1rem 1.2rem 1rem 3.2rem;
  border: 2px solid #e0dbd0;
  border-radius: 40px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%237a9e7e' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7.5' cy='7.5' r='5.5'/%3E%3Cline x1='11.5' y1='11.5' x2='16' y2='16'/%3E%3C/svg%3E") 1.1rem center no-repeat;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
  color: var(--text);
}

.species-filter::placeholder {
  color: var(--text-light);
  font-weight: 300;
}

.species-filter:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 2px 12px rgba(122,158,126,0.15);
}

.species-no-results {
  text-align: center;
  color: var(--text-mid);
  padding: 2rem 0;
  display: none;
}

.species-entry .form-badge {
  display: inline-block;
  margin-top: 0.2rem;
  padding: 0.25rem 0.9rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.species-entry > .species-thumb {
  grid-area: photo;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #e0dbd0;
  align-self: start;
}

.band-dark .species-thumb {
  border-color: rgba(255,255,255,0.15);
}

.species-body {
  grid-area: body;
}

.species-footer {
  grid-area: footer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1.2rem;
  margin-top: 1rem;
  border-top: 1px solid #e8e3d8;
}

.species-range {
  display: block;
  width: 220px;
  max-width: 45%;
  height: auto;
  border-radius: 8px;
  border: 1px solid #e0dbd0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  flex-shrink: 0;
  cursor: zoom-in;
  transition: box-shadow 0.2s, transform 0.2s;
}

.species-range:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: scale(1.03);
}

.band-dark .species-entry {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
}
.band-dark .species-header {
  border-bottom-color: rgba(255,255,255,0.1);
}
.band-dark .species-footer {
  border-top-color: rgba(255,255,255,0.1);
}
.band-dark .species-range {
  border-color: rgba(255,255,255,0.15);
}

.badge-foliose { background: #e8f0e8; color: var(--moss); }
.badge-fruticose { background: #e0f0f0; color: var(--teal); }
.badge-crustose { background: #ebebeb; color: var(--stone); }
.badge-gelatinous { background: #ede8f0; color: #6b5b8a; }

.species-body p {
  font-size: 0.95rem;
}

/* ============================================
   LAYERS / STACKED DIAGRAM
   ============================================ */

.layer-stack {
  margin: 2rem 0;
}

.layer-item {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid #e8e3d8;
  align-items: start;
}

.layer-item:last-child { border-bottom: none; }

.layer-swatch {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  flex-shrink: 0;
}

.layer-item h4 { margin: 0 0 0.3rem; }
.layer-item p { margin: 0; font-size: 0.9rem; }

/* ============================================
   PROCESS / STEPS
   ============================================ */

.process-steps {
  counter-reset: step;
  margin: 2rem 0;
}

.step {
  counter-increment: step;
  padding: 2rem 0 2rem 5rem;
  position: relative;
  border-left: 2px solid var(--sage-light);
  margin-left: 1.5rem;
}

.step::before {
  content: counter(step);
  position: absolute;
  left: -1.6rem;
  top: 2rem;
  width: 3rem;
  height: 3rem;
  background: var(--moss);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.1rem;
}

.step h4 { margin-top: 0.3rem; }

/* ============================================
   ACCORDION
   ============================================ */

.accordion-item {
  border-bottom: 1px solid #e0dbd0;
}

.accordion-item summary {
  padding: 1.5rem 0;
  padding-right: 2.5rem;
  cursor: pointer;
  list-style: none;
  position: relative;
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--forest);
}

.accordion-item summary::after {
  content: '+';
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--sage);
  transition: transform 0.3s;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.accordion-item[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

.accordion-item .acc-body {
  padding: 0 0 2rem;
  font-size: 0.95rem;
  color: var(--text-mid);
}

.accordion-item .acc-body ul {
  margin: 0.8rem 0;
  padding-left: 1.5rem;
}

.accordion-item .acc-body li {
  margin-bottom: 0.5rem;
}

/* ============================================
   CALLOUT BOX
   ============================================ */

.callout {
  background: var(--cream);
  border-left: 4px solid var(--accent);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
}

.callout p { margin-bottom: 0.5rem; }
.callout p:last-child { margin-bottom: 0; }

.callout.green { border-left-color: var(--moss); }
.callout.teal { border-left-color: var(--teal); }

/* ============================================
   GLOSSARY
   ============================================ */

.glossary-list {
  columns: 2;
  column-gap: 3rem;
  margin: 2rem 0;
}

.glossary-entry {
  break-inside: avoid;
  display: flow-root;
  padding: 0.8rem 0;
  border-bottom: 1px solid #eae5da;
}

.glossary-entry dt {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--forest);
}

.glossary-entry dd {
  font-size: 0.9rem;
  color: var(--text-mid);
  margin: 0;
}

/* ============================================
   SCALE / SPECTRUM BAR
   ============================================ */

.spectrum {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-radius: 12px;
  overflow: hidden;
  margin: 2rem 0;
  min-height: 200px;
}

.spectrum-zone {
  padding: 2rem 1.5rem;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.spectrum-zone h4 {
  color: white;
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.spectrum-zone p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  margin: 0;
}

.zone-clean { background: var(--moss); }
.zone-moderate { background: #8a7a30; }
.zone-polluted { background: #8a3a2a; }

/* ============================================
   GRID LAYOUTS
   ============================================ */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin: 2rem 0;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin: 2rem 0;
}

/* ============================================
   INLINE LIST
   ============================================ */

.content-section ul, .content-section ol {
  padding-left: 1.5rem;
  margin-bottom: 1.2rem;
  color: var(--text-mid);
}

.content-section li { margin-bottom: 0.5rem; }

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  background: var(--deep-green);
  color: rgba(255,255,255,0.5);
  padding: 4rem 2rem;
}

.site-footer .footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
}

.site-footer h4 {
  color: rgba(255,255,255,0.8);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.site-footer a {
  color: var(--sage-light);
  text-decoration: none;
}

.site-footer a:hover { color: white; }

.site-footer ul {
  list-style: none;
}

.site-footer li {
  margin-bottom: 0.5rem;
}

.footer-bottom {
  max-width: 1100px;
  margin: 2rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem;
}

/* ============================================
   PAGE LINKS / CTA
   ============================================ */

.page-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.page-link {
  display: block;
  text-decoration: none;
  color: var(--text);
  padding: 2.5rem 2rem;
  border-radius: 12px;
  background: var(--cream);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.page-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

.page-link .link-number {
  font-family: 'Playfair Display', serif;
  font-size: 4rem;
  font-weight: 900;
  color: var(--sage-light);
  opacity: 0.3;
  position: absolute;
  top: -0.5rem;
  right: 1rem;
  line-height: 1;
}

.page-link h3 {
  font-size: 1.3rem;
  color: var(--forest);
  margin: 0 0 0.5rem;
}

.page-link p {
  font-size: 0.9rem;
  color: var(--text-light);
  margin: 0;
}

/* ============================================
   CHEMICAL TEST DISPLAY
   ============================================ */

.chem-test {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid #e0dbd0;
  align-items: start;
}

.chem-test:last-child { border-bottom: none; }

.chem-symbol {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: white;
  flex-shrink: 0;
}

.chem-test h4 { margin: 0 0 0.3rem; font-size: 1rem; }
.chem-test p { margin: 0; font-size: 0.9rem; }

/* ============================================
   TABLE
   ============================================ */

table.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9rem;
}

table.data-table th {
  text-align: left;
  padding: 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  border-bottom: 2px solid var(--forest);
}

table.data-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #eae5da;
  color: var(--text-mid);
  vertical-align: top;
}

table.data-table td strong { color: var(--text); }

table.data-table tr:hover td { background: rgba(244,239,228,0.5); }

.band-dark table.data-table td strong { color: #fff; }
.band-dark table.data-table td { border-bottom-color: rgba(255,255,255,0.1); }
.band-dark table.data-table th { color: rgba(255,255,255,0.6); border-bottom-color: rgba(255,255,255,0.2); }
.band-dark table.data-table tr:hover td { background: rgba(255,255,255,0.05); }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
  .feature-split { grid-template-columns: 1fr; gap: 2rem; }
  .feature-split.reverse { direction: ltr; }
  .species-entry {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "photo"
      "body"
      "footer";
  }
  .species-entry > .species-thumb { max-width: 320px; }
  .species-footer { flex-wrap: wrap; }
  .species-range { max-width: 60%; }
  .grid-2 { grid-template-columns: 1fr; gap: 2rem; }
  .grid-3 { grid-template-columns: 1fr; gap: 1.5rem; }
  .glossary-list { columns: 1; }
  .spectrum { grid-template-columns: 1fr; }
  .site-footer .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .site-nav .nav-inner { flex-wrap: wrap; }
  .site-nav ul { display: none; width: 100%; }
  .site-nav ul.open { display: flex; flex-direction: column; }
  .mobile-toggle { display: block; }
  .page-hero { padding: 5rem 1.5rem 4rem; }
  .content-section { padding: 3rem 1.5rem; }
  .band { padding: 3rem 1.5rem; }
  .step { padding-left: 3.5rem; }
  .chem-test { grid-template-columns: 1fr; }
  .chem-symbol { margin-bottom: 0.5rem; }
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger.visible > *:nth-child(1) { transition-delay: 0s; opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(2) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(3) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(4) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(5) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(6) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }

/* ============================================
   SPECIES PHOTOS (iNaturalist)
   ============================================ */

.species-photos {
  margin-top: 1.5rem;
}

.species-photos .photo-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.6rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  border-radius: 8px;
  overflow: hidden;
}

.photo-grid a {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--cream);
  position: relative;
}

.photo-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.photo-grid a:hover img {
  transform: scale(1.08);
}

.photo-credit {
  font-size: 0.7rem;
  color: var(--text-light);
  margin-top: 0.4rem;
  font-style: italic;
}

.photo-credit a {
  color: var(--sage);
  text-decoration: none;
}

.photo-credit a:hover { text-decoration: underline; }

.photo-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-light);
  padding: 1rem 0;
}

.photo-loading .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--sage-light);
  border-top-color: var(--moss);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   DISTRIBUTION MAP (GBIF + Leaflet)
   ============================================ */

.species-map {
  margin-top: 1.2rem;
}

.species-map .map-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.6rem;
}

.map-container {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e0dbd0;
  background: #e8e4db;
}

.map-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: 100%;
  margin-top: -18%;
  margin-bottom: -32%;
}

.map-cell {
  position: relative;
  line-height: 0;
}

.map-cell img {
  width: 100%;
  display: block;
}

.map-cell .density {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.85;
}

.map-credit {
  font-size: 0.7rem;
  color: var(--text-light);
  margin-top: 0.3rem;
}

.map-credit a {
  color: var(--sage);
  text-decoration: none;
}

@media (max-width: 900px) {
  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 500px) {
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   SPECIES DETAIL PAGE
   ============================================ */

.species-hero {
  padding: 6rem 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  color: white;
}

.species-hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.species-hero-inner {
  position: relative;
  z-index: 1;
}

.species-hero .breadcrumb {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  opacity: 0.6;
  margin-bottom: 1.5rem;
}

.species-hero .breadcrumb a {
  color: white;
  text-decoration: none;
  opacity: 0.8;
}

.species-hero .breadcrumb a:hover { opacity: 1; }

.species-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.species-hero h1 em {
  font-style: italic;
}

.species-hero-common {
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 300;
  opacity: 0.8;
  margin-bottom: 1rem;
}

.species-hero .form-badge {
  display: inline-block;
  padding: 0.35rem 1.1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.species-detail-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 4rem;
  align-items: start;
}

.species-detail-main {
  min-width: 0;
}

.species-detail-section {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid #e8e3d8;
}

.species-detail-section:last-child {
  border-bottom: none;
}

.species-detail-section h2 {
  font-size: 1.8rem;
  color: var(--forest);
  margin-bottom: 1.2rem;
}

.species-detail-section p {
  color: var(--text-mid);
  margin-bottom: 1rem;
  line-height: 1.8;
}

.species-detail-section p:last-child {
  margin-bottom: 0;
}

.distribution-summary {
  font-weight: 500;
  color: var(--text) !important;
  margin-bottom: 1.2rem !important;
}

.id-checklist {
  list-style: none;
  padding: 0;
}

.id-checklist li {
  position: relative;
  padding: 0.8rem 0 0.8rem 2rem;
  border-bottom: 1px solid #f0ebe0;
  color: var(--text-mid);
  line-height: 1.6;
}

.id-checklist li:last-child { border-bottom: none; }

.id-checklist li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  top: 0.85rem;
  color: var(--moss);
  font-weight: 700;
  font-size: 1rem;
}

/* Fun Facts */

.fun-facts-section {
  background: var(--cream);
  margin-left: -2rem;
  margin-right: -2rem;
  padding: 2.5rem 2rem !important;
  border-radius: 12px;
  border-bottom: none !important;
}

.fun-fact {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #e0dbd0;
  align-items: flex-start;
}

.fun-fact:last-child { border-bottom: none; }

.fact-icon {
  color: var(--lichen-gold);
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.fun-fact p {
  margin: 0 !important;
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.7;
}

/* Sidebar */

.species-detail-sidebar {
  position: sticky;
  top: 5rem;
}

.quick-facts {
  background: var(--cream);
  border-radius: 12px;
  padding: 1.8rem;
}

.quick-facts h3 {
  font-size: 1rem;
  color: var(--forest);
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--sage-light);
}

.quick-facts dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.quick-facts dt {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-top: 1rem;
}

.quick-facts dt:first-of-type { margin-top: 0; }

.quick-facts dd {
  font-size: 0.9rem;
  color: var(--text-mid);
  margin: 0.2rem 0 0;
  line-height: 1.5;
}

.species-sidebar-list {
  list-style: none;
  padding: 0;
}

.species-sidebar-list li {
  margin: 0;
}

.species-sidebar-list a {
  display: block;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  color: var(--text-mid);
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.species-sidebar-list a:hover {
  background: rgba(122,158,126,0.15);
  color: var(--forest);
}

.species-sidebar-list a.active {
  background: var(--moss);
  color: white;
}

/* Photos on detail page */

.species-detail-photos {
  margin-bottom: 2rem;
}

.species-detail-photos h2 {
  font-size: 1.8rem;
  color: var(--forest);
  margin-bottom: 1.2rem;
}

.photo-grid-detail {
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

/* Related species */

.related-species {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid #e8e3d8;
}

.related-species h2 {
  font-size: 1.8rem;
  color: var(--forest);
  margin-bottom: 1.2rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.related-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.2rem;
  background: var(--cream);
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.related-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.related-sci {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--forest);
}

.related-common {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Species detail page link on main species page */

.species-link {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--moss);
  text-decoration: none;
  letter-spacing: 0.03em;
  margin-left: auto;
}

.species-link:hover { color: var(--forest); text-decoration: underline; }
.band-dark .species-link { color: var(--sage-light); }
.band-dark .species-link:hover { color: white; }

/* ============================================
   IDENTIFICATION PAGE - PHOTO GRIDS
   ============================================ */

.id-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 1.5rem;
}

.id-photo-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.id-photo-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }

.id-photo-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--cream);
}

.id-photo-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.id-photo-card:hover img { transform: scale(1.05); }

.id-photo-card span {
  display: block;
  padding: 0.5rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--forest);
  text-align: center;
  background: var(--cream);
}

/* Soredia vs Isidia comparison */

.comparison-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.comparison-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin-bottom: 0.8rem;
}

.comparison-item h4 {
  color: var(--forest);
  margin-bottom: 0.4rem;
}

.comparison-item p {
  font-size: 0.9rem;
  color: var(--text-mid);
}

/* Look-alike pairs */

.lookalike-pair {
  margin-bottom: 4rem;
}

.lookalike-photos {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.lookalike-photo {
  flex: 1;
  border-radius: 10px;
  overflow: hidden;
}

.lookalike-photo img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.lookalike-vs {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   GLOSSARY PAGE
   ============================================ */

.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.feature-card {
  background: var(--cream);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.feature-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.feature-card h4 {
  padding: 0.7rem 0.8rem 0.2rem;
  font-size: 0.95rem;
  color: var(--forest);
}

.feature-card p {
  padding: 0 0.8rem 0.8rem;
  font-size: 0.78rem;
  color: var(--text-mid);
  line-height: 1.5;
}

.glossary-thumb {
  float: right;
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  margin: 0 0 0.4rem 0.8rem;
}

/* FAQ */

.faq-item summary {
  font-size: 1.15rem;
}

/* Identification & glossary responsive */

@media (max-width: 900px) {
  .id-photo-grid.cols-5 { grid-template-columns: repeat(3, 1fr); }
  .id-photo-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .comparison-row { grid-template-columns: 1fr; }
  .feature-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

@media (max-width: 600px) {
  .id-photo-grid { grid-template-columns: repeat(2, 1fr); }
  .id-photo-grid.cols-5 { grid-template-columns: repeat(2, 1fr); }
  .id-photo-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .lookalike-photos { flex-direction: column; }
  .lookalike-vs { width: 32px; height: 32px; font-size: 0.65rem; }
  .glossary-thumb { width: 60px; height: 45px; }
  .feature-cards { grid-template-columns: repeat(2, 1fr); }
}

/* Species detail responsive */

@media (max-width: 900px) {
  .species-detail-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 1.5rem 3rem;
  }

  .species-detail-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .species-sidebar-list { max-height: 200px; }

  .fun-facts-section {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding: 2rem 1.5rem !important;
  }
}

@media (max-width: 600px) {
  .species-hero { padding: 4rem 1.5rem 3rem; }

  .species-detail-sidebar {
    grid-template-columns: 1fr;
  }

  .photo-grid-detail {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}
