/* ==========================================================================
   BIO POD — base layer
   1. Tokens
   2. Reset
   3. Typography
   4. Layout primitives
   5. Surfaces and decorative systems
   Component styles live in components.css, motion in animations.css and
   breakpoint composition in responsive.css.
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  /* Colour — a botanical system: deep canopy greens, warm paper, one living leaf accent. */
  --ink: #06120d;
  --forest: #0a1e15;
  --forest-2: #10291c;
  --forest-3: #17331f;
  --paper: #f5f2e9;
  --paper-2: #ece7da;
  --cream: #e4ddcb;
  --stone: #55645b;
  --stone-soft: #7a8a7f;
  --stone-dark: #a9b4ab;
  --leaf: #9bc47a;
  --leaf-bright: #b7d79a;
  --leaf-deep: #3e5d31;
  --water: #9fc3bc;
  --amber: #c8a06a;

  --line-dark: rgba(169, 180, 171, 0.18);
  --line-dark-strong: rgba(169, 180, 171, 0.34);
  --line-light: rgba(6, 18, 13, 0.14);
  --line-light-strong: rgba(6, 18, 13, 0.28);

  --surface-raised: rgba(245, 242, 233, 0.035);
  --surface-raised-hover: rgba(245, 242, 233, 0.06);
  --surface-sunk: rgba(6, 18, 13, 0.35);

  /* Type */
  --font-display: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-editorial: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --fs-display: clamp(2.75rem, 8.4vw, 7.25rem);
  --fs-h1: clamp(2.35rem, 5.4vw, 4.5rem);
  --fs-h2: clamp(1.95rem, 3.6vw, 3.15rem);
  --fs-h3: clamp(1.3rem, 1.9vw, 1.7rem);
  --fs-h4: clamp(1.0625rem, 1.2vw, 1.2rem);
  --fs-lead: clamp(1.0625rem, 1.35vw, 1.3125rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.9375rem;
  --fs-micro: 0.8125rem;
  --fs-label: 0.6875rem;

  --tracking-display: -0.045em;
  --tracking-h: -0.03em;
  --tracking-label: 0.16em;

  /* Space */
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --section-y: clamp(4.25rem, 9vw, 8.5rem);
  --stack-xs: 0.5rem;
  --stack-sm: 0.875rem;
  --stack-md: 1.5rem;
  --stack-lg: 2.5rem;
  --stack-xl: 4rem;

  /* Radius and depth */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 32px;
  --r-pill: 999px;
  --shadow-lift: 0 24px 60px -32px rgba(4, 12, 8, 0.55);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 160ms;
  --dur-base: 260ms;
  --dur-slow: 620ms;
  --dur-reveal: 820ms;

  --nav-h: 4.25rem;
  --measure: 62ch;
}

/* 2. Reset ----------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1.5rem);
}

body {
  min-height: 100vh;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.62;
  letter-spacing: -0.006em;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

svg {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: var(--tracking-h);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

::selection {
  background: var(--leaf);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--leaf);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

.on-paper :focus-visible,
.on-paper :where(a, button, input, select, textarea, summary):focus-visible {
  outline-color: var(--leaf-deep);
}

/* 3. Typography ------------------------------------------------------------ */
.display {
  font-size: var(--fs-display);
  line-height: 0.94;
  letter-spacing: var(--tracking-display);
  font-weight: 500;
}

.h1 {
  font-size: var(--fs-h1);
  line-height: 0.98;
  letter-spacing: var(--tracking-h);
}

.h2 {
  font-size: var(--fs-h2);
  line-height: 1.04;
}

.h3 {
  font-size: var(--fs-h3);
  line-height: 1.14;
  letter-spacing: -0.022em;
}

.h4 {
  font-size: var(--fs-h4);
  line-height: 1.3;
  letter-spacing: -0.012em;
}

.editorial {
  font-family: var(--font-editorial);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.52;
  color: var(--stone-dark);
  max-width: 56ch;
  letter-spacing: -0.012em;
}

.prose {
  max-width: var(--measure);
  display: grid;
  gap: 1.05em;
}

.prose p {
  color: var(--stone-dark);
  font-size: var(--fs-body);
  line-height: 1.68;
}

.prose p strong {
  color: var(--paper);
  font-weight: 500;
}

.on-paper .lead,
.on-paper .prose p {
  color: var(--stone);
}

.on-paper .prose p strong {
  color: var(--ink);
}

.muted {
  color: var(--stone-dark);
}

.on-paper .muted {
  color: var(--stone);
}

.accent {
  color: var(--leaf);
}

.on-paper .accent {
  color: var(--leaf-deep);
}

em.accent {
  font-style: normal;
}

/* Mono label used for evidence, indices and technical captions. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 400;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--stone-dark);
  line-height: 1.4;
}

.eyebrow::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  background: var(--leaf);
  border-radius: 1px;
}

.on-paper .eyebrow {
  color: var(--stone);
}

.on-paper .eyebrow::before {
  background: var(--leaf-deep);
}

.label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--stone-dark);
}

.on-paper .label {
  color: var(--stone);
}

.caption {
  font-size: var(--fs-micro);
  line-height: 1.55;
  color: var(--stone-dark);
  max-width: 46ch;
}

.on-paper .caption {
  color: var(--stone);
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* 4. Layout primitives ----------------------------------------------------- */
.wrap {
  width: min(100% - (var(--gutter) * 2), 82.5rem);
  margin-inline: auto;
}

.wrap--narrow {
  width: min(100% - (var(--gutter) * 2), 62rem);
  margin-inline: auto;
}

.section {
  position: relative;
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: clamp(3rem, 6vw, 5.5rem);
}

.section--flush-top {
  padding-top: 0;
}

.stack {
  display: grid;
  gap: var(--stack-md);
}

.stack--sm {
  gap: var(--stack-sm);
}

.stack--lg {
  gap: var(--stack-lg);
}

.flow > * + * {
  margin-top: var(--flow-gap, 1rem);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.split {
  display: grid;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.rule {
  height: 1px;
  border: 0;
  background: var(--line-dark);
  width: 100%;
}

.on-paper .rule {
  background: var(--line-light);
}

.measure {
  max-width: var(--measure);
}

.measure--tight {
  max-width: 44ch;
}

/* 5. Surfaces -------------------------------------------------------------- */
.on-paper {
  background: var(--paper);
  color: var(--ink);
}

.on-cream {
  background: var(--cream);
  color: var(--ink);
}

.surface-forest {
  background: var(--forest);
}

.surface-ink {
  background: var(--ink);
}

/* Fine engineering grid used behind hero and feature panels. */
.grid-lines::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(to right, var(--line-dark) 1px, transparent 1px);
  background-size: calc(100% / 6) 100%;
  opacity: 0.5;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 78%);
}

.on-paper.grid-lines::before {
  background-image: linear-gradient(to right, var(--line-light) 1px, transparent 1px);
}

/* Subtle film grain keeps large dark fields from looking flat. */
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
}

/* Warm light wash that reads as water surface, not a decorative gradient blob. */
.wash {
  position: relative;
  isolation: isolate;
}

.wash::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 80% at 78% 8%, rgba(155, 196, 122, 0.16), transparent 58%),
    radial-gradient(90% 70% at 12% 92%, rgba(159, 195, 188, 0.11), transparent 60%),
    linear-gradient(180deg, var(--forest) 0%, var(--ink) 62%);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  transform: translateY(-160%);
  background: var(--paper);
  color: var(--ink);
  padding: 0.7rem 1.1rem;
  border-radius: var(--r-pill);
  font-size: var(--fs-small);
  font-weight: 500;
  transition: transform var(--dur-fast) var(--ease-out);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* Reading progress for long editorial pages. */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 90;
  background: var(--leaf);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
  opacity: 0.85;
}
