/* ==========================================================================
   NightScroll - Design Tokens
   The single source of truth for color, type, space, elevation and motion.
   No raw values in component or page styles: reference these variables.

   Contrast: every text token is WCAG AA verified (>= 4.5:1) on all surface
   layers. Do not place --purple-400 text on solid --purple-600 fills; use
   --white or --purple-300 there instead.
   ========================================================================== */

:root {
  /* ---- Purple accent scale ---------------------------------------------- */
  --purple-300: #c4b5fd;   /* accent text on purple surfaces (>= 5.9:1)    */
  --purple-400: #a78bfa;   /* links, icons, focus ring          (>= 6.0:1) */
  --purple-500: #8b5cf6;   /* primary hover                                */
  --purple-600: #7c3aed;   /* primary (brand)                              */
  --purple-700: #6d28d9;   /* primary active                               */
  --purple-900: #4c1d95;   /* badges, deep accents                         */
  --purple-950: #2e1065;   /* gradients                                    */

  /* ---- Layered near-black surfaces --------------------------------------- */
  --bg: #0a0a0f;                          /* page background              */
  --surface-1: #111118;                   /* cards, panels, modals        */
  --surface-2: #17171f;                   /* inputs, dropdowns, fields    */
  --surface-3: #1f1f2a;                   /* hover states, raised rows    */
  --surface-glass: rgba(10, 10, 15, 0.78);/* sticky header backdrop       */
  --scrim: rgba(5, 5, 9, 0.72);           /* modal overlay                */

  /* ---- Borders ------------------------------------------------------------- */
  --border: #262633;
  --border-strong: #34344a;

  /* ---- Text (AA on background + all surfaces) ----------------------------- */
  --text: #f4f4f8;        /* headings and body            (>= 14.8:1) */
  --text-muted: #a9a9bf;  /* secondary text               (>= 7.1:1)  */
  --text-faint: #8d8da6;  /* timestamps, fine print       (>= 5.0:1)  */

  /* ---- Semantic ------------------------------------------------------------- */
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.12);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --danger-strong: #ef4444;                     /* solid danger buttons */
  --white: #ffffff;

  /* ---- Focus + decoration ---------------------------------------------------- */
  --focus-ring: var(--purple-400);
  --gradient-brand: linear-gradient(135deg, var(--purple-700), var(--purple-950));

  /* ---- Typography ------------------------------------------------------------ */
  --font-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Fluid type scale */
  --text-2xs: 0.6875rem;                          /* 11px: badges        */
  --text-xs: 0.75rem;                             /* 12px: hints         */
  --text-sm: 0.8125rem;                           /* 13px: meta          */
  --text-base: 0.9375rem;                         /* 15px: body          */
  --text-md: 1rem;                                /* 16px                */
  --text-lg: 1.125rem;                            /* 18px                */
  --text-xl: clamp(1.25rem, 1.15rem + 0.45vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  --text-3xl: clamp(1.875rem, 1.55rem + 1.5vw, 2.5rem);
  --text-hero: clamp(2.25rem, 1.7rem + 2.4vw, 3.5rem);

  --leading-tight: 1.1;    /* display headings only */
  --leading-snug: 1.35;
  --leading-base: 1.6;
  --display-tracking: 0.02em;  /* keeps Bebas Neue legible on long titles */

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

  /* ---- Radii -------------------------------------------------------------------- */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* ---- Elevation ---------------------------------------------------------------- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 0 1px rgba(124, 58, 237, 0.35), 0 8px 32px rgba(124, 58, 237, 0.25);

  /* ---- Z-index layers (never invent new values) ----------------------------------- */
  --z-header: 100;
  --z-dropdown: 200;
  --z-drawer: 300;
  --z-modal: 400;
  --z-toast: 500;

  /* ---- Motion ---------------------------------------------------------------------- */
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 320ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  /* ---- Layout ----------------------------------------------------------------------- */
  --container-max: 1240px;
  --container-pad: clamp(1rem, 0.6rem + 2vw, 1.75rem);
  --header-h: 64px;
  --touch-target: 44px;
  --cover-ratio: 2 / 3;   /* standard book cover */
}
