/* ─── Design Tokens ───────────────────────────────────────────────────── */
:root {
  /* Colors */
  --clr-bg:           #07070e;
  --clr-surface:      #0f0f1c;
  --clr-surface-2:    #161628;
  --clr-surface-3:    #1e1e34;
  --clr-border:       rgba(255, 255, 255, 0.07);
  --clr-border-2:     rgba(255, 255, 255, 0.12);

  --clr-accent:       #6366f1;
  --clr-accent-hover: #4f52e0;
  --clr-accent-light: #818cf8;
  --clr-accent-dim:   rgba(99, 102, 241, 0.12);
  --clr-accent-glow:  rgba(99, 102, 241, 0.25);

  --clr-text:         #eeeef5;
  --clr-text-2:       #9898be;
  --clr-text-3:       #5c5c88;

  --clr-green:        #22c55e;
  --clr-green-dim:    rgba(34, 197, 94, 0.12);
  --clr-amber:        #f59e0b;
  --clr-red:          #ef4444;

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

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;
  --text-7xl:  4.5rem;

  --leading-tight:  1.2;
  --leading-snug:   1.35;
  --leading-normal: 1.6;
  --leading-loose:  1.8;

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

  /* Spacing */
  --sp-1:   0.25rem;
  --sp-2:   0.5rem;
  --sp-3:   0.75rem;
  --sp-4:   1rem;
  --sp-5:   1.25rem;
  --sp-6:   1.5rem;
  --sp-8:   2rem;
  --sp-10:  2.5rem;
  --sp-12:  3rem;
  --sp-16:  4rem;
  --sp-20:  5rem;
  --sp-24:  6rem;
  --sp-32:  8rem;
  --sp-40:  10rem;

  /* Layout */
  --max-w:     1200px;
  --max-w-sm:  720px;
  --max-w-md:  960px;
  --nav-h:     64px;

  /* Radius */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --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 40px rgba(0,0,0,0.6);
  --shadow-accent: 0 0 40px rgba(99, 102, 241, 0.18);

  /* Transitions */
  --ease:       cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in:    cubic-bezier(0.4, 0, 1, 1);
  --dur-fast:   120ms;
  --dur-normal: 220ms;
  --dur-slow:   400ms;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
}

body {
  font-family: var(--font);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--clr-text);
  background-color: var(--clr-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

button, input, select, textarea {
  font: inherit;
}

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

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--clr-text);
}

/* ─── Typography ─────────────────────────────────────────────────────── */
.text-xs    { font-size: var(--text-xs); }
.text-sm    { font-size: var(--text-sm); }
.text-base  { font-size: var(--text-base); }
.text-lg    { font-size: var(--text-lg); }
.text-xl    { font-size: var(--text-xl); }
.text-2xl   { font-size: var(--text-2xl); }
.text-3xl   { font-size: var(--text-3xl); }
.text-4xl   { font-size: var(--text-4xl); }
.text-5xl   { font-size: var(--text-5xl); }

.font-medium   { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold     { font-weight: var(--weight-bold); }

.clr-2    { color: var(--clr-text-2); }
.clr-3    { color: var(--clr-text-3); }
.clr-accent { color: var(--clr-accent-light); }

/* ─── Layout Utilities ───────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

.section {
  padding-block: var(--sp-24);
}

.section-sm {
  padding-block: var(--sp-16);
}

/* ─── Grid ───────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-8); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); }

/* ─── Flex Utilities ─────────────────────────────────────────────────── */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }

/* ─── Section Headers ────────────────────────────────────────────────── */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--clr-accent-light);
  background: var(--clr-accent-dim);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--sp-4);
}

.section-heading {
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  color: var(--clr-text);
}

.section-heading em {
  font-style: normal;
  color: var(--clr-accent-light);
}

.section-sub {
  font-size: var(--text-lg);
  color: var(--clr-text-2);
  line-height: var(--leading-loose);
  max-width: 56ch;
}

.section-header {
  margin-bottom: var(--sp-16);
}

.section-header.centered {
  text-align: center;
}

.section-header.centered .section-sub {
  margin-inline: auto;
}

/* ─── Dividers ───────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--clr-border);
  margin-block: var(--sp-12);
}

/* ─── Scroll Reveal ──────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }
.reveal-delay-4 { transition-delay: 320ms; }

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }

  .section { padding-block: var(--sp-16); }
  .section-sm { padding-block: var(--sp-10); }
  .section-header { margin-bottom: var(--sp-10); }

  .container { padding-inline: var(--sp-4); }
}
