/*
 * design-tokens.css
 *
 * Atlas console token sheet, GeoLiquefy Design Harness v1 (W5d restyle pass).
 *
 * THIS FILE IS A COPY, NOT THE SOURCE OF TRUTH. The harness's canonical
 * token file lives at geoliquefy-design/tokens.css (sibling repo); that file
 * remains authoritative for the marketing site AND for any future change to
 * these values. This copy exists only because Atlas is a separate deployed
 * app (its own FastAPI static mount) that cannot reach across repos at
 * runtime. If you need to change a token value, change it in
 * geoliquefy-design/tokens.css first, then re-apply the same change here;
 * do not let this file drift into a second, competing definition.
 *
 * What differs from tokens.css, and why (see console-mapping.md, the
 * applier checklist this file executes):
 *   1. Atlas has no light mode today (console-mapping.md intro), so this
 *      file ships ONLY the dark-mode values as a plain :root block, instead
 *      of gating them behind `@media (prefers-color-scheme: dark)`. The
 *      light-mode :root block, the media query, and the [data-theme]
 *      overrides from tokens.css are intentionally NOT reproduced here.
 *   2. @font-face src paths point at /static/fonts/ (this app's real mount,
 *      see atlas/web/app.py) instead of tokens.css's /fonts/ placeholder.
 *   3. Console-specific radius override (console-mapping.md Section 5):
 *      Atlas's existing 4/6/8px radius scale is denser than the harness
 *      marketing default and is deliberately kept, scoped to
 *      `body.atlas-console`.
 *   4. Two new console-scoped tokens not in tokens.css at all:
 *      --surface-1-map (coverage.html choropleth land fill, from Atlas's
 *      old --land) and --mixed-600 / --mixed-soft (gallery.html's third
 *      outcome category, "wildcard"/mixed_evidence, from Atlas's old
 *      --wild / --wild-bg). See console-mapping.md Section 4.
 *   5. --scrim, consolidating the two near-duplicate modal backdrop rgba
 *      literals found across runs.html/gallery.html (console-mapping.md
 *      Section 7).
 *   6. Metric-matched fallback @font-face blocks are omitted here (Atlas
 *      never shipped a font-family before this pass, so there is no
 *      previously-visible layout to preserve against FOUT the way the
 *      marketing site's pre-harness Google Fonts swap needed); Atlas's own
 *      15px base / 1.55 line-height are left as page-level overrides, not
 *      touched by this token file.
 */

/* ================================================================
   FONT LOADING
   Self-hosted per FONTS-LICENSE.txt in /static/fonts/. Atlas's own --font
   token already named "Inter" before this pass (console-mapping.md Section
   2/6) but never shipped an @font-face, so it silently fell back to the
   system stack; this block is what actually ships it.
   ================================================================ */

@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/inter-var.woff2') format('woff2-variations'),
       url('/static/fonts/inter-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url('/static/fonts/dm-sans-300.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url('/static/fonts/dm-sans-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url('/static/fonts/dm-sans-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url('/static/fonts/dm-sans-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ================================================================
   DARK MODE TOKENS (Atlas's only mode)
   Seeded from Atlas's own production values, console-mapping.md Section 2.
   Old Atlas token name noted per row so a reviewer can trace each swap.
   ================================================================ */

:root {
  /* ---- Typography: families ---- */
  --font-body: 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Helvetica, Arial, sans-serif;
  --font-heading: 'DM Sans', 'DM Sans Fallback', -apple-system, BlinkMacSystemFont,
    sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace; /* Atlas's own
    chain, unchanged: JetBrains Mono is already its second choice and is the exact
    revisit candidate flagged in DESIGN.md Section 10 for dossier hash/code blocks */

  /* ---- Typography: weights ---- */
  --font-light: 300;
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* ---- Typography: fluid type scale ---- */
  --text-display: clamp(3.5rem, 2.6rem + 4.2vw, 5rem);
  --text-h1: clamp(2.5rem, 2.1rem + 1.8vw, 3rem);
  --text-h2: clamp(1.75rem, 1.55rem + 0.9vw, 2rem);
  --text-h3: clamp(1.25rem, 1.15rem + 0.45vw, 1.5rem);
  --text-h4: clamp(1.125rem, 1.075rem + 0.22vw, 1.25rem);
  --text-body-xl: 1.5rem;
  --text-body-l: 1.3125rem;
  --text-body-m: 1.0625rem;
  --text-body-s: 0.9375rem;
  --text-caption: 0.875rem;
  --text-micro: 0.75rem;

  /* ---- Typography: line heights ---- */
  --leading-tight: 1.1;
  --leading-marketing: 1.47059;
  --leading-dossier: 1.6;

  /* ---- Typography: measure ---- */
  --measure-body: 65ch;
  --measure-dossier: 75ch;

  /* ---- Typography: letter-spacing ---- */
  --tracking-display: -0.03em;
  --tracking-h1: -0.03em;
  --tracking-h2: -0.025em;
  --tracking-h3: -0.02em;
  --tracking-h4: -0.015em;
  --tracking-body: -0.011em;
  --tracking-body-s: -0.008em;
  --tracking-micro: 0.05em;
  --tracking-eyebrow: 0.12em;

  /* ---- Color: surfaces ---- */
  --surface-0: #0B1016;   /* was Atlas --bg */
  --surface-1: #121A24;   /* was Atlas --panel */
  --surface-2: #0D141D;   /* was Atlas's untokenized inset-input literal #0d141d */

  /* ---- Color: on-surface / text ---- */
  --on-surface-0: #E7EDF3;  /* was Atlas --text; 16.19:1 on surface-0 */
  --on-surface-1: #93A3B5;  /* was Atlas --text-dim; 7.41:1 on surface-0 */
  /* CAVEAT (console-mapping.md Section 2, DESIGN.md Section 2.2): fails AA-normal
     (3.50:1 on surface-0, 3.21:1 on surface-1). Inherited from Atlas's shipping
     --text-faint. Scope to label/metadata use only (stepper labels, timestamps,
     mono metadata), always paired with an icon or positional cue; never body copy. */
  --on-surface-2: #5C6B7D;  /* was Atlas --text-faint */

  /* ---- Color: accent ---- */
  --accent-600: #4FB0FF;    /* was Atlas --accent; 8.17:1 on surface-0 */
  --accent-700: #1C4A6B;    /* was Atlas --accent-dim */
  --accent-soft: #16283A;   /* was Atlas --accent-soft, unchanged name and value */
  --accent-ring: #16283A;

  /* ---- Color: status ---- */
  --danger-600: #E0605A;    /* was Atlas --danger; 5.45:1 on surface-0 */
  --danger-fill: #E0605A;
  --danger-soft: #2A1414;   /* was Atlas --danger-bg */

  --success-700: #57C785;   /* was Atlas --ok; 9.01:1 on surface-0 */
  --success-soft: #10241A;  /* was Atlas --ok-bg (added to index.html per
    console-mapping.md's "index.html gap" note, even though index.html had no
    prior consumer) */

  --warn-800: #E0A340;      /* was Atlas --warn; 8.62:1 on surface-0 */
  --warn-soft: #2A2110;     /* was Atlas --warn-bg */

  /* ---- Color: borders ---- */
  --border-subtle: #223042; /* was Atlas --panel-border */
  --border-strong: #2A3A4C; /* was coverage.html's --land-border, consolidated per
    console-mapping.md Section 4: identical to DESIGN.md's dark --border-strong */
  --border-divider: #223042;

  /* ---- Color: console-specific tokens (console-mapping.md Section 4) ---- */
  --surface-1-map: #1B2634;  /* coverage.html choropleth land fill, was --land.
    Sits between surface-0 and surface-1; kept off the shared surface scale
    since it is a map-specific fill, not a generic UI surface. */
  --mixed-600: #B98AE0;      /* gallery.html "wildcard"/mixed_evidence outcome,
    was --wild. Genuine third outcome category, distinct from success/warn/danger;
    approximately 8.9:1 on surface-0, comfortable AA pass. */
  --mixed-soft: #201A2A;     /* was --wild-bg */

  /* ---- Color: modal/tooltip scrim (console-mapping.md Section 7) ---- */
  --scrim: rgba(11, 16, 22, 0.72);  /* consolidates runs.html's rgba(4,8,12,.72) and
    gallery.html's rgba(5,8,12,.72): the same one-hex-digit-off drift pattern the
    critique flagged on the marketing site's two near-blacks. Built from
    --surface-0's RGB (11,16,22) at 72% opacity so it is mathematically tied to
    the canonical dark surface instead of a third hand-picked near-black. */

  /* ---- Spacing ---- */
  --space-1: 8px;
  --space-1-5: 12px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;
  --space-12: 96px;
  --space-15: 120px;

  /* ---- Effects: shadows ---- */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.36);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.48);
  --shadow-accent: 0 4px 12px rgba(79, 176, 255, 0.3);

  /* ---- Effects: radius (marketing-scale default; overridden below for
     the console, console-mapping.md Section 5) ---- */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 980px;

  /* ---- Motion ---- */
  --ease-default: ease;
  --ease-btn: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-entrance: cubic-bezier(0.16, 1, 0.3, 1);

  --duration-instant: 0.1s;
  --duration-fast: 0.2s;
  --duration-base: 0.3s;
  --duration-slow: 0.5s;
  --duration-entrance: 0.8s;
  --duration-shimmer: 2.2s;  /* matches Atlas's own existing .progress-fill.working
    shimmer cadence exactly; not a new value introduced by this pass */

  /* ---- Icons ---- */
  --icon-stroke: 1.5px;
  --icon-size-default: 24px;
  --icon-size-compact: 20px;
}

/* Console-specific radius override (console-mapping.md Section 5): Atlas's
   existing smaller radius scale already suits a data-dense console UI
   (small buttons, tight input fields, compact chips) better than the
   marketing-derived default above. Scoped to body.atlas-console rather
   than changing the shared --radius-* values globally, so a future
   marketing-site consumer of this same file (should one ever exist) is
   unaffected. */
body.atlas-console {
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
}

/* ---- Focus-visible (global, not per-component) ---- */
:focus-visible {
  outline: 2px solid var(--accent-600);
  outline-offset: 2px;
}

.btn:focus-visible,
.nav-btn:focus-visible,
button:focus-visible {
  outline-offset: 3px;
}

/* ---- Selection ---- */
::selection {
  background: var(--accent-ring);
  color: var(--on-surface-0);
}
