:root {
  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { 
  scroll-behavior: smooth;
  overflow-x: hidden;
}

/* PAGE BASE */
body {
  font-family: var(--font-sans);
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  /* Background handled by themes.css */
}

/* =========================
   CUSTOM SCROLLBARS
========================= */

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary, #111);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color, rgba(255,255,255,0.15));
  border-radius: 5px;
  border: 2px solid var(--bg-secondary, #111);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color, #00ffcc);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color, rgba(255,255,255,0.15)) var(--bg-secondary, #111);
}

/* =========================
   PAGE TRANSITIONS
========================= */

.page-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary, #0a0a0a);
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.page-transition-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.page-transition-overlay .loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color, rgba(255,255,255,0.15));
  border-top-color: var(--accent-color, #00ffcc);
  border-radius: 50%;
  animation: pageSpinner 0.8s linear infinite;
}

@keyframes pageSpinner {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* SKIP LINK */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #000;
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  z-index: 9999;
  font-weight: 600;
  transition: all 0.3s ease;
}

.skip-link:focus { 
  left: 12px;
  box-shadow: 0 0 20px var(--accent-glow);
}

/* GLOBAL ANIMATIONS */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes glitchText {
  0% {
    text-shadow: 
      2px 0 0 var(--accent-color),
      -2px 0 0 rgba(0, 255, 204, 0.8);
    transform: translate(0);
  }
  20% {
    text-shadow: 
      -2px 0 0 var(--accent-color),
      2px 0 0 rgba(0, 255, 204, 0.8);
    transform: translate(-2px, 2px);
  }
  40% {
    text-shadow: 
      2px 0 0 var(--accent-color),
      -2px 0 0 rgba(0, 255, 204, 0.8);
    transform: translate(2px, -2px);
  }
  60% {
    text-shadow: 
      -2px 0 0 var(--accent-color),
      2px 0 0 rgba(0, 255, 204, 0.8);
    transform: translate(-2px, 2px);
  }
  80% {
    text-shadow: 
      2px 0 0 var(--accent-color),
      -2px 0 0 rgba(0, 255, 204, 0.8);
    transform: translate(2px, -2px);
  }
  100% {
    text-shadow: 
      2px 0 0 var(--accent-color),
      -2px 0 0 rgba(0, 255, 204, 0.8);
    transform: translate(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.8s ease-out;
}

/* GLITCH TEXT EFFECT */
.glitch-text {
  position: relative;
  animation: glitchText 0.3s ease-in-out;
  animation-delay: 0.5s;
}

/* CURSOR FOLLOWER */
.cursor-follower {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-color);
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  transition: 
    opacity 0.3s ease,
    transform 0.15s ease;
  mix-blend-mode: difference;
  will-change: transform;
}

.cursor-follower.active {
  opacity: 0.6;
  transform: scale(1.5);
}

@media (hover: hover) and (pointer: fine) {
  .cursor-follower {
    opacity: 0.4;
  }
}

/* TYPOGRAPHY */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(36px, 5vw, 64px);
}

h2 {
  font-size: clamp(24px, 3vw, 32px);
  margin-bottom: 16px;
}

/* FLOATING CTA */
.floating-cta {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(100px);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.floating-cta.visible {
  opacity: 1;
  transform: translateY(0);
}

.btn-floating {
  box-shadow: 
    0 8px 30px rgba(0,0,0,.4),
    0 0 40px var(--accent-glow);
  animation: floatPulse 3s ease-in-out infinite;
}

@keyframes floatPulse {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow: 
      0 8px 30px rgba(0,0,0,.4),
      0 0 40px var(--accent-glow);
  }
  50% {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 
      0 12px 40px rgba(0,0,0,.5),
      0 0 50px var(--accent-glow);
  }
}

/* REDUCE 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;
  }
  
  .cursor-follower {
    display: none;
  }
  
  .floating-cta {
    display: none;
  }
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .floating-cta {
    bottom: 20px;
    right: 20px;
  }
  
  .btn-floating {
    padding: 12px 18px;
    font-size: 14px;
  }
}
