/* Veluma — Design Tokens
 *
 * Single source of truth for brand and UI primitives.
 * Every other stylesheet references these variables.
 * Updating a value here updates the entire application.
 *
 * Naming convention:
 *   --color-*  → colors
 *   --font-*   → typography
 *   --space-*  → spacing scale (rem-based, 4px increments)
 *   --radius-* → border radius
 *   --shadow-* → elevation/depth
 *   --z-*      → z-index layering
 *   --duration-* → animation timing
 */

:root {
  /* ─────────────────────────────────────────────
   * Brand Colors (per memory)
   * ───────────────────────────────────────────── */

  /* Primary — magenta/pink (wordmark & accents) */
  --color-brand-primary: #FE019A;
  --color-brand-primary-soft: #FCE4F0;
  --color-brand-primary-hover: #E0017F;

  /* Anchor — deep navy (primary buttons & headers) */
  --color-brand-anchor: #1C0264;
  --color-brand-anchor-hover: #15014D;
  --color-brand-anchor-soft: #E8E5F2;

  /* Accent — yellow (logo burst/star only — used sparingly) */
  --color-brand-accent: #FFFF00;

  /* Muted — gray (muted text & dividers) */
  --color-brand-muted: #A6A6A6;

  /* ─────────────────────────────────────────────
   * Semantic Action / Role tokens
   *
   * Brand hierarchy (Lumenasa): PINK is the primary action/brand color,
   * PURPLE (deep navy) is the secondary/structural anchor, YELLOW stays a
   * sparing logo-only accent. Consuming styles reference THESE role tokens,
   * so the whole hierarchy can be re-skinned here without touching any
   * component. The raw --color-brand-* hex values above never change —
   * only the roles they're assigned to.
   *
   * Contrast note: white-on-bright-pink (#FE019A) is only ~3.7:1 (fails AA),
   * so the primary pink action RESTS on the darker #E0017F where white text
   * is ~4.7:1 (passes AA) — at rest and on hover alike. Bright #FE019A stays
   * the brand/wordmark/accent color via --color-brand-primary (untouched).
   * ───────────────────────────────────────────── */

  /* Primary action — PINK (primary buttons, active nav, key accents).
   * Rests on the darker #E0017F so white lettering is AA-readable at rest;
   * rest now equals the old hover shade, so pink no longer darkens on hover. */
  --color-action-primary: var(--color-brand-primary-hover);  /* #E0017F — white stays AA (~4.7:1) */
  --color-action-primary-hover: var(--color-brand-primary-hover);
  --color-action-primary-soft: var(--color-brand-primary-soft);
  --color-on-primary: var(--color-text-inverse);    /* white text on pink, at rest and on hover */

  /* Secondary / structural — PURPLE deep navy (anchor surfaces, secondary buttons) */
  --color-action-secondary: var(--color-brand-anchor);
  --color-action-secondary-hover: var(--color-brand-anchor-hover);
  --color-action-secondary-soft: var(--color-brand-anchor-soft);
  --color-on-secondary: var(--color-text-inverse);  /* white text on purple — ~16:1 */

  /* ─────────────────────────────────────────────
   * Semantic Surface Colors
   * ───────────────────────────────────────────── */

  --color-surface-page: #F8F4EC;        /* cream — main background */
  --color-surface-card: #FFFCF6;        /* paper — elevated surfaces */
  --color-surface-overlay: rgba(13, 27, 61, 0.4);  /* navy overlay */

  /* ─────────────────────────────────────────────
   * Semantic Text Colors
   * ───────────────────────────────────────────── */

  --color-text-primary: var(--color-brand-anchor);  /* deep purple — headings & body-dark (structural anchor) */
  --color-text-secondary: #4A5168;      /* softer for secondary content */
  --color-text-muted: #8A91A8;          /* very muted for hints */
  --color-text-inverse: #FFFCF6;        /* light text on dark backgrounds */
  --color-text-link: var(--color-brand-primary);

  /* ─────────────────────────────────────────────
   * Status Colors
   * ───────────────────────────────────────────── */

  --color-status-success: #2E7D5B;
  --color-status-warning: #C68A1B;
  --color-status-error: #B82828;
  --color-status-info: #2E5C8A;

  /* ─────────────────────────────────────────────
   * Borders & Dividers
   * ───────────────────────────────────────────── */

  --color-border-soft: rgba(13, 27, 61, 0.08);
  --color-border-medium: rgba(13, 27, 61, 0.16);
  --color-border-strong: rgba(13, 27, 61, 0.32);

  /* ─────────────────────────────────────────────
   * Typography
   * ───────────────────────────────────────────── */

  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Monaco, 'Courier New', monospace;

  --font-size-xs: 0.75rem;     /* 12px */
  --font-size-sm: 0.875rem;    /* 14px */
  --font-size-base: 1rem;      /* 16px */
  --font-size-md: 1.125rem;    /* 18px */
  --font-size-lg: 1.25rem;     /* 20px */
  --font-size-xl: 1.5rem;      /* 24px */
  --font-size-2xl: 2rem;       /* 32px */
  --font-size-3xl: 2.5rem;     /* 40px */
  --font-size-4xl: 3.5rem;     /* 56px */

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

  --line-height-tight: 1.15;
  --line-height-base: 1.5;
  --line-height-loose: 1.75;

  --letter-spacing-tight: -0.02em;
  --letter-spacing-base: 0;
  --letter-spacing-wide: 0.05em;
  --letter-spacing-mono: 0.12em;

  /* ─────────────────────────────────────────────
   * Spacing Scale (4px increments)
   * ───────────────────────────────────────────── */

  --space-0: 0;
  --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-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */

  /* ─────────────────────────────────────────────
   * Border Radius
   * ───────────────────────────────────────────── */

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* ─────────────────────────────────────────────
   * Shadows / Elevation
   * ───────────────────────────────────────────── */

  --shadow-sm: 0 1px 2px rgba(13, 27, 61, 0.06);
  --shadow-md: 0 4px 12px rgba(13, 27, 61, 0.08);
  --shadow-lg: 0 12px 28px rgba(13, 27, 61, 0.12);
  --shadow-xl: 0 24px 48px rgba(13, 27, 61, 0.16);
  --shadow-focus: 0 0 0 3px rgba(254, 1, 154, 0.25);

  /* ─────────────────────────────────────────────
   * Z-Index Layering
   * ───────────────────────────────────────────── */

  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;

  /* ─────────────────────────────────────────────
   * Animation Durations
   * ───────────────────────────────────────────── */

  --duration-instant: 100ms;
  --duration-fast: 200ms;
  --duration-base: 300ms;
  --duration-slow: 500ms;

  --easing-default: cubic-bezier(0.4, 0, 0.2, 1);
  --easing-emphasized: cubic-bezier(0.2, 0, 0, 1);

  /* ─────────────────────────────────────────────
   * Layout Dimensions
   * ───────────────────────────────────────────── */

  --layout-sidebar-width: 240px;
  --layout-sidebar-collapsed-width: 64px;
  --layout-header-height: 64px;
  --layout-content-max-width: 1440px;
}

/* ─────────────────────────────────────────────
 * Reset & Base
 * ───────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height-base);
  color: var(--color-text-primary);
  background: var(--color-surface-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
}

a {
  color: var(--color-text-link);
  text-decoration: none;
  transition: color var(--duration-fast) var(--easing-default);
}

a:hover {
  color: var(--color-brand-primary-hover);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

img,
svg {
  max-width: 100%;
  display: block;
}
