/* ============================================================
   main.css — Design tokens, reset, layout, typography
   ============================================================
   Table of contents:
     1. Custom properties (design tokens)
     2. Reset & base
     3. Typography scale
     4. Layout utilities
     5. Scrollbar
     6. Responsive breakpoints (structural)
   ============================================================ */


/* ─── 1. Custom properties ────────────────────────────────── */
:root {
  /* Palette */
  --color-bg:           #0d0d1a;
  --color-bg-secondary: #12121f;
  --color-bg-card:      rgba(255, 255, 255, 0.04);
  --color-border:       rgba(255, 255, 255, 0.08);

  --color-accent:       #6366f1;   /* indigo */
  --color-accent-cyan:  #22d3ee;   /* cyan */
  --color-accent-hover: #818cf8;

  --color-text:         #e2e8f0;
  --color-text-muted:   #94a3b8;
  --color-text-faint:   #475569;

  --color-success:      #34d399;
  --color-warning:      #fbbf24;

  /* Gradients */
  --gradient-hero:      linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-cyan) 100%);
  --gradient-card:      linear-gradient(145deg, rgba(99,102,241,0.1) 0%, rgba(34,211,238,0.05) 100%);

  /* Spacing scale (8px base) */
  --space-1:  0.25rem;   /*  4px */
  --space-2:  0.5rem;    /*  8px */
  --space-3:  0.75rem;   /* 12px */
  --space-4:  1rem;      /* 16px */
  --space-5:  1.25rem;   /* 20px */
  --space-6:  1.5rem;    /* 24px */
  --space-8:  2rem;      /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */

  /* Typography */
  --font-sans:  'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  1.875rem;   /* 30px */
  --text-4xl:  2.25rem;    /* 36px */
  --text-5xl:  3rem;       /* 48px */
  --text-6xl:  3.75rem;    /* 60px */

  --weight-normal:    400;
  --weight-medium:    500;
  --weight-semibold:  600;
  --weight-bold:      700;
  --weight-extrabold: 800;

  --leading-tight:  1.25;
  --leading-normal: 1.6;
  --leading-loose:  1.8;

  /* Radius */
  --radius-sm:   0.375rem;
  --radius-md:   0.75rem;
  --radius-lg:   1rem;
  --radius-xl:   1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 24px rgba(99,102,241,0.3);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow:   400ms ease;

  /* Layout */
  --max-width: 1100px;
  --nav-height: 64px;
}


/* ─── 2. Reset & base ─────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  min-height: 100vh;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

/* ─── 3. Typography scale ─────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-text);
}

.section-title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-extrabold);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
  position: relative;
  display: inline-block;
}

/* Accent underline on section titles */
.section-title::after {
  content: '';
  display: block;
  height: 3px;
  width: 48px;
  background: var(--gradient-hero);
  border-radius: var(--radius-full);
  margin-top: var(--space-2);
}

.section-subtitle {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  margin-bottom: var(--space-10);
}

.text-accent {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-muted { color: var(--color-text-muted); }
.text-faint { color: var(--color-text-faint); }

.font-mono { font-family: var(--font-mono); }


/* ─── 4. Layout utilities ─────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.section {
  padding-block: var(--space-20);
}

.section--alt {
  background-color: var(--color-bg-secondary);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }


/* ─── 5. Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent-hover);
}


/* ─── 6. Responsive breakpoints ───────────────────────────── */
@media (max-width: 1024px) {
  :root { --max-width: 100%; }

  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --text-5xl: 2.5rem;
    --text-6xl: 2.75rem;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .section {
    padding-block: var(--space-12);
  }
}

@media (max-width: 480px) {
  .container {
    padding-inline: var(--space-4);
  }

  .section-title {
    font-size: var(--text-2xl);
  }
}
