/* ==========================================================================
   Syrax website: design tokens (2026-11 redesign)
   --------------------------------------------------------------------------
   ONE source of truth for colour, surfaces, elevation, spacing, radius, type
   and motion, in both themes. Load it AFTER every other stylesheet on a page
   (only components.css comes after it), so these values win over the older
   :root copies in styles.css and the inline <style> on index.html until those
   copies are removed.

   The values are the user platform's own (`user/app/styles/ui-v2.css`,
   4 Nov 2026), so the site and the app read as one product. The legacy
   variable names (--bg, --surface, --text2, --accent ...) are kept and
   re-pointed, so existing markup picks up the new look without a rewrite.

   Fonts follow the brand documents: Oxanium (display), DM Sans (body),
   DM Mono (eyebrows and figures). All self-hosted in fonts/fonts.css.
   ========================================================================== */

:root{
  color-scheme:dark;

  /* ── Surfaces: ground → card → raised → floating ─────────────────────── */
  --sx-ground:#030c0d;
  --sx-surface-1:#08171a;
  --sx-surface-2:#0c1e22;
  --sx-surface-3:#11272c;
  --sx-band:#061315;              /* alternate section band, between ground and card */
  --sx-glass:rgba(5,18,20,.78);   /* nav and overlays only */

  /* ── Lines ───────────────────────────────────────────────────────────── */
  --sx-hairline:rgba(221,240,242,.08);
  --sx-hairline-strong:rgba(221,240,242,.14);
  --sx-highlight:rgba(255,255,255,.06);  /* 1px top edge on raised surfaces */
  --sx-spot:rgba(29,217,232,.05);        /* the quiet radial wash */

  /* ── Text ────────────────────────────────────────────────────────────── */
  --sx-text-1:#ddf0f2;
  --sx-text-2:#a9cdd3;
  --sx-text-3:#86a9b0;   /* 4.9:1 on surface-1, AA for small text */

  /* ── Brand ───────────────────────────────────────────────────────────── */
  --sx-accent:#0fa8b0;        /* fills: primary buttons, selected state */
  --sx-accent-text:#2cc4cc;   /* teal used AS text on dark grounds (AA) */
  --sx-accent-strong:#1dd9e8;
  --sx-accent-ink:#021012;    /* text on a teal fill */
  --sx-accent-soft:rgba(15,168,176,.10);
  --sx-accent-line:rgba(15,168,176,.32);
  --sx-gold:#c8a96e;
  --sx-gold-soft:rgba(200,169,110,.08);
  --sx-gold-line:rgba(200,169,110,.28);
  --sx-focus:#1dd9e8;

  /* ── Icon depth plane (the platform's back plane) ────────────────────── */
  --sx-plane-top:rgba(29,217,232,.55);
  --sx-plane-bottom:rgba(15,168,176,.10);
  --sx-plane-flat:rgba(15,168,176,.24);
  --sx-icon-back-top:var(--sx-plane-top);--sx-icon-back-bot:var(--sx-plane-bottom);--sx-icon-back-flat:var(--sx-plane-flat);

  /* ── Elevation ───────────────────────────────────────────────────────── */
  --sx-elev-1:0 1px 1px rgba(0,0,0,.30),0 2px 4px rgba(0,0,0,.22);
  --sx-elev-2:0 1px 1px rgba(0,0,0,.30),0 2px 4px rgba(0,0,0,.25),0 8px 16px -4px rgba(0,0,0,.35);
  --sx-elev-3:0 2px 4px rgba(0,0,0,.30),0 12px 28px -6px rgba(0,0,0,.50);
  --sx-elev-4:0 4px 8px rgba(0,0,0,.35),0 24px 56px -12px rgba(0,0,0,.65);

  /* ── Spacing (4-point) ───────────────────────────────────────────────── */
  --sx-1:4px;--sx-2:8px;--sx-3:12px;--sx-4:16px;--sx-6:24px;--sx-8:32px;
  --sx-12:48px;--sx-16:64px;--sx-24:96px;--sx-32:128px;
  --sx-gutter:clamp(16px,4vw,48px);
  --sx-section:clamp(64px,7vw,96px);   /* vertical padding of a section */
  --sx-max:1200px;
  --sx-measure:68ch;

  /* ── Radius ──────────────────────────────────────────────────────────── */
  --sx-r-sm:6px;--sx-r-md:10px;--sx-r-lg:14px;--sx-r-xl:20px;--sx-r-pill:999px;

  /* ── Type ────────────────────────────────────────────────────────────── */
  --sx-font-display:'Oxanium','DM Sans',system-ui,sans-serif;
  --sx-font-body:'DM Sans',system-ui,-apple-system,'Segoe UI',sans-serif;
  --sx-font-mono:'DM Mono',ui-monospace,'SFMono-Regular',Menlo,monospace;
  --sx-fs-xs:.75rem;--sx-fs-sm:.875rem;--sx-fs-card:.9375rem;--sx-fs-md:1rem;
  --sx-fs-lg:1.125rem;--sx-fs-xl:1.25rem;--sx-fs-2xl:1.5rem;
  --sx-fs-h2:clamp(1.75rem,1.2rem + 2.2vw,2.5rem);
  --sx-fs-h1:clamp(2.25rem,1.4rem + 3.6vw,3.5rem);

  /* ── Motion ──────────────────────────────────────────────────────────── */
  --sx-ease:cubic-bezier(0.2,0,0,1);
  --sx-fast:140ms;--sx-base:200ms;--sx-slow:420ms;
  --sx-blur:18px;
}

:root[data-theme="light"]{
  color-scheme:light;

  --sx-ground:#eef3f4;
  --sx-surface-1:#ffffff;
  --sx-surface-2:#f7fafa;
  --sx-surface-3:#ffffff;
  --sx-band:#e6eef0;
  --sx-glass:rgba(255,255,255,.82);

  --sx-hairline:rgba(8,40,45,.10);
  --sx-hairline-strong:rgba(8,40,45,.16);
  --sx-highlight:rgba(255,255,255,.9);
  --sx-spot:rgba(15,168,176,.05);

  --sx-text-1:#0e2125;
  --sx-text-2:#4d676b;
  --sx-text-3:#576b6f;

  --sx-accent:#087a84;        /* white text on it = 5.1:1 (AA) */
  --sx-accent-text:#086f78;   /* AA on the raised light band too */
  --sx-accent-strong:#086b73;
  --sx-accent-ink:#ffffff;
  --sx-accent-soft:rgba(12,152,164,.08);
  --sx-accent-line:rgba(12,152,164,.36);
  --sx-gold:#7a5f30;
  --sx-gold-soft:rgba(156,125,66,.08);
  --sx-gold-line:rgba(156,125,66,.30);
  --sx-focus:#0a7a84;

  --sx-plane-top:rgba(15,140,150,.42);
  --sx-plane-bottom:rgba(15,140,150,.06);
  --sx-plane-flat:rgba(15,140,150,.18);
  --sx-icon-back-top:var(--sx-plane-top);--sx-icon-back-bot:var(--sx-plane-bottom);--sx-icon-back-flat:var(--sx-plane-flat);

  --sx-elev-1:0 1px 2px rgba(8,30,34,.05),0 1px 1px rgba(8,30,34,.03);
  --sx-elev-2:0 1px 2px rgba(8,30,34,.05),0 4px 10px -2px rgba(8,30,34,.07);
  --sx-elev-3:0 2px 4px rgba(8,30,34,.05),0 12px 28px -6px rgba(8,30,34,.14);
  --sx-elev-4:0 4px 8px rgba(8,30,34,.06),0 24px 56px -12px rgba(8,30,34,.22);
}

/* Legacy names, re-pointed. `:root[data-theme]` matches the specificity of the
   older light block in styles.css, and this file loads later, so it wins in
   both themes. Every legacy name now resolves to the platform values above. */
:root,:root[data-theme]{
  --bg:var(--sx-ground);--bg2:var(--sx-surface-1);--bg3:var(--sx-surface-2);
  --surface:var(--sx-surface-1);--surface2:var(--sx-surface-2);
  --border:var(--sx-hairline);--border2:var(--sx-hairline-strong);--border3:var(--sx-accent-line);
  --text:var(--sx-text-1);--text2:var(--sx-text-2);--text3:var(--sx-text-3);
  --accent:var(--sx-accent-text);--accent-dark:#0a7a80;--accent2:var(--sx-accent);--accent3:var(--sx-accent-strong);
  --accent-glow:var(--sx-accent-soft);--accent-glow2:rgba(15,168,176,.18);
  --gold:var(--sx-gold);--gold2:#a8894e;--green:#2cc4a8;
  --mono:var(--sx-font-mono);--sans:var(--sx-font-body);--display:var(--sx-font-display);
  --edge-light:var(--sx-highlight);
  --shadow-card:inset 0 1px 0 var(--sx-highlight),var(--sx-elev-1);
  --shadow-hover:inset 0 1px 0 var(--sx-highlight),var(--sx-elev-3);
  --ease-spring:var(--sx-ease);--ease-hub:var(--sx-ease);

  /* Four names used across pages but never defined before: they fell
     through to inherited (full-brightness) text. Now they mean something. */
  --text-primary:var(--sx-text-1);
  --text1:var(--sx-text-1);
  --text-secondary:var(--sx-text-2);
  --body:var(--sx-text-2);
}
:root[data-theme="light"]{
  --accent-dark:#086b73;--gold2:#9c7d42;--green:#0f6248;
  --accent-glow2:rgba(12,152,164,.14);
}
