/*
  Island Lab tool theme, tokens v0.2. Rules: /design/DESIGN.md.
  Adopt with one tag, absolute path:
    <link rel="stylesheet" href="/design/tokens/islandlab-v0_2.css">
  From islandlab.css (v0.1, frozen for shipped cuts). What changed: the house
  type, option C "instrument readout", picked by Sean on 2026-11-10 from
  design/type-options_v0_2.html. Martian Mono, condensed (wdth 75), for titles,
  numbers, labels, tabs and chips; IBM Plex Sans for body copy. Both are
  self-hosted from /design/fonts/ (SIL Open Font Licence), so pages work offline
  and make no third-party call. Inter, Fraunces and Georgia are retired; every new
  cut links this file (scripts/check_house_type.py).
  Colour values are unchanged from v0.1. The GDR drafting-sheet layer
  (design/islandlab-brand_v0_2.css, --ds-*) is a separate client layer.
  Line language: Sean's geo marks setting of 2026-10-08,
  tol=0.25 water=2 fill=none stroke=2.0 motion=off.
*/

/* House faces. Variable files: Martian Mono wght 100-800, wdth 75-112.5;
   IBM Plex Sans wght 100-700, wdth 85-100, roman and italic. Latin plus
   latin-ext, so macrons and other place-name marks render. */
@font-face { font-family: 'Martian Mono'; font-style: normal; font-weight: 100 800; font-stretch: 75% 112.5%; font-display: swap;
  src: url(/design/fonts/martian-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Martian Mono'; font-style: normal; font-weight: 100 800; font-stretch: 75% 112.5%; font-display: swap;
  src: url(/design/fonts/martian-mono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 100 700; font-stretch: 85% 100%; font-display: swap;
  src: url(/design/fonts/ibm-plex-sans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 100 700; font-stretch: 85% 100%; font-display: swap;
  src: url(/design/fonts/ibm-plex-sans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: italic; font-weight: 100 700; font-stretch: 85% 100%; font-display: swap;
  src: url(/design/fonts/ibm-plex-sans-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: italic; font-weight: 100 700; font-stretch: 85% 100%; font-display: swap;
  src: url(/design/fonts/ibm-plex-sans-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* Grounds, darkest to lightest: page, band, panel, raised card. */
  --abyss: #06151A;
  --mid: #091F24;
  --deep: #0C2A30;
  --surface: #11363E;
  --panel: #04181C;

  /* Roles: signal is the one bold line, model is computed or secondary, life is living things. */
  --signal: #5EE6C8;
  --model: #8AA9C2;
  --life: #E6B567;

  /* Ink, strongest to quietest. */
  --text: #E8F0EE;
  --muted: #86A09F;
  --faint: #5C7676;
  --ink-strong: #FFFFFF;

  /* Rules and borders. */
  --line: rgba(133, 170, 168, 0.16);
  --line-strong: rgba(133, 170, 168, 0.30);

  /* Line language: one signal stroke, quieter secondary strokes in the model colour, no fill. */
  --stroke-signal: 2px;
  --stroke-secondary: 1.2px;
  --stroke-secondary-opacity: 0.7;
  --stroke-secondary-color: var(--model);
  --mark-fill: none;
  --mark-tol: 0.25;

  /* Type families (option C, Sean 2026-11-10), each ending in an OS fallback.
     --display carries titles, numbers and the brand; --mono carries labels, tabs
     and chips; both are Martian Mono, set condensed with --display-stretch.
     --serif is kept only so a v0.1 page that swaps its link tag still resolves;
     new code uses --display. */
  --display: 'Martian Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Martian Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --serif: var(--display);
  --display-stretch: 75%;
  --display-weight: 500;
  --ls-display: -0.03em;

  /* Type scale in px; body 15 matches the landing page. */
  --fs-micro: 11px;
  --fs-small: 13px;
  --fs-body: 15px;
  --fs-lead: 18px;
  --fs-h3: 22px;
  --fs-h2: 30px;
  --fs-h1: 44px;
  --lh-body: 1.5;
  --lh-head: 1.12;
  --ls-kicker: 0.12em;
  --ls-label: 0.08em;

  /* Spacing on a 4 px step, and the page measure. */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --maxw: 1120px;

  /* Radii: panel corners, small controls, pills. */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --r-pill: 999px;

  /* Cards: headline at least 18 px and at least 1.35x the support line (18 / 13 = 1.38). */
  --card-head-size: 18px;
  --card-head-family: var(--display);
  --card-support-size: 13px;
  --card-support-color: var(--muted);
  --card-pad: var(--sp-4);
  --card-bg: var(--surface);
  --card-border: 1px solid var(--line);

  /* Chips: mono pill, provenance tints for the synthetic and pending states. */
  --chip-size: var(--fs-micro);
  --chip-ls: 0.04em;
  --chip-pad: 2px 8px;
  --chip-border: 1px solid var(--line-strong);
  --chip-color: var(--muted);
  --chip-synthetic: var(--life);
  --chip-local: var(--signal);
  --chip-derived: var(--model);

  /* Map basemap: OSM tiles tinted by a filter on .leaflet-tile-pane, night by default. */
  --tile-filter: invert(1) hue-rotate(190deg) saturate(0.35) brightness(0.72) contrast(0.9);

  /* Motion is opt-in: a page sets this to 1 to allow its marks to move. */
  --motion: 0;
}

/* Day theme; "light" is an alias because some pages use that name. */
:root[data-theme="day"],
:root[data-theme="light"] {
  --abyss: #E6EBEA;
  --mid: #DDE4E2;
  --deep: #D4DCDB;
  --surface: #F4F7F6;
  --panel: #E1E8E6;
  --signal: #0E9E83;
  --model: #436680;
  --life: #B07E1E;
  --text: #0E2227;
  --muted: #43615F;
  --faint: #7A918F;
  --ink-strong: #082027;
  --line: rgba(20, 60, 58, 0.14);
  --line-strong: rgba(20, 60, 58, 0.26);
  --tile-filter: saturate(0.4) brightness(1.02);
}

/* House type defaults. :where() keeps specificity at zero, so any rule a page
   writes wins; a page that writes nothing still gets the house faces. */
:where(body) {
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}
:where(h1, h2, h3, .il-display) {
  font-family: var(--display);
  font-stretch: var(--display-stretch);
  font-weight: var(--display-weight);
  letter-spacing: var(--ls-display);
  line-height: var(--lh-head);
}
:where(code, kbd, samp, pre, .il-label) {
  font-family: var(--mono);
  font-stretch: var(--display-stretch);
}

/* The one rule a map page needs from this file. */
.leaflet-tile-pane {
  filter: var(--tile-filter);
}

/* Card and chip shapes, opt-in by class. */
.il-card {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--r-md);
  padding: var(--card-pad);
}
.il-card-head {
  font-family: var(--card-head-family);
  font-stretch: var(--display-stretch);
  letter-spacing: -0.02em;
  font-size: var(--card-head-size);
  font-weight: var(--display-weight);
  line-height: var(--lh-head);
  color: var(--text);
  margin: 0;
}
.il-card-support {
  font-family: var(--sans);
  font-size: var(--card-support-size);
  line-height: var(--lh-body);
  color: var(--card-support-color);
  margin: var(--sp-1) 0 0;
}
.il-kicker {
  font-family: var(--mono);
  font-stretch: var(--display-stretch);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--faint);
}
.il-chip {
  display: inline-block;
  font-family: var(--mono);
  font-stretch: var(--display-stretch);
  font-size: var(--chip-size);
  letter-spacing: var(--chip-ls);
  padding: var(--chip-pad);
  border: var(--chip-border);
  border-radius: var(--r-pill);
  color: var(--chip-color);
}
.il-chip.synthetic { color: var(--chip-synthetic); border-color: var(--chip-synthetic); }
.il-chip.local { color: var(--chip-local); border-color: var(--chip-local); }
.il-chip.derived { color: var(--chip-derived); border-color: var(--chip-derived); }

/* Marks: real geometry, signal line bold, secondary lines quiet, nothing filled. */
.il-mark { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.il-mark .sig { fill: none; stroke: var(--signal); stroke-width: var(--stroke-signal); }
.il-mark .sec {
  fill: none;
  stroke: var(--stroke-secondary-color);
  stroke-width: var(--stroke-secondary);
  opacity: var(--stroke-secondary-opacity);
}

/* Reduced motion always wins over a page's opt-in. */
@media (prefers-reduced-motion: reduce) {
  :root { --motion: 0; }
  .il-mark * { animation: none !important; }
}
