/* Base: variables, reset, background FX, typography, custom cursor */
/* ============ VARIABLES & RESET ============ */
:root {
  --bg: #07090f;
  --bg-soft: #0d1119;
  --card: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8ecf4;
  --muted: #8b94a7;
  --accent: #22d3ee;
  --accent-2: #8b5cf6;
  --gradient: linear-gradient(135deg, #22d3ee, #8b5cf6);
  --radius: 16px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  cursor: none;
}

/* Keep the exact spot visible: interactive elements also use the custom cursor */
a, button, [role="button"] { cursor: none; }

/* Sections don't hide behind the fixed navbar when anchor-jumping */
.section, .hero { scroll-margin-top: 90px; }

/* Fallback cursor for touch devices */
@media (hover: none) {
  body, a, button, [role="button"] { cursor: auto; }
  .cursor-glow, .cursor-dot, .cursor-ring { display: none; }
}

/* ============ BACKGROUND FX ============ */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(600px circle at 20% 10%, rgba(34, 211, 238, 0.08), transparent 60%),
    radial-gradient(700px circle at 80% 80%, rgba(139, 92, 246, 0.08), transparent 60%);
  z-index: 0;
  pointer-events: none;
}

.cursor-glow {
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.10), transparent 65%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.3s;
}

/* ============ CUSTOM CURSOR (precise) ============ */
/* Big soft glow is kept (ambient). The precise position is carried by a
   small bright dot (exactly under the mouse) plus a reactive ring. */
.cursor-dot {
  position: fixed;
  left: 0;
  top: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.85), 0 0 2px rgba(255, 255, 255, 0.9);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.15s ease, background 0.2s ease;
}

.cursor-ring {
  position: fixed;
  left: 0;
  top: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(34, 211, 238, 0.65);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9998;
  transition:
    width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.25s ease,
    background-color 0.25s ease;
}

/* Interactive elements: the ring expands to show "you are here" */
.cursor-ring.active {
  width: 58px;
  height: 58px;
  border-color: rgba(139, 92, 246, 0.95);
  background: rgba(34, 211, 238, 0.07);
}
.cursor-dot.active {
  transform: translate(-50%, -50%) scale(1.7);
  background: var(--accent-2);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.9);
}

/* Pressed */
.cursor-dot.down { transform: translate(-50%, -50%) scale(0.55); }

/* Off-window: hide until it comes back */
.cursor-dot.hidden,
.cursor-ring.hidden { opacity: 0; }

main, header, section, footer, nav { position: relative; z-index: 2; }

/* ============ TYPOGRAPHY ============ */
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 2.5rem;
}
