/* ==========================================================================
   GRU — Design Tokens
   Palette locked by the GRU brand manual (USMC Green / Warth Warming / Black).
   Cream is taken from the manual's RGB value (241,239,219), not its printed
   hex "#363f33", which is a typo in the source document.
   ========================================================================== */

:root {
  /* --- Brand core ------------------------------------------------------- */
  --green:        #1F5B33;  /* USMC Green — primary */
  --green-deep:   #143A21;  /* depth / shadow tint */
  --green-dark:   #0E2716;  /* deepest surface */
  --green-live:   #2E9553;  /* derived: interactive + focus only, never large fills */
  --cream:        #F1EFDB;  /* Warth Warming — primary ground */
  --cream-dim:    #E1DEC3;  /* rules, dividers, muted strokes on cream */
  --cream-deep:   #CFCBAB;  /* pressed / tertiary */
  --ink:          #0A0F0C;  /* near-black, greened — richer than pure #000 */
  --black:        #000000;  /* brand black, reserved for pure contrast */

  /* --- Semantic surfaces ------------------------------------------------ */
  --bg:            var(--cream);
  --fg:            var(--ink);
  --fg-muted:      #4A5750;
  --rule:          var(--cream-dim);
  --surface:       #E9E6CE;

  --bg-invert:     var(--green);
  --fg-invert:     var(--cream);
  /* 4.82:1 on #1F5B33 — the previous #A9C0B0 measured 4.17 and failed AA for
     the small body copy and form labels that sit on the green sections. */
  --fg-invert-mut: #B9CDC0;
  --rule-invert:   rgba(241, 239, 219, 0.22);

  --danger:        #B3261E;
  --danger-invert: #FF9A92;
  --ok:            #1F5B33;

  /* --- Type ------------------------------------------------------------- */
  --font-display: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-body:    'Poppins', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* Display scale — fluid, set tight. Used sparingly and very large. */
  --t-mega:  clamp(2.5rem,  6.6vw,  6rem);
  --t-xxl:   clamp(2.15rem, 5.4vw,  4.75rem);
  --t-xl:    clamp(1.9rem,  4.1vw,  3.5rem);
  --t-lg:    clamp(1.5rem,  2.6vw,  2.25rem);

  /* Body scale */
  --t-lead:  clamp(1.0625rem, 1.35vw, 1.375rem);
  --t-base:  1rem;
  --t-sm:    0.9375rem;
  --t-xs:    0.8125rem;

  /* Instrument (mono) scale — labels, indices, data */
  --t-label: 0.6875rem;
  --t-label-lg: 0.8125rem;

  --lh-display: 0.92;
  --lh-tight:   1.12;
  --lh-body:    1.62;

  --tr-mega:  -0.045em;
  --tr-display: -0.03em;
  --tr-label: 0.18em;

  /* --- Space ------------------------------------------------------------ */
  --s-1:  0.25rem;
  --s-2:  0.5rem;
  --s-3:  0.75rem;
  --s-4:  1rem;
  --s-5:  1.5rem;
  --s-6:  2rem;
  --s-7:  3rem;
  --s-8:  4rem;
  --s-9:  6rem;
  --s-10: 8rem;

  --section-y: clamp(5.5rem, 12vh, 11rem);
  --gutter:    clamp(1.25rem, 5vw, 5.5rem);
  --measure:   68ch;
  --maxw:      104rem;

  /* --- Motion ----------------------------------------------------------- */
  --e-out:  cubic-bezier(0.16, 1, 0.3, 1);      /* entrances */
  --e-in:   cubic-bezier(0.7, 0, 0.84, 0);      /* exits */
  --e-soft: cubic-bezier(0.4, 0, 0.2, 1);       /* state changes */

  --d-fast:  160ms;
  --d-base:  260ms;
  --d-slow:  520ms;
  --d-veil:  900ms;

  /* --- Depth ------------------------------------------------------------ */
  --z-content: 10;
  --z-nav:     60;
  --z-overlay: 90;
  --z-loader:  120;

  --radius: 0px;      /* the identity is hard-edged; nothing is rounded */
  --radius-pill: 999px;
}

/* Inverted context: any section painted green or ink flips the semantics so
   components never need to know which ground they are sitting on. */
.on-dark {
  --bg:     var(--green);
  --fg:     var(--cream);
  --fg-muted: var(--fg-invert-mut);
  --rule:   var(--rule-invert);
  --surface: var(--green-deep);
  --danger: var(--danger-invert);
}

.on-ink {
  --bg:     var(--ink);
  --fg:     var(--cream);
  --fg-muted: #8A9990;
  --rule:   rgba(241, 239, 219, 0.16);
  --surface: #131B16;
  --danger: var(--danger-invert);
}
