/* ============================================================
   main.css — Root variables, CSS reset, and base styles
   ============================================================ */

/* ---- Google Fonts fallback (loaded via <link> in HTML) ---- */

/* ---- CSS Custom Properties ---- */
:root {
  /* Background Scale */
  --color-bg-primary:    #0a0a0f;
  --color-bg-secondary:  #12121a;
  --color-bg-tertiary:   #1a1a26;

  /* Text Scale */
  --color-text-primary:  #e8e8f0;
  --color-text-secondary:#a0a0b8;
  --color-text-muted:    #606078;

  /* Accent */
  --color-accent:        #6c63ff;
  --color-accent-hover:  #8b84ff;
  --color-accent-subtle: #6c63ff1a;

  /* Semantic */
  --color-border:        #2a2a3a;
  --color-success:       #4ade80;
  --color-error:         #f87171;

  /* Typography */
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing Scale (8px base) */
  --space-1:  0.25rem;  /* 4px  */
  --space-2:  0.5rem;   /* 8px  */
  --space-3:  0.75rem;  /* 12px */
  --space-4:  1rem;     /* 16px */
  --space-6:  1.5rem;   /* 24px */
  --space-8:  2rem;     /* 32px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */

  /* Border Radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;

  /* Layout */
  --max-width: 1100px;
  --nav-height: 64px;
}

/* ---- CSS Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  background-color: var(--color-bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Base Typography ---- */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text-primary);
  line-height: 1.2;
  font-weight: 700;
}

p {
  color: var(--color-text-secondary);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover,
a:focus-visible {
  color: var(--color-accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

button {
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  background: none;
}

/* ---- Focus Styles (accessibility) ---- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---- Layout Utilities ---- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.section {
  padding-block: var(--space-16);
}

.section__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: var(--space-12);
  position: relative;
}

.section__title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--color-accent);
  margin-top: var(--space-3);
  border-radius: var(--radius-full);
}

/* ---- Visually Hidden (screen reader only) ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
