/* ==========================================================================
   Valtx SDD — Design tokens
   Single source of truth for palette, spacing, type scale, radii and shadows.
   Do not hardcode colours anywhere else; add a token here instead.
   ========================================================================== */

:root {
  /* --- Raw palette ------------------------------------------------------ */
  /* Neutrals (grays) */
  --gray-950: #18181B;
  --gray-800: #27272A;
  --gray-700: #3F3F46;
  --gray-600: #52525B;
  --gray-400: #A1A1AA;
  --gray-300: #D4D4D8;
  --gray-200: #E4E4E7;
  --gray-100: #F1F1F3;
  --smoke:    #F7F7F8;  /* smoke white — page background */
  --white:    #FFFFFF;

  /* Purple (accent) */
  --purple-900: #4C1D95;
  --purple-800: #5B21B6;
  --purple-700: #6D28D9;
  --purple-400: #A78BFA;
  --purple-100: #EDE9FE;

  /* Dark-mode surfaces */
  --ink-950: #121214;
  --ink-900: #1C1C20;
  --ink-800: #2A2A31;

  /* --- Semantic roles (light theme) ------------------------------------- */
  --color-bg:            var(--smoke);
  --color-bg-alt:        var(--gray-100);
  --color-surface:       var(--white);
  --color-border:        var(--gray-200);
  --color-border-strong: var(--gray-300);

  --color-heading:  var(--gray-950);
  --color-text:     var(--gray-700);
  --color-muted:    var(--gray-600);

  --color-accent:        var(--purple-700);
  --color-accent-hover:  var(--purple-800);
  --color-accent-soft:   var(--purple-100);
  --color-accent-strong: var(--purple-800);
  --color-on-accent:     var(--white);

  --color-focus:  var(--purple-700);
  --color-shadow: 24 24 27; /* RGB channels, used with alpha */

  /* --- Typography ------------------------------------------------------- */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
               Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  /* Fluid type scale (min .. max) */
  --text-xs:   0.8125rem;                              /* 13px */
  --text-sm:   0.9375rem;                              /* 15px */
  --text-base: 1rem;                                   /* 16px */
  --text-lg:   clamp(1.0625rem, 0.99rem + 0.34vw, 1.1875rem);
  --text-xl:   clamp(1.25rem, 1.17rem + 0.4vw, 1.4375rem);
  --text-2xl:  clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --text-3xl:  clamp(2rem, 1.55rem + 2.2vw, 3.25rem);

  --leading-tight:  1.15;
  --leading-snug:   1.35;
  --leading-normal: 1.65;

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

  --tracking-tight: -0.02em;
  --tracking-wide:   0.08em;

  /* --- Spacing scale (4px base) ----------------------------------------- */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.5rem;
  --space-6:  2rem;
  --space-7:  2.5rem;
  --space-8:  3rem;
  --space-9:  4rem;
  --space-10: 5.5rem;

  --section-y: clamp(3.5rem, 2.4rem + 4.5vw, 6rem);

  /* --- Layout ----------------------------------------------------------- */
  --container-max: 68rem;
  --container-pad: clamp(1rem, 0.6rem + 1.8vw, 2rem);
  --measure: 62ch;

  /* --- Radii ------------------------------------------------------------ */
  --radius-sm:   6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-pill: 999px;

  /* --- Shadows ---------------------------------------------------------- */
  --shadow-sm: 0 1px 2px rgb(var(--color-shadow) / 0.06),
               0 1px 3px rgb(var(--color-shadow) / 0.05);
  --shadow-md: 0 2px 4px rgb(var(--color-shadow) / 0.05),
               0 8px 20px rgb(var(--color-shadow) / 0.07);

  /* --- Motion ----------------------------------------------------------- */
  --ease: cubic-bezier(0.2, 0, 0.15, 1);
  --duration-fast: 120ms;
  --duration-base: 200ms;
}

/* --- Dark theme ---------------------------------------------------------
   Only the semantic roles are remapped; the raw palette stays the same.
   ------------------------------------------------------------------------ */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg:            var(--ink-950);
    --color-bg-alt:        var(--ink-900);
    --color-surface:       var(--ink-900);
    --color-border:        var(--ink-800);
    --color-border-strong: #3A3A44;

    --color-heading: #FAFAFA;
    --color-text:    var(--gray-300);
    --color-muted:   var(--gray-400);

    --color-accent:        var(--purple-400);
    --color-accent-hover:  #C4B5FD;
    --color-accent-soft:   #2A2140;
    --color-accent-strong: var(--purple-400);
    --color-on-accent:     #1A1030;

    --color-focus:  var(--purple-400);
    --color-shadow: 0 0 0;

    --shadow-sm: 0 1px 2px rgb(var(--color-shadow) / 0.4);
    --shadow-md: 0 2px 4px rgb(var(--color-shadow) / 0.35),
                 0 8px 20px rgb(var(--color-shadow) / 0.45);
  }
}
