/* =========================================================================
   PEWIT Labs — Design Tokens
   Single source of truth: color, type, space, radius, shadow, motion.
   Light is default. Dark overrides under [data-theme="dark"].
   ========================================================================= */

:root {
  /* ---- Brand scale (blue) -------------------------------------------- */
  --brand-50:  #eef4ff;
  --brand-100: #dbe7ff;
  --brand-200: #b9d1ff;
  --brand-300: #8fb2ff;
  --brand-400: #5f8cff;
  --brand-500: #2f6bff;   /* primary */
  --brand-600: #1d54e0;   /* primary hover */
  --brand-700: #1840b8;
  --brand-800: #163492;
  --brand-900: #122a72;
  --brand-950: #0b1c52;

  /* ---- Cool neutral scale -------------------------------------------- */
  --slate-50:  #f7f8fb;
  --slate-100: #eef1f6;
  --slate-200: #e3e7ef;
  --slate-300: #cdd4e0;
  --slate-400: #9aa3b8;
  --slate-500: #6b7488;
  --slate-600: #4d566b;
  --slate-700: #364056;
  --slate-800: #212a3d;
  --slate-900: #131a2b;
  --slate-950: #0a0f1e;

  /* ---- Functional colors --------------------------------------------- */
  --green-500: #10b981;
  --amber-500: #f59e0b;
  --red-500:   #ef4444;

  /* ---- Semantic: surfaces & text (LIGHT) ----------------------------- */
  --color-bg:            #ffffff;
  --color-bg-subtle:     #f6f8fc;
  --color-surface:       #ffffff;
  --color-surface-2:     #f7f9fd;
  --color-surface-3:     #eef3fb;
  --color-border:        #e7eaf1;
  --color-border-strong: #d5dae5;

  --color-text:          #0f1729;
  --color-text-muted:    #5a6478;
  --color-text-subtle:   #8a93a6;
  --color-text-inverse:  #ffffff;

  --color-primary:        var(--brand-500);
  --color-primary-hover:  var(--brand-600);
  --color-primary-soft:   var(--brand-50);
  --color-primary-border: var(--brand-200);
  --color-on-primary:     #ffffff;

  --color-success: var(--green-500);
  --color-warning: var(--amber-500);
  --color-danger:  var(--red-500);

  --color-ring: color-mix(in srgb, var(--brand-500) 38%, transparent);

  /* Hero / brand gradient (matches banner) */
  --gradient-brand: linear-gradient(135deg, #1f4fe6 0%, #2f6bff 55%, #4f82ff 100%);
  --gradient-brand-deep: linear-gradient(150deg, #112a72 0%, #1840b8 50%, #2f6bff 100%);
  --gradient-soft: linear-gradient(180deg, #f6f8fc 0%, #ffffff 100%);

  /* ---- Typography ----------------------------------------------------- */
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Code", monospace;

  --text-xs:   clamp(0.75rem, 0.74rem + 0.05vw, 0.78rem);
  --text-sm:   clamp(0.86rem, 0.84rem + 0.08vw, 0.9rem);
  --text-base: clamp(0.98rem, 0.95rem + 0.12vw, 1.05rem);
  --text-lg:   clamp(1.1rem, 1.05rem + 0.2vw, 1.22rem);
  --text-xl:   clamp(1.28rem, 1.2rem + 0.4vw, 1.5rem);
  --text-2xl:  clamp(1.6rem, 1.4rem + 0.9vw, 2.1rem);
  --text-3xl:  clamp(2rem, 1.6rem + 1.8vw, 2.9rem);
  --text-4xl:  clamp(2.5rem, 1.9rem + 3vw, 4rem);
  --text-5xl:  clamp(3rem, 2rem + 4.6vw, 5rem);

  --leading-tight: 1.08;
  --leading-snug:  1.25;
  --leading-normal:1.6;

  --tracking-tight: -0.02em;
  --tracking-snug:  -0.01em;
  --tracking-wide:  0.04em;

  --weight-regular: 400;
  --weight-medium:  500;
  --weight-semibold:600;
  --weight-bold:    700;

  /* ---- Spacing (4px base) -------------------------------------------- */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --container:      1200px;
  --container-wide: 1320px;
  --container-narrow: 760px;
  --gutter: clamp(1.15rem, 4vw, 2.5rem);
  --section-y: clamp(3.5rem, 7vw, 7rem);

  /* ---- Radius --------------------------------------------------------- */
  --radius-xs:  0.375rem;
  --radius-sm:  0.5rem;
  --radius:     0.75rem;
  --radius-lg:  1rem;
  --radius-xl:  1.5rem;
  --radius-2xl: 2rem;
  --radius-full:999px;

  /* ---- Shadows (blue-tinted, layered) -------------------------------- */
  --shadow-xs: 0 1px 2px rgba(15, 23, 41, 0.06);
  --shadow-sm: 0 1px 2px rgba(15, 23, 41, 0.06), 0 2px 6px rgba(15, 23, 41, 0.05);
  --shadow:    0 4px 12px rgba(15, 23, 41, 0.07), 0 2px 4px rgba(15, 23, 41, 0.05);
  --shadow-md: 0 10px 28px rgba(20, 40, 100, 0.1), 0 4px 8px rgba(15, 23, 41, 0.05);
  --shadow-lg: 0 22px 50px rgba(20, 40, 100, 0.14), 0 8px 16px rgba(15, 23, 41, 0.06);
  --shadow-brand: 0 18px 44px rgba(47, 107, 255, 0.28);

  /* ---- Motion --------------------------------------------------------- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 0.15s;
  --dur: 0.25s;
  --dur-slow: 0.45s;

  --z-header: 100;
  --z-overlay: 900;
  --z-modal: 1000;
  --z-toast: 1100;

  color-scheme: light;
}

/* ===== Dark theme ====================================================== */
[data-theme="dark"] {
  --color-bg:            #0a0f1e;
  --color-bg-subtle:     #0c1325;
  --color-surface:       #101a30;
  --color-surface-2:     #142038;
  --color-surface-3:     #18243f;
  --color-border:        #223049;
  --color-border-strong: #2d3d5a;

  --color-text:          #eef2fb;
  --color-text-muted:    #a6b1c8;
  --color-text-subtle:   #7a8499;
  --color-text-inverse:  #0a0f1e;

  --color-primary:        #4f82ff;
  --color-primary-hover:  #6f99ff;
  --color-primary-soft:   #16224a;
  --color-primary-border: #2a3e6e;
  --color-on-primary:     #ffffff;

  --color-ring: color-mix(in srgb, #4f82ff 45%, transparent);

  --gradient-soft: linear-gradient(180deg, #0c1325 0%, #0a0f1e 100%);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
  --shadow:    0 4px 14px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.6);
  --shadow-brand: 0 18px 44px rgba(47, 107, 255, 0.4);

  color-scheme: dark;
}
