/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ─── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  /* Surface */
  --bg:           #0c0817;
  --bg-elevated:  #110d1f;
  --bg-card:      #160e27;
  --bg-input:     #1e1231;

  /* Text */
  --fg:           #f0eeff;
  --fg-muted:     #9088aa;
  --fg-subtle:    #8a7ba3;

  /* Accent */
  --accent:       #ff7a1a;
  --accent-hover: #ff9533;
  --accent-glow:  rgba(255, 122, 26, 0.18);
  --accent-dim:   rgba(255, 122, 26, 0.08);
  --accent-purple: #8822cc;

  /* Borders */
  --border:       rgba(136, 34, 204, 0.14);
  --border-hover: rgba(136, 34, 204, 0.28);

  /* Semantic */
  --success:      #3fb950;
  --code-bg:      #0d1117;
  --code-border:  rgba(255,255,255,0.06);

  /* Typography */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Radii */
  --radius-sm:  8px;
  --radius:     12px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  /* Spacing */
  --gap-xs:  0.5rem;
  --gap-sm:  1rem;
  --gap-md:  1.5rem;
  --gap-lg:  2.5rem;
  --gap-xl:  4rem;
  --gap-2xl: 7rem;

  /* Layout */
  --max-w:   1200px;
  --nav-h:   60px;

  /* Easing */
  --ease:    cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light mode */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:          #ffffff;
    --bg-elevated: #fafafa;
    --bg-card:     #f4f4f4;
    --bg-input:    #eeeeee;
    --fg:          #0d0d0d;
    --fg-muted:    #6b6b6b;
    --fg-subtle:   #aaa;
    --border:      rgba(0, 0, 0, 0.06);
    --border-hover:rgba(0, 0, 0, 0.12);
    --code-bg:     #0d1117;
    --accent-glow: rgba(232, 81, 10, 0.08);
  }
}
[data-theme="light"] {
  --bg:          #ffffff;
  --bg-elevated: #fafafa;
  --bg-card:     #f4f4f4;
  --bg-input:    #eeeeee;
  --fg:          #0d0d0d;
  --fg-muted:    #6b6b6b;
  --fg-subtle:   #aaa;
  --border:      rgba(0, 0, 0, 0.06);
  --border-hover:rgba(0, 0, 0, 0.12);
  --code-bg:     #0d1117;
}
[data-theme="dark"] {
  --bg:           #0c0817;
  --bg-elevated:  #110d1f;
  --bg-card:      #160e27;
  --fg:           #f0eeff;
  --fg-muted:     #9088aa;
  --border:       rgba(136, 34, 204, 0.14);
}

/* ─── Base ───────────────────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.65;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

/* ─── Typography Scale ───────────────────────────────────────────────────── */
.t-display {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 6vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.t-h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.t-h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.t-h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.t-body { font-size: 1rem; line-height: 1.7; }
.t-body-sm { font-size: 0.875rem; line-height: 1.65; }
.t-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.t-muted { color: var(--fg-muted); }
.t-subtle { color: var(--fg-subtle); }
.t-mono { font-family: var(--font-mono); }
.t-accent { color: var(--accent); }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}
@media (max-width: 768px) {
  .container { padding: 0 1.25rem; }
}
.section {
  padding: var(--gap-2xl) 0;
}
.section-sm {
  padding: var(--gap-xl) 0;
}
@media (max-width: 768px) {
  .section { padding: 3.5rem 0; }
  .section-sm { padding: 2.5rem 0; }
}

/* ─── Grid ───────────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap-md); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-md); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap-md); }
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ─── Decorative ─────────────────────────────────────────────────────────── */
.grid-bg {
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
}
.glow-accent {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}
