@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap");

/* ===== ENHANCED THEME TRANSITIONS ===== */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --accent-blue: #0ea5e9;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-orange: #f97316;
  --accent-green: #10b981;

  /* Mobile-specific variables */
  --mobile-padding: 1rem;
  --mobile-section-gap: 4rem;
  --touch-target-min: 44px;

  /* Theme transition variables */
  --theme-transition-duration: 0.8s;
  --theme-transition-easing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced Theme Transitions - Much more subtle */
* {
  transition: background-color 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    text-shadow 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Subtle ripple effect */
body::after {
  content: "";
  position: fixed;
  top: var(--ripple-y, 50%);
  left: var(--ripple-x, 50%);
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  background: var(--theme-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

body.theme-transitioning::after {
  animation: subtleRipple 0.8s ease-out forwards;
}

@keyframes subtleRipple {
  0% {
    width: 0;
    height: 0;
    opacity: 0.15;
  }
  50% {
    opacity: 0.08;
  }
  100% {
    width: 150vmax;
    height: 150vmax;
    opacity: 0;
  }
}

/* Remove all loading spinner styles */
.theme-loading {
  display: none !important;
}

/* Enhanced theme option animations */
.theme-option {
  position: relative;
  overflow: hidden;
}

.theme-option::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: var(--theme-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  z-index: -1;
}

.theme-option.activating::after {
  width: 100px;
  height: 100px;
  opacity: 0.3;
}

.theme-option.active {
  position: relative;
}

.theme-option.active::before {
  animation: activeThemePulse 2s ease-in-out infinite;
}

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

/* Smooth gradient transitions for themed elements */
.logo,
.hero h1,
.section-title,
.hero p .location,
.btn-primary {
  transition: background var(--theme-transition-duration)
      var(--theme-transition-easing),
    -webkit-background-clip var(--theme-transition-duration) var(--theme-transition-easing),
    background-clip var(--theme-transition-duration)
      var(--theme-transition-easing);
}

/* Enhanced button transition effects */
.btn-primary {
  position: relative;
  overflow: hidden;
}

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

.btn-primary.theme-transitioning::before {
  left: 100%;
}

/* Navigation transition effects */
.nav-content,
.theme-switcher,
.contact-form,
.project-card,
.skill-card {
  transition: background var(--theme-transition-duration)
      var(--theme-transition-easing),
    border-color var(--theme-transition-duration) var(--theme-transition-easing),
    box-shadow var(--theme-transition-duration) var(--theme-transition-easing);
}

/* Background constellation transitions */
.constellation-bg,
.cosmic-bg {
  transition: opacity var(--theme-transition-duration)
    var(--theme-transition-easing);
}

/* Theme preview effect */
.theme-option:hover::before {
  animation: themePreview 0.3s ease-out;
}

@keyframes themePreview {
  0% {
    opacity: 0.6;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
  100% {
    opacity: 0.8;
    transform: scale(1);
  }
}

/* Faster transitions for interactive elements during theme change */
body.theme-transitioning .btn,
body.theme-transitioning .nav-links a,
body.theme-transitioning .skill-card {
  transition-duration: 0.4s;
}

/* Theme transition loading indicator */
.theme-loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border: 3px solid transparent;
  border-top: 3px solid var(--theme-primary);
  border-radius: 50%;
  animation: themeLoading 1s linear infinite;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
}

.theme-loading.active {
  opacity: 1;
}

@keyframes themeLoading {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Staggered animation for theme-aware elements */
body.theme-transitioning .hero p .location:nth-child(1) {
  transition-delay: 0.1s;
}

body.theme-transitioning .hero p .location:nth-child(2) {
  transition-delay: 0.2s;
}

body.theme-transitioning .hero p .location:nth-child(3) {
  transition-delay: 0.3s;
}

body.theme-transitioning .hero p .highlight-performance {
  transition-delay: 0.4s;
}

body.theme-transitioning .hero p .highlight-scalability {
  transition-delay: 0.5s;
}

body.theme-transitioning .hero p .highlight-ux {
  transition-delay: 0.6s;
}

/* Theme Variables */
:root[data-theme="deep-space"] {
  --theme-bg-start: #0f1419;
  --theme-bg-mid: #1a1a2e;
  --theme-bg-mid2: #16213e;
  --theme-bg-end: #0f0f23;
  --theme-accent-1: rgba(78, 205, 196, 0.12);
  --theme-accent-2: rgba(199, 125, 255, 0.08);
  --theme-accent-3: rgba(255, 107, 107, 0.06);
  --theme-accent-4: rgba(255, 177, 66, 0.08);
  --theme-accent-5: rgba(236, 72, 153, 0.1);
  --theme-accent-6: rgba(16, 185, 129, 0.06);
  --theme-primary: #0ea5e9;
  --theme-secondary: #8b5cf6;
  --theme-tertiary: #10b981;
}

:root[data-theme="nebula-storm"] {
  --theme-bg-start: #1a0b2e;
  --theme-bg-mid: #2d1b4e;
  --theme-bg-mid2: #3c1361;
  --theme-bg-end: #16001e;
  --theme-accent-1: rgba(186, 85, 211, 0.25);
  --theme-accent-2: rgba(138, 43, 226, 0.2);
  --theme-accent-3: rgba(255, 20, 147, 0.18);
  --theme-accent-4: rgba(75, 0, 130, 0.15);
  --theme-accent-5: rgba(148, 0, 211, 0.22);
  --theme-accent-6: rgba(221, 160, 221, 0.12);
  --theme-primary: #ba55d3;
  --theme-secondary: #8a2be2;
  --theme-tertiary: #ff1493;
}

:root[data-theme="solar-flare"] {
  --theme-bg-start: #2d1810;
  --theme-bg-mid: #4a2c1a;
  --theme-bg-mid2: #5c3317;
  --theme-bg-end: #1a0e08;
  --theme-accent-1: rgba(255, 140, 0, 0.25);
  --theme-accent-2: rgba(255, 69, 0, 0.2);
  --theme-accent-3: rgba(255, 215, 0, 0.18);
  --theme-accent-4: rgba(178, 34, 34, 0.15);
  --theme-accent-5: rgba(255, 165, 0, 0.22);
  --theme-accent-6: rgba(184, 115, 51, 0.12);
  --theme-primary: #ff8c00;
  --theme-secondary: #ffd700;
  --theme-tertiary: #ff4500;
}

/* ===== FOUNDATION & RESET ===== */
html {
  background: #0f0f23;
  min-height: 100%;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  /* Improve iOS Safari scrolling */
  -webkit-overflow-scrolling: touch;
  /* Handle viewport changes on mobile */
  height: -webkit-fill-available;
}

html[data-theme="nebula-storm"] {
  background: #16001e;
}

html[data-theme="solar-flare"] {
  background: #1a0e08;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(
    ellipse at center,
    var(--theme-bg-start) 0%,
    var(--theme-bg-mid) 30%,
    var(--theme-bg-mid2) 60%,
    var(--theme-bg-end) 100%
  );
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  font-variation-settings: "slnt" 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  min-height: 100vh;
  /* iOS Safari viewport fix */
  min-height: -webkit-fill-available;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;

  /* Desktop: use fixed background */
  background-attachment: fixed;
  background-size: 100% 120vh;
  background-repeat: no-repeat;
  background-position: center top;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);

  /* Prevent bounce scrolling on iOS */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
}

/* Mobile: use scroll background and ensure full coverage */
@media (max-width: 768px) {
  body {
    /* Disable fixed background on mobile */
    background-attachment: scroll;
    background-size: 100% 100%;
    background-repeat: repeat-y;
    /* Ensure background covers entire scrollable area */
    min-height: 200vh; /* Ensure background extends beyond viewport */
  }

  /* Add a pseudo-element to ensure consistent background coverage */
  body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
      ellipse at center,
      var(--theme-bg-start) 0%,
      var(--theme-bg-mid) 30%,
      var(--theme-bg-mid2) 60%,
      var(--theme-bg-end) 100%
    );
    z-index: -1;
    pointer-events: none;
  }
}

/* ===== THEME-SPECIFIC BACKGROUNDS ===== */
:root[data-theme="nebula-storm"] body::before {
  background: radial-gradient(
      circle at 15% 15%,
      var(--theme-accent-1) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 85% 25%,
      var(--theme-accent-2) 0%,
      transparent 35%
    ),
    radial-gradient(
      circle at 45% 60%,
      var(--theme-accent-3) 0%,
      transparent 30%
    ),
    radial-gradient(
      circle at 80% 85%,
      var(--theme-accent-4) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 20% 80%,
      var(--theme-accent-5) 0%,
      transparent 45%
    ),
    radial-gradient(
      circle at 60% 20%,
      var(--theme-accent-6) 0%,
      transparent 35%
    ),
    radial-gradient(
      circle at 30% 40%,
      rgba(186, 85, 211, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 70% 70%,
      rgba(138, 43, 226, 0.12) 0%,
      transparent 45%
    );
  opacity: 0.6;
  animation: nebulaStorm 12s ease-in-out infinite;
}

:root[data-theme="solar-flare"] body::before {
  background: radial-gradient(
      circle at 15% 15%,
      var(--theme-accent-1) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 85% 25%,
      var(--theme-accent-2) 0%,
      transparent 35%
    ),
    radial-gradient(
      circle at 45% 60%,
      var(--theme-accent-3) 0%,
      transparent 30%
    ),
    radial-gradient(
      circle at 80% 85%,
      var(--theme-accent-4) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 20% 80%,
      var(--theme-accent-5) 0%,
      transparent 45%
    ),
    radial-gradient(
      circle at 60% 20%,
      var(--theme-accent-6) 0%,
      transparent 35%
    ),
    radial-gradient(
      circle at 50% 30%,
      rgba(255, 140, 0, 0.18) 0%,
      transparent 55%
    ),
    radial-gradient(
      circle at 25% 75%,
      rgba(255, 69, 0, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 75% 60%,
      rgba(255, 215, 0, 0.12) 0%,
      transparent 45%
    );
  opacity: 0.7;
  animation: solarFlare 15s ease-in-out infinite;
}

/* ===== BACKGROUND ANIMATIONS ===== */
@keyframes cosmicPulse {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes nebulaStorm {
  0%,
  100% {
    opacity: 0.6;
    filter: hue-rotate(0deg) brightness(1);
  }
  25% {
    opacity: 0.8;
    filter: hue-rotate(15deg) brightness(1.1);
  }
  50% {
    opacity: 0.7;
    filter: hue-rotate(-10deg) brightness(1.2);
  }
  75% {
    opacity: 0.9;
    filter: hue-rotate(20deg) brightness(1.05);
  }
}

@keyframes solarFlare {
  0%,
  100% {
    opacity: 0.7;
    filter: brightness(1) contrast(1);
  }
  20% {
    opacity: 0.9;
    filter: brightness(1.3) contrast(1.1);
  }
  40% {
    opacity: 0.8;
    filter: brightness(1.1) contrast(1.2);
  }
  60% {
    opacity: 1;
    filter: brightness(1.4) contrast(1.05);
  }
  80% {
    opacity: 0.85;
    filter: brightness(1.2) contrast(1.15);
  }
}

/* ===== CONSTELLATION BACKGROUNDS ===== */
.constellation-bg,
.cosmic-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.cosmic-bg {
  z-index: 3;
}

/* Mobile background optimization */
@media (max-width: 768px) {
  .constellation-bg,
  .cosmic-bg {
    height: 100vh;
    top: 0;
  }

  /* Significantly reduce background elements on mobile */
  .bg-star:nth-child(n + 20),
  .bg-particle:nth-child(n + 3),
  .floating-shape:nth-child(n + 2),
  .cosmic-trail:nth-child(n + 2),
  .constellation-line:nth-child(n + 2) {
    display: none;
  }
}

/* ===== STAR EFFECTS ===== */
.bg-star {
  position: absolute;
  border-radius: 50%;
  animation: twinkle 3s ease-in-out infinite;
  transform-origin: center;
}

.bg-star.small {
  width: 2px;
  height: 2px;
  animation-duration: 6s;
}

.bg-star.medium {
  width: 3px;
  height: 3px;
  animation-duration: 5s;
}

.bg-star.large {
  width: 4px;
  height: 4px;
  animation-duration: 4s;
}

/* Mobile star size adjustments */
@media (max-width: 768px) {
  .bg-star.small {
    width: 1.5px;
    height: 1.5px;
  }
  .bg-star.medium {
    width: 2px;
    height: 2px;
  }
  .bg-star.large {
    width: 2.5px;
    height: 2.5px;
  }
}

/* ===== THEME-SPECIFIC STAR COLORS ===== */
/* Deep Space (default) star colors */
.bg-star.color-blue {
  background: radial-gradient(
    circle,
    rgba(78, 205, 196, 0.9),
    rgba(78, 205, 196, 0.3),
    transparent
  );
  box-shadow: 0 0 8px rgba(78, 205, 196, 0.6);
}

.bg-star.color-purple {
  background: radial-gradient(
    circle,
    rgba(199, 125, 255, 0.9),
    rgba(199, 125, 255, 0.3),
    transparent
  );
  box-shadow: 0 0 8px rgba(199, 125, 255, 0.6);
}

.bg-star.color-pink {
  background: radial-gradient(
    circle,
    rgba(255, 107, 107, 0.9),
    rgba(255, 107, 107, 0.3),
    transparent
  );
  box-shadow: 0 0 8px rgba(255, 107, 107, 0.6);
}

.bg-star.color-orange {
  background: radial-gradient(
    circle,
    rgba(255, 177, 66, 0.9),
    rgba(255, 177, 66, 0.3),
    transparent
  );
  box-shadow: 0 0 8px rgba(255, 177, 66, 0.6);
}

.bg-star.color-green {
  background: radial-gradient(
    circle,
    rgba(16, 185, 129, 0.9),
    rgba(16, 185, 129, 0.3),
    transparent
  );
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.bg-star.color-white {
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.9),
    rgba(255, 255, 255, 0.2),
    transparent
  );
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

/* Nebula Storm star colors */
:root[data-theme="nebula-storm"] .bg-star.color-blue {
  background: radial-gradient(
    circle,
    rgba(186, 85, 211, 0.9),
    rgba(186, 85, 211, 0.3),
    transparent
  );
  box-shadow: 0 0 8px rgba(186, 85, 211, 0.6);
}

:root[data-theme="nebula-storm"] .bg-star.color-purple {
  background: radial-gradient(
    circle,
    rgba(138, 43, 226, 0.9),
    rgba(138, 43, 226, 0.3),
    transparent
  );
  box-shadow: 0 0 8px rgba(138, 43, 226, 0.6);
}

:root[data-theme="nebula-storm"] .bg-star.color-pink {
  background: radial-gradient(
    circle,
    rgba(255, 20, 147, 0.9),
    rgba(255, 20, 147, 0.3),
    transparent
  );
  box-shadow: 0 0 8px rgba(255, 20, 147, 0.6);
}

:root[data-theme="nebula-storm"] .bg-star.color-orange {
  background: radial-gradient(
    circle,
    rgba(221, 160, 221, 0.9),
    rgba(221, 160, 221, 0.3),
    transparent
  );
  box-shadow: 0 0 8px rgba(221, 160, 221, 0.6);
}

:root[data-theme="nebula-storm"] .bg-star.color-green {
  background: radial-gradient(
    circle,
    rgba(148, 0, 211, 0.9),
    rgba(148, 0, 211, 0.3),
    transparent
  );
  box-shadow: 0 0 8px rgba(148, 0, 211, 0.6);
}

:root[data-theme="nebula-storm"] .bg-star.color-white {
  background: radial-gradient(
    circle,
    rgba(221, 160, 221, 0.9),
    rgba(221, 160, 221, 0.2),
    transparent
  );
  box-shadow: 0 0 6px rgba(221, 160, 221, 0.4);
}

/* Solar Flare star colors */
:root[data-theme="solar-flare"] .bg-star.color-blue {
  background: radial-gradient(
    circle,
    rgba(255, 140, 0, 0.9),
    rgba(255, 140, 0, 0.3),
    transparent
  );
  box-shadow: 0 0 8px rgba(255, 140, 0, 0.6);
}

:root[data-theme="solar-flare"] .bg-star.color-purple {
  background: radial-gradient(
    circle,
    rgba(255, 69, 0, 0.9),
    rgba(255, 69, 0, 0.3),
    transparent
  );
  box-shadow: 0 0 8px rgba(255, 69, 0, 0.6);
}

:root[data-theme="solar-flare"] .bg-star.color-pink {
  background: radial-gradient(
    circle,
    rgba(255, 215, 0, 0.9),
    rgba(255, 215, 0, 0.3),
    transparent
  );
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

:root[data-theme="solar-flare"] .bg-star.color-orange {
  background: radial-gradient(
    circle,
    rgba(255, 165, 0, 0.9),
    rgba(255, 165, 0, 0.3),
    transparent
  );
  box-shadow: 0 0 8px rgba(255, 165, 0, 0.6);
}

:root[data-theme="solar-flare"] .bg-star.color-green {
  background: radial-gradient(
    circle,
    rgba(178, 34, 34, 0.9),
    rgba(178, 34, 34, 0.3),
    transparent
  );
  box-shadow: 0 0 8px rgba(178, 34, 34, 0.6);
}

:root[data-theme="solar-flare"] .bg-star.color-white {
  background: radial-gradient(
    circle,
    rgba(184, 115, 51, 0.9),
    rgba(184, 115, 51, 0.2),
    transparent
  );
  box-shadow: 0 0 6px rgba(184, 115, 51, 0.4);
}

/* ===== PARTICLE EFFECTS ===== */
.bg-particle {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  opacity: 0.3;
  animation: float 35s linear infinite;
}

@media (max-width: 768px) {
  .bg-particle {
    opacity: 0.2;
    animation-duration: 40s;
  }
}

.bg-particle.color-blue {
  background: linear-gradient(45deg, #4ecdc4, #26de81);
  box-shadow: 0 0 3px rgba(78, 205, 196, 0.2);
}

.bg-particle.color-purple {
  background: linear-gradient(45deg, #c77dff, #e056fd);
  box-shadow: 0 0 3px rgba(199, 125, 255, 0.2);
}

.bg-particle.color-pink {
  background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
  box-shadow: 0 0 3px rgba(255, 107, 107, 0.2);
}

.bg-particle.color-orange {
  background: linear-gradient(45deg, #ffb142, #ffa726);
  box-shadow: 0 0 3px rgba(255, 177, 66, 0.2);
}

/* Theme-specific particles */
:root[data-theme="nebula-storm"] .bg-particle.color-blue {
  background: linear-gradient(45deg, #ba55d3, #8a2be2);
  box-shadow: 0 0 6px rgba(186, 85, 211, 0.4);
}

:root[data-theme="nebula-storm"] .bg-particle.color-purple {
  background: linear-gradient(45deg, #8a2be2, #9400d3);
  box-shadow: 0 0 6px rgba(138, 43, 226, 0.4);
}

:root[data-theme="nebula-storm"] .bg-particle.color-pink {
  background: linear-gradient(45deg, #ff1493, #c71585);
  box-shadow: 0 0 6px rgba(255, 20, 147, 0.4);
}

:root[data-theme="nebula-storm"] .bg-particle.color-orange {
  background: linear-gradient(45deg, #dda0dd, #ba55d3);
  box-shadow: 0 0 6px rgba(221, 160, 221, 0.4);
}

:root[data-theme="solar-flare"] .bg-particle.color-blue {
  background: linear-gradient(45deg, #ff8c00, #ffa500);
  box-shadow: 0 0 6px rgba(255, 140, 0, 0.4);
}

:root[data-theme="solar-flare"] .bg-particle.color-purple {
  background: linear-gradient(45deg, #ff4500, #ff6347);
  box-shadow: 0 0 6px rgba(255, 69, 0, 0.4);
}

:root[data-theme="solar-flare"] .bg-particle.color-pink {
  background: linear-gradient(45deg, #ffd700, #ffb347);
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
}

:root[data-theme="solar-flare"] .bg-particle.color-orange {
  background: linear-gradient(45deg, #b8733f, #d2691e);
  box-shadow: 0 0 6px rgba(184, 115, 51, 0.4);
}

/* ===== COSMIC TRAILS ===== */
.cosmic-trail {
  position: absolute;
  width: 1px;
  height: 60px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: trail 25s linear infinite;
  opacity: 0.2;
}

@media (max-width: 768px) {
  .cosmic-trail {
    opacity: 0.1;
    height: 40px;
  }
}

.cosmic-trail.color-blue {
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(78, 205, 196, 0.3),
    transparent
  );
}

.cosmic-trail.color-purple {
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(199, 125, 255, 0.3),
    transparent
  );
}

.cosmic-trail.color-pink {
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 107, 107, 0.3),
    transparent
  );
}

/* Theme-specific trails */
:root[data-theme="nebula-storm"] .cosmic-trail.color-blue {
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(186, 85, 211, 0.4),
    transparent
  );
}

:root[data-theme="nebula-storm"] .cosmic-trail.color-purple {
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(138, 43, 226, 0.4),
    transparent
  );
}

:root[data-theme="nebula-storm"] .cosmic-trail.color-pink {
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 20, 147, 0.4),
    transparent
  );
}

:root[data-theme="solar-flare"] .cosmic-trail.color-blue {
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 140, 0, 0.4),
    transparent
  );
}

:root[data-theme="solar-flare"] .cosmic-trail.color-purple {
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 69, 0, 0.4),
    transparent
  );
}

:root[data-theme="solar-flare"] .cosmic-trail.color-pink {
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 215, 0, 0.4),
    transparent
  );
}

/* ===== FLOATING SHAPES ===== */
.floating-shape {
  position: absolute;
  opacity: 0.04;
  animation: floatGeometric 40s infinite linear;
  font-size: 14px;
  font-weight: 300;
  user-select: none;
}

@media (max-width: 768px) {
  .floating-shape {
    opacity: 0.02;
    font-size: 12px;
  }
}

.floating-shape.color-blue {
  color: #4ecdc4;
}
.floating-shape.color-purple {
  color: #c77dff;
}
.floating-shape.color-pink {
  color: #ff6b6b;
}
.floating-shape.color-orange {
  color: #ffb142;
}
.floating-shape.color-green {
  color: #26de81;
}

/* ===== CONSTELLATION LINES ===== */
.constellation-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transform-origin: left center;
  animation: pulseLine 4s ease-in-out infinite;
}

@media (max-width: 768px) {
  .constellation-line {
    opacity: 0.5;
  }
}

/* ===== THEME SWITCHER ===== */
.theme-switcher {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 101;
  display: flex;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 25px;
  padding: 0.5rem;
  opacity: 0;
  animation: fadeInDown 1s ease 0.5s forwards;
}

.theme-option {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-option::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.theme-option:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.theme-option.active {
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

/* Theme button designs */
.theme-option[data-theme="deep-space"] {
  background: radial-gradient(circle, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
}

.theme-option[data-theme="deep-space"]::before {
  background: radial-gradient(
      circle at 30% 30%,
      rgba(78, 205, 196, 0.3),
      transparent 60%
    ),
    radial-gradient(circle at 70% 70%, rgba(139, 92, 246, 0.2), transparent 60%);
}

.theme-option[data-theme="nebula-storm"] {
  background: radial-gradient(circle, #2d1b4e 0%, #3c1361 50%, #16001e 100%);
}

.theme-option[data-theme="nebula-storm"]::before {
  background: radial-gradient(
      circle at 30% 30%,
      rgba(186, 85, 211, 0.6),
      transparent 60%
    ),
    radial-gradient(circle at 70% 70%, rgba(255, 20, 147, 0.4), transparent 60%);
  animation: nebulaGlow 2s ease-in-out infinite;
}

.theme-option[data-theme="solar-flare"] {
  background: radial-gradient(circle, #4a2c1a 0%, #5c3317 50%, #1a0e08 100%);
}

.theme-option[data-theme="solar-flare"]::before {
  background: radial-gradient(
      circle at 30% 30%,
      rgba(255, 140, 0, 0.8),
      transparent 60%
    ),
    radial-gradient(circle at 70% 70%, rgba(255, 69, 0, 0.6), transparent 60%);
  animation: solarGlow 2.5s ease-in-out infinite;
}

@keyframes nebulaGlow {
  0%,
  100% {
    opacity: 0.8;
    filter: brightness(1);
  }
  50% {
    opacity: 1;
    filter: brightness(1.2);
  }
}

@keyframes solarGlow {
  0%,
  100% {
    opacity: 0.8;
    filter: brightness(1);
  }
  50% {
    opacity: 1;
    filter: brightness(1.4);
  }
}

/* ===== CONTAINER ===== */
.container {
  position: relative;
  z-index: 10;
  min-height: 100vh;
}

/* ===== NAVIGATION ===== */
nav {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: auto;
  max-width: 90vw;
  padding: 0;
  background: none;
  border: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  animation: fadeInDown 1s ease 0.3s forwards;
}

nav.scrolled {
  top: 1rem;
  transform: translateX(-50%) scale(0.95);
}

nav.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(-20px);
  pointer-events: none;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 25px;
  padding: 0.5rem 1.25rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 1rem;
}

.logo {
  font-size: 0.9rem;
  font-weight: 700;
  background: linear-gradient(
    135deg,
    var(--theme-primary),
    var(--theme-secondary)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 0.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.75rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  padding: 0.4rem 0.75rem;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  transform-origin: center;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--text-primary);
  transform: translateY(-1px) scale(1.05);
  background: rgba(255, 255, 255, 0.1);
}

.nav-links a.active {
  color: var(--theme-primary);
  background: rgba(255, 255, 255, 0.08);
}

.nav-social {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.nav-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-social-link svg {
  width: 12px;
  height: 12px;
}

.nav-social-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  transform: translateY(-1px) scale(1.05);
}

/* Hide navigation toggle by default - no burger menu needed */
.nav-toggle {
  display: none;
}

@media (max-width: 768px) {
  nav {
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100vw - 2rem);
    max-width: calc(100vw - 2rem);
  }

  .nav-content {
    padding: 0.5rem 1rem;
    gap: 0.75rem;
    border-radius: 20px;
  }

  .logo {
    font-size: 0.85rem;
  }

  .nav-links {
    gap: 0.1rem;
  }

  .nav-links a {
    font-size: 0.7rem;
    padding: 0.35rem 0.6rem;
    border-radius: 12px;
  }

  .nav-social-link {
    width: 22px;
    height: 22px;
  }

  .nav-social-link svg {
    width: 11px;
    height: 11px;
  }

  .theme-switcher {
    position: fixed;
    top: auto;
    bottom: 2rem;
    left: auto;
    right: 2rem;
    transform: none;
    padding: 0.4rem;
    gap: 0.3rem;
    border-radius: 20px;
    animation: fadeInUp 1s ease 0.8s forwards;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  }

  .theme-option {
    width: 22px;
    height: 22px;
  }
}

@media (max-width: 480px) {
  nav {
    width: calc(100vw - 1.5rem);
    max-width: calc(100vw - 1.5rem);
  }

  .nav-content {
    padding: 0.45rem 0.8rem;
    gap: 0.6rem;
  }

  .logo {
    font-size: 0.8rem;
  }

  .nav-links a {
    font-size: 0.65rem;
    padding: 0.3rem 0.5rem;
  }

  .theme-switcher {
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.35rem;
  }

  .theme-option {
    width: 20px;
    height: 20px;
  }
}

/* ===== HERO SECTION ===== */
.hero {
  min-height: calc(100vh - 90px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 90px 2.25rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero-content {
  max-width: 750px;
  position: relative;
  z-index: 10;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 37px;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInUp 1s ease 0.5s forwards;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.hero h1 {
  font-size: clamp(2.25rem, 6vw, 5.25rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.125rem;
  background: linear-gradient(
    135deg,
    #ffffff 0%,
    var(--theme-primary) 25%,
    var(--theme-secondary) 50%,
    var(--theme-tertiary) 75%,
    var(--theme-primary) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite, fadeInUp 1s ease 0.8s forwards;
  opacity: 0;
  transform: translateY(40px);
}

.hero p {
  font-size: 0.94rem;
  color: var(--text-secondary);
  font-weight: 400;
  max-width: 450px;
  margin: 0 auto 2.25rem;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInUp 1s ease 1.1s forwards;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
  line-height: 1.8;
  position: relative;
}

/* Enhanced location and highlight styling */
.hero p .location {
  background: linear-gradient(
    135deg,
    var(--theme-primary),
    var(--theme-secondary)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
  position: relative;
  transition: all 0.3s ease;
  cursor: default;
}

.hero p .location:nth-child(1) {
  background: linear-gradient(
    135deg,
    var(--theme-primary),
    var(--theme-tertiary)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p .location:nth-child(2) {
  background: linear-gradient(
    135deg,
    var(--theme-secondary),
    var(--theme-tertiary)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p .location:nth-child(3) {
  background: linear-gradient(
    135deg,
    var(--theme-tertiary),
    var(--theme-primary)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p .highlight-performance {
  color: var(--theme-tertiary);
  text-shadow: 0 0 10px var(--theme-tertiary);
}

.hero p .highlight-scalability {
  color: var(--theme-primary);
  text-shadow: 0 0 10px var(--theme-primary);
}

.hero p .highlight-ux {
  color: var(--theme-secondary);
  text-shadow: 0 0 10px var(--theme-secondary);
}

.hero-cta {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInUp 1s ease 1.4s forwards;
}

.btn {
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--theme-primary),
    var(--theme-secondary)
  );
  color: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15), 0 2px 8px var(--theme-primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 4px 12px var(--theme-primary);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-3px) scale(1.02);
}

/* Mobile hero adjustments */
@media (max-width: 768px) {
  .hero {
    padding: 100px var(--mobile-padding) 2rem;
    min-height: calc(100vh - 100px);
  }

  .btn {
    padding: 0.7rem 1.25rem;
    font-size: 0.8rem;
    width: 100%;
    max-width: 260px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 90px var(--mobile-padding) 1.5rem;
  }

  .btn {
    padding: 0.65rem 1.1rem;
    font-size: 0.75rem;
    max-width: 240px;
  }
}

/* ===== SECTION FOUNDATION ===== */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  background: linear-gradient(
    135deg,
    var(--text-primary),
    var(--text-secondary)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 450px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Mobile section adjustments */
@media (max-width: 768px) {
  .section-header {
    margin-bottom: 2rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .section-subtitle {
    font-size: 0.8rem;
    max-width: 350px;
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 1.5rem;
  }

  .section-subtitle {
    font-size: 0.75rem;
    max-width: 300px;
  }
}

/* ===== ABOUT SECTION ===== */
.about {
  padding: 6rem 2.25rem;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

.astronaut-image {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
}

.astronaut-image img {
  width: 82px;
  height: 82px;
  object-fit: contain;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.about-intro p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.8;
  text-align: center;
}

/* Timeline */
.journey-timeline {
  margin: 3rem 0;
  position: relative;
}

.journey-timeline::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--accent-blue),
    var(--accent-purple),
    var(--accent-pink)
  );
  opacity: 0.3;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2.25rem;
  position: relative;
}

.timeline-marker {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-marker::after {
  content: "";
  width: 12px;
  height: 12px;
  background: var(--bg-primary);
  border-radius: 50%;
}

.timeline-marker.active {
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));
  animation: pulse-glow 2s infinite;
}

.timeline-content {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.timeline-content:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-4px);
}

.timeline-content h3 {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.timeline-content p {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.8rem;
}

.global-perspective {
  margin-top: 2.25rem;
  padding: 1.9rem;
  background: linear-gradient(
    135deg,
    rgba(14, 165, 233, 0.05),
    rgba(139, 92, 246, 0.05)
  );
  border: 1px solid rgba(14, 165, 233, 0.1);
  border-radius: 15px;
  text-align: center;
}

.global-perspective p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  font-style: italic;
}

/* Mobile about adjustments */
@media (max-width: 768px) {
  .about {
    padding: var(--mobile-section-gap) var(--mobile-padding);
  }

  .astronaut-image img {
    width: 60px;
    height: 60px;
  }

  .timeline-item {
    gap: 1rem;
  }

  .timeline-content {
    padding: 1.25rem;
  }

  .journey-timeline::before {
    left: 12px;
  }

  .timeline-marker {
    width: 24px;
    height: 24px;
  }

  .timeline-marker::after {
    width: 8px;
    height: 8px;
  }

  .global-perspective {
    padding: 1.5rem;
  }

  .about-intro p {
    font-size: 0.85rem;
    line-height: 1.7;
  }
}

@media (max-width: 480px) {
  .about {
    padding: 3rem var(--mobile-padding);
  }

  .timeline-content {
    padding: 1rem;
  }

  .global-perspective {
    padding: 1.25rem;
  }

  .timeline-content h3 {
    font-size: 0.9rem;
  }

  .timeline-content p {
    font-size: 0.75rem;
  }
}

/* ===== SKILLS SECTION ===== */
.skills {
  padding: 1.5rem 2.25rem 6rem;
  max-width: 1050px;
  margin: 0 auto;
  position: relative;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
  gap: 1.5rem;
}

.skill-card {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.01)
  );
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.9rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.skill-card:hover {
  transform: translateY(-12px) scale(1.02);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.02)
  );
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.skill-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.125rem;
  font-size: 1.125rem;
}

.skill-card h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.skill-card p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.125rem;
  font-size: 0.8rem;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tech-tag {
  padding: 0.2rem 0.56rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  font-size: 0.65rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.skill-card:hover .tech-tag {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* Mobile skills adjustments */
@media (max-width: 768px) {
  .skills {
    padding: 2rem var(--mobile-padding) var(--mobile-section-gap);
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .skill-card {
    padding: 1.5rem;
  }

  .skill-card:hover {
    transform: translateY(-6px) scale(1.01);
  }

  .skill-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .skill-card h4 {
    font-size: 1rem;
  }

  .skill-card p {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .skills {
    padding: 2rem var(--mobile-padding) 3rem;
  }

  .skill-card {
    padding: 1.25rem;
  }

  .tech-tag {
    font-size: 0.6rem;
    padding: 0.15rem 0.45rem;
  }
}

/* ===== PROJECTS SECTION ===== */
.projects {
  padding: 6rem 2.25rem;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

.project-card {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.02)
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 2.25rem;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-8px);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.03)
  );
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.project-header {
  display: flex;
  align-items: flex-start;
  gap: 1.125rem;
  margin-bottom: 1.5rem;
}

.project-icon {
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.project-meta h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.project-subtitle {
  color: var(--accent-blue);
  font-weight: 500;
  margin-bottom: 0.375rem;
  font-size: 0.8rem;
}

.project-duration {
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.project-overview {
  margin-bottom: 1.9rem;
}

.project-overview p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.85rem;
}

.project-highlights {
  margin-bottom: 1.9rem;
}

.highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.125rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 9px;
  transition: all 0.3s ease;
}

.highlight-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(8px);
}

.highlight-icon {
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.highlight-item h4 {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.375rem;
  font-size: 0.85rem;
}

.highlight-item p {
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: 0.75rem;
}

.tech-showcase {
  margin-bottom: 1.9rem;
}

.tech-category {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.tech-label {
  color: var(--text-primary);
  font-weight: 600;
  min-width: 60px;
  font-size: 0.7rem;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.tech-badge {
  padding: 0.3rem 0.75rem;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: white;
  border-radius: 15px;
  font-size: 0.65rem;
  font-weight: 500;
}

.project-actions {
  text-align: center;
}

/* Mobile projects adjustments */
@media (max-width: 768px) {
  .projects {
    padding: var(--mobile-section-gap) var(--mobile-padding);
  }

  .project-card {
    padding: 1.75rem;
  }

  .project-header {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .project-meta h3 {
    font-size: 1.2rem;
  }

  .project-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    align-self: center;
  }

  .tech-category {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .highlight-item {
    padding: 0.6rem;
  }

  .highlight-item:hover {
    transform: translateX(4px);
  }
}

@media (max-width: 480px) {
  .project-card {
    padding: 1.5rem;
  }

  .project-meta h3 {
    font-size: 1.1rem;
  }

  .highlight-item {
    padding: 0.5rem;
  }

  .highlight-item h4 {
    font-size: 0.8rem;
  }

  .highlight-item p {
    font-size: 0.7rem;
  }
}

/* ===== PROJECT MODAL ===== */
.project-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.modal-content {
  position: relative;
  background: linear-gradient(
    135deg,
    rgba(17, 17, 17, 0.95),
    rgba(10, 10, 10, 0.95)
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  width: 90%;
  max-width: 675px;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-modal.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
  color: var(--text-primary);
  font-size: 1.125rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.125rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
  /* Improve touch target */
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.9rem;
  overflow-y: auto;
  max-height: calc(90vh - 90px);
  /* Smooth scrolling on iOS */
  -webkit-overflow-scrolling: touch;
}

.case-study-content {
  color: var(--text-secondary);
  line-height: 1.7;
}

.case-study-content h1,
.case-study-content h2,
.case-study-content h3,
.case-study-content h4 {
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.case-study-content h1 {
  font-size: 1.5rem;
  margin-top: 0;
}

.case-study-content h2 {
  font-size: 1.125rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.375rem;
}

.case-study-content h3 {
  font-size: 1rem;
  color: var(--accent-blue);
}

.loading {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-secondary);
}

/* Mobile modal adjustments */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 1rem;
    max-height: 85vh;
  }

  .modal-header {
    padding: 1.25rem;
  }

  .modal-body {
    padding: 1.25rem;
    max-height: calc(85vh - 80px);
  }

  .modal-header h2 {
    font-size: 1rem;
  }

  .case-study-content h1 {
    font-size: 1.25rem;
  }

  .case-study-content h2 {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .modal-content {
    width: calc(100vw - 1rem);
    margin: 0.5rem;
    max-height: 90vh;
  }

  .modal-header {
    padding: 1rem;
  }

  .modal-body {
    padding: 1rem;
  }
}

/* ===== CONTACT SECTION ===== */
.contact {
  padding: 6rem 2.25rem;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.contact-header {
  text-align: center;
  margin-bottom: 3rem;
  opacity: 0;
  transform: translateY(60px);
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-header.animate {
  opacity: 1;
  transform: translateY(0);
}

.contact-form {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.02)
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 2.25rem;
  backdrop-filter: blur(20px);
  opacity: 0;
  transform: translateY(80px);
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-form.animate {
  opacity: 1;
  transform: translateY(0);
}

.form-group {
  margin-bottom: 1.125rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.375rem;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.8rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.875rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  /* Improve mobile input experience */
  -webkit-appearance: none;
  appearance: none;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
  transform: translateY(-2px);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
  /* Better mobile textarea */
  min-height: 100px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.submit-btn {
  width: 100%;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* Improve touch target */
  min-height: var(--touch-target-min);
}

.submit-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 4px 12px var(--theme-primary);
}

.submit-btn.loading {
  pointer-events: none;
  opacity: 0.8;
}

.submit-btn.success {
  background: linear-gradient(135deg, var(--accent-green), #059669);
}

.form-message {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 6px;
  font-weight: 500;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.8rem;
}

.form-message.show {
  opacity: 1;
  transform: translateY(0);
}

.form-message.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-green);
}

.form-message.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

/* Form validation */
.form-group input.error,
.form-group textarea.error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.field-error {
  color: #ef4444;
  font-size: 0.65rem;
  margin-top: 0.2rem;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.field-error.show {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile contact adjustments */
@media (max-width: 768px) {
  .contact {
    padding: var(--mobile-section-gap) var(--mobile-padding);
  }

  .contact-form {
    padding: 1.75rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 1rem;
    font-size: 16px; /* Prevent zoom on iOS */
  }

  .form-group textarea {
    min-height: 120px;
  }

  .submit-btn {
    padding: 1.125rem 1.5rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .contact-form {
    padding: 1.5rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 0.875rem;
  }

  .submit-btn {
    padding: 1rem 1.25rem;
  }
}

/* ===== CURSOR EFFECTS ===== */
.cursor {
  position: fixed;
  width: 15px;
  height: 15px;
  background: radial-gradient(circle, var(--accent-blue), transparent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transition: transform 0.1s ease;
}

.cursor.magnetic {
  transform: scale(1.5);
}

/* Hide cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
  .cursor {
    display: none;
  }
}

/* ===== SCROLL REVEAL ===== */
.scroll-reveal {
  opacity: 0;
  transform: translateY(60px);
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ===== ANIMATIONS ===== */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

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

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

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

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.4);
  }
  50% {
    box-shadow: 0 0 30px rgba(236, 72, 153, 0.6);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.2;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

@keyframes float {
  0% {
    transform: translateY(100vh) translateX(0) rotate(0deg);
    opacity: 0;
  }
  20% {
    opacity: 0.3;
  }
  80% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-10vh) translateX(20px) rotate(180deg);
    opacity: 0;
  }
}

@keyframes trail {
  0% {
    transform: translateY(-100px) translateX(0) rotate(15deg);
    opacity: 0;
  }
  20% {
    opacity: 0.4;
  }
  80% {
    opacity: 0.4;
  }
  100% {
    transform: translateY(100vh) translateX(30px) rotate(15deg);
    opacity: 0;
  }
}

@keyframes floatGeometric {
  0% {
    transform: translateY(100vh) translateX(0) rotate(0deg);
    opacity: 0;
  }
  20% {
    opacity: 0.04;
  }
  80% {
    opacity: 0.04;
  }
  100% {
    transform: translateY(-100px) translateX(20px) rotate(180deg);
    opacity: 0;
  }
}

@keyframes pulseLine {
  0%,
  100% {
    opacity: 0.05;
  }
  50% {
    opacity: 0.15;
  }
}

/* ===== ACCESSIBILITY & PERFORMANCE ===== */

/* Respect user preferences for reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Disable parallax and complex animations */
  .hero {
    transform: none !important;
  }

  body::before {
    animation: none !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --bg-primary: #000000;
  }

  .nav-content,
  .contact-form,
  .project-card,
  .skill-card {
    border-color: rgba(255, 255, 255, 0.3);
  }
}

/* Focus styles for keyboard navigation */
.keyboard-nav *:focus {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* ===== LANDSCAPE MOBILE OPTIMIZATION ===== */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
    padding: 80px var(--mobile-padding) 1rem;
  }

  .hero h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: 0.5rem;
  }

  .hero p {
    margin-bottom: 1rem;
    font-size: 0.8rem;
  }

  .hero-badge {
    margin-bottom: 0.75rem;
  }

  .about,
  .skills,
  .projects,
  .contact {
    padding: 2rem var(--mobile-padding);
  }

  .theme-switcher {
    bottom: 1rem;
    padding: 0.4rem;
  }
}

/* ===== VERY SMALL SCREENS ===== */
@media (max-width: 360px) {
  :root {
    --mobile-padding: 0.75rem;
    --mobile-section-gap: 3rem;
  }

  .hero {
    padding: 100px var(--mobile-padding) 1rem;
  }

  .hero h1 {
    font-size: clamp(1.25rem, 10vw, 2rem);
    line-height: 1.2;
  }

  .hero p {
    font-size: 0.8rem;
  }

  .section-title {
    font-size: 1.25rem;
  }

  .contact-form,
  .project-card,
  .skill-card {
    padding: 1rem;
  }

  .timeline-content {
    padding: 0.75rem;
  }

  .global-perspective {
    padding: 1rem;
  }

  .btn {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  .theme-switcher,
  .cursor,
  .constellation-bg,
  .cosmic-bg,
  .nav-social {
    display: none !important;
  }

  body::before {
    display: none !important;
  }

  .hero,
  .about,
  .skills,
  .projects,
  .contact {
    padding: 1rem !important;
    page-break-inside: avoid;
  }
}
