/* ==========================================================================
   GCC Asset Command — 1. Tokens, reset, base type
   --------------------------------------------------------------------------
   Hand-authored. No build step, no Node, no framework: the stylesheet that
   ships is the stylesheet that was written.

   Two knobs drive the whole system:
     html.dark                  -> color scheme
     html[data-density=compact] -> information density
   Everything else is derived from the tokens below.
   ========================================================================== */

/* --- Color: light (default) --------------------------------------------- */
:root {
  color-scheme: light;

  /* Planes & surfaces */
  --plane:        #F4F5F7;   /* the page behind the cards */
  --surface:      #FFFFFF;   /* card / panel */
  --surface-2:    #F7F8FA;   /* inset fill, table stripe, input */
  --surface-3:    #EDEFF3;   /* hover fill, track */
  --line:         #E3E6EB;   /* hairline */
  --line-strong:  #CFD4DC;   /* control border, axis */

  /* Ink */
  --ink:          #10141A;
  --ink-2:        #414A57;
  --ink-muted:    #6B7480;
  --ink-faint:    #97A0AC;
  --ink-on-dark:  #FFFFFF;

  /* Brand — navy chrome, amber mark, blue action */
  --brand:        #1F263A;
  --brand-2:      #2B3450;
  --amber:        #F5B301;
  --accent:       #2A78D6;
  --accent-hover: #256ABF;
  --accent-ink:   #1C5CAB;   /* accent as small text (4.5:1 on surface) */
  --accent-wash:  #E9F1FC;
  --accent-line:  #C7DDF7;

  /* Status — reserved. Never used as a chart series color.
     `-mark` paints graphics, `-ink` paints small text, `-wash` paints fills. */
  --ok:        #0CA30C;  --ok-ink:      #146B1B;  --ok-wash:      #E7F5E9;  --ok-line:      #BFE4C4;
  --warn:      #FAB219;  --warn-ink:    #8A5A00;  --warn-wash:    #FDF3DC;  --warn-line:    #F2DCA6;
  --serious:   #EC835A;  --serious-ink: #96431A;  --serious-wash: #FCEDE5;  --serious-line: #F3CFBC;
  --crit:      #D03B3B;  --crit-ink:    #A32020;  --crit-wash:    #FBEAEA;  --crit-line:    #F0C4C4;
  --neutral:   #6B7480;  --neutral-ink: #4A535F;  --neutral-wash: #EEF0F3;  --neutral-line: #DBDFE5;

  /* Data-viz — the validated categorical order. Slot = identity, never rank.
     Validated on this surface: adjacent CVD ΔE 9.1, normal-vision ΔE 19.6. */
  --series-1: #2A78D6;  /* blue    */
  --series-2: #EB6834;  /* orange  */
  --series-3: #1BAF7A;  /* aqua    */
  --series-4: #EDA100;  /* yellow  */
  --series-5: #E87BA4;  /* magenta */
  --series-6: #008300;  /* green   */
  --series-7: #4A3AA7;  /* violet  */
  --series-8: #E34948;  /* red     */
  --series-other: #A8B0BC;  /* the folded tail — never a 9th hue */

  /* Sequential ramp (one hue, light -> dark) for magnitude */
  --seq-100: #CDE2FB; --seq-200: #9EC5F4; --seq-300: #6DA7EC; --seq-400: #3987E5;
  --seq-500: #256ABF; --seq-600: #184F95; --seq-700: #0D366B;

  /* Chart chrome */
  --grid:     #E7E9ED;
  --axis:     #CFD4DC;
  --de-emph:  #C9CED7;   /* the "everything else" grey in emphasis charts */

  /* Elevation */
  --shadow-1: 0 1px 2px rgba(16, 20, 26, .05), 0 1px 3px rgba(16, 20, 26, .05);
  --shadow-2: 0 2px 4px rgba(16, 20, 26, .05), 0 8px 20px rgba(16, 20, 26, .07);
  --shadow-3: 0 4px 8px rgba(16, 20, 26, .07), 0 18px 44px rgba(16, 20, 26, .14);
  --ring:     0 0 0 3px var(--accent-line);

  /* Sidebar (always dark, both themes — it is chrome, not surface) */
  --nav-bg:        #191F2E;
  --nav-bg-2:      #141926;
  --nav-line:      rgba(255, 255, 255, .07);
  --nav-ink:       #A8B2C4;
  --nav-ink-hover: #E4E8F0;
  --nav-ink-on:    #FFFFFF;
  --nav-active-bg: rgba(255, 255, 255, .09);
}

html.dark {
  color-scheme: dark;

  --plane:       #0D1014;
  --surface:     #161A21;
  --surface-2:   #1C212A;
  --surface-3:   #252B36;
  --line:        #2A313C;
  --line-strong: #3A424F;

  --ink:         #E9EDF2;
  --ink-2:       #B4BDC9;
  --ink-muted:   #8792A1;
  --ink-faint:   #6A7482;

  --brand:       #1F263A;
  --brand-2:     #2B3450;
  --accent:      #3987E5;
  --accent-hover:#5598E7;
  --accent-ink:  #86B6EF;
  --accent-wash: rgba(57, 135, 229, .14);
  --accent-line: rgba(57, 135, 229, .34);

  --ok:        #0CA30C;  --ok-ink:      #4EC45B;  --ok-wash:      rgba(12, 163, 12, .15);  --ok-line:      rgba(12, 163, 12, .35);
  --warn:      #FAB219;  --warn-ink:    #F0BE52;  --warn-wash:    rgba(250, 178, 25, .15); --warn-line:    rgba(250, 178, 25, .34);
  --serious:   #EC835A;  --serious-ink: #EFA184;  --serious-wash: rgba(236, 131, 90, .15); --serious-line: rgba(236, 131, 90, .34);
  --crit:      #D03B3B;  --crit-ink:    #EE7A7A;  --crit-wash:    rgba(208, 59, 59, .17);  --crit-line:    rgba(208, 59, 59, .38);
  --neutral:   #8792A1;  --neutral-ink: #A3ADBA;  --neutral-wash: rgba(135, 146, 161, .15);--neutral-line: rgba(135, 146, 161, .3);

  /* Same eight hues, stepped for the dark surface (validated set, not a flip) */
  --series-1: #3987E5;
  --series-2: #D95926;
  --series-3: #199E70;
  --series-4: #C98500;
  --series-5: #D55181;
  --series-6: #008300;
  --series-7: #9085E9;
  --series-8: #E66767;
  --series-other: #5C6672;

  --seq-100: #0D366B; --seq-200: #184F95; --seq-300: #256ABF; --seq-400: #3987E5;
  --seq-500: #6DA7EC; --seq-600: #9EC5F4; --seq-700: #CDE2FB;

  --grid:    #232933;
  --axis:    #38404C;
  --de-emph: #464F5C;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 2px 4px rgba(0, 0, 0, .3), 0 8px 20px rgba(0, 0, 0, .4);
  --shadow-3: 0 4px 8px rgba(0, 0, 0, .35), 0 18px 44px rgba(0, 0, 0, .55);

  --nav-bg:   #12161F;
  --nav-bg-2: #0D1119;
}

/* --- Type, space, shape, motion ------------------------------------------ */
:root {
  /* One sans for everything, hero figures included. No display face. */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          Helvetica, Arial, "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo,
               Consolas, monospace;

  --fs-3xs:  .6875rem;  /* 11 — micro caps */
  --fs-2xs:  .75rem;    /* 12 — meta, chips */
  --fs-xs:   .8125rem;  /* 13 — table meta */
  --fs-sm:   .875rem;   /* 14 — dense body */
  --fs-md:   .9375rem;  /* 15 — table body */
  --fs-base: 1rem;      /* 16 — body */
  --fs-lg:   1.0625rem; /* 17 — panel title */
  --fs-xl:   1.25rem;   /* 20 — page title */
  --fs-2xl:  1.5rem;    /* 24 */
  --fs-stat: 2rem;      /* 32 — stat-tile value */
  --fs-hero: 3rem;      /* 48 — the one hero figure per view */

  --lh-tight: 1.2;
  --lh-snug:  1.35;
  --lh-body:  1.55;

  --sp-1: .25rem; --sp-2: .5rem;  --sp-3: .75rem; --sp-4: 1rem;
  --sp-5: 1.25rem; --sp-6: 1.5rem; --sp-7: 2rem;  --sp-8: 2.5rem; --sp-9: 3rem;

  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-pill: 999px;

  /* Density-driven (see [data-density]) */
  --card-pad:   1.125rem;
  --gap:        1rem;
  --row-py:     .625rem;
  --control-h:  38px;
  --content-px: 1.5rem;
  --page-fs:    1rem;

  --shell-max: 1680px;
  --nav-w:     264px;
  --nav-w-min: 68px;
  --topbar-h:  60px;

  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
}

html[data-density="compact"] {
  --card-pad:   .875rem;
  --gap:        .75rem;
  --row-py:     .375rem;
  --control-h:  32px;
  --content-px: 1rem;
  --page-fs:    .9375rem;
  --fs-stat:    1.625rem;
  --fs-hero:    2.375rem;
  --fs-xl:      1.125rem;
}

/* --- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: var(--page-fs);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--plane);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
}

img, svg, video, canvas { display: block; max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }

a { color: var(--accent-ink); text-decoration: none; text-underline-offset: .18em; }
a:hover { text-decoration: underline; }

ul, ol { list-style: none; padding: 0; }

table { border-collapse: collapse; border-spacing: 0; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -.011em;
  color: var(--ink);
}
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-base); }

hr { border: 0; border-top: 1px solid var(--line); }

[hidden], [x-cloak] { display: none !important; }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
:focus:not(:focus-visible) { outline: none; }

/* --- Base type helpers ---------------------------------------------------- */
.eyebrow {
  font-size: var(--fs-3xs);
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.muted   { color: var(--ink-muted); }
.faint   { color: var(--ink-faint); }
.strong  { font-weight: 600; color: var(--ink); }
.mono    { font-family: var(--font-mono); font-feature-settings: "zero" 1; }
.nums    { font-variant-numeric: tabular-nums; }   /* columns only */
.t-3xs { font-size: var(--fs-3xs); }
.t-2xs { font-size: var(--fs-2xs); }
.t-xs  { font-size: var(--fs-xs); }
.t-sm  { font-size: var(--fs-sm); }
.t-md  { font-size: var(--fs-md); }
.t-lg  { font-size: var(--fs-lg); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.clamp-2 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.nowrap { white-space: nowrap; }

.ink-ok      { color: var(--ok-ink); }
.ink-warn    { color: var(--warn-ink); }
.ink-serious { color: var(--serious-ink); }
.ink-crit    { color: var(--crit-ink); }
.ink-accent  { color: var(--accent-ink); }

/* --- Layout helpers ------------------------------------------------------- */
.row    { display: flex; align-items: center; gap: var(--sp-2); }
.row-t  { display: flex; align-items: flex-start; gap: var(--sp-2); }
.col    { display: flex; flex-direction: column; gap: var(--sp-2); }
.wrap   { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.center { justify-content: center; }
.end    { justify-content: flex-end; }
.grow   { flex: 1 1 auto; min-width: 0; }
.none   { flex: none; }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); } .gap-4 { gap: var(--sp-4); }
.gap-5 { gap: var(--sp-5); } .gap-6 { gap: var(--sp-6); }
.mt-1 { margin-top: var(--sp-1); } .mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); } .mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); } .mt-6 { margin-top: var(--sp-6); }
.mb-1 { margin-bottom: var(--sp-1); } .mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); } .mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.ml-auto { margin-left: auto; } .mr-auto { margin-right: auto; }
.text-right { text-align: right; } .text-center { text-align: center; }
.w-full { width: 100%; }
.rel { position: relative; }
.hide { display: none !important; }

/* Scrollbars: thin and theme-aware inside panes */
.scroll { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-track { background: transparent; }
.scroll::-webkit-scrollbar-thumb {
  background: var(--line-strong); border-radius: var(--r-pill);
  border: 3px solid transparent; background-clip: content-box;
}
.scroll::-webkit-scrollbar-thumb:hover { background-clip: content-box; background-color: var(--ink-faint); }

/* Icons: sized by font, colored by currentColor */
.i {
  width: 1.0625em; height: 1.0625em; flex: none;
  display: inline-block; vertical-align: -.16em;
  stroke-width: 2;
}
.i-sm { width: .9375em; height: .9375em; }
.i-lg { width: 1.25em;  height: 1.25em; }
.i-xl { width: 1.5em;   height: 1.5em; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

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