/* Holobiome mockups — design tokens.
   Source: HOLOBIOME_PORTAL_REVAMP.md Appendix E1/E2 and annex_visual.md §2 (Daylight Paper / Deep Constellation).
   Theme and motion: <html data-theme="light|dark" data-motion="on|off"> (with data-theme-pref / data-motion-pref), set
   before the first paint by assets/js/theme-boot.js from this browser's choice (System follows the device).
   Components use these semantic names only; no hex literal belongs in ui.css or a screen file.
   Fixes vs. the style tile: the forced theme always wins over the OS preference (the tile's dark block was
   also bound to a class and the OS query), and nothing here sets a width that can overflow 320–390 px. */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/Inter-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/Inter-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600 700; font-display: swap; src: url('../fonts/Inter-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../fonts/Fraunces-var.woff2') format('woff2'); }

:root,
[data-theme="light"] {
  color-scheme: light;

  /* Surfaces — opaque, never glass over motion */
  --surface-0: #FAF8F4;
  --surface-1: #FFFFFF;
  --surface-2: #F1EFE9;
  --surface-sunk: #ECE9E1;            /* deeper well behind inset charts; decorative only */
  --surface-bar: rgba(250, 248, 244, 0.92);

  /* Text — verified >= 5.0:1 on all three surfaces */
  --text-1: #14192B;
  --text-2: #4A526E;
  --text-3: #5D6582;

  /* Lines */
  --border-subtle: #E2DFD7;
  --border-strong: #767E99;           /* essential control and graph boundaries (>= 3.5:1) */

  /* Brand and interaction */
  --brand: #2B3A70;
  --on-brand: #FFFFFF;
  --interactive: #2346B8;
  --brand-soft: rgba(43, 58, 112, 0.08);
  --brand-softer: rgba(43, 58, 112, 0.05);
  --focus: #2346B8;

  /* Data roles — colour identifies series, never a verdict */
  --you: #D4511E;                     /* graphical mark only; never small white type on it */
  --you-ink: #AD3B0E;                 /* text naming the current sample */
  --you-halo: #FFFFFF;
  --earlier: #687089;
  --cohort: #485685;
  --world: #767E99;                   /* muted catalogue dots (labelled in text); >= 3:1 on the disc at the map's 0.88 opacity */
  --band-80: rgba(43, 58, 112, 0.10);
  --band-50: rgba(43, 58, 112, 0.20);
  --grid: #E7E4DC;

  /* Taxonomy slots (paired with circle / square / diamond / ring / cross) */
  --tax-1: #3B52B8;
  --tax-2: #0E7C73;
  --tax-3: #946800;
  --tax-4: #8E3B9C;
  --tax-5: #687089;

  /* Process status — operational states only, never biology */
  --info-bg: #EFF6FF;     --info-ink: #1E429F;     --info-border: #BFDBFE;
  --caution-bg: #FEFCE8;  --caution-ink: #854D0E;  --caution-border: #F3D97A;
  --error-bg: #FEF2F2;    --error-ink: #991B1B;    --error-border: #FECACA;

  /* Demonstration label and presenter chrome (presenter is deliberately inverse) */
  --demo-bg: #EEF0F8;     --demo-ink: #2B3A70;     --demo-border: #C9CFE6;
  --pz-bg: #1C2133;       --pz-ink: #EEF1FC;       --pz-ink-2: #B2BBD9;    --pz-line: #3A4363;
  --pz-btn: #2A3150;      --pz-accent: #F3D97A;

  /* Logo */
  --logo-wordmark: #1E2952;
  --logo-pill-start: #4F63A8;
  --logo-pill-end: #232E5C;

  /* Elevation */
  --shadow-1: 0 1px 2px rgba(20, 25, 43, 0.04), 0 2px 8px rgba(20, 25, 43, 0.04);
  --shadow-2: 0 4px 16px rgba(20, 25, 43, 0.08), 0 12px 32px rgba(20, 25, 43, 0.06);
  --shadow-sheet: 0 -8px 32px rgba(20, 25, 43, 0.12), 0 24px 56px rgba(20, 25, 43, 0.18);
  --shadow-raise: 0 2px 6px rgba(20, 25, 43, 0.06), 0 14px 36px rgba(20, 25, 43, 0.14);   /* lifted: under the pointer, or in flight before it lands */
  --scrim: rgba(20, 25, 43, 0.38);
}

[data-theme="dark"] {
  color-scheme: dark;

  --surface-0: #0A0E1C;
  --surface-1: #12182E;
  --surface-2: #1A2240;
  --surface-sunk: #0E1326;
  --surface-bar: rgba(10, 14, 28, 0.92);

  --text-1: #EEF1FC;
  --text-2: #B2BBD9;
  --text-3: #8E98BA;

  --border-subtle: #263056;
  --border-strong: #6E789C;

  --brand: #8CAAFF;
  --on-brand: #0A0E1C;
  --interactive: #9BB5FF;
  --brand-soft: rgba(140, 170, 255, 0.14);
  --brand-softer: rgba(140, 170, 255, 0.08);
  --focus: #9BB5FF;

  --you: #F47B48;
  --you-ink: #FF9B70;
  --you-halo: #0A0E1C;
  --earlier: #8E98BA;
  --cohort: #6FD4F2;
  --world: #6E789C;
  --band-80: rgba(140, 170, 255, 0.12);
  --band-50: rgba(140, 170, 255, 0.24);
  --grid: #1E2747;

  --tax-1: #7389F5;
  --tax-2: #2BB5A8;
  --tax-3: #D49B27;
  --tax-4: #C874D6;
  --tax-5: #8E98BA;

  /* Process states sit back in the night palette: never the most saturated surface on screen. */
  --info-bg: #151D3A;     --info-ink: #A9C4FF;     --info-border: #2C3D7A;
  --caution-bg: #241D12;  --caution-ink: #F5D27A;  --caution-border: #854D0E;
  --error-bg: #450A0A;    --error-ink: #FCA5A5;    --error-border: #991B1B;

  --demo-bg: #1A2448;     --demo-ink: #C9D6FF;     --demo-border: #33407A;
  --pz-bg: #E6E8F0;       --pz-ink: #14192B;       --pz-ink-2: #4A526E;    --pz-line: #C3C8D8;
  --pz-btn: #D5D9E6;      --pz-accent: #854D0E;

  --logo-wordmark: #EEF1FC;
  --logo-pill-start: #6B85E8;
  --logo-pill-end: #2B3A70;

  --shadow-1: 0 0 0 1px rgba(140, 170, 255, 0.06);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(140, 170, 255, 0.12);
  --shadow-sheet: 0 -8px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(140, 170, 255, 0.16);
  --shadow-raise: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(140, 170, 255, 0.18);
  --scrim: rgba(2, 4, 12, 0.66);
}

:root {
  /* Type families: self-hosted OFL files in shared/fonts, system fallbacks */
  --font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'DejaVu Sans Mono', monospace;

  /* Type scale (Appendix E2) — desktop values; phone overrides below */
  --t-display: 2.25rem;   --t-display-lh: 2.625rem;
  --t-h1: 1.5rem;         --t-h1-lh: 1.9375rem;
  --t-h2: 1.125rem;       --t-h2-lh: 1.5rem;
  --t-num: 2.25rem;       --t-num-lh: 2.5rem;
  --t-body: 1rem;         --t-body-lh: 1.5rem;
  --t-small: 0.875rem;    --t-small-lh: 1.25rem;
  --t-caption: 0.75rem;   --t-caption-lh: 1.0625rem;

  /* Space (4, 8, 12, 16, 20, 24, 32, 40, 48) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;

  /* Radii (6, 10, 16, 24, pill) */
  --r-xs: 6px; --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-pill: 999px;

  /* Layout */
  --page-max: 1120px;
  --read-max: 680px;
  --header-h: 64px;
  --nav-h: 48px;
  --tabbar-h: 56px;
  --tap: 44px;
  --row-h: 52px;
  --gutter: var(--s-6);
  --sheet-side-w: 420px;
  --sheet-center-w: 680px;

  /* Motion: one vocabulary for every state change (design_review/round2/beta/MOTION_AUDIT.md). Durations: fast for small
     state (a hover, a chevron, a marker's fade), base for popovers, exits, tab content and a reading marker's glide, slow
     for sheets, expands and pages, move for a view travelling to another place (the map's camera, with in-out), draw for
     a chart drawing itself; stagger between items entering together. Curves: out
     to arrive, in to leave, in-out to move between two places, pop for a small mark appearing (a slight overshoot).
     HB.motion (theme-boot.js) reads them for script. Motion Off zeroes every duration and the stagger (below). */
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 280ms;
  --dur-move: 480ms;
  --stagger: 40ms;
  /* Data drawing itself (a chart's line, area, points, bands and columns, the map's dots popping in, the range bars, the
     People network unrolling) runs 30% slower than the UI moves above (owner, 2026-10-28), so a screen at a low frame
     rate (15 fps) still shows the motion: draw 900 → 1170 ms, and the data's own pop, fill and stagger are the UI's base
     (200), slow (280) and stagger (40) × 1.3. Sheets, tabs, toasts and pages keep the UI values. */
  --dur-draw: 1170ms;
  --dur-data-pop: 260ms;
  --dur-data-fill: 364ms;
  --stagger-data: 52ms;
  --dur-unroll: 1560ms;   /* one edge of the People network unrolling (a slow 1200 ms draw × 1.3) */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (max-width: 767px) {
  :root {
    --t-display: 1.75rem;  --t-display-lh: 2.125rem;
    --t-h1: 1.375rem;      --t-h1-lh: 1.75rem;
    --t-h2: 1.0625rem;     --t-h2-lh: 1.4375rem;
    --t-num: 1.875rem;     --t-num-lh: 2.125rem;
    --header-h: 56px;
    --gutter: var(--s-4);
  }
}

:root[data-motion="off"] { --dur-fast: 0ms; --dur-base: 0ms; --dur-slow: 0ms; --dur-move: 0ms; --dur-draw: 0ms; --stagger: 0ms; --dur-data-pop: 0ms; --dur-data-fill: 0ms; --stagger-data: 0ms; --dur-unroll: 0ms; }

/* Print always uses Daylight Paper and never changes the screen preference. */
@media print {
  :root, [data-theme="dark"] {
    color-scheme: light;
    --surface-0: #FFFFFF; --surface-1: #FFFFFF; --surface-2: #F4F2EC; --surface-sunk: #F4F2EC;
    --text-1: #14192B; --text-2: #3D445C; --text-3: #4A526E;
    --border-subtle: #D9D5CB; --border-strong: #5D6582;
    --brand: #2B3A70; --on-brand: #FFFFFF; --interactive: #2346B8;
    --you: #D4511E; --you-ink: #AD3B0E; --you-halo: #FFFFFF; --earlier: #687089; --cohort: #485685; --world: #767E99;
    --band-80: rgba(43, 58, 112, 0.10); --band-50: rgba(43, 58, 112, 0.20); --grid: #E7E4DC;
    --tax-1: #3B52B8; --tax-2: #0E7C73; --tax-3: #946800; --tax-4: #8E3B9C; --tax-5: #687089;
    --info-bg: #EFF6FF; --info-ink: #1E429F; --info-border: #BFDBFE;
    --caution-bg: #FEFCE8; --caution-ink: #854D0E; --caution-border: #F3D97A;
    --error-bg: #FEF2F2; --error-ink: #991B1B; --error-border: #FECACA;
    --demo-bg: #EEF0F8; --demo-ink: #2B3A70; --demo-border: #C9CFE6;
    --shadow-1: none; --shadow-2: none; --shadow-raise: none;
    --logo-wordmark: #1E2952;
  }
}
