:root {
  --bg-primary: #050510;
  --bg-surface: rgba(255, 255, 255, 0.03);
  --bg-surface-hover: rgba(255, 255, 255, 0.06);
  --bg-surface-solid: #0c0c1a;

  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --text-tertiary: #555568;
  --text-muted: #3a3a50;

  --accent-cyan: #00d4ff;
  --accent-purple: #a855f7;
  --accent-pink: #ff3366;
  --accent-green: #22c55e;
  --accent-amber: #f59e0b;

  --accent-cyan-dim: rgba(0, 212, 255, 0.1);
  --accent-purple-dim: rgba(168, 85, 247, 0.1);
  --accent-pink-dim: rgba(255, 51, 102, 0.1);
  --accent-green-dim: rgba(34, 197, 94, 0.1);

  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-border-hover: rgba(255, 255, 255, 0.12);
  --glass-shine: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.06) 0%,
    transparent 40%,
    transparent 60%,
    rgba(255, 255, 255, 0.03) 100%
  );

  --gradient-brand: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple), var(--accent-pink));
  --gradient-text: linear-gradient(135deg, #00d4ff 0%, #a855f7 50%, #ff3366 100%);

  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-serif: "DM Serif Display", "Georgia", serif;

  --fs-xs: clamp(0.7rem, 0.65rem + 0.25vw, 0.8rem);
  --fs-sm: clamp(0.8rem, 0.75rem + 0.25vw, 0.9rem);
  --fs-base: clamp(0.9rem, 0.85rem + 0.25vw, 1rem);
  --fs-md: clamp(1rem, 0.9rem + 0.5vw, 1.2rem);
  --fs-lg: clamp(1.2rem, 1rem + 1vw, 1.6rem);
  --fs-xl: clamp(1.5rem, 1.2rem + 1.5vw, 2.2rem);
  --fs-2xl: clamp(2rem, 1.5rem + 2.5vw, 3.2rem);
  --fs-hero: clamp(2.8rem, 2rem + 4vw, 5rem);

  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-section: clamp(5rem, 4rem + 5vw, 9rem);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --nav-height: 64px;
  --max-width: 1100px;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
}

::selection {
  background: rgba(168, 85, 247, 0.3);
  color: #fff;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

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

/* --- Gradient mesh background --- */

.gradient-mesh {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  will-change: transform;
}

.blob--1 {
  width: 600px;
  height: 600px;
  background: var(--accent-cyan);
  opacity: 0.07;
  top: -10%;
  left: -5%;
  animation: float-1 25s ease-in-out infinite;
}

.blob--2 {
  width: 500px;
  height: 500px;
  background: var(--accent-purple);
  opacity: 0.07;
  top: 40%;
  right: -10%;
  animation: float-2 30s ease-in-out infinite;
}

.blob--3 {
  width: 400px;
  height: 400px;
  background: var(--accent-pink);
  opacity: 0.05;
  bottom: -5%;
  left: 30%;
  animation: float-3 20s ease-in-out infinite;
}

@keyframes float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(80px, 40px) scale(1.1); }
  66% { transform: translate(-40px, 80px) scale(0.95); }
}

@keyframes float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-60px, -30px) scale(0.9); }
  66% { transform: translate(40px, -60px) scale(1.05); }
}

@keyframes float-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, -40px) scale(1.1); }
}

/* --- Noise texture overlay --- */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* --- Custom cursor --- */

.has-cursor { cursor: none; }
.has-cursor a,
.has-cursor button,
.has-cursor [data-copy] { cursor: none; }

.cursor__dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease, background 0.2s ease;
  mix-blend-mode: difference;
}

.cursor__ring {
  position: fixed;
  width: 40px;
  height: 40px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease,
              border-color 0.3s ease, background 0.3s ease;
  mix-blend-mode: difference;
}

.cursor--active .cursor__dot {
  transform: translate(-50%, -50%) scale(0.5);
}

.cursor--active .cursor__ring {
  width: 60px;
  height: 60px;
  border-color: rgba(168, 85, 247, 0.5);
}

@media (pointer: coarse) {
  .cursor__dot, .cursor__ring { display: none; }
  .has-cursor { cursor: auto; }
  .has-cursor a, .has-cursor button, .has-cursor [data-copy] { cursor: pointer; }
}
