/* =====================================================================
   NextTechBuddy DESIGN TOKENS — the ONLY file allowed to contain colour values.
   Change a value here and the whole site (landing, sign-in, dashboard, lessons) follows.
   Layers:
     1. Primitives   — raw palette. Never used directly outside this file.
     2. Semantic     — what a colour MEANS (text, surface, primary action…). Use these.
     3. Component    — per-component decisions (buttons, inputs, cards…). Use these in components.
   Themes override layer 2/3 only, via [data-theme="…"] on <html>.
   ===================================================================== */

:root {
  /* ---------- 1. PRIMITIVES (brand palette) ---------- */
  --p-cobalt-900: #0e2a66;
  --p-cobalt-700: #173f91;   /* Midnight Cobalt */
  --p-cobalt-500: #2c62d6;
  --p-cobalt-100: #e3eafc;
  --p-sky-600: #0098c4;
  --p-sky-500: #00b9ea;      /* Sky Blue */
  --p-sky-100: #dff6fd;
  --p-lavender-300: #c3cdf3;
  --p-lavender-200: #d5dcf8; /* Blue Lavender */
  --p-lavender-100: #e9edfc;
  --p-frost: #f7f9ff;        /* Frost White */
  --p-white: #ffffff;
  --p-ink-900: #101326;      /* Ink */
  --p-ink-700: #2b3152;
  --p-ink-500: #5a6182;
  --p-ink-300: #8d93b0;
  --p-green-600: #16924a;
  --p-green-100: #ddf5e6;
  --p-red-600: #d23c32;
  --p-red-100: #fde4e1;
  --p-amber-600: #c97d06;
  --p-amber-100: #fff1d6;
  --p-violet-600: #6b4fe0;
  --p-violet-100: #ece7ff;

  /* reference-image palette (sampled from the approved light/dark mocks) */
  --p-peri-50: #f2f6fd;      /* frosty chip glass */
  --p-peri-100: #e4ebfd;     /* topbar glass */
  --p-peri-200: #d8dffc;     /* page top */
  --p-peri-300: #c4d2fd;     /* page middle */
  --p-peri-400: #bdcefd;     /* page deepest */
  --p-sky-200: #c5e6fe;      /* nav active (light) */
  --p-sky-300: #89cef4;      /* light-sky button (dark mode) */
  --p-night-950: #0b1122;    /* Night Ink page */
  --p-night-900: #101421;    /* Night Ink */
  --p-slate-800: #202a40;    /* Slate Glass */
  --p-slate-600: #3d4865;
  --p-lavender-edge: #a8b7ff;
  --p-frost-text: #f2f5ff;

  /* ---------- 2. SEMANTIC ---------- */
  /* ONE theme: dark frame + light content + rich accent panel (like the approved reference) */
  --color-bg: #eef0fb;
  --color-bg-gradient: radial-gradient(1200px 700px at 85% 110%, rgba(196, 210, 253, .9), transparent 60%), linear-gradient(180deg, #f8f9ff 0%, #eef0fb 100%);
  --frame-bg: #0c1022;                 /* the dark app shell */
  --frame-pill: #1b2140;               /* nav pills on the frame */
  --frame-pill-text: #e6eaff;
  --frame-active-bg: var(--p-white);
  --frame-active-text: var(--p-ink-900);
  --surface-content: #eceffa;          /* light area inside the frame */
  --accent-panel: linear-gradient(165deg, #1e3a8a 0%, #2f55c9 45%, #6f8ff0 100%);
  --accent-panel-text: var(--p-white);
  --accent-glass: rgba(255, 255, 255, .14);
  --accent-glass-edge: rgba(255, 255, 255, .22);
  --emphasis-bg: #121735;              /* dark highlight pill (“You”, active task) */
  --emphasis-text: var(--p-white);

  --glass-blur: blur(14px) saturate(140%);
  --glass-sheen: linear-gradient(160deg, rgba(255, 255, 255, .6) 0%, rgba(255, 255, 255, 0) 40%);
  --glass-edge: rgba(23, 63, 145, .08);
  --glass-edge-soft: rgba(23, 63, 145, .06);
  --glass-inner: inset 0 1px 0 rgba(255, 255, 255, .9);
  --glass-1: #eceffa; --glass-2: #fafbff; --glass-3: #f2f4fd; --glass-4: #f2f4fd;

  --color-surface: var(--glass-2);
  --color-surface-solid: var(--p-frost);
  --color-surface-raised: var(--p-white);
  --color-surface-muted: var(--glass-3);
  --color-surface-accent: #dfe6fd;
  --color-border: var(--glass-edge);
  --color-border-strong: rgba(23, 63, 145, .16);
  --color-divider: rgba(23, 63, 145, .10);
  --color-overlay: rgba(16, 19, 38, .38);

  /* text */
  --color-text: var(--p-ink-900);
  --color-text-muted: var(--p-ink-500);
  --color-text-subtle: var(--p-ink-300);
  --color-text-inverse: var(--p-white);
  --color-heading: var(--p-ink-900);
  --color-link: var(--p-cobalt-500);
  --color-code: var(--p-cobalt-700);

  /* actions */
  --color-primary: var(--emphasis-bg);
  --color-primary-hover: var(--p-cobalt-900);
  --color-primary-fill: var(--emphasis-bg);
  --color-on-primary: var(--p-white);
  --color-accent: var(--p-sky-500);
  --color-accent-hover: var(--p-sky-600);
  --color-accent-fill: linear-gradient(180deg, #4fd0f4 0%, var(--p-sky-500) 100%);
  --color-on-accent: var(--p-white);
  --color-focus: var(--p-sky-500);
  --color-art-a: var(--p-cobalt-500);
  --color-art-b: var(--p-sky-500);

  /* status */
  --color-success: var(--p-green-600);
  --color-success-soft: var(--p-green-100);
  --color-danger: var(--p-red-600);
  --color-danger-soft: var(--p-red-100);
  --color-warning: var(--p-amber-600);
  --color-warning-soft: var(--p-amber-100);
  --color-info: var(--p-cobalt-500);
  --color-info-soft: var(--p-cobalt-100);

  /* data / lessons (packets, highlights) */
  --color-flow-request: var(--p-amber-600);
  --color-flow-response: var(--p-green-600);
  --color-flow-lookup: var(--p-sky-500);
  --color-flow-error: var(--p-red-600);
  --color-flow-data: var(--p-violet-600);
  --color-lesson-stage: var(--p-frost);
  --color-lesson-panel: var(--p-white);
  --color-lesson-zoom: var(--p-sky-100);
  --color-lesson-line: var(--p-cobalt-700);
  --color-lesson-line-idle: var(--p-lavender-300);

  /* ---------- typography ---------- */
  --font-sans: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
  --text-display: clamp(2.2rem, 1.4rem + 3vw, 3.6rem);   /* hero headline */
  --text-h1: clamp(1.7rem, 1.2rem + 1.6vw, 2.4rem);       /* page title */
  --text-h2: clamp(1.3rem, 1.05rem + .8vw, 1.7rem);       /* section / card title */
  --text-h3: 1.125rem;                                     /* sub-heading */
  --text-body: 1rem;
  --text-small: .875rem;
  --text-caption: .75rem;
  --weight-regular: 500;
  --weight-medium: 600;
  --weight-bold: 800;
  --leading-tight: 1.15;
  --leading-normal: 1.5;

  /* ---------- space, shape, depth ---------- */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px;
  --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px; --space-16: 64px;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 18px; --radius-xl: 28px; --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(16, 19, 38, .06), 0 2px 6px rgba(23, 63, 145, .06);
  --shadow-md: 0 8px 24px rgba(60, 90, 190, .10);
  --shadow-lg: 0 20px 50px rgba(60, 90, 190, .12);
  --ring: 0 0 0 3px rgba(0, 185, 234, .35);
  --layout-max: 1280px;
  --motion-fast: 140ms; --motion-base: 240ms; --motion-ease: cubic-bezier(.2, .8, .2, 1);

  /* ---------- 3. COMPONENT tokens ---------- */
  --btn-primary-bg: var(--color-primary-fill);
  --btn-primary-bg-hover: var(--color-primary);
  --btn-primary-text: var(--color-on-primary);
  --btn-primary-glow: 0 8px 20px rgba(12, 16, 34, .25);
  --btn-accent-bg: var(--color-accent-fill);
  --btn-accent-bg-hover: var(--color-accent);
  --btn-accent-text: var(--color-on-accent);
  --btn-accent-glow: 0 8px 20px rgba(0, 185, 234, .32);
  --btn-secondary-bg: var(--glass-4);
  --btn-secondary-text: var(--p-ink-900);
  --btn-secondary-border: var(--glass-edge);
  --btn-ghost-text: var(--color-text);
  --btn-ghost-bg-hover: var(--glass-3);
  --input-bg: var(--glass-4);
  --input-border: var(--glass-edge);
  --input-text: var(--color-text);
  --input-placeholder: var(--color-text-subtle);
  --panel-bg: var(--glass-1);          /* big outer screen panel */
  --card-bg: var(--glass-2);           /* card inside a panel */
  --card-border: var(--glass-edge);
  --card-shadow: var(--shadow-md);
  --tile-bg: var(--glass-4);           /* frosty tile: Today, day box, lesson */
  --topbar-bg: var(--glass-3);
  --chip-bg: var(--glass-4);
  --chip-text: var(--color-text);
  --chip-border: var(--glass-edge);
  --chip-icon: var(--p-cobalt-500);
  --nav-active-bg: var(--color-surface-accent);
  --nav-active-text: var(--p-cobalt-700);
  --cmd-key-bg: var(--p-cobalt-100);
  --cmd-key-text: var(--color-code);
}
