/* ============================================================
   MAIN.CSS — Variables, Reset, Typography
   craftbyte.com
   ============================================================ */

/* --- Fonts -------------------------------------------------- */
@font-face {
  font-family: 'Geist';
  src: url('../fonts/GeistVF.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('../fonts/GeistMonoVF.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* --- Design Tokens ----------------------------------------- */
:root {
  /* Base palette */
  --bg:          #09090b;   /* zinc-950 */
  --bg-elevated: #18181b;   /* zinc-900 */
  --bg-card:     #1c1c1f;
  --border:      rgba(255, 255, 255, 0.08);
  --border-accent: rgba(34, 211, 238, 0.25);

  /* Text */
  --text-primary:   #f4f4f5;   /* zinc-100 */
  --text-secondary: #a1a1aa;   /* zinc-400 */
  --text-muted:     #52525b;   /* zinc-600 */

  /* Accent — electric cyan */
  --accent:         #22d3ee;   /* cyan-400 */
  --accent-dim:     rgba(34, 211, 238, 0.15);
  --accent-glow:    rgba(34, 211, 238, 0.08);

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

  /* Spacing scale */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;

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

  /* Transitions */
  --transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);

  /* Nav */
  --nav-height: 64px;

  /* Z-index scale */
  --z-canvas:  0;
  --z-content: 10;
  --z-nav:     100;
  --z-modal:   200;
}

/* --- 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(--text-primary);
  background-color: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul, ol {
  list-style: none;
}

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

/* --- Typography -------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p {
  color: var(--text-secondary);
  max-width: 65ch;
  line-height: 1.7;
}

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

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

/* Label / eyebrow — used max once per 3 sections */
.label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* --- Focus Visible ----------------------------------------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* --- Selection --------------------------------------------- */
::selection {
  background: var(--accent-dim);
  color: var(--text-primary);
}

/* --- Scrollbar --------------------------------------------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --- Reduced Motion ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
