:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', var(--font-sans);
  
  --bg-primary: #0a192f;
  --bg-secondary: #0f223f;
  --accent-primary: #64ffda;
  --accent-secondary: #298dff;
  --text-primary: #cfe3ff;
  --text-secondary: #8892b0;
  
  --glass-bg: rgba(23, 49, 90, 0.4);
  --glass-border: rgba(100, 255, 218, 0.15);
  --glass-glow: rgba(100, 255, 218, 0.05);
}

body {
  font-family: var(--font-sans) !important;
}

h1, h2, h3, h4, h5, h6, .carousel-title {
  font-family: var(--font-heading) !important;
}

.font-sans {
  font-family: var(--font-sans) !important;
}

.font-roboto {
  font-family: var(--font-sans) !important;
}

/* Glassmorphic Cards */
.glass-card {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border: 1px solid var(--glass-border) !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  border-color: rgba(100, 255, 218, 0.4) !important;
  box-shadow: 0 12px 40px 0 rgba(100, 255, 218, 0.15);
}

/* Background Spotlight Glow */
.spotlight-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(circle 600px at var(--mouse-x, 0px) var(--mouse-y, 0px), rgba(100, 255, 218, 0.06), transparent 80%);
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Fade In Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-10deg) scale(0.9);
  }
  to {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

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

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Animation Classes */
.animate-on-scroll {
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.animated {
  opacity: 1;
}

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

.fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-left {
  animation: fadeInLeft 0.8s ease-out forwards;
}

.fade-in-right {
  animation: fadeInRight 0.8s ease-out forwards;
}

.slide-in-top {
  animation: slideInFromTop 0.8s ease-out forwards;
}

.scale-in {
  animation: scaleIn 0.6s ease-out forwards;
}

.rotate-in {
  animation: rotateIn 0.8s ease-out forwards;
}

/* Stagger Animation Delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* Header Animation */
.main-header {
  animation: slideInFromTop 0.6s ease-out;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.main-header.scrolled {
  box-shadow: 0 4px 20px rgba(100, 255, 218, 0.1);
}

/* Hamburger Animation */
.hamburger {
  cursor: pointer;
  transition: transform 0.3s ease;
}

.hamburger:hover {
  transform: scale(1.1);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
  transition: transform 0.3s ease;
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
  transition: transform 0.3s ease;
}

/* Nav Links Animation */
.nav-link {
  position: relative;
  transition: all 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #64ffda, #298dff);
  transition: width 0.3s ease;
}

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

.nav-link.active {
  color: #64ffda;
}

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

/* Intro Section Animations */
.intro-text {
  animation: fadeInLeft 1s ease-out 0.2s both;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.intro-text:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(100, 255, 218, 0.2);
}

.intro-img-box {
  animation: scaleIn 1s ease-out 0.4s both;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.intro-img-box:hover {
  transform: scale(1.05) rotate(2deg);
  box-shadow: 0 20px 40px rgba(100, 255, 218, 0.3);
}

.intro-img-box img {
  transition: transform 0.5s ease;
}

.intro-img-box:hover img {
  transform: scale(1.1);
}

.intro-info-box {
  animation: fadeInRight 1s ease-out 0.6s both;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.intro-info-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(100, 255, 218, 0.2);
}

/* Hello Gradient Animation */
.hello-gradient {
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}

/* Skills Grid Animation */
.skills > div {
  opacity: 0;
  transform: translateY(30px) scale(0.9);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.skills > div.animated {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.skills > div:hover {
  transform: translateY(-10px) scale(1.1);
  transition: all 0.3s ease;
}

.skills img {
  transition: transform 0.3s ease, filter 0.3s ease;
}

.skills > div:hover img {
  transform: rotate(10deg) scale(1.2);
  filter: drop-shadow(0 0 10px rgba(100, 255, 218, 0.5));
}

/* Work Cards Animation */
.work-card {
  opacity: 0;
  transform: translateY(50px) scale(0.95);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.work-card.animated {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.work-card-img {
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.work-card:hover .work-card-img {
  transform: rotate(360deg) scale(1.1);
  box-shadow: 0 0 30px rgba(100, 255, 218, 0.6);
}

/* Carousel Animations */
.carousel-card {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-card:hover {
  transform: translateY(-10px) scale(1.02);
}

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

.carousel-card:hover img {
  transform: scale(1.1);
}

.carousel-btn {
  transition: all 0.3s ease;
}

.carousel-btn:hover {
  transform: scale(1.1) rotate(5deg);
}

.carousel-btn:active {
  transform: scale(0.95);
}

/* Contact Buttons Animation */
.contact-icon-btn {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-icon-img {
  transition: all 0.4s ease;
}

.contact-icon-btn:hover .contact-icon-img {
  transform: rotate(360deg) scale(1.2);
  box-shadow: 0 0 20px rgba(100, 255, 218, 0.8);
}

/* Resume Button Animation */
.resume-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.resume-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.resume-btn:hover::before {
  left: 100%;
}

/* Back to Top Button */
#backToTopBtn {
  transition: all 0.3s ease;
  animation: pulse 2s ease-in-out infinite;
}

#backToTopBtn:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 10px 30px rgba(100, 255, 218, 0.5);
}

/* Footer Animation */
.footer {
  animation: fadeInUp 0.8s ease-out;
}

/* Loading Animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(100, 255, 218, 0.3);
  border-radius: 50%;
  border-top-color: #64ffda;
  animation: spin 1s ease-in-out infinite;
}

/* Smooth Transitions for All Interactive Elements */
button, a, .card-btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile Hidden with Animation */
.mobile-hidden {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
  opacity: 0;
}

.mobile-hidden:not(.mobile-hidden) {
  max-height: 500px;
  opacity: 1;
}

/* Canvas Background Animation */
#canvas {
  animation: fadeIn 1s ease-out;
}

/* Section Title Animation */
.carousel-title {
  position: relative;
  display: inline-block;
}

.carousel-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #64ffda, #298dff);
  transition: width 0.5s ease;
}

.carousel-title.animated::after {
  width: 100px;
}

/* Text Selection */
::selection {
  background: rgba(100, 255, 218, 0.3);
  color: #fff;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #0a192f;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #64ffda, #298dff);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #298dff, #64ffda);
}

/* Mobile Responsive Animations */
@media (max-width: 768px) {
  .intro {
    flex-direction: column;
    align-items: center;
  }

  .intro-text,
  .intro-img-box,
  .intro-info-box {
    animation-duration: 0.6s;
    margin: 10px 0;
  }

  .skills > div {
    animation-delay: 0.05s;
  }

  .work-card {
    animation-delay: 0.1s;
  }

  .carousel-card {
    min-width: 280px;
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Loading State */
.page-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0a192f;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.page-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Services Animation Initial State */
#services .glass-card {
  opacity: 0;
  transform: translateY(30px);
}

/* Testimonials Animation Initial State */
#testimonials .glass-card {
  opacity: 0;
  transform: translateY(30px);
}

