/* ============================================
   Dr. Eliyar — Design System & Base Styles
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Colors */
  --color-bg-dark: #0D1117;
  --color-bg-dark-alt: #161B22;
  --color-primary: #0F4C81;
  --color-primary-hover: #1669B8;
  --color-primary-light: rgba(15, 76, 129, 0.15);
  --color-bg-light: #F5F7FA;
  --color-text-light: #F9FAFB;
  --color-text-dark: #111827;
  --color-text-secondary: #9CA3AF;
  --color-success: #16A34A;
  --color-error: #DC2626;
  --color-border-dark: #1F2933;
  --color-border-light: #E5E7EB;
  --color-overlay: rgba(13, 17, 23, 0.7);
  --color-header-bg: rgba(13, 17, 23, 0.92);
  --color-card-dark: #161B22;
  --color-card-dark-hover: #1C2330;

  /* Fear-mode (calm) palette overrides */
  --color-calm-bg: #EEF2F7;
  --color-calm-card: #FFFFFF;
  --color-calm-primary: #3B82C4;
  --color-calm-accent: #7DD3C0;

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --h1-size: 48px;
  --h2-size: 32px;
  --h3-size: 24px;
  --text-size: 16px;
  --text-sm: 14px;
  --text-xs: 12px;

  /* Spacing scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 18px 45px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 20px rgba(15, 76, 129, 0.3);

  /* Transitions */
  --transition-fast: 200ms cubic-bezier(0.4, 0.0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0.0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0.0, 0.2, 1);

  /* Layout */
  --container-max: 1200px;
  --header-height: 72px;
}

/* --- Reset --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-size);
  line-height: 1.6;
  color: var(--color-text-light);
  background-color: var(--color-bg-dark);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

ul, ol {
  list-style: none;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

/* --- Typography --- */
h1, .h1 {
  font-size: var(--h1-size);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

h2, .h2 {
  font-size: var(--h2-size);
  font-weight: 600;
  line-height: 1.25;
}

h3, .h3 {
  font-size: var(--h3-size);
  font-weight: 600;
  line-height: 1.3;
}

p {
  margin-bottom: var(--space-md);
}

.text-secondary {
  color: var(--color-text-secondary);
}

.text-accent {
  color: var(--color-primary-hover);
}

.text-success {
  color: var(--color-success);
}

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-4xl) 0;
}

.section--light {
  background-color: var(--color-bg-light);
  color: var(--color-text-dark);
}

.section--dark {
  background-color: var(--color-bg-dark);
}

.section--alt {
  background-color: var(--color-bg-dark-alt);
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section__header h2 {
  margin-bottom: var(--space-md);
}

.section__header p {
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.section--light .section__header p {
  color: #6B7280;
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.flex {
  display: flex;
  align-items: center;
}

.flex--between {
  justify-content: space-between;
}

.flex--center {
  justify-content: center;
}

.flex--gap-sm { gap: var(--space-sm); }
.flex--gap-md { gap: var(--space-md); }
.flex--gap-lg { gap: var(--space-lg); }

/* --- Visually Hidden (a11y) --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
