/* Soil Life Atlas — shared tokens
   Watercolor-inspired palette: pigment-like colors on warm cream paper,
   soft edge bleeds, visible paper grain. Reference: Goldie Wilson-style
   painterly field-guide illustration.
   ============================================================ */
:root {
  /* ---------- Base surfaces ---------- */
  --color-ink: #1a3a5a;            /* prussian-blue ink — pigment, not digital */
  --color-ink-deep: #102a45;       /* indigo depth for dark sections */
  --color-ink-soft: #2f567a;       /* mid marine for inner surfaces */
  --color-paper: #f7f1e3;          /* warm cream watercolor paper */
  --color-paper-deep: #efe6d0;     /* deeper cream */
  --color-paper-deeper: #e6d7b5;   /* sand */
  --color-paper-rose: #f2d6cc;     /* rose-tinted paper accent */

  /* ---------- Pigment signals ---------- */
  /* Warm pigments */
  --color-coral:    #d65a3a;       /* coral pigment — primary warm */
  --color-saffron:  #e8a043;       /* saffron — secondary warm */
  --color-amber:    #c97829;       /* raw sienna — link / eyebrow */
  --color-rose:     #e39a8a;       /* soft rose pigment */
  --color-brick:    #9a3828;       /* burnt sienna */

  /* Cool pigments */
  --color-teal:     #2a8a8a;       /* viridian-teal */
  --color-cyan:     #4aa8c9;       /* cerulean */
  --color-indigo:   #1a3a5a;       /* prussian blue */
  --color-cobalt:   #102a45;       /* deep cobalt */

  /* Greens */
  --color-lime:     #9cc04a;       /* chlorophyll — sap green */
  --color-moss:     #6a8a4a;       /* mid sap */
  --color-sage:     #9ab080;       /* soft sage wash */
  --color-forest:   #2d5432;       /* deep hooker's green */

  /* Neutrals */
  --color-soil:     #6b4a2f;
  --color-soil-light: #9a8060;
  --color-muted:    #7a6a55;
  --color-muted-dark: rgba(247,241,227,0.6);

  /* ---------- Semantic roles ---------- */
  --color-spectral:       var(--color-coral);
  --color-spectral-light: var(--color-saffron);

  /* ---------- Kingdom palette (pigment-keyed) ---------- */
  --kingdom-bact:  #3d6a38;   /* bacteria — sap green */
  --kingdom-arch:  #9a3828;   /* archaea — burnt sienna */
  --kingdom-fung:  #6b3a1a;   /* fungi — van dyck brown */
  --kingdom-prot:  #4aa8c9;   /* protists — cerulean */
  --kingdom-plant: #9cc04a;   /* plants — sap green light */
  --kingdom-faun:  #1a3a5a;   /* animalia — prussian blue */

  /* ---------- Watercolor washes (for backgrounds) ---------- */
  --wash-coral:    rgba(214, 90, 58, 0.14);
  --wash-saffron:  rgba(232, 160, 67, 0.14);
  --wash-teal:     rgba(42, 138, 138, 0.13);
  --wash-lime:     rgba(156, 192, 74, 0.14);
  --wash-rose:     rgba(227, 154, 138, 0.16);
  --wash-ink:      rgba(26, 58, 90, 0.10);
  --wash-marine:   rgba(16, 42, 69, 0.12);

  /* ---------- Type ---------- */
  --font-display: "Fraunces", ui-serif, Georgia, serif;
  --font-body:    "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv01";
}

* { box-sizing: border-box; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-ink);
  font-weight: 400;
  margin: 0;
  font-feature-settings: "ss01";
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }

::selection {
  background: rgba(214, 90, 58, 0.28);
  color: var(--color-ink);
}

/* ============================================================
   WATERCOLOR SYSTEM
   ============================================================ */

/* Body-wide paper grain — permanent under everything */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch' seed='4'/><feColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.25 0 0 0 0 0.15 0 0 0 0.22 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.5;
  mix-blend-mode: multiply;
}

/* Ensure content sits above the grain */
main, header, footer { position: relative; z-index: 2; }

/* Utility: watercolor wash — soft gradient pool, no hard edges */
.wash {
  position: absolute;
  pointer-events: none;
  filter: blur(18px);
  opacity: 0.85;
  mix-blend-mode: multiply;
}

/* Utility classes */
.mono { font-family: var(--font-mono); }
.serif { font-family: var(--font-display); }
.italic-serif { font-family: var(--font-display); font-style: italic; }
.caption {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-muted);
}

/* Paper grain — legacy class for section-local use */
.paper-grain {
  position: absolute; inset: 0; pointer-events: none;
  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.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.29 0 0 0 0 0.22 0 0 0 0 0.16 0 0 0 0.12 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.3;
  mix-blend-mode: multiply;
}
