/* ============================================
   GROWbox — Editorial Botanical Redesign
   Design tokens + base styles
   ============================================ */

:root {
  /* Palette: Verdant (default) — fresh greens, holographic accent, paper warmth */
  --bg: #f1ecd9;
  --bg-2: #e8e1c5;
  --bg-3: #ddd5b4;
  --paper: #faf5e2;
  --ink: #0e2418;
  --ink-2: #234231;
  --ink-3: #5a6e5b;
  --rule: #c4bd9a;
  --rule-soft: #d6cfae;
  --moss: #1e6e3a;        /* deep emerald */
  --moss-2: #2d8a4a;      /* mid emerald */
  --leaf: #4ec97a;        /* fresh leaf */
  --leaf-2: #8de08a;      /* spring sprout */
  --leaf-3: #c8f08a;      /* lime tip */
  --glow: #5cf2a4;        /* holographic glow */
  --clay: #c4632e;
  --clay-2: #a8501f;
  --bloom: #d4a373;
  --berry: #8b3a2b;
  --sun: #f5c542;         /* golden sun */
  --sun-2: #ffd96b;

  /* Type */
  --font-display: "Newsreader", "Source Serif 4", Georgia, serif;
  --font-body: "Public Sans", "Inter", -apple-system, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Density */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  /* Radii */
  --r-xs: 2px;
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 16px;
  --r-pill: 999px;

  /* Layout */
  --container: 1240px;
  --container-narrow: 880px;
}

/* Earthy (legacy palette, available as toggle) */
[data-palette="earthy"] {
  --bg: #f4efe6;
  --bg-2: #ebe4d6;
  --bg-3: #e3dac6;
  --paper: #faf6ed;
  --ink: #1c2a1d;
  --ink-2: #3a4a36;
  --ink-3: #6b7560;
  --rule: #c9bfaa;
  --rule-soft: #ddd2bb;
  --moss: #2d4a2a;
  --moss-2: #3d5e38;
  --leaf: #7a8c5c;
  --leaf-2: #94a572;
  --leaf-3: #b5c48f;
  --glow: #b4c490;
  --clay: #c4632e;
  --clay-2: #a8501f;
  --bloom: #d4a373;
  --berry: #8b3a2b;
  --sun: #e8b94a;
  --sun-2: #f5c970;
}

/* Dark/Forest palette */
[data-palette="forest"] {
  --bg: #0a1a10;
  --bg-2: #112318;
  --bg-3: #182d20;
  --paper: #0e2014;
  --ink: #eaf6e0;
  --ink-2: #c4d8b8;
  --ink-3: #7a8e7a;
  --rule: #244030;
  --rule-soft: #1a2e22;
  --moss: #4ec97a;
  --moss-2: #6cdf94;
  --leaf: #8de08a;
  --leaf-2: #b8f08a;
  --leaf-3: #d8ff9c;
  --glow: #5cf2a4;
  --clay: #f5b06e;
  --clay-2: #e89856;
  --bloom: #ffe4b8;
  --berry: #f4a08c;
  --sun: #ffd96b;
  --sun-2: #ffe49a;
}

/* extra tokens for sage/bloom (forward-compat) */
[data-palette="sage"], [data-palette="bloom"] {
  --leaf-3: var(--leaf-2);
  --glow: var(--leaf);
  --sun-2: var(--sun);
}

/* Sage minimal */
[data-palette="sage"] {
  --bg: #fffaf0;
  --bg-2: #f5efe0;
  --bg-3: #ebe4d2;
  --paper: #ffffff;
  --ink: #1a3a2a;
  --ink-2: #2d4a3a;
  --ink-3: #6a7a6c;
  --rule: #c9bfaa;
  --rule-soft: #e0d8c4;
  --moss: #1a3a2a;
  --moss-2: #2d4a3a;
  --leaf: #8b9d77;
  --leaf-2: #a8b894;
  --clay: #d4a373;
  --bloom: #c9b896;
  --berry: #8b3a2b;
  --sun: #d4a44b;
}

/* Bloom (warm with rose) */
[data-palette="bloom"] {
  --bg: #f3f5e6;
  --bg-2: #e8ecd3;
  --bg-3: #dce3bf;
  --paper: #fafce8;
  --ink: #0e2418;
  --ink-2: #1f3a26;
  --ink-3: #5e7560;
  --rule: #c2cba0;
  --rule-soft: #d4dcb3;
  --moss: #1f7a3f;
  --moss-2: #2c9550;
  --leaf: #5dd183;
  --leaf-2: #95e890;
  --leaf-3: #ccf590;
  --glow: #6cf2a8;
  --clay: #d97a6e;
  --bloom: #f0b8b8;
  --berry: #a8443c;
  --sun: #f5c542;
  --sun-2: #ffd96b;
}

/* Density modifiers */
[data-density="compact"] {
  --space-7: 32px;
  --space-8: 44px;
  --space-9: 64px;
  --space-10: 88px;
}
[data-density="airy"] {
  --space-7: 64px;
  --space-8: 96px;
  --space-9: 144px;
  --space-10: 192px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Paper grain texture overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.1  0 0 0 0 0.1  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Type scale */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: clamp(48px, 7vw, 104px); font-weight: 380; letter-spacing: -0.025em; }
h2 { font-size: clamp(36px, 4.5vw, 64px); font-weight: 400; letter-spacing: -0.02em; }
h3 { font-size: clamp(24px, 2.4vw, 32px); font-weight: 450; }
h4 { font-size: 20px; font-weight: 500; }

h1 em, h2 em, h3 em {
  font-style: italic;
  font-weight: 380;
  color: var(--moss);
}

p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--moss); }

.lead {
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.4;
  font-weight: 380;
  color: var(--ink-2);
  letter-spacing: -0.01em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--ink-3);
}

.mono { font-family: var(--font-mono); font-size: 0.9em; letter-spacing: 0; }

/* Layout */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

section { padding: var(--space-9) 0; }
section.tight { padding: var(--space-7) 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  background: transparent;
  color: var(--ink);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--moss);
  color: var(--paper);
  border-color: var(--moss);
}
.btn-primary:hover { background: var(--moss-2); border-color: var(--moss-2); }

.btn-ghost {
  border-color: var(--rule);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink); background: var(--bg-2); }

.btn-link {
  padding: 0;
  border: none;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  border-radius: 0;
}
.btn-link:hover { transform: none; text-decoration-color: var(--moss); }

.btn .arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}
.btn:hover .arrow { transform: translateX(3px); }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 1px solid var(--rule-soft);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo .mark {
  width: 28px;
  height: 28px;
  display: inline-block;
}
.nav-links {
  display: flex;
  gap: var(--space-5);
  margin-left: auto;
  align-items: center;
}
.nav-links a {
  font-size: 14px;
  text-decoration: none;
  color: var(--ink-2);
  font-weight: 500;
  letter-spacing: -0.005em;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--moss); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--moss);
  color: var(--paper);
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.18s ease, transform 0.18s ease;
}
.nav-cta:hover { background: var(--moss-2); color: var(--paper); transform: translateY(-1px); }

.nav-mode {
  appearance: none;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 4px;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.nav-mode:hover {
  background: var(--bg-2);
  color: var(--moss);
  border-color: var(--moss);
}
.nav-mode:active { transform: scale(0.94); }

/* Burger button */
.nav-burger {
  appearance: none;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  width: 36px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  margin-left: 4px;
  padding: 0;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.nav-burger span {
  display: block;
  width: 14px;
  height: 1.4px;
  background: currentColor;
  border-radius: 2px;
  transition: background .18s ease;
}
.nav-burger:hover {
  background: var(--bg-2);
  color: var(--moss);
  border-color: var(--moss);
}
.nav-burger:active { transform: scale(0.94); }

/* ===== SiteMenu drawer ===== */
.smenu-scrim {
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 12, 0);
  backdrop-filter: blur(0);
  pointer-events: none;
  z-index: 1000;
  transition: background .35s ease, backdrop-filter .35s ease;
}
.smenu-scrim.is-open {
  background: rgba(8, 18, 12, 0.32);
  backdrop-filter: blur(2px);
  pointer-events: auto;
}
[data-dark="1"] .smenu-scrim.is-open {
  background: rgba(0, 0, 0, 0.55);
}

.smenu {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 360px;
  max-width: 92vw;
  background: var(--paper);
  border-left: 1px solid var(--rule);
  box-shadow: -24px 0 60px rgba(8, 18, 12, 0.08);
  z-index: 1001;
  transform: translateX(100%);
  transition: transform .42s cubic-bezier(.22,.61,.36,1);
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  color: var(--ink);
}
.smenu.is-open {
  transform: translateX(0);
}

.smenu-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 14px;
  border-bottom: 1px solid var(--rule-soft);
}
.smenu-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 450;
  letter-spacing: -0.01em;
  font-style: italic;
  color: var(--ink);
}
.smenu-close {
  appearance: none;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.smenu-close:hover { background: var(--bg-2); color: var(--moss); border-color: var(--moss); }

.smenu-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

/* Account block */
.smenu-account {
  background: var(--bg-2);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.smenu-account-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.smenu-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--rule);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--moss);
  flex-shrink: 0;
}
.smenu-avatar-empty { color: var(--ink-3); }
.smenu-account-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 2px;
}
.smenu-account-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.smenu-account-name.muted { color: var(--ink-3); font-weight: 400; }
.smenu-account-actions {
  display: flex;
  gap: 8px;
}
.smenu-cta-primary {
  appearance: none;
  border: 0;
  background: var(--ink);
  color: var(--bg);
  flex: 1;
  padding: 9px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background .18s ease;
}
.smenu-cta-primary:hover { background: var(--moss); color: var(--paper); }
.smenu-cta-ghost {
  flex: 1;
  text-align: center;
  padding: 9px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease;
}
.smenu-cta-ghost:hover { background: var(--bg-3); border-color: var(--moss); color: var(--moss); }
.smenu-link {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--ink-3);
  font-size: 12px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  padding: 4px 6px;
}
.smenu-link:hover { color: var(--moss); }

/* Section */
.smenu-section { display: flex; flex-direction: column; gap: 10px; }
.smenu-section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--rule-soft);
}
.smenu-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.smenu-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--bg-2);
}
.smenu-pill-soft { background: transparent; border-style: dashed; }

/* Mode + Lang segmented control */
.smenu-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-2);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-pill);
  padding: 3px;
  gap: 2px;
}
.smenu-seg-opt {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--ink-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.smenu-seg-opt:hover { color: var(--ink); }
.smenu-seg-opt.is-active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 0 0 1px var(--rule-soft);
}

/* Palette swatches */
.smenu-palettes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.smenu-palette {
  appearance: none;
  background: var(--paper);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-md);
  padding: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  font-family: var(--font-body);
  text-align: left;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.smenu-palette:hover {
  border-color: var(--moss);
  transform: translateY(-1px);
}
.smenu-palette.is-active {
  border-color: var(--moss);
  background: var(--bg-2);
  box-shadow: 0 0 0 2px var(--moss) inset;
}
.smenu-palette-chip {
  width: 100%;
  height: 28px;
  border-radius: 6px;
  display: flex;
  overflow: hidden;
  border: 1px solid var(--rule-soft);
}
.smenu-palette-chip > span {
  flex: 1;
  display: block;
}
.smenu-palette-chip > span:first-child { flex: 0 0 32%; }
.smenu-palette-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

/* Portal list */
.smenu-portal {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.smenu-portal li + li { border-top: 1px solid var(--rule-soft); }
.smenu-portal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  text-decoration: none;
  color: var(--ink);
  border-radius: 6px;
  transition: background .18s ease, color .18s ease;
}
.smenu-portal-item:hover {
  background: var(--bg-2);
  color: var(--moss);
}
.smenu-portal-item.is-locked {
  color: var(--ink-3);
  cursor: not-allowed;
}
.smenu-portal-item.is-locked:hover {
  background: transparent;
  color: var(--ink-3);
}
.smenu-portal-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--rule-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--moss);
  flex-shrink: 0;
}
.smenu-portal-item.is-locked .smenu-portal-icon { color: var(--ink-3); }
.smenu-portal-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.smenu-portal-name {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.smenu-portal-hint {
  font-size: 11.5px;
  color: var(--ink-3);
  font-family: var(--font-body);
}
.smenu-portal-arrow {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-3);
  transition: transform .18s ease, color .18s ease;
}
.smenu-portal-item:hover .smenu-portal-arrow {
  transform: translateX(2px);
  color: var(--moss);
}
.smenu-portal-lock {
  color: var(--ink-3);
  opacity: 0.7;
}

.smenu-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--rule-soft);
}

/* ===== Loading: opening box + fractal tree ===== */
.loading-grow {
  display: inline-block;
  position: relative;
}
.loading-grow svg { display: block; overflow: visible; }

@keyframes lg-lid-open {
  0%, 8% { transform: rotate(0deg) translateY(0); }
  18%, 80% { transform: rotate(-58deg) translate(-4px, -8px); }
  92%, 100% { transform: rotate(0deg) translateY(0); }
}
@keyframes lg-box-pulse {
  0%, 8%, 92%, 100% { transform: translateY(0) scale(1); }
  16% { transform: translateY(2px) scale(1.02, 0.98); }
  22%, 80% { transform: translateY(0) scale(1); }
}
@keyframes lg-tree-grow {
  0%, 14% { transform: translateY(20px) scale(0.6); opacity: 0; }
  22% { transform: translateY(0) scale(1); opacity: 1; }
  85%, 100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes lg-tree-hide {
  0%, 88% { opacity: 1; transform: translateY(0) scale(1); }
  96%, 100% { opacity: 0; transform: translateY(8px) scale(0.85); }
}
@keyframes lg-branch-draw {
  0% { stroke-dashoffset: var(--len, 40); opacity: 0; }
  60% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes lg-leaf-pop {
  0%, 30% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.4); opacity: 1; }
  60%, 100% { transform: scale(1); opacity: 1; }
}
@keyframes lg-spark-twinkle {
  0%, 30%, 100% { opacity: 0; transform: scale(0.5); }
  60% { opacity: 1; transform: scale(1.2); }
  80% { opacity: 0; transform: scale(0.8); }
}
@keyframes lg-glow-pulse {
  0%, 12% { opacity: 0; }
  30% { opacity: 0.6; }
  85% { opacity: 0.9; }
  95%, 100% { opacity: 0; }
}

.loading-grow .lg-lid { animation: lg-lid-open 4.8s ease-in-out infinite; transform-origin: 70px 100px; }
.loading-grow .lg-box { animation: lg-box-pulse 4.8s ease-in-out infinite; transform-origin: 100px 130px; }
.loading-grow .lg-tree {
  animation: lg-tree-grow 4.8s cubic-bezier(.22,.61,.36,1) infinite,
             lg-tree-hide 4.8s ease-in infinite;
  transform-origin: 100px 100px;
}
.loading-grow .lg-glow { animation: lg-glow-pulse 4.8s ease-in-out infinite; transform-origin: 100px 100px; }

.loading-grow .lg-branch {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
}
.loading-grow .lg-b1 { animation: lg-branch-draw 4.8s ease-out infinite; animation-delay: 0.6s; }
.loading-grow .lg-b2 { animation: lg-branch-draw 4.8s ease-out infinite; animation-delay: 1.0s; }
.loading-grow .lg-b3 { animation: lg-branch-draw 4.8s ease-out infinite; animation-delay: 1.0s; }
.loading-grow .lg-b4 { animation: lg-branch-draw 4.8s ease-out infinite; animation-delay: 1.4s; }
.loading-grow .lg-b5 { animation: lg-branch-draw 4.8s ease-out infinite; animation-delay: 1.4s; }
.loading-grow .lg-b6 { animation: lg-branch-draw 4.8s ease-out infinite; animation-delay: 1.4s; }
.loading-grow .lg-b7 { animation: lg-branch-draw 4.8s ease-out infinite; animation-delay: 1.4s; }

.loading-grow .lg-leaf {
  animation: lg-leaf-pop 4.8s ease-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.loading-grow .lg-l1 { animation-delay: 1.7s; }
.loading-grow .lg-l2 { animation-delay: 1.85s; }
.loading-grow .lg-l3 { animation-delay: 2.0s; }
.loading-grow .lg-l4 { animation-delay: 2.15s; }
.loading-grow .lg-l5 { animation-delay: 1.0s; }
.loading-grow .lg-l6 { animation-delay: 2.4s; }

.loading-grow .lg-spark { animation: lg-spark-twinkle 4.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.loading-grow .lg-sp1 { animation-delay: 1.2s; }
.loading-grow .lg-sp2 { animation-delay: 1.6s; }
.loading-grow .lg-sp3 { animation-delay: 2.0s; }
.loading-grow .lg-sp4 { animation-delay: 2.4s; }

@media (prefers-reduced-motion: reduce) {
  .loading-grow * { animation: none !important; }
  .loading-grow .lg-branch { stroke-dashoffset: 0; }
  .loading-grow .lg-tree, .loading-grow .lg-leaf { opacity: 1; }
}

/* Splash overlay (initial loading) */
.splash-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 1500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  animation: splash-fade 1.2s ease-in-out forwards;
}
.splash-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  opacity: 0;
  animation: splash-label-in 1.2s ease-out forwards;
  animation-delay: 0.3s;
}
@keyframes splash-fade {
  0%, 70% { opacity: 1; pointer-events: auto; }
  100% { opacity: 0; pointer-events: none; }
}
@keyframes splash-label-in {
  0% { opacity: 0; transform: translateY(4px); }
  40%, 80% { opacity: 0.7; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-2px); }
}

/* Hero rule */
.section-rule {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.section-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* Cards */
.card {
  background: var(--paper);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-md);
  padding: var(--space-6);
}

/* Footer — soil/earth aesthetic with grass on top + roots below */
.foot-earth-wrap {
  position: relative;
  margin-top: var(--space-9);
  background: linear-gradient(
    to bottom,
    transparent 0,
    transparent 200px,
    var(--earth-top, #6b4a2b) 200px,
    var(--earth-mid, #4a3320) 60%,
    var(--earth-bottom, #2a1d12) 100%
  );
}

/* Grass strip sits ABOVE the footer — its own box, blades grow upward over page bg */
.grass-strip {
  position: relative;
  width: 100%;
  pointer-events: none;
  /* The strip overlaps the soil seam by a few px so blades emerge from soil */
  margin-bottom: -2px;
  z-index: 1;
}

footer.foot {
  position: relative;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255, 217, 107, 0.06), transparent 60%),
    linear-gradient(180deg, #6b4a2b 0%, #4a3320 50%, #3a2818 100%);
  color: var(--paper);
  padding: var(--space-7) 0 var(--space-6);
  overflow: hidden;
}

/* Soil texture: faint speckles using radial-gradient noise */
footer.foot::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 22%, rgba(255, 217, 107, 0.07) 0, transparent 1.5px),
    radial-gradient(circle at 38% 8%,  rgba(244, 239, 230, 0.05) 0, transparent 1.5px),
    radial-gradient(circle at 72% 38%, rgba(255, 217, 107, 0.06) 0, transparent 1.5px),
    radial-gradient(circle at 88% 12%, rgba(244, 239, 230, 0.04) 0, transparent 1px),
    radial-gradient(circle at 22% 68%, rgba(255, 217, 107, 0.05) 0, transparent 1.5px),
    radial-gradient(circle at 58% 82%, rgba(244, 239, 230, 0.04) 0, transparent 1px),
    radial-gradient(circle at 92% 76%, rgba(255, 217, 107, 0.06) 0, transparent 1.5px);
  background-size: 240px 240px;
  opacity: 0.8;
}
footer.foot > * { position: relative; z-index: 1; }

footer.foot * { color: var(--paper); }
footer.foot a { color: var(--paper); text-decoration-color: rgba(244, 239, 230, 0.3); }
footer.foot a:hover { text-decoration-color: var(--paper); color: var(--leaf-2); }

/* Roots strip sits BELOW the footer */
.roots-strip {
  position: relative;
  width: 100%;
  background: linear-gradient(180deg, #3a2818 0%, #221610 70%, #110a08 100%);
  pointer-events: none;
  z-index: 0;
  /* slight overlap to avoid seam */
  margin-top: -2px;
}

/* sway animations */
@keyframes grass-sway {
  0%, 100% { transform: rotate(-1.5deg); }
  50% { transform: rotate(1.5deg); }
}
@keyframes dandelion-nod {
  0%, 100% { transform: rotate(-2deg) translateY(0); }
  50% { transform: rotate(2deg) translateY(-1px); }
}
@keyframes seed-drift {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translate(60px, -30px) rotate(40deg); opacity: 0; }
}
@keyframes myc-pulse {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.3); }
}
@keyframes bug-walk {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(60px, -2px) rotate(8deg); }
  50% { transform: translate(140px, 1px) rotate(-4deg); }
  75% { transform: translate(220px, -1px) rotate(6deg); }
  100% { transform: translate(300px, 0) rotate(0deg); }
}

/* Bee flying loop */
@keyframes bee-fly {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(80px, -10px); }
  50% { transform: translate(180px, 6px); }
  75% { transform: translate(100px, -16px); }
}
@keyframes bee-wing {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.2); }
}

/* Butterfly paths */
@keyframes butterfly-fly-1 {
  0% { transform: translate(0, 0); }
  20% { transform: translate(120px, -30px); }
  40% { transform: translate(60px, -60px); }
  60% { transform: translate(220px, -40px); }
  80% { transform: translate(160px, -80px); }
  100% { transform: translate(0, 0); }
}
@keyframes butterfly-fly-2 {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-80px, -40px); }
  50% { transform: translate(-160px, -10px); }
  75% { transform: translate(-100px, -50px); }
  100% { transform: translate(0, 0); }
}
@keyframes wing-flap {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(0.35); }
}
@keyframes wing-flap-r {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(0.35); }
}

/* Worm wiggle */
@keyframes worm-wiggle {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(40px); }
}

.foot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-7);
  margin-bottom: var(--space-8);
}
.foot-col h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: var(--space-3);
}
.foot-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.foot-col a { font-size: 15px; text-decoration: none; }
.foot-col a:hover { text-decoration: underline; text-decoration-color: var(--paper); text-underline-offset: 4px; }
.foot-bottom {
  border-top: 1px solid rgba(244, 239, 230, 0.18);
  padding-top: var(--space-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: 13px;
  opacity: 0.7;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

@media (max-width: 900px) {
  .nav-links { gap: var(--space-3); }
  .nav-links a:not(.nav-cta) { display: none; }
  .nav-mode { display: inline-flex; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}

/* Utilities */
.center { text-align: center; }
.flex { display: flex; }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.muted { color: var(--ink-3); }
.serif { font-family: var(--font-display); }

/* Number marker (used in growth steps) */
.numeral {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-3);
  font-weight: 400;
}

/* Form base */
input, textarea, select {
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--moss);
  background: var(--bg);
}
label {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 6px;
  font-weight: 500;
}
