/* ============================================================
   base.css — Design system foundation
   All variables, reset, typography, and utility classes.
   Every page imports this first.
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  /* Background layers */
  --bg-void:      #0a0a0a;
  --bg-surface:   #111111;
  --bg-elevated:  #1c1c1c;
  --bg-overlay:   #242424;

  /* Accent — Crimson */
  --crimson:      #dc2626;
  --crimson-soft: #ef4444;
  --crimson-dim:  rgba(220, 38, 38, 0.12);
  --crimson-border: rgba(220, 38, 38, 0.25);

  /* Accent — Gold */
  --gold:         #f59e0b;
  --gold-soft:    #fbbf24;
  --gold-dim:     rgba(245, 158, 11, 0.10);
  --gold-border:  rgba(245, 158, 11, 0.25);

  /* Text */
  --text-primary:   #f0f0f0;
  --text-secondary: rgba(240, 240, 240, 0.55);
  --text-muted:     rgba(240, 240, 240, 0.25);
  --text-accent:    var(--gold);

  /* Borders */
  --border:        rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-accent: var(--crimson-border);

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

  /* Type scale */
  --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 */

  /* Spacing scale */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;
  --sp-24: 96px;
  --sp-32: 128px;

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

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Transitions */
  --t-fast:   150ms ease;
  --t-base:   250ms ease;
  --t-slow:   400ms ease;
  --t-slower: 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

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

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

ul, ol {
  list-style: none;
}

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl);  }
h4 { font-size: var(--text-lg);  }

p {
  color: var(--text-secondary);
  line-height: 1.7;
}

code, pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

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

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

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

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

/* ── Text Utilities ────────────────────────────────────────── */
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-gold      { color: var(--gold); }
.text-crimson   { color: var(--crimson-soft); }

.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }

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

.uppercase     { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.08em; }
.tracking-wider{ letter-spacing: 0.14em; }

/* ── Overline label (used for section eyebrows) ────────────── */
.overline {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
}

/* ── Tag / Pill ────────────────────────────────────────────── */
.tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg-elevated);
  transition: color var(--t-fast), border-color var(--t-fast);
}

.tag:hover {
  color: var(--gold);
  border-color: var(--gold-border);
}

.tag--active {
  color: var(--gold);
  border-color: var(--gold-border);
  background: var(--gold-dim);
}

.tag--crimson {
  color: var(--crimson-soft);
  border-color: var(--crimson-border);
  background: var(--crimson-dim);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  transition: all var(--t-base);
  cursor: pointer;
  white-space: nowrap;
}

.btn--primary {
  background: var(--crimson-dim);
  color: var(--crimson-soft);
  border: 1px solid var(--crimson-border);
}

.btn--primary:hover {
  background: rgba(220, 38, 38, 0.22);
  border-color: var(--crimson-soft);
  color: #fff;
}

.btn--gold {
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--gold-border);
}

.btn--gold:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--gold-soft);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* ── Divider ───────────────────────────────────────────────── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
}

.divider--accent {
  background: linear-gradient(90deg, var(--crimson) 0%, var(--gold) 100%);
  height: 1px;
  width: 48px;
  border: none;
}

/* ── Scroll fade-in animation ──────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--t-slower), transform var(--t-slower);
}

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

/* ── Page transition ───────────────────────────────────────── */
.page-wrapper {
  animation: pageFadeIn 400ms ease forwards;
}

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-void); }
::-webkit-scrollbar-thumb { background: var(--bg-overlay); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-medium); }

/* ── Selection ─────────────────────────────────────────────── */
::selection {
  background: var(--crimson-dim);
  color: var(--crimson-soft);
}

/* ── Responsive breakpoints ────────────────────────────────── */
/* Mobile:  < 640px  */
/* Tablet:  640–1024px */
/* Desktop: > 1024px  */

@media (max-width: 640px) {
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-2xl); }
  .container { padding-inline: var(--sp-4); }
  .section { padding-block: var(--sp-16); }
}