/* ============================================================================
   AIST DESIGN SYSTEM — SEMANTIC TOKENS (roles)
   ----------------------------------------------------------------------------
   Components consume ONLY these role tokens, never the raw --aist-* values.
   Default (:root)      = LIGHT, white base (universal safe default).
   [data-theme="dark"]  = dark remap.
   Mode bases (white vs cream) live in themes/marketing.css & themes/product.css
   and are opted into with data-mode="marketing" | "product" on the root.
   Requires: core.css loaded first.
   ========================================================================== */

:root {
  /* ---- Surfaces & text (light default) ---------------------------------- */
  --color-bg:            var(--aist-white);      /* page background          */
  --color-surface:       var(--aist-white);      /* cards, panels            */
  --color-surface-2:     var(--aist-warm-100);   /* raised / sidebar / inset */
  --color-chip:          var(--aist-warm-100);   /* hover & chip fills        */

  --color-text:          var(--aist-ink);
  --color-text-2:        var(--aist-ink-2);
  --color-text-3:        var(--aist-ink-3);
  --color-text-muted:    var(--aist-ink-4);

  /* ---- Accent ----------------------------------------------------------- */
  --color-accent:        var(--aist-orange);
  --color-accent-hover:  var(--aist-orange-hover);
  --color-on-accent:     var(--aist-white);
  --color-accent-tint:   var(--aist-orange-tint-2);

  /* ---- Borders / effects ------------------------------------------------ */
  --color-border-soft:   var(--aist-border-soft);
  --color-border:        var(--aist-border);
  --color-border-strong: var(--aist-border-mid);
  --color-border-hover:  var(--aist-border-hover);
  --color-hover:         var(--aist-hover-veil);
  --color-shadow:        var(--aist-shadow);
  --color-focus-ring:    var(--aist-orange);

  /* Overlays: tooltips, dropdowns, popovers */
  --color-glow:          var(--aist-glow);          /* product bg radial glow */
  --color-dot:           var(--aist-dot);           /* hero backdrop grid     */
  --color-dot-accent:    var(--aist-dot-accent);
  --color-tooltip-bg:    var(--aist-ink);
  --color-tooltip-text:  #F4F4F6;
  --shadow-pop:          0 14px 34px var(--color-shadow);  /* dropdown/popover */

  /* Responsive: < 1024px switches to the mobile model (single zone) */
  --bp-mobile:           var(--aist-bp-mobile);

  /* ---- Status -----------------------------------------------------------
     Two halves per state (see core.css): the plain name is the SURFACE
     half — fill, icon, dot, rail, border — and `-text` is the LABEL half.
     Use `-text` wherever the state colours type; use the plain name for
     everything that is not type. Swapping them fails contrast in one
     direction or burns the fill in the other.                           */
  --color-ok:     var(--aist-ok);     --color-ok-bg:     var(--aist-ok-bg);
  --color-ai:     var(--aist-ai);     --color-ai-bg:     var(--aist-ai-bg);
  --color-info:   var(--aist-info);   --color-info-bg:   var(--aist-info-bg);
  --color-warn:   var(--aist-warn);   --color-warn-bg:   var(--aist-warn-bg);
  --color-danger: var(--aist-danger); --color-danger-bg: var(--aist-danger-bg);

  --color-ok-text:     var(--aist-ok-text);
  --color-ai-text:     var(--aist-ai-text);
  --color-info-text:   var(--aist-info-text);
  --color-warn-text:   var(--aist-warn-text);
  --color-danger-text: var(--aist-danger-text);

  /* ---- Radius aliases --------------------------------------------------- */
  --radius-xs:   var(--aist-radius-xs);
  --radius-sm:   var(--aist-radius-sm);
  --radius-md:   var(--aist-radius-md);
  --radius-lg:   var(--aist-radius-lg);
  --radius-full: var(--aist-radius-full);

  /* ---- Type families ---------------------------------------------------- */
  --font-sans: var(--aist-font-sans);
  --font-mono: var(--aist-font-mono);

  /* ---- Type scale (raw sizes; roles applied in guides/components) -------- */
  --fs-3xs: 10px;  --fs-2xs: 11px;  --fs-xs: 12px;   --fs-sm: 13px;
  --fs-base: 14px; --fs-md: 15px;   --fs-lg: 16px;   --fs-xl: 18px;
  --fs-2xl: 20px;  --fs-3xl: 24px;  --fs-4xl: 30px;  --fs-5xl: 38px;
  --fs-6xl: 48px;  --fs-7xl: 64px;  --fs-8xl: 84px;

  /* Fluid marketing headline sizes */
  --fs-display: clamp(2.75rem, 6.5vw, 5.5rem);   /* hero                     */
  --fs-h1:      clamp(2rem, 4vw, 3.25rem);        /* section headline         */
  --fs-h2:      clamp(1.5rem, 2.4vw, 2.25rem);

  /* Line heights & tracking */
  --lh-tight:  1.05;
  --lh-snug:   1.2;
  --lh-normal: 1.5;
  --lh-relaxed:1.7;
  --tracking-tight:  -0.02em;
  --tracking-normal: 0;
  --tracking-wide:   0.08em;
  --tracking-caps:   0.16em;   /* mono eyebrow labels */
  --tracking-caps-x: 0.34em;   /* logo lockup label   */
}

/* ---- Dark theme remap ---------------------------------------------------- */
[data-theme="dark"] {
  --color-bg:            var(--aist-d-bg);
  --color-surface:       var(--aist-d-surface);
  --color-surface-2:     var(--aist-d-surface-2);
  --color-chip:          var(--aist-d-chip);

  --color-text:          var(--aist-d-text);
  --color-text-2:        var(--aist-d-text-2);
  --color-text-3:        var(--aist-d-text-3);
  --color-text-muted:    var(--aist-d-text-4);

  --color-accent:        var(--aist-orange-dark);
  --color-accent-hover:  var(--aist-orange-dark-hover);
  --color-on-accent:     #1A1005;
  --color-accent-tint:   rgba(236, 116, 68, 0.16);

  --color-border-soft:   var(--aist-d-border-soft);
  --color-border:        var(--aist-d-border);
  --color-border-strong: var(--aist-d-border-mid);
  --color-border-hover:  var(--aist-d-border-hover);
  --color-hover:         var(--aist-d-hover-veil);
  --color-shadow:        var(--aist-d-shadow);
  --color-focus-ring:    var(--aist-orange-dark);

  --color-glow:          var(--aist-d-glow);
  --color-dot:           rgba(255, 255, 255, 0.12);
  --color-dot-accent:    var(--aist-orange-dark);
  --color-tooltip-bg:    var(--aist-d-tooltip-bg);
  --color-tooltip-text:  var(--aist-d-text);

  --color-ok:     var(--aist-ok-dark);     --color-ok-bg:     rgba(132, 204, 139, 0.14);
  --color-ai:     var(--aist-ai-dark);     --color-ai-bg:     rgba(188, 164, 244, 0.16);
  --color-info:   var(--aist-info-dark);   --color-info-bg:   rgba(143, 182, 230, 0.16);
  --color-warn:   var(--aist-warn-dark);   --color-warn-bg:   rgba(230, 184, 101, 0.16);
  --color-danger: var(--aist-danger-dark); --color-danger-bg: rgba(238, 142, 120, 0.16);

  /* On graphite the surface half already clears the text bar on canvas,
     plate and tint alike — measured, lowest 4.72:1. So the text half is
     the same value here: a second, darker one would be less readable,
     not more. The variable still exists so a component can name the role
     once and work in both themes.                                       */
  --color-ok-text:     var(--aist-ok-dark);
  --color-ai-text:     var(--aist-ai-dark);
  --color-info-text:   var(--aist-info-dark);
  --color-warn-text:   var(--aist-warn-dark);
  --color-danger-text: var(--aist-danger-dark);
}
