/* =====================================================================
   SortiGo — Design Tokens
   Single source of truth for color, type, spacing, radius, shadow, motion.
   ===================================================================== */

/* Fonts — loaded via Google Fonts CDN.
   Substitution: Manrope stands in for an unprovided brand font. */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ---------- Color: Sky (primary) ------------------------------------ */
  --sky-50:  #F0F9FF;
  --sky-100: #E0F2FE;
  --sky-200: #BAE6FD;
  --sky-300: #7DD3FC;
  --sky-400: #38BDF8;
  --sky-500: #0EA5E9;
  --sky-600: #0284C7;  /* PRIMARY */
  --sky-700: #0369A1;
  --sky-800: #075985;
  --sky-900: #0C4A6E;

  /* ---------- Color: Slate (neutrals) --------------------------------- */
  --slate-50:  #F8FAFC;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-600: #475569;
  --slate-700: #334155;  /* PRIMARY TEXT */
  --slate-800: #1E293B;
  --slate-900: #0F172A;

  /* ---------- Color: Semantic ----------------------------------------- */
  --success-50:  #ECFDF5;
  --success-500: #10B981;
  --success-600: #059669;
  --success-700: #047857;

  --warning-50:  #FFFBEB;
  --warning-500: #F59E0B;
  --warning-600: #D97706;
  --warning-700: #B45309;

  --danger-50:   #FEF2F2;
  --danger-500:  #EF4444;
  --danger-600:  #DC2626;
  --danger-700:  #B91C1C;

  /* ---------- Semantic role tokens ------------------------------------ */
  --bg:           var(--slate-50);     /* page background */
  --surface:      #FFFFFF;             /* cards & sheets */
  --surface-alt:  var(--slate-100);    /* striped rows, code blocks */
  --highlight:    var(--sky-100);      /* selected, info banner, ghost hover */

  --fg-1:         var(--slate-700);    /* primary text */
  --fg-2:         var(--slate-500);    /* secondary text */
  --fg-3:         var(--slate-400);    /* tertiary / placeholder */
  --fg-inverse:   #FFFFFF;             /* text on primary fill */
  --fg-link:      var(--sky-700);

  --border:       var(--slate-200);
  --border-strong:var(--slate-300);
  --divider:      var(--slate-100);

  --primary:      var(--sky-600);
  --primary-hover:var(--sky-700);
  --primary-press:var(--sky-800);
  --primary-tint: var(--sky-100);
  --accent:       var(--sky-400);
  --focus-ring:   var(--sky-400);

  /* ---------- Type ---------------------------------------------------- */
  --font-sans:    'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-display: var(--font-sans);

  /* Sizes — 1.25 scale, anchored at 16px */
  --text-2xs:  11px;
  --text-xs:   12px;
  --text-sm:   14px;
  --text-md:   16px;   /* body default */
  --text-lg:   18px;
  --text-xl:   20px;
  --text-2xl:  24px;
  --text-3xl:  30px;
  --text-4xl:  38px;
  --text-5xl:  48px;
  --text-6xl:  60px;
  --text-7xl:  76px;

  /* Weights */
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;
  --weight-black:    800;

  /* Line heights */
  --lh-tight:  1.15;
  --lh-snug:   1.3;
  --lh-normal: 1.5;
  --lh-relaxed:1.65;

  /* Letter spacing */
  --tracking-tight:  -0.02em;
  --tracking-normal: 0;
  --tracking-wide:   0.04em;
  --tracking-caps:   0.08em;

  /* ---------- Spacing (4pt grid) -------------------------------------- */
  --space-0:  0px;
  --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;
  --space-20: 80px;
  --space-24: 96px;

  /* ---------- Radius -------------------------------------------------- */
  --radius-xs:  4px;
  --radius-sm:  8px;    /* buttons, inputs */
  --radius-md:  12px;   /* cards */
  --radius-lg:  16px;   /* modals */
  --radius-xl:  24px;
  --radius-full:999px;

  /* ---------- Shadow (cool sky undertone) ----------------------------- */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12), 0 4px 8px rgba(15, 23, 42, 0.06);
  --shadow-focus: 0 0 0 4px rgba(56, 189, 248, 0.30);

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

  /* ---------- Container widths ---------------------------------------- */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1200px;
  --container-2xl:1440px;
}

/* =====================================================================
   Semantic element styles
   ===================================================================== */

html, body {
  background: var(--bg);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, .h1 {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  line-height: var(--lh-tight);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tight);
  color: var(--slate-800);
  margin: 0;
}
h2, .h2 {
  font-size: var(--text-3xl);
  line-height: var(--lh-tight);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  color: var(--slate-800);
  margin: 0;
}
h3, .h3 {
  font-size: var(--text-2xl);
  line-height: var(--lh-snug);
  font-weight: var(--weight-bold);
  color: var(--slate-800);
  margin: 0;
}
h4, .h4 {
  font-size: var(--text-xl);
  line-height: var(--lh-snug);
  font-weight: var(--weight-semibold);
  color: var(--slate-800);
  margin: 0;
}
h5, .h5 {
  font-size: var(--text-lg);
  line-height: var(--lh-snug);
  font-weight: var(--weight-semibold);
  color: var(--fg-1);
  margin: 0;
}

p, .body {
  font-size: var(--text-md);
  line-height: var(--lh-relaxed);
  color: var(--fg-1);
  margin: 0;
  text-wrap: pretty;
}

.body-sm, small {
  font-size: var(--text-sm);
  line-height: var(--lh-normal);
  color: var(--fg-2);
}

.eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--sky-700);
}

.lead {
  font-size: var(--text-xl);
  line-height: var(--lh-relaxed);
  color: var(--fg-2);
  font-weight: var(--weight-regular);
}

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: var(--slate-800);
  background: var(--surface-alt);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
}

a, .link {
  color: var(--fg-link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-base) var(--ease-out);
}
a:hover, .link:hover {
  border-bottom-color: currentColor;
}

::selection {
  background: var(--sky-200);
  color: var(--slate-900);
}

*:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
