/* ═══════════════════════════════════════════════════════════════════════════
   IDCRAFT DESIGN TOKENS — Phase 11
   Single source of truth for color, spacing, type, radius, elevation & motion.
   Consumed by the workspace shell, the admin panel and every component.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Color · core ─────────────────────────────── */
  --c-ink: #0f0f0f;
  --c-ink-2: #3a3a3a;
  --c-ink-3: #717171;
  --c-ink-4: #9c9c9c;
  --c-surface: #ffffff;
  --c-surface-2: #f7f6f3;
  --c-surface-3: #efefec;
  --c-surface-4: rgba(255, 255, 255, 0.6);
  --c-border: rgba(0, 0, 0, 0.08);
  --c-border-strong: rgba(0, 0, 0, 0.15);

  /* ── Color · brand/accent ─────────────────────── */
  --c-accent: #ff5c35;
  --c-accent-hover: #e94f2b;
  --c-accent-2: #ffb347;
  --c-accent-3: #8a3dff;
  --c-accent-soft: rgba(255, 92, 53, 0.12);
  --c-accent-ring: rgba(255, 92, 53, 0.28);
  --c-accent-grad: linear-gradient(135deg, #ff5c35 0%, #ffb347 100%);
  --c-accent-grad-soft: linear-gradient(135deg, rgba(255, 92, 53, 0.14), rgba(255, 179, 71, 0.14));

  /* ── Color · semantic ─────────────────────────── */
  --c-success: #1a9454;
  --c-success-soft: rgba(26, 148, 84, 0.12);
  --c-danger: #d93025;
  --c-danger-soft: rgba(217, 48, 37, 0.12);
  --c-warning: #c78a00;
  --c-warning-soft: rgba(199, 138, 0, 0.14);
  --c-info: #1a73e8;
  --c-info-soft: rgba(26, 115, 232, 0.12);

  /* ── Color · workspace chrome ─────────────────── */
  --c-sidebar-bg: #121212;
  --c-sidebar-bg-2: #1d1d1d;
  --c-sidebar-ink: rgba(255, 255, 255, 0.72);
  --c-sidebar-ink-strong: #ffffff;
  --c-sidebar-border: rgba(255, 255, 255, 0.08);
  --c-topbar-bg: rgba(255, 255, 255, 0.82);

  /* ── Color · footer (public pages) ────────────── */
  --c-footer-bg: #121212;
  --c-footer-bg-2: #1b1b1b;
  --c-footer-text: rgba(255, 255, 255, 0.72);
  --c-footer-link: rgba(255, 255, 255, 0.66);
  --c-footer-heading: rgba(255, 255, 255, 0.42);

  /* ── Spacing scale ────────────────────────────── */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.875rem;
  --space-4: 1.25rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4rem;
  --space-8: 6rem;

  /* ── Typography ───────────────────────────────── */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;

  --fs-3xs: 0.625rem;   /* 10px  */
  --fs-2xs: 0.6875rem;  /* 11px  */
  --fs-xs: 0.78rem;
  --fs-sm: 0.9rem;
  --fs-base: 1rem;
  --fs-lg: 1.18rem;
  --fs-xl: 1.55rem;
  --fs-2xl: 2rem;
  --fs-3xl: 2.7rem;
  --fs-4xl: 3.5rem;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.08em;

  --lh-tight: 1.1;
  --lh-snug: 1.3;
  --lh-normal: 1.5;
  --lh-relaxed: 1.65;

  /* ── Radii ────────────────────────────────────── */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;

  /* ── Shadows · elevation ──────────────────────── */
  --shadow-xs: 0 1px 2px rgba(15, 15, 15, 0.05);
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.14);
  --shadow-xl: 0 24px 80px rgba(0, 0, 0, 0.18);
  --shadow-accent: 0 8px 28px rgba(255, 92, 53, 0.28);

  /* ── Motion ───────────────────────────────────── */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 150ms;
  --dur-base: 240ms;
  --dur-slow: 400ms;
  --dur-slower: 700ms;

  /* ── Layout · chrome dims ─────────────────────── */
  --nav-h: 60px;
  --sidebar-w: 264px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 64px;
  --content-max-w: 1240px;

  /* ── Z-index ladder ───────────────────────────── */
  --z-sidebar: 1030;
  --z-topbar: 1040;
  --z-dropdown: 1050;
  --z-modal: 1060;
  --z-backdrop: 1055;
  --z-toast: 2000;
  --z-tooltip: 3000;

  /* ── Component tokens ─────────────────────────── */
  --control-h: 42px;
  --control-h-sm: 34px;
  --input-radius: 12px;
  --card-pad: 1.25rem;
  --student-modal-gutter: 18px;
}

/* ── Dark theme ──────────────────────────────────── */
[data-theme="dark"] {
  --c-ink: #f0efeb;
  --c-ink-2: #c8c6c0;
  --c-ink-3: #8a887f;
  --c-ink-4: #6b6a64;
  --c-surface: #141414;
  --c-surface-2: #1e1e1e;
  --c-surface-3: #282828;
  --c-surface-4: rgba(20, 20, 20, 0.6);

  --c-border: rgba(255, 255, 255, 0.08);
  --c-border-strong: rgba(255, 255, 255, 0.14);

  --c-accent: #ff6b4a;
  --c-accent-hover: #ff815f;
  --c-accent-soft: rgba(255, 92, 53, 0.18);
  --c-accent-ring: rgba(255, 92, 53, 0.38);

  --c-success-soft: rgba(26, 148, 84, 0.18);
  --c-danger-soft: rgba(217, 48, 37, 0.18);
  --c-warning-soft: rgba(199, 138, 0, 0.2);
  --c-info-soft: rgba(26, 115, 232, 0.18);

  --c-sidebar-bg: #0c0c0c;
  --c-sidebar-bg-2: #181818;
  --c-topbar-bg: rgba(20, 20, 20, 0.82);

  --c-footer-bg: #080808;
  --c-footer-bg-2: #121212;
  --c-footer-text: rgba(255, 255, 255, 0.78);
  --c-footer-link: rgba(255, 255, 255, 0.74);
  --c-footer-heading: rgba(255, 255, 255, 0.48);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 24px 80px rgba(0, 0, 0, 0.7);
}

/* ── Reduced motion ──────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}