/* ============================================================================
   ADAM RUBIN — TRANSFORMATION STUDIO
   Brand system: single source of truth for design tokens.

   This file is consumed by:
     - the site stylesheet  (/assets/css/site.css  @imports it)
     - the living styleguide (/brand/index.html)
     - any workspace / dashboard that opts into the brand

   Nothing in the site should hard-code a hex value, font family, spacing
   step, easing curve, or duration that isn't declared here. Change the brand
   here; the whole site follows.

   Fonts: declared in /assets/css/fonts.css (self-hosted, open-license),
   loaded via <link> ahead of this file. This file is pure variables — no
   url() — so it stays portable wherever it's imported.
   ========================================================================== */

:root {
  color-scheme: light;

  /* ============================================================ PALETTE ==== */
  /* Warm paper + near-black cerebral indigo + one indigo accent. That indigo
     accent is the ONLY color that appears across the whole site.
     The Element families are hue-coded (--fam-1..5) — a deliberate departure
     from master spec §9.2 — but that palette is limited to the periodic
     table and the five /system component panels (D211). Everything else (buttons, links, figures, diagrams, hovers) is
     the indigo accent. */

  /* -- light ground (the default surface) -- */
  --paper:        #ece4d2;   /* primary background — warm white            */
  --paper-warm:   #f3ecdc;   /* raised card / hover on paper                */
  --paper-deep:   #e2d8c2;   /* recessed / alternating light section        */

  /* -- ink (text on paper, and the dark ground) -- */
  --ink:          #14182b;   /* primary text; also the dark-section base    */
  --ink-soft:     #2a3050;   /* headings that want a touch less weight      */
  --ink-2:        #3a4060;   /* body text, secondary                        */
  --muted:        #555b6b;   /* tertiary text, metadata (4.5:1 on paper-deep) */
  --muted-dim:    #95a0b0;   /* faint — figure captions, disabled           */

  --line:         rgba(20, 24, 43, 0.12);  /* hairlines on paper            */
  --line-strong:  rgba(20, 24, 43, 0.24);  /* borders, dividers             */

  /* -- accent: cerebral indigo. Used sparingly: eyebrows, focus, the
        "load-bearing" mark, illumination, one hover state. Never a fill for
        large areas, never for decoration. -- */
  --accent:       #5443cf;
  --accent-bright:#8a6fff;   /* luminous indigo — glow, motion highlight; 5:1 on ink-bg */
  --accent-soft:  rgba(84, 67, 207, 0.55);
  --accent-mist:  rgba(84, 67, 207, 0.12);

  /* -- dark ground (inverted sections: hero, System diagram, contact) -- */
  --ink-bg:          #101327;                    /* dark section background   */
  --ink-bg-raised:   #171b33;                    /* card on dark              */
  --on-dark:         #f3ecdc;                    /* primary text on dark      */
  --on-dark-2:       rgba(243, 236, 220, 0.72);  /* body on dark             */
  --on-dark-muted:   rgba(243, 236, 220, 0.52);  /* labels on dark           */
  --on-dark-faint:   rgba(243, 236, 220, 0.32);  /* faint on dark            */
  --line-on-dark:        rgba(243, 236, 220, 0.14);
  --line-on-dark-strong: rgba(243, 236, 220, 0.26);

  /* -- Element family hues. RESERVED FOR THE 30-ELEMENT PERIODIC TABLE and its
        key — nowhere else. Not the System diagram, not failure patterns, not
        decoration. If it isn't an Element cell, it gets the indigo accent.
        A deliberate departure from master spec §9.2: desaturated, L-matched —
        three cool (indigo/steel/teal), two warm (mauve/ochre). Row + code
        still lead; color is a quiet second signal. -- */
  --fam-1: #5a55a8;   /* Direction   · indigo      */
  --fam-2: #4f6698;   /* Engagement  · steel blue  */
  --fam-3: #9a6080;   /* Capability  · mauve-rose  */
  --fam-4: #a5895a;   /* Activation  · ochre       */
  --fam-5: #4d7d88;   /* Sustainment · teal-ink    */
  /* on the dark ground, lifted a step for contrast */
  --fam-1-bright: #8f8ad6;
  --fam-2-bright: #8098c8;
  --fam-3-bright: #c893ac;
  --fam-4-bright: #d4b98a;
  --fam-5-bright: #86b3bd;

  /* ========================================================= TYPOGRAPHY === */
  --font-serif: "Fraunces", ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --font-sans:  "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Fluid type scale. Serif display is the editorial voice; mono is the
     instrument panel; sans is everything you read at length.
     Display face = Fraunces serif (master spec §9.3's "geometric sans" is
     superseded). See brand-system.md §Typography.                            */
  --fs-display: clamp(3.1rem, 8.2vw, 7rem);      /* hero H1                    */
  --fs-h1:      clamp(2.5rem, 5.2vw, 4.35rem);   /* page title                */
  --fs-h2:      clamp(2rem, 3.9vw, 3.4rem);      /* major section             */
  --fs-h3:      clamp(1.35rem, 2.2vw, 2.05rem);  /* figure / card heading     */
  --fs-h4:      clamp(1.05rem, 1.5vw, 1.3rem);   /* sub-heading               */
  --fs-pov:     clamp(1.55rem, 2.7vw, 2.5rem);   /* POV line / pull quote     */
  --fs-lede:    clamp(1.1rem, 1.35vw, 1.3rem);   /* intro paragraph           */
  --fs-body:    1.0625rem;                       /* 17px body                 */
  --fs-small:   0.9375rem;                       /* 15px caption / meta       */
  --fs-label:   0.72rem;                         /* mono uppercase label      */
  --fs-caption: 0.75rem;                         /* mono figure caption       */
  --fs-stat:    clamp(3.5rem, 9.5vw, 8.5rem);    /* statistics, big numerals  */

  --lh-display: 0.98;
  --lh-heading: 1.06;
  --lh-pov:     1.22;
  --lh-body:    1.62;
  --lh-tight:   1.3;

  --tracking-display: -0.032em;
  --tracking-heading: -0.018em;
  --tracking-h3:      -0.01em;
  --tracking-body:     0;
  --tracking-label:    0.14em;   /* mono, UPPERCASE labels                     */
  --tracking-caption:  0.04em;   /* mono, lowercase captions                   */

  --weight-display: 380;   /* Fraunces variable — light editorial             */
  --weight-heading: 400;

  /* Fraunces is NEVER italicized anywhere on the site — the italic doesn't
     read well at these sizes. Emphasis in a serif heading or POV line =
     weight or color, never slant. Body emphasis (.em) = bold.
     ONE scoped exception (D86): .womn-cap + .womn-q on /why-it-matters-now.
     Fraunces axis settings: opsz kept modest so display type stays calm and
     authoritative rather than high-fashion; SOFT rounds the terminals a
     touch for warmth. Apply with font-variation-settings.                    */
  --fvs-display: "opsz" 40, "SOFT" 40;
  --fvs-heading: "opsz" 28, "SOFT" 30;
  --fvs-text:    "opsz" 12, "SOFT" 0;
  --weight-emphasis:520;
  --weight-body:    400;
  --weight-ui:      500;
  --weight-strong:  600;

  /* ============================================================ SPACE ===== */
  --space-2xs: clamp(4px,  0.25vw + 3px, 8px);
  --space-xs:  clamp(8px,  0.5vw  + 6px, 16px);
  --space-sm:  clamp(12px, 0.8vw  + 9px, 22px);
  --space-md:  clamp(16px, 1.25vw + 12px, 36px);
  --space-lg:  clamp(24px, 2vw    + 18px, 52px);
  --space-xl:  clamp(36px, 2.5vw  + 28px, 64px);
  --space-2xl: clamp(48px, 4vw    + 32px, 100px);
  --space-3xl: clamp(72px, 6vw    + 48px, 148px);
  --section-y: clamp(64px, 7vw + 40px, 160px);   /* vertical rhythm per band   */

  /* ============================================================ LAYOUT ==== */
  --container:      1200px;
  --container-wide: 1360px;
  --container-text: 720px;    /* prose measure                                */
  --gutter:         clamp(20px, 5vw, 64px);
  --nav-height:     64px;
  --readout-w:      320px;    /* /elements instrument — the sticky readout column */

  --radius:    4px;
  --radius-lg: 8px;
  --radius-pill: 999px;

  /* ============================================================ MOTION ==== */
  /* "Clarity emerging from complexity." Motion explains; it never decorates.
     Everything here has a static equivalent under prefers-reduced-motion.    */
  --ease:      cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out:  cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-1: 0.2s;    /* micro — hover, focus            */
  --dur-2: 0.35s;   /* standard — reveal, illuminate   */
  --dur-3: 0.6s;    /* deliberate — assemble, climb    */
  --dur-4: 1.1s;    /* set-piece — fragments aligning  */

  /* ============================================================ DEPTH ==== */
  --shadow-1: 0 2px 8px rgba(20, 24, 43, 0.06);
  --shadow-2: 0 10px 26px rgba(20, 24, 43, 0.10);
  --shadow-accent: 0 14px 34px rgba(84, 67, 207, 0.18);
  --focus-ring: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent);
  --focus-ring-dark: 0 0 0 2px var(--ink-bg), 0 0 0 4px var(--accent-bright);

  /* ======================================================== GRADIENTS ==== */
  /* Three sanctioned behaviors only (master spec §9.4). Optical, not blobs. */
  --grad-illumination:
    radial-gradient(60% 60% at 50% 40%,
      var(--accent-mist) 0%, rgba(84,67,207,0.04) 45%, transparent 72%);
  --grad-field:
    linear-gradient(180deg, var(--ink-bg) 0%, #0c0f20 100%);
  --grad-signal:
    linear-gradient(90deg, transparent 0%, var(--accent-bright) 50%, transparent 100%);

  /* ================================================ BACKGROUND TREATMENTS ==
     Applied sparingly via the .bg-grid / .bg-wash utilities (see site.css).
     Rhythm rule: leave some bands completely plain so the treated ones read
     as deliberate. Every grid/wash is masked or low-alpha enough to sit
     *under* content, never competing with it.                               */

  /* ruled grid — 1px lines, faded at the band's top and bottom edges */
  --grid-size: 60px;
  --grid-line-light:   rgba(20, 24, 43, 0.045);
  --grid-line-light-v: rgba(20, 24, 43, 0.035);
  --grid-line-dark:    rgba(243, 236, 220, 0.06);
  --grid-line-dark-v:  rgba(243, 236, 220, 0.045);
  --grid-mask: linear-gradient(180deg, transparent 0%, #000 12%, #000 80%, transparent 100%);

  /* corner wash — a soft indigo radial anchored to one top corner, over the
     ground color. Faint on light, more present on dark. */
  --wash-light: radial-gradient(72% 64% at 14% -4%, rgba(122, 92, 255, 0.07), transparent 62%);
  --wash-light-right: radial-gradient(72% 64% at 86% -4%, rgba(122, 92, 255, 0.07), transparent 62%);
  --wash-dark: radial-gradient(64% 92% at 82% 4%, rgba(122, 92, 255, 0.16), transparent 66%);
  --field-dark: linear-gradient(180deg, #15182d 0%, #0d1021 100%);

  /* ================================ COMPONENT-COLOR EXPLORATION (archive) ===
     The four candidate sets compared while choosing the Element family hues.
     --famX-{1..5} map to Direction / Engagement / Capability / Activation /
     Sustainment. The shipped set is --fam-1..5 above (V4 + Pair C).
     Kept for the record. See brand/component-colors.html                    */

  /* V1 · tonal — indigo only, lightness steps */
  --famA-1:#2b2f4c; --famA-2:#343a63; --famA-3:#3e4578; --famA-4:#49528d; --famA-5:#565fa2;
  /* V2 · analogous cool sweep — blue → indigo → violet, matched L & S */
  --famB-1:#3f5bd0; --famB-2:#5a48d8; --famB-3:#7a52c8; --famB-4:#4d6fb0; --famB-5:#5e5bb5;
  /* V3 · one accent, tint intensity — hue fixed, saturation/again position carries meaning */
  --famC-1:#5a48d8; --famC-2:#6d5ede; --famC-3:#8073e4; --famC-4:#9389ea; --famC-5:#a79ff0;
  /* V4 · desaturated distinct hues — Adam's pick, with "Pair C" for
     Capability/Activation (2026-08-31). This IS the shipped set — mirrored
     into --fam-1..5 above, which is what components read. Kept here as the
     exploration record. */
  --famD-1:#5a55a8; --famD-2:#4f6698; --famD-3:#9a6080; --famD-4:#a5895a; --famD-5:#4d7d88;
}

/* Dark context: opt a subtree into inverted text tokens by adding
   class="on-dark" (or [data-ground="dark"]). Components read the same
   --text / --bg aliases and just work in both grounds.                       */
:root {
  --bg:        var(--paper);
  --bg-raised: var(--paper-warm);
  --text:      var(--ink);
  --text-2:    var(--ink-2);
  --text-muted:var(--muted);
  --hairline:  var(--line);
  --hairline-strong: var(--line-strong);
}
.on-dark, [data-ground="dark"] {
  --bg:        var(--ink-bg);
  --bg-raised: var(--ink-bg-raised);
  --text:      var(--on-dark);
  --text-2:    var(--on-dark-2);
  --text-muted:var(--on-dark-muted);
  --hairline:  var(--line-on-dark);
  --hairline-strong: var(--line-on-dark-strong);
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-1: 0s; --dur-2: 0s; --dur-3: 0s; --dur-4: 0s; }
}
