:root {
  /* Fonts */
  --font-base: 'Inter', system-ui, sans-serif;
  --font-heading: 'Poppins', sans-serif;

  /* Colors */
  --color-bg: #ffffff;
  --color-text: #111827;
  --color-primary: #4f46e5;
  --color-primary-hover: #6366f1;
  --color-primary-active: #1e40af;

  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;

  /* Borders & radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.15);

  /* Transition timing */
  --transition-fast: 0.2s ease-in-out;
  --transition-base: 0.3s ease;
  --transition-slow: 0.6s ease;
}
/* Default (light mode) */
:root {
  --color-bg: #ffffff;
  --color-text: #111827;
  --color-primary: #4f46e5;
  --color-primary-hover: #6366f1;
  --color-primary-active: #1e40af;
}

/* Dark mode override */
.dark {
  --color-bg: #0f0f17;
  --color-text: #e5e7eb;
  --color-primary: #93c5fd;
  --color-primary-hover: #bfdbfe;
  --color-primary-active: #60a5fa;
}

/* ===========================
   Global Reset & Base Styles
   =========================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-base, 'Inter', system-ui, sans-serif);
  background-color: var(--color-bg, #ffffff);
  color: var(--color-text, #111827);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading, 'Poppins', sans-serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text, #111827);
}

/* Links */
a {
  color: var(--color-primary, #4f46e5);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
a:visited {
  color: var(--color-primary, #4f46e5);
}
a:active {
  color: var(--color-primary-active, #1e40af);
}

/* Lists */
ul, ol {
  padding-left: var(--space-md, 1.25rem);
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
}
th, td {
  padding: 0.5rem;
  text-align: left;
}

/* Forms baseline */
button, input, textarea, select {
  font: inherit;
}

/* Buttons (baseline) */
button {
  cursor: pointer;
  border: none;
  background: none;
}

/* ===========================
   Accessibility & Focus States
   =========================== */
:focus-visible {
  outline: 2px solid var(--color-primary, #4f46e5);
  outline-offset: 2px;
}

/* ===========================
   Reduced Motion Support
   =========================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
