/* ---------------------------------------------------------------
   HERMES OS — SHARED DESIGN TOKENS ("Line", 2026-10-13)

   One source of truth for landing, dashboard, login, signup, 404.
   Pages link this BEFORE their own stylesheet and must not redefine
   these values locally; add a token here instead.

   Direction (docs/DESIGN_DIRECTION.md): the company as a transit network.
   One neutral grotesk (Geist) for everything and Geist Mono for paths and
   ids, on a calm zinc ground (2026-10-13 v2: Archivo's wide signage read as
   a poster, not a tool). Colour is owned: eight
   line colours belong to employees, and three state colours mean exactly
   one thing each (amber = waits on you, red = failed, green = delivered).
   --------------------------------------------------------------- */

/* The faces are linked by each page's <head> (Geist with its weight axis,
   Geist Mono for machine data). An @import here loaded them a
   second time and held the stylesheet until the font CSS arrived. */

:root {
  color-scheme: dark;

  /* Surfaces, darkest to lightest. Night: the rail is black, the sheet is
     graphite, objects on it one step up. */
  --bg-dark:     #09090B;
  --bg-panel:    #0E0E11;
  --bg-raised:   #1A1A1E;
  --bg-card:     #121215;
  --bg-hover:    rgba(255, 255, 255, 0.04);
  --glass:       #121215;
  --glass-blur:  none;

  /* Lines */
  --border:        rgba(255, 255, 255, 0.085);
  --border-soft:   rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.17);

  /* Translucent layers over any surface */
  --surface-1: rgba(255, 255, 255, 0.025);
  --surface-2: rgba(255, 255, 255, 0.05);
  --surface-3: rgba(255, 255, 255, 0.08);
  /* An opaque raised surface. Five dashboard surfaces (the DAG planner and
     graph modals, the new-room modal, DAG project cards) asked for
     var(--surface), which did not exist, so the browser drew them with NO
     background and the page behind showed through the dialog. */
  --surface: var(--bg-raised);
  --surface-4: rgba(255, 255, 255, 0.12);
  /* Named layers, so a theme swaps one value instead of fifty literals:
     a recessed well, a bar or panel, an opaque sheet, a modal scrim.
     The names say "glass" for history; they are opaque now. */
  --well:        rgba(0, 0, 0, 0.28);
  --glass-panel: #0E0E11;
  --glass-sheet: #16161A;
  --scrim:       rgba(0, 0, 0, 0.62);

  /* Ink */
  --text-main:   #EDEDEF;
  --text-muted:  #A1A1AA;
  --text-subtle: #8B8B95;              /* 5.2:1 on --bg-card */
  --ink:        var(--text-main);
  --ink-muted:  var(--text-muted);
  --ink-subtle: var(--text-subtle);

  /* The primary action: paper on night, ink on paper */
  --paper:       #EDEDEF;
  --paper-ink:   #09090B;
  --paper-hover: #FFFFFF;

  /* Signal: the Hermes line. Focus, selection, the current place. */
  --accent:      #7B9BFF;
  --accent-ink:  #FFFFFF;
  --accent-dim:  rgba(123, 155, 255, 0.12);
  --accent-line: rgba(123, 155, 255, 0.45);
  --accent-glow: transparent;           /* no halos: depth has an offset */
  --gold:        #FFC21A;               /* waits on you */

  /* Ambient light was retired with the glass; kept as names, transparent. */
  --aurora-a: transparent;
  --aurora-b: transparent;
  --aurora-c: transparent;

  /* State */
  --ok:    #34C774;
  --warn:  #FF9F2E;
  --alert: #FF5D4F;
  --info:  #7B9BFF;
  --gold-dim:   rgba(255, 194, 26, 0.10);
  --gold-line:  rgba(255, 194, 26, 0.42);
  --alert-dim:  rgba(255, 93, 79, 0.10);
  --alert-line: rgba(255, 93, 79, 0.42);
  --ok-dim:     rgba(52, 199, 116, 0.10);
  --warn-dim:   rgba(255, 159, 46, 0.10);
  --info-dim:   rgba(110, 147, 255, 0.12);

  /* Lines: the eight colours employees own (app.js uiLine()). Each carries
     white initials at 600 weight. */
  --line-1: #5E8C14;   /* olive (red would read as "failed") */
  --line-2: #F26A1B;   /* orange */
  --line-3: #9A5B23;   /* brown (yellow would read as "waits on you") */
  --line-4: #12A150;   /* green */
  --line-5: #0A97A8;   /* teal */
  --line-6: #2F5BEA;   /* blue */
  --line-7: #7C4DEB;   /* violet */
  --line-8: #D6337F;   /* magenta */

  /* Type */
  --font-display: 'Geist', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --font-ui: 'Geist', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Segoe UI', sans-serif;
  --font-body: var(--font-ui);
  --font-mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 20px;
  --text-2xl: 28px;
  --text-3xl: 44px;
  --text-hero: clamp(48px, 8.4vw, 128px);
  --text-metric: 30px;               /* every KPI numeral, one size, condensed */

  /* TYPE SCALE (dashboard). One family, three widths:
       page title      600 / 34-44px, wdth 112  .view-title
       metric          650 / 30px, wdth 75, tabular  .stat-value
       card/section    600 / 15px                .card-title .panel-title
       body            400 / 14px
       secondary       400-500 / 13px            list rows, descriptions
       label/meta      500 / 12px                .card-meta .field-label
       machine data    Geist Mono 12px           ids, paths only
     Nothing smaller than 12px. */

  --tracking-tight: -0.03em;
  --tracking-label: 0.06em;

  /* Space (4px grid) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

  /* Shape: signage corners, small and even. Circles are for bullets. */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* Depth: offset and a soft blur, never a halo. */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -8px rgba(0, 0, 0, 0.6);
  --shadow-3: 0 2px 8px rgba(0, 0, 0, 0.45), 0 24px 64px -16px rgba(0, 0, 0, 0.8);
  --ring: 0 0 0 2px var(--bg-dark), 0 0 0 4px var(--accent);

  /* Depth (2026-10-18). Elevation is still an offset, not a halo: three
     steps, each one further from the sheet. `--scene` is the product's one
     perspective, used only where something is genuinely 3D (the cortex
     core); `--core-glow` is the one accent allowed to emit light. Every
     other surface keeps the "no glow" rule the design notes state. */
  --elev-1: 0 1px 0 rgba(255, 255, 255, 0.03), 0 10px 24px -18px rgba(0, 0, 0, 0.9);
  --elev-2: 0 1px 0 rgba(255, 255, 255, 0.04), 0 22px 44px -26px rgba(0, 0, 0, 0.95);
  --elev-3: 0 1px 0 rgba(255, 255, 255, 0.05), 0 40px 80px -40px rgba(0, 0, 0, 1);
  --scene: 1100px;
  --core-glow: rgba(123, 155, 255, 0.38);

  /* Motion */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-1: 140ms;
  --dur-2: 220ms;
  --dur-3: 360ms;
  --dur-4: 640ms;
}

/* Day: map white on a cool grey base. Set by /static/theme.js as
   <html data-theme="light">; beats every page's own :root because the
   attribute makes it more specific. Contrast on white: --text-subtle 5.5:1,
   --accent 6.1:1; every text token >= 4.5:1 on the page base. */
:root[data-theme="light"] {
  color-scheme: light;

  --bg-dark:   #F7F7F8;
  --bg-panel:  #FAFAFA;
  --bg-raised: #FFFFFF;
  --bg-card:   #FFFFFF;
  --surface:   #FFFFFF;
  --bg-hover:  rgba(10, 11, 13, 0.04);
  --glass:     #FFFFFF;

  --surface-1: rgba(10, 11, 13, 0.025);
  --surface-2: rgba(10, 11, 13, 0.045);
  --surface-3: rgba(10, 11, 13, 0.07);
  --surface-4: rgba(10, 11, 13, 0.1);
  --well:        rgba(10, 11, 13, 0.035);
  --scrim:       rgba(10, 11, 13, 0.36);
  --glass-panel: #FFFFFF;
  --glass-sheet: #FFFFFF;

  --border:        rgba(9, 9, 11, 0.09);
  --border-soft:   rgba(9, 9, 11, 0.06);
  --border-strong: rgba(9, 9, 11, 0.18);
  --hairline-top:  none;

  --text-main:   #09090B;
  --text-muted:  #52525B;
  --text-subtle: #6B6B74;

  --paper:       #09090B;
  --paper-ink:   #FFFFFF;
  --paper-hover: #27272A;

  --accent:      #2457E6;
  --accent-ink:  #FFFFFF;
  --accent-dim:  rgba(36, 87, 230, 0.08);
  --accent-line: rgba(36, 87, 230, 0.4);
  --accent-glow: transparent;
  --core-glow:   rgba(36, 87, 230, 0.30);
  --gold:        #8F5F00;
  --gold-dim:    rgba(232, 166, 0, 0.12);
  --gold-line:   rgba(178, 120, 0, 0.45);

  --ok:    #0B7F3E;
  --warn:  #B25A00;
  --alert: #C8281B;
  --info:  #2457E6;
  --ok-dim:     rgba(11, 127, 62, 0.08);
  --warn-dim:   rgba(178, 90, 0, 0.09);
  --alert-dim:  rgba(200, 40, 27, 0.07);
  --alert-line: rgba(200, 40, 27, 0.36);
  --info-dim:   rgba(33, 72, 214, 0.08);

  --shadow-1: 0 1px 2px rgba(9, 9, 11, 0.05);
  --shadow-2: 0 1px 2px rgba(9, 9, 11, 0.05), 0 8px 24px -10px rgba(9, 9, 11, 0.14);
  --shadow-3: 0 2px 6px rgba(9, 9, 11, 0.06), 0 24px 56px -18px rgba(9, 9, 11, 0.24);
  --ring: 0 0 0 2px #FFFFFF, 0 0 0 4px var(--accent);
}

/* Dashboard neutral palette. The office uses these names directly so the
   signed-in product stays monochrome while status dots remain semantic. */
:root {
  --dashboard-bg: #0e0e0e;
  --dashboard-surface: #161616;
  --dashboard-surface-raised: #1d1d1d;
  --dashboard-border: rgba(255,255,255,.08);
  --dashboard-text: #ececec;
  --dashboard-muted: #8a8a8a;
}
:root[data-theme="light"] {
  --dashboard-bg: #fdfdfd;
  --dashboard-surface: #ffffff;
  --dashboard-surface-raised: #f4f4f4;
  --dashboard-border: rgba(0,0,0,.08);
  --dashboard-text: #111111;
  --dashboard-muted: #6b6b6b;
}

/* Ambient background: a slow aurora + film grain. Put `.ambient` on a
   fixed, full-viewport element behind content (pointer-events: none). */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--bg-dark);
}
.ambient::before { display: none; }
.ambient::after { display: none; }


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

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------
   PUBLIC PAGES: "Platform" (2026-11-20). The landing, /compare, sign-in
   and sign-up stop wearing the generic AI-SaaS coat (blue neon, purple
   light pools, frosted cards). They take the product's own world, the
   transit line, and dress it as a station platform at night: warm
   off-black ground, paper-coloured ink, hairline rules, mono platform
   numbers, and one hi-vis signal colour for the thing to press.
   --pub-signal is a FILL (dark ink on it, 15.6:1). --pub-signal-ink is
   the same signal as TEXT on the ground (>= 4.5:1 in both themes).
   --------------------------------------------------------------- */
:root {
  /* 23 Nov 2026: the landing's own palette (owner: "the signup page still
     looks different, make it match"). Near-black ground, white ink, a white
     button with black text, blue for links and lines, as on the landing. */
  --pub-ground:      #09090B;
  --pub-sheet:       #121215;
  --pub-sheet-2:     #18181B;
  --pub-rule:        rgba(255, 255, 255, 0.08);
  --pub-rule-strong: rgba(255, 255, 255, 0.17);
  --pub-ink:         #EDEDEF;
  --pub-ink-muted:   #A1A1AA;   /* 7.6:1 on the ground */
  --pub-ink-subtle:  #8B8B95;   /* 5.6:1 on the ground */
  --pub-signal:      #EDEDEF;
  --pub-signal-ink:  #7B9BFF;   /* 7.3:1 on the ground */
  --pub-on-signal:   #09090B;
  --pub-signal-dim:  rgba(123, 155, 255, 0.12);
  --pub-signal-line: rgba(123, 155, 255, 0.45);
  --pub-shadow:      0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 40px 80px -40px rgba(0, 0, 0, 0.75);
  --pub-grid:        rgba(255, 255, 255, 0.04);
}
:root[data-theme="light"] {
  --pub-ground:      #F7F7F8;
  --pub-sheet:       #FFFFFF;
  --pub-sheet-2:     #EFEFF1;
  --pub-rule:        rgba(9, 9, 11, 0.09);
  --pub-rule-strong: rgba(9, 9, 11, 0.18);
  --pub-ink:         #09090B;
  --pub-ink-muted:   #52525B;   /* 7.4:1 on the ground */
  --pub-ink-subtle:  #6B6B74;   /* 5.0:1 on the ground */
  --pub-signal:      #09090B;
  --pub-signal-ink:  #2457E6;   /* 5.4:1 on the ground */
  --pub-on-signal:   #FFFFFF;
  --pub-signal-dim:  rgba(36, 87, 230, 0.08);
  --pub-signal-line: rgba(36, 87, 230, 0.40);
  --pub-shadow:      0 1px 2px rgba(9, 9, 11, 0.06), 0 30px 60px -36px rgba(9, 9, 11, 0.25);
  --pub-grid:        rgba(9, 9, 11, 0.05);
}
