/* earthseed.technology site stylesheet: tokens/colors, typography, space, css/base, css/components in one file.
   Built from the files in tokens/ and css/; fonts load from Google Fonts in each page head. */
/* ── tokens/colors.css ── */
/* Colour. Three ramps on one perceptual lightness scale, then semantic aliases.
   Contrast ratios in comments are measured against the ground named. */
:root {
  /* — sage ramp — the brand */
  --es-sage-100: #f0fae1;
  --es-sage-200: #e1eecc;
  --es-sage-300: #ccdbb2;
  --es-sage-400: #aebf92;
  --es-sage-500: #8fa073;
  --es-sage-600: #728157;
  --es-sage-700: #56633f;   /* 5.4:1 on beige  · 6.5:1 on white */
  --es-sage-800: #3d472b;   /* 8.3:1 on beige  · 9.8:1 on white — the mark */
  --es-sage-900: #272e1b;

  /* — rust ramp — the finding */
  --es-rust-100: #fff2eb;
  --es-rust-200: #ffe1d0;
  --es-rust-300: #ffc6a5;
  --es-rust-400: #f6a06b;   /* 4.7:1 on ink — the reversed datum */
  --es-rust-500: #d67f48;
  --es-rust-600: #b2622d;   /* 3.8:1 on beige · 4.5:1 on white — graphic use only */
  --es-rust-700: #8c491a;   /* 5.7:1 on beige · 6.8:1 on white — rust that carries words */
  --es-rust-800: #643312;
  --es-rust-900: #402310;

  /* — ink ramp — warm neutrals, never grey */
  --es-ink-100: #f9f4ed;
  --es-ink-200: #eee7db;
  --es-ink-300: #dcd3c4;
  --es-ink-400: #c0b6a5;
  --es-ink-500: #a19786;
  --es-ink-600: #82796a;
  --es-ink-700: #645c50;   /* 5.5:1 on beige · 6.6:1 on white — lightest ink allowed */
  --es-ink-800: #474238;   /* 8.4:1 on beige · 10:1 on white */
  --es-ink-900: #2e2b25;   /* 11.9:1 on beige · 14.1:1 on white */

  /* — grounds — */
  --es-ground-beige: #f5ead8;  /* anything earthseed controls */
  --es-ground-white: #ffffff;  /* anything a government files or photocopies */
  --es-ground-sand: #ebddc5;   /* the only tint: table headers, callouts, pull-quotes */

  /* — semantic aliases: use these in page CSS — */
  --es-brand: var(--es-sage-800);
  --es-brand-deep: var(--es-sage-900);
  --es-finding: var(--es-rust-600);        /* datum, period, highlight — graphic only */
  --es-finding-text: var(--es-rust-700);   /* rust at text size */
  --es-finding-reversed: var(--es-rust-400);

  --es-bg: var(--es-ground-beige);
  --es-surface: var(--es-ground-white);
  --es-tint: var(--es-ground-sand);

  --es-text: var(--es-ink-900);
  --es-text-secondary: var(--es-ink-800);
  --es-text-muted: var(--es-ink-700);
  --es-text-on-dark: var(--es-ground-beige);

  --es-border: var(--es-ink-300);
  --es-rule: var(--es-ink-200);

  --es-link: var(--es-rust-700);          /* 5.7:1 beige · 6.8:1 white */
  --es-link-visited: var(--es-sage-700);  /* 5.4:1 beige · 6.5:1 white */
  --es-link-hover: var(--es-rust-800);    /* 8.7:1 beige */
  --es-link-active: var(--es-rust-900);   /* 12:1 beige */
  --es-focus: var(--es-rust-600);

  /* — chart and map ramps, five steps each — */
  --es-seq-rust-1: var(--es-rust-200);
  --es-seq-rust-2: var(--es-rust-300);
  --es-seq-rust-3: var(--es-rust-400);
  --es-seq-rust-4: var(--es-rust-500);
  --es-seq-rust-5: var(--es-rust-700);

  --es-seq-sage-1: var(--es-sage-200);
  --es-seq-sage-2: var(--es-sage-300);
  --es-seq-sage-3: var(--es-sage-400);
  --es-seq-sage-4: var(--es-sage-500);
  --es-seq-sage-5: var(--es-sage-700);

  /* diverging: under target (rust) → baseline → over target (sage) */
  --es-div-1: var(--es-rust-700);
  --es-div-2: var(--es-rust-400);
  --es-div-3: var(--es-ink-200);
  --es-div-4: var(--es-sage-400);
  --es-div-5: var(--es-sage-700);

  /* categorical, in this order, maximum five series */
  --es-cat-1: var(--es-rust-700);
  --es-cat-2: var(--es-sage-700);
  --es-cat-3: var(--es-rust-400);
  --es-cat-4: var(--es-sage-400);
  --es-cat-5: var(--es-ink-700);
}

/* Reversed context: put this class on any sage or ink panel. */
.es-reversed {
  --es-text: var(--es-ground-beige);
  --es-text-secondary: var(--es-sage-200);
  --es-text-muted: var(--es-sage-300);
  --es-finding: var(--es-rust-400);
  --es-finding-text: var(--es-rust-400);
  --es-surface: var(--es-sage-900);
  --es-rule: rgba(240, 250, 225, 0.22);
  --es-border: rgba(240, 250, 225, 0.3);
  --es-link: var(--es-rust-400);
  --es-link-visited: var(--es-sage-400);
  --es-link-hover: var(--es-rust-300);
  --es-link-active: var(--es-rust-200);
}

/* ── tokens/typography.css ── */
/* Type. Science Gothic names things, heads display and sets every label and caption.
   Archivo takes over at section-head size and sets everything anyone has to read. */
:root {
  --es-font-display: "Science Gothic", "Archivo", system-ui, sans-serif;
  --es-font-body: "Archivo", system-ui, sans-serif;

  /* Science Gothic axis presets — apply with font-variation-settings */
  --es-vf-wordmark: "wght" 700, "wdth" 62;      /* @kind font */
  --es-vf-display: "wght" 500, "wdth" 112;      /* @kind font */
  --es-vf-label: "wght" 700, "wdth" 100;        /* @kind font */
  --es-vf-label-light: "wght" 500, "wdth" 100;  /* @kind font */
  --es-vf-figure: "wght" 600, "wdth" 100;       /* @kind font */

  /* Companion stretch/weight pairs. Google Fonts serves Science Gothic as static
     width instances, so font-variation-settings alone does not move the width axis:
     set both. wdth 62 = extra-condensed, 100 = normal, 112 = semi-expanded. */
  --es-stretch-wordmark: 62.5%;
  --es-stretch-display: 112.5%;
  --es-stretch-label: 100%;

  /* sizes */
  --es-size-display-xl: 52px;
  --es-size-display: 36px;
  --es-size-h3: 20px;
  --es-size-h4: 17px;
  --es-size-body: 16px;
  --es-size-body-sm: 15px;
  --es-size-small: 13px;
  --es-size-caption: 12.5px;
  --es-size-label: 11.5px;   /* the floor — nothing smaller, anywhere */

  /* tracking */
  --es-track-display: -0.025em;
  --es-track-section: -0.005em;
  --es-track-label: 0.16em;
  --es-track-figure: 0.01em;

  /* leading */
  --es-leading-display: 1.04;
  --es-leading-section: 1.14;
  --es-leading-body: 1.6;
  --es-leading-caption: 1.55;

  /* weights (Archivo) */
  --es-weight-body: 400;
  --es-weight-medium: 500;
  --es-weight-strong: 600;
}

/* ── tokens/space.css ── */
/* Spacing, radii, shadow. The mark's band height is the conceptual unit;
   in layout that becomes the 4px scale below. */
:root {
  --es-space-1: 4px;
  --es-space-2: 8px;
  --es-space-3: 12px;
  --es-space-4: 16px;
  --es-space-5: 22px;
  --es-space-6: 30px;
  --es-space-7: 44px;
  --es-space-8: 66px;
  --es-space-9: 96px;

  --es-measure: 68ch;        /* maximum line length for body copy */
  --es-page: 1000px;         /* content column */

  --es-radius-sm: 6px;
  --es-radius-md: 12px;
  --es-radius-lg: 16px;      /* the default: cards, panels, images */
  --es-radius-mark: 0.19em;  /* the mark's corner — 19% of the band height */

  /* Flat by default. One shadow exists, for overlays only. */
  --es-shadow-none: none;
  --es-shadow-overlay: 0 12px 32px rgba(46, 43, 37, 0.18);

  --es-border-width: 1px;
}

/* ── css/base.css ── */
/* Base. Sets the beige ground, the body face and the themed focus ring. */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--es-bg);
  color: var(--es-text);
  font-family: var(--es-font-body);
  font-size: var(--es-size-body);
  font-weight: var(--es-weight-body);
  line-height: var(--es-leading-body);
  -webkit-font-smoothing: antialiased;
}

/* Documents a government files sit on white. */
body.es-on-white { background: var(--es-ground-white); }

h1, h2 {
  font-family: var(--es-font-display);
  font-variation-settings: var(--es-vf-display);
  font-size: var(--es-size-display);
  letter-spacing: var(--es-track-display);
  line-height: var(--es-leading-display);
  margin: 0 0 var(--es-space-3);
}
h1 { font-size: var(--es-size-display-xl); }

h3, h4 {
  font-family: var(--es-font-body);
  font-weight: var(--es-weight-strong);
  font-size: var(--es-size-h3);
  letter-spacing: var(--es-track-section);
  line-height: var(--es-leading-section);
  margin: 0 0 var(--es-space-2);
}
h4 { font-size: var(--es-size-h4); }

p { margin: 0 0 var(--es-space-3); max-width: var(--es-measure); text-wrap: pretty; }
strong, b { font-weight: var(--es-weight-strong); }
small { font-size: var(--es-size-caption); }
img, svg { display: block; max-width: 100%; }
figure { margin: 0; }

/* Links. Order: link, visited, hover, focus, active.
   :where() keeps specificity at zero so component rules
   (.work-card__title a, nav links) still win. */
:where(a[href]) {
  color: var(--es-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 120ms ease, text-decoration-thickness 120ms ease;
}
:where(a[href]):visited { color: var(--es-link-visited); }
:where(a[href]):hover { color: var(--es-link-hover); text-decoration-thickness: 2px; }
:where(a[href]):focus-visible { color: var(--es-link-hover); border-radius: 2px; }
:where(a[href]):active { color: var(--es-link-active); }
@media (prefers-reduced-motion: reduce) { :where(a[href]) { transition: none; } }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--es-focus); outline-offset: 2px; }
::selection { background: var(--es-rust-200); }

table { border-collapse: collapse; width: 100%; }

/* ── css/components.css ── */
/* Components. Every class is prefixed es- so it can drop into any stack. */

/* — the wordmark and lockups —
   Horizontal always carries the rust period. Stacked never does. */
.es-wordmark {
  font-family: var(--es-font-display);
  font-variation-settings: var(--es-vf-wordmark);
  font-size: 31px;
  line-height: 1;
  letter-spacing: 0;
  color: var(--es-brand);
  white-space: nowrap;
}
.es-wordmark .es-dot { color: var(--es-finding); }

.es-lockup {
  display: flex;
  align-items: center;
  gap: 0.34em;                       /* one band height at the mark's size */
  font-size: 58px;                   /* drives the mark; the wordmark sets its own */
}
.es-lockup > .es-mark { width: 1em; height: 1em; flex: none; }
.es-lockup--stacked { flex-direction: column; align-items: flex-start; gap: 0.2em; }
.es-lockup--stacked .es-wordmark { white-space: normal; font-size: 25px; line-height: 1.05; }

/* — kicker / label — the Science Gothic caps style — */
.es-kicker {
  font-family: var(--es-font-display);
  font-variation-settings: var(--es-vf-label);
  font-size: var(--es-size-label);
  letter-spacing: var(--es-track-label);
  text-transform: uppercase;
  color: var(--es-finding-text);
}
.es-kicker--light { font-variation-settings: var(--es-vf-label-light); }
.es-kicker--brand { color: var(--es-brand); }
.es-kicker--muted { color: var(--es-text-muted); }

/* — display headline — */
.es-display {
  font-family: var(--es-font-display);
  font-variation-settings: var(--es-vf-display);
  font-size: var(--es-size-display);
  letter-spacing: var(--es-track-display);
  line-height: var(--es-leading-display);
  color: var(--es-text);
}

/* — big number — the other place Science Gothic earns its keep — */
.es-figure {
  font-family: var(--es-font-display);
  font-variation-settings: var(--es-vf-figure);
  font-size: 64px;
  line-height: 1;
  letter-spacing: var(--es-track-figure);
  font-variant-numeric: tabular-nums;
  color: var(--es-brand);
}
.es-figure--finding { color: var(--es-finding-text); }
.es-stat { display: flex; flex-direction: column; gap: var(--es-space-2); }
.es-stat__label { font-size: var(--es-size-small); color: var(--es-text-muted); max-width: 32ch; }

/* — caption — */
.es-caption {
  font-size: var(--es-size-caption);
  line-height: var(--es-leading-caption);
  color: var(--es-text-muted);
}

/* — card — flat, white, 16px — */
.es-card {
  background: var(--es-surface);
  border-radius: var(--es-radius-lg);
  padding: var(--es-space-6);
}
.es-card--tint { background: var(--es-tint); }
.es-card--outline { background: transparent; border: var(--es-border-width) solid var(--es-border); }
.es-card--brand { background: var(--es-brand); color: var(--es-text-on-dark); }
.es-card--overlay { box-shadow: var(--es-shadow-overlay); }

/* — buttons — square-cornered, matching the mark, not pills — */
.es-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--es-space-2);
  font-family: var(--es-font-body);
  font-size: var(--es-size-body-sm);
  font-weight: var(--es-weight-strong);
  line-height: 1.2;
  padding: 11px 18px;
  border-radius: var(--es-radius-sm);
  border: var(--es-border-width) solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.es-btn--primary { background: var(--es-brand); color: var(--es-ground-beige); }
.es-btn--primary:hover { background: var(--es-sage-900); }
.es-btn--primary:active { background: var(--es-sage-900); }

.es-btn--secondary { background: transparent; color: var(--es-brand); border-color: var(--es-brand); }
.es-btn--secondary:hover { background: var(--es-sage-200); }

.es-btn--finding { background: var(--es-finding-text); color: var(--es-rust-100); }
.es-btn--finding:hover { background: var(--es-rust-800); }

.es-btn--ghost { background: transparent; color: var(--es-finding-text); padding-inline: var(--es-space-2); }
.es-btn--ghost:hover { color: var(--es-rust-800); background: var(--es-rust-100); }

.es-btn[disabled], .es-btn--disabled { opacity: 0.45; pointer-events: none; }

/* — tag — */
.es-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--es-font-body);
  font-size: var(--es-size-caption);
  font-weight: var(--es-weight-medium);
  padding: 3px 10px;
  border-radius: var(--es-radius-sm);
  background: var(--es-sage-200);
  color: var(--es-sage-800);
}
.es-tag--finding { background: var(--es-rust-200); color: var(--es-rust-800); }
.es-tag--neutral { background: var(--es-ink-200); color: var(--es-ink-800); }
.es-tag--outline { background: transparent; border: var(--es-border-width) solid var(--es-border); color: var(--es-text-secondary); }

/* — form fields — */
.es-field { display: flex; flex-direction: column; gap: var(--es-space-2); }
.es-field > label {
  font-size: var(--es-size-small);
  font-weight: var(--es-weight-strong);
  color: var(--es-text-secondary);
}
.es-input {
  font-family: var(--es-font-body);
  font-size: var(--es-size-body-sm);
  color: var(--es-text);
  background: var(--es-surface);
  padding: 11px 13px;
  border: var(--es-border-width) solid var(--es-border);
  border-radius: var(--es-radius-sm);
  width: 100%;
}
.es-input::placeholder { color: var(--es-ink-500); }
.es-input:hover { border-color: var(--es-ink-400); }
.es-input:focus-visible { border-color: var(--es-focus); outline: 2px solid var(--es-focus); outline-offset: 1px; }

/* — table — tabular numerals are not optional — */
.es-table { font-size: var(--es-size-small); }
.es-table th {
  text-align: left;
  font-weight: var(--es-weight-strong);
  color: var(--es-text-secondary);
  background: var(--es-tint);
  padding: 10px 12px;
}
.es-table td {
  padding: 10px 12px;
  border-top: var(--es-border-width) solid var(--es-rule);
  font-variant-numeric: tabular-nums;
}
.es-table td.es-num, .es-table th.es-num { text-align: right; }

/* — map margin credit block — */
.es-credit {
  display: flex;
  gap: var(--es-space-4);
  align-items: flex-start;
  font-size: var(--es-size-label);
  line-height: 1.5;
  color: var(--es-text);
}
.es-credit > .es-mark { width: 34px; flex: none; margin-top: 2px; }
.es-credit__author { font-weight: var(--es-weight-strong); }
.es-credit__meta { color: var(--es-text-muted); }

/* — rules and layout — */
.es-rule { height: 1px; border: 0; background: var(--es-rule); margin: var(--es-space-5) 0; }
.es-page { max-width: var(--es-page); margin: 0 auto; padding: 0 var(--es-space-7); }
.es-stack { display: flex; flex-direction: column; gap: var(--es-space-4); }
.es-row { display: flex; flex-wrap: wrap; gap: var(--es-space-4); }
.es-grid { display: grid; gap: var(--es-space-4); grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }

/* — legend swatches for maps and charts — */
.es-legend { display: flex; flex-wrap: wrap; gap: var(--es-space-4); font-size: var(--es-size-caption); }
.es-legend__item { display: flex; align-items: center; gap: var(--es-space-2); }
.es-legend__swatch { width: 16px; height: 16px; border-radius: 3px; }
.es-ramp { display: flex; height: 30px; border-radius: var(--es-radius-sm); overflow: hidden; border: var(--es-border-width) solid var(--es-border); }
.es-ramp > * { flex: 1; }

