:root {
  /* Premium Color Palette */
  --bg-deep: #050507;
  --bg-card: rgba(20, 20, 30, 0.4);
  --bg-card-hover: rgba(30, 30, 45, 0.6);
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.5);
  --secondary: #a855f7;
  --accent: #2dd4bf;
  /* Teal/Cyan accent */

  /* Gradients */
  --gradient-main: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --gradient-dark: linear-gradient(to bottom, transparent, #050507);
  --gradient-glass: linear-gradient(135deg,
      rgba(255, 255, 255, 0.05) 0%,
      rgba(255, 255, 255, 0.01) 100%);

  /* Text */
  --text-white: #ffffff;
  --text-off: #cbd5e1;
  --text-muted: #94a3b8;

  /* Typography */
  --font-heading: 'Outfit', 'Inter', sans-serif;
  /* Switching to Outfit for headings */
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout */
  --container-width: 1400px;
  /* Wider container */
  --header-height: 80px;
  --radius-lg: 24px;
  --radius-xl: 40px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  cursor: none;
  /* Hide default cursor for custom one */
}

body {
  background-color: var(--bg-deep);
  color: var(--text-white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  /* Noise texture overlay */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 9999;
  pointer-events: none;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background-color: var(--text-white);
}

.cursor-outline {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: width 0.2s, height 0.2s, background-color 0.2s;
}

body:hover .cursor-outline {
  /* Slight lag interaction handled in JS */
}

/* Canvas Background */
#canvas-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  opacity: 0.6;
}

/* Typography Overhaul */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 0;
  width: 40px;
  height: 4px;
  background: var(--gradient-main);
  border-radius: 2px;
}

h3 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

p {
  color: var(--text-off);
  margin-bottom: 1.5rem;
  font-weight: 300;
}

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

/* Utility Classes */
.container {
  width: 90%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.section {
  padding: 15vh 0;
  /* More breathing room */
  position: relative;
}

.flex {
  display: flex;
  gap: 1rem;
}

.flex-col {
  flex-direction: column;
}

.flex-center {
  align-items: center;
  justify-content: center;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(to right, #fff, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.gradient-text-anim {
  background: linear-gradient(to right, #6366f1, #a855f7, #2dd4bf, #6366f1);
  background-size: 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientFlow 8s ease infinite;
}

@keyframes gradientFlow {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Glass & Card Styles */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  /* Thinner border */
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  /* Top highlight */
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.card {
  position: relative;
  padding: 2.5rem;
  overflow: hidden;
  transition: transform 0.1s;
  /* JS handles tilt */
  transform-style: preserve-3d;
}

/* Magnetic Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  border-radius: 100px;
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  overflow: hidden;
  background: transparent;
  z-index: 1;
  border: none;
  transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  /* Magnetic feel */
}

/* Primary Button Glow Effect */
.btn-primary {
  color: white;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-main);
  z-index: -1;
  border-radius: inherit;
  transition: all 0.3s ease;
}

.btn-primary:hover::before {
  transform: scale(1.05);
  /* Subtle grow */
  box-shadow: 0 0 30px var(--primary-glow);
}

.btn-outline {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: white;
}

/* Navigation */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  background: rgba(5, 5, 7, 0.6);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: all 0.3s ease;
}

.nav-container {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.04em;
}

.logo span {
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 3rem;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link:hover,
.nav-link.active {
  color: white;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
}

/* Scroll Animations */
.reveal-fade-up {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

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

/* Specific Sections */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding-top: var(--header-height);
}

.hero-content p {
  font-size: 1.5rem;
  max-width: 600px;
  margin: 2rem auto;
}

/* Icon Box Upgrade */
.icon-box {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--accent);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Project Card Upgrade */
.project-card .project-img {
  height: 250px;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  overflow: hidden;
  position: relative;
}

.project-card .project-img i {
  transition: transform 0.5s ease;
}

.project-card:hover .project-img i {
  transform: scale(1.1) rotate(5deg);
}

.tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-off);
  padding: 0.4rem 1rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Footer Upgrade */
footer {
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 900px) {
  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-deep);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    transform: translateY(-100%);
    transition: transform 0.4s ease;
    z-index: 999;
  }

  .nav-links.open {
    transform: translateY(0);
  }

  .mobile-toggle {
    display: block;
    z-index: 1001;
  }

  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}