/* ==========================================================================
   Weio design tokens  v2  (2026-11-28)
   The legacy gold and grey I/O look, on every surface:
   weio.ai, legal, help, app.weio.ai (chat, portal, plans), errors, phone.

   Brand: the I/O mark (grey terminal frame + gold cursor) with "Weio",
   from the live /brand/ files. Gold #E8B05C = Out, grey #7D838B = In.
   Dark is the default (the legacy look). Light is the same system by day.
   Fonts: Geist + Geist Mono, self-hosted at /assets/fonts.css (CSP: self only).

   <html data-theme="dark">  or  data-theme="light". With neither: dark,
   unless the device asks for light AND the page opts in with
   data-theme-auto (see bottom).
   Variable names start with --w-. The old --wa-* names map onto these in
   legacy-alias.css, so the live site keeps working during the move.
   ========================================================================== */

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

  /* Surfaces: the site's blue-black ground */
  --w-paper:        #06080B;  /* page */
  --w-surface:      #0A0E13;  /* sidebar, cards */
  --w-raise:        #0D1218;  /* inputs, modals, menus */
  --w-sunk:         #121A22;  /* wells, user bubble, segmented track */
  --w-card:         linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012));
  --w-band:         #0A0E13;
  --w-band-ink:     #E7E9E6;
  --w-glow:         radial-gradient(70% 60% at 50% 0%, rgba(232,176,92,.13), rgba(232,176,92,0) 70%),
                    radial-gradient(50% 40% at 50% 62%, rgba(120,140,170,.10), rgba(120,140,170,0) 75%);

  /* Ink */
  --w-ink:          #E7E9E6;  /* 16.4:1 */
  --w-ink-2:        #B4BBC4;  /* 10.4:1 */
  --w-ink-3:        #8B949E;  /*  6.5:1 */
  --w-ink-invert:   #06080B;

  /* Lines */
  --w-line:         rgba(231, 233, 230, .10);
  --w-line-2:       rgba(231, 233, 230, .20);
  --w-ring:         inset 0 0 0 1px rgba(231, 233, 230, .08);
  --w-ring-2:       inset 0 0 0 1px rgba(231, 233, 230, .16);
  --w-focus:        #E8B05C;

  /* I/O pair: grey = In, gold = Out. Gold is the one accent. */
  --w-io-in:        #7D838B;  /* "In" box, IN tags (5.2:1) */
  --w-gold:         #E8B05C;  /* "Out", primary button, active, send (10.3:1) */
  --w-gold-hover:   #F0C27A;
  --w-gold-ink:     #E8B05C;  /* gold text and links */
  --w-gold-tint:    rgba(232, 176, 92, .12);
  --w-gold-ring:    inset 0 0 0 1px rgba(232, 176, 92, .40);
  --w-on-gold:      #1A1204;  /* text on gold, 9.5:1 */

  /* Status */
  --w-ok:           #7FD6A6;
  --w-ok-tint:      rgba(127, 214, 166, .12);
  --w-warn:         #F5D26A;
  --w-warn-tint:    rgba(245, 210, 106, .12);
  --w-err:          #FF8A7A;
  --w-err-tint:     rgba(255, 138, 122, .12);
  --w-info:         #8FE3FF;
  --w-info-tint:    rgba(143, 227, 255, .10);

  /* Solid button: ink pill (the site's send button) */
  --w-solid:        #E7E9E6;
  --w-solid-hover:  #FFFFFF;
  --w-on-solid:     #06080B;

  --w-header-bg:    rgba(6, 8, 11, .94);
  --w-scrim:        rgba(0, 0, 0, .6);
  --w-shadow-1:     0 1px 2px rgba(0,0,0,.4);
  --w-shadow-2:     0 24px 48px -28px rgba(0,0,0,.8);
  --w-shadow-3:     0 30px 80px -30px rgba(0,0,0,.9);
}

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

  /* Cool grey-white, so the gold stays the only warm thing */
  --w-paper:        #F4F4F1;
  --w-surface:      #FAFAF8;
  --w-raise:        #FFFFFF;
  --w-sunk:         #EBEBE7;
  --w-card:         #FAFAF8;
  --w-band:         #0A0E13;  /* plan band stays dark in both themes */
  --w-band-ink:     #E7E9E6;
  --w-glow:         radial-gradient(70% 60% at 50% 0%, rgba(232,176,92,.20), rgba(232,176,92,0) 70%),
                    radial-gradient(50% 40% at 50% 62%, rgba(120,140,170,.12), rgba(120,140,170,0) 75%);

  --w-ink:          #0E1116;  /* 17.2:1 */
  --w-ink-2:        #4A5058;  /*  7.4:1 */
  --w-ink-3:        #5F656D;  /*  5.3:1 */
  --w-ink-invert:   #FFFFFF;

  --w-line:         rgba(14, 17, 22, .10);
  --w-line-2:       rgba(14, 17, 22, .18);
  --w-ring:         inset 0 0 0 1px rgba(14, 17, 22, .09);
  --w-ring-2:       inset 0 0 0 1px rgba(14, 17, 22, .18);
  --w-focus:        #8A5A12;

  --w-io-in:        #7D838B;  /* display size only (3.5:1); small IN tags use ink-3 */
  --w-gold:         #E8B05C;  /* fills keep the same gold */
  --w-gold-hover:   #DDA14A;
  --w-gold-ink:     #8A5A12;  /* gold text on light, 5.4:1 */
  --w-gold-tint:    #F6EBD8;
  --w-gold-ring:    inset 0 0 0 1px rgba(184, 128, 40, .55);
  --w-on-gold:      #1A1204;

  --w-ok:           #2A6F43;
  --w-ok-tint:      #E3F0E7;
  --w-warn:         #7A5A00;
  --w-warn-tint:    #FBF0D2;
  --w-err:          #B3261E;
  --w-err-tint:     #FBE4E1;
  --w-info:         #22597F;
  --w-info-tint:    #E2ECF6;

  --w-solid:        #0E1116;
  --w-solid-hover:  #262B33;
  --w-on-solid:     #FFFFFF;

  --w-header-bg:    rgba(244, 244, 241, .92);
  --w-scrim:        rgba(14, 17, 22, .40);
  --w-shadow-1:     0 1px 2px rgba(14,17,22,.06);
  --w-shadow-2:     0 12px 32px -16px rgba(14,17,22,.22);
  --w-shadow-3:     0 30px 70px -30px rgba(14,17,22,.35);
}

:root {
  --w-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --w-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Type: calm and light, like the site's v3 pass. Display weights stay 500-600. */
  --w-fs-display: clamp(44px, 6vw, 92px);   /* the I/O hero */
  --w-fs-h1:      clamp(34px, 4vw, 54px);
  --w-fs-h2:      clamp(26px, 2.8vw, 36px);
  --w-fs-h3:      19px;
  --w-fs-h4:      16px;
  --w-fs-body:    16px;
  --w-fs-ui:      15px;
  --w-fs-sm:      14px;
  --w-fs-xs:      12.5px;
  --w-fs-eyebrow: 13px;

  --w-lh-tight:   1.02;
  --w-lh-head:    1.06;
  --w-lh-body:    1.55;

  --w-fw-reg:     400;
  --w-fw-med:     500;
  --w-fw-semi:    600;
  --w-fw-bold:    600;
  --w-fw-heavy:   600;

  --w-track-display: -0.045em;
  --w-track-head:    -0.035em;
  --w-track-eyebrow:  0.01em;

  --w-s1: 4px;  --w-s2: 8px;  --w-s3: 12px; --w-s4: 16px; --w-s5: 20px;
  --w-s6: 24px; --w-s7: 32px; --w-s8: 40px; --w-s9: 56px; --w-s10: 96px; --w-s11: 152px;

  --w-max:        1240px;
  --w-max-prose:  720px;
  --w-gutter:     clamp(20px, 5vw, 72px);
  --w-header-h:   64px;
  --w-sidebar-w:  272px;
  --w-drawer-w:   min(320px, 85vw);
  --w-tabbar-h:   64px;
  --w-tap:        44px;

  --w-r-xs:   6px;
  --w-r-sm:   12px;
  --w-r-md:   16px;
  --w-r-lg:   20px;
  --w-r-pill: 999px;

  --w-ease:   cubic-bezier(.2, .7, .2, 1);
  --w-dur-1:  150ms;
  --w-dur-2:  250ms;

  --w-z-header: 40; --w-z-tabbar: 45; --w-z-drawer: 60; --w-z-modal: 70; --w-z-toast: 80;
}

/* Optional: follow the device on pages that set data-theme-auto on <html>
   and no data-theme. The app uses the user's saved choice instead. */
@media (prefers-color-scheme: light) {
  :root[data-theme-auto]:not([data-theme]) {
    color-scheme: light;
    --w-paper:#F4F4F1; --w-surface:#FAFAF8; --w-raise:#FFFFFF; --w-sunk:#EBEBE7; --w-card:#FAFAF8;
    --w-ink:#0E1116; --w-ink-2:#4A5058; --w-ink-3:#5F656D; --w-ink-invert:#FFFFFF;
    --w-line:rgba(14,17,22,.10); --w-line-2:rgba(14,17,22,.18);
    --w-ring:inset 0 0 0 1px rgba(14,17,22,.09); --w-ring-2:inset 0 0 0 1px rgba(14,17,22,.18);
    --w-focus:#8A5A12; --w-gold-hover:#DDA14A; --w-gold-ink:#8A5A12; --w-gold-tint:#F6EBD8;
    --w-gold-ring:inset 0 0 0 1px rgba(184,128,40,.55);
    --w-ok:#2A6F43; --w-ok-tint:#E3F0E7; --w-warn:#7A5A00; --w-warn-tint:#FBF0D2;
    --w-err:#B3261E; --w-err-tint:#FBE4E1; --w-info:#22597F; --w-info-tint:#E2ECF6;
    --w-solid:#0E1116; --w-solid-hover:#262B33; --w-on-solid:#FFFFFF;
    --w-header-bg:rgba(244,244,241,.92); --w-scrim:rgba(14,17,22,.40);
    --w-shadow-1:0 1px 2px rgba(14,17,22,.06); --w-shadow-2:0 12px 32px -16px rgba(14,17,22,.22);
    --w-shadow-3:0 30px 70px -30px rgba(14,17,22,.35);
  }
}

/* Breakpoints (copy the numbers; custom properties can't go in media queries)
     1100px  wide desktop    900px  sidebar -> drawer, tab bar appears
      600px  one column, modals become bottom sheets
      390px  phone design target (360px must still work)                  */

@media (prefers-reduced-motion: reduce) { :root { --w-dur-1: 0ms; --w-dur-2: 0ms; } }
