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

:root {
  --primary: #3b82f6;
  --primary-dark: #1d4ed8;
  --accent: #f59e0b;
  --accent-glow: #fbbf24;
  --light-bg: #ffffff;
  --dark-bg: #0f172a;
  --light-text: #1e293b;
  --dark-text: #f1f5f9;
  --bg: var(--light-bg);
  --text: var(--light-text);
  --card-bg: rgba(255, 255, 255, 0.9);
  --card-text: #1e293b;
  --border: rgba(0, 0, 0, 0.1);
  --shadow: rgba(0, 0, 0, 0.1);
  --gradient: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  
  /* Liquid Glass Variables - Light Mode */
  --glass-bg: rgba(255, 255, 255, 0.35);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: rgba(0, 0, 0, 0.15);
  --glass-blur: 25px;
  --glass-blur-strong: 50px;
  --liquid-gradient: linear-gradient(135deg,
    rgba(59, 130, 246, 0.25) 0%,
    rgba(245, 158, 11, 0.2) 50%,
    rgba(168, 85, 247, 0.25) 100%);
  --shimmer-gradient: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.6) 50%,
    transparent 100%);
}

[data-theme="dark"] {
  --bg: var(--dark-bg);
  --text: var(--dark-text);
  --card-bg: rgba(30, 41, 59, 0.9);
  --card-text: #e2e8f0;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: rgba(0, 0, 0, 0.3);
  
  /* Dark Mode Liquid Glass */
  --glass-bg: rgba(30, 41, 59, 0.4);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-shadow: rgba(0, 0, 0, 0.5);
  --liquid-gradient: linear-gradient(135deg,
    rgba(59, 130, 246, 0.2) 0%,
    rgba(245, 158, 11, 0.15) 50%,
    rgba(168, 85, 247, 0.2) 100%);
  --shimmer-gradient: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%);
}

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

/* Better text handling for mobile */
h1, h2, h3, h4, h5, h6, p, a, span, div {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: all 0.3s ease;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%; /* Prevents iOS text size adjustment */
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Liquid Glass Animated Background */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.15;
  background:
    radial-gradient(circle at 20% 20%, var(--primary) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, var(--accent) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.15) 0%, transparent 60%);
  animation: liquidFloat 30s ease-in-out infinite;
  filter: blur(60px);
}

/* Floating glass orbs */
.bg-animation::before,
.bg-animation::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: var(--liquid-gradient);
  backdrop-filter: blur(var(--glass-blur));
  border: 2px solid var(--glass-border);
  animation: glassOrb 35s ease-in-out infinite;
  box-shadow:
    0 0 60px rgba(59, 130, 246, 0.3),
    inset 0 0 40px rgba(255, 255, 255, 0.2);
}

.bg-animation::before {
  top: 15%;
  left: 5%;
  animation-delay: 0s;
}

.bg-animation::after {
  bottom: 15%;
  right: 5%;
  animation-delay: 17s;
}

@keyframes liquidFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg) scale(1);
    opacity: 0.15;
  }
  25% {
    transform: translateY(-50px) rotate(90deg) scale(1.15);
    opacity: 0.2;
  }
  50% {
    transform: translateY(-30px) rotate(180deg) scale(0.95);
    opacity: 0.25;
  }
  75% {
    transform: translateY(-60px) rotate(270deg) scale(1.08);
    opacity: 0.18;
  }
}

@keyframes glassOrb {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 0.4;
  }
  25% {
    transform: translate(80px, -50px) rotate(90deg) scale(1.1);
    opacity: 0.6;
  }
  50% {
    transform: translate(120px, 0px) rotate(180deg) scale(0.9);
    opacity: 0.5;
  }
  75% {
    transform: translate(60px, 50px) rotate(270deg) scale(1.05);
    opacity: 0.55;
  }
}

/* Floating Glass Elements */
.floating-glass-elements {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.glass-orb {
  position: absolute;
  border-radius: 50%;
  background: var(--liquid-gradient);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 2px solid var(--glass-border);
  box-shadow:
    0 8px 32px var(--glass-shadow),
    0 0 60px rgba(59, 130, 246, 0.2),
    inset 0 0 30px rgba(255, 255, 255, 0.15);
  animation: floatGlass 20s ease-in-out infinite;
}

.glass-orb-1 {
  width: 120px;
  height: 120px;
  top: 15%;
  left: 8%;
  animation-delay: 0s;
  animation-duration: 28s;
  background: linear-gradient(135deg,
    rgba(59, 130, 246, 0.3) 0%,
    rgba(168, 85, 247, 0.2) 100%);
}

.glass-orb-2 {
  width: 150px;
  height: 150px;
  top: 55%;
  right: 12%;
  animation-delay: 7s;
  animation-duration: 35s;
  background: linear-gradient(135deg,
    rgba(245, 158, 11, 0.25) 0%,
    rgba(59, 130, 246, 0.2) 100%);
}

.glass-orb-3 {
  width: 90px;
  height: 90px;
  bottom: 25%;
  left: 15%;
  animation-delay: 12s;
  animation-duration: 24s;
  background: linear-gradient(135deg,
    rgba(168, 85, 247, 0.3) 0%,
    rgba(245, 158, 11, 0.2) 100%);
}

.glass-orb-4 {
  width: 130px;
  height: 130px;
  top: 35%;
  right: 25%;
  animation-delay: 18s;
  animation-duration: 40s;
  background: linear-gradient(135deg,
    rgba(59, 130, 246, 0.25) 0%,
    rgba(245, 158, 11, 0.25) 50%,
    rgba(168, 85, 247, 0.2) 100%);
}

@keyframes floatGlass {
  0%, 100% {
    transform: translateY(0px) translateX(0px) rotate(0deg) scale(1);
    opacity: 0.5;
  }
  25% {
    transform: translateY(-40px) translateX(30px) rotate(90deg) scale(1.1);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-30px) translateX(-20px) rotate(180deg) scale(0.95);
    opacity: 0.6;
  }
  75% {
    transform: translateY(-50px) translateX(15px) rotate(270deg) scale(1.05);
    opacity: 0.65;
  }
}

/* Hide hamburger on desktop by default */
.mobile-menu-toggle {
  display: none;
}

/* Liquid Glass Theme Toggle */
.theme-toggle {
  z-index: 1001;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px var(--glass-shadow);

  display: flex;
  align-items: center;
  justify-content: center;

  width: 50px;
  height: 50px;

  margin-left: 0.5rem;
  flex: 0 0 auto;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px var(--glass-shadow);
  background: rgba(255, 255, 255, 0.15);
}

.theme-icon {
  font-size: 1.4rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Liquid Glass Navigation */
nav {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur-strong));
  -webkit-backdrop-filter: blur(var(--glass-blur-strong));
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  border-bottom: 2px solid var(--glass-border);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 8px 32px var(--glass-shadow),
    inset 0 -1px 0 rgba(255, 255, 255, 0.2);
}

nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--shimmer-gradient);
  animation: shimmer 3s ease-in-out infinite;
}

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

[data-theme="dark"] nav {
  background: var(--glass-bg);
  border-bottom: 2px solid var(--glass-border);
  box-shadow:
    0 8px 32px var(--glass-shadow),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}

/* NAV BAR CONTAINER */
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 70px;
  position: relative;
}

/* LOGO */
.logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  transition: all 0.3s ease;
}

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

.nav-links li a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s ease;
}

.nav-links li a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: width 0.3s ease;
}

.nav-links li a:hover::after {
  width: 100%;
}

.nav-links li a:hover {
  color: var(--primary);
}

.mobile-menu-toggle {
  display: none;
  z-index: 1000;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
}

.hamburger-line {
  width: 25px;
  height: 3px;
  background: var(--text);
  margin: 3px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}
.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}
.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile layout with Liquid Glass optimizations */
@media (max-width: 768px) {
  /* Reduce blur intensity on mobile for better performance */
  :root {
    --glass-blur: 15px;
    --glass-blur-strong: 25px;
  }

  /* Reduce animation complexity on mobile */
  .bg-animation {
    filter: blur(40px);
    animation-duration: 40s;
  }

  .glass-orb {
    animation-duration: 35s !important;
  }

  /* Simplify hero glow on mobile */
  .hero::before {
    filter: blur(50px);
    animation-duration: 10s;
  }

  /* Disable parallax on mobile for performance */
  .glass-orb {
    transform: none !important;
  }
  
  .mobile-menu-toggle {
    display: flex;
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    flex-direction: column;
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    padding: 0.5rem;
    box-shadow: 0 4px 16px var(--glass-shadow);
    transition: all 0.3s ease;
  }
  
  .mobile-menu-toggle:hover {
    background: var(--glass-bg);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 20px var(--glass-shadow);
  }

  .nav-links {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    height: calc(100vh - 70px);
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur-strong));
    -webkit-backdrop-filter: blur(var(--glass-blur-strong));
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 1.5rem;
    padding-top: 2rem;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    border-right: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--glass-shadow);
    z-index: 999;
  }
  
  .nav-links.active {
    transform: translateX(0);
  }

  .nav-links li a {
    font-size: 1.2rem;
    padding: 0.75rem 1rem;
    width: 90%;
    text-align: center;
    border-radius: 8px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    color: var(--text);
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px var(--glass-shadow);
  }
  
  .nav-links li a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
    border-color: var(--primary);
  }
  
  .nav-links li a::after {
    display: none;
  }

  .logo {
    font-size: 1.3rem;
    margin-left: 3.5rem;
  }

  .theme-toggle {
    width: 45px;
    height: 45px;
    padding: 0.6rem;
    margin-left: auto;
    flex: 0 0 auto;
  }
  
  .theme-icon {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  /* Further reduce blur for very small screens */
  :root {
    --glass-blur: 10px;
    --glass-blur-strong: 20px;
  }

  /* Further optimize animations */
  .bg-animation {
    filter: blur(30px);
    animation-duration: 50s;
  }

  .glass-orb {
    animation-duration: 40s !important;
  }

  /* Simplify transitions on small screens */
  .btn, .project-card, .skill-item, .contact-card {
    transition: all 0.3s ease;
  }

  /* Reduce shadow complexity */
  .btn-primary:hover,
  .project-card:hover,
  .skill-item:hover {
    box-shadow: 0 15px 40px var(--glass-shadow);
  }
  
  /* Enhanced mobile menu visibility */
  .nav-links {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur-strong));
    -webkit-backdrop-filter: blur(var(--glass-blur-strong));
  }
  
  .nav-links li a {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    font-size: 1.1rem;
    padding: 0.6rem 0.8rem;
    width: 95%;
  }

  .theme-toggle {
    width: 40px;
    height: 40px;
    padding: 0.5rem;
    margin-left: 0.3rem;
  }
  
  .theme-icon {
    font-size: 1rem;
  }
  
  /* Optimize floating orbs for small screens */
  .bg-animation::before,
  .bg-animation::after {
    width: 100px;
    height: 100px;
  }
  
  /* Reduce floating glass elements on mobile */
  .glass-orb-1, .glass-orb-3 {
    display: none;
  }

  .glass-orb-2 {
    width: 80px;
    height: 80px;
  }

  .glass-orb-4 {
    width: 60px;
    height: 60px;
  }

  /* Additional iPhone-specific fixes */
  .btn {
    padding: 0.75rem 1.2rem;
    font-size: 0.9rem;
    gap: 0.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .btn-small {
    font-size: 0.8rem;
    padding: 0.5rem 0.9rem;
  }

  .hero-cta {
    gap: 0.8rem;
    padding: 0 1rem;
    width: 100%;
  }

  .hero-cta .btn {
    width: 100%;
    max-width: 280px;
  }

  .hero {
    padding: 0 1.5rem;
  }

  .hero-greeting {
    font-size: 1rem;
  }

  .hero-title {
    font-size: clamp(1.8rem, 12vw, 2.8rem);
    margin-bottom: 1rem;
  }

  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  /* Fix section titles */
  .section-title {
    font-size: 2rem;
  }

  .section-subtitle {
    font-size: 0.95rem;
  }

  /* Fix project actions buttons */
  .project-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .project-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Fix about text */
  .about-text {
    font-size: 0.95rem;
  }

  /* Improve spacing on small screens */
  .section {
    padding: 3rem 1rem;
  }

  /* Fix contact form on small screens */
  .contact-form {
    padding: 2rem 1.5rem;
  }

  .form-input {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 0 2.5rem;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle,
    rgba(59, 130, 246, 0.15) 0%,
    rgba(168, 85, 247, 0.1) 50%,
    transparent 70%);
  border-radius: 50%;
  filter: blur(80px);
  animation: heroGlow 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes heroGlow {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.8;
  }
}

.hero-content {
  max-width: 800px;
  animation: fadeInUp 1s ease-out;
  position: relative;
  z-index: 1;
}

.hero-greeting {
  font-size: 1.2rem;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.2s forwards;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg,
    var(--primary) 0%,
    var(--accent) 50%,
    var(--primary-dark) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  animation:
    fadeInUp 1s ease-out 0.4s forwards,
    gradientShift 4s ease-in-out infinite;
  text-shadow: 0 0 40px rgba(59, 130, 246, 0.3);
  position: relative;
}

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

.hero-subtitle {
  font-size: 1.3rem;
  color: var(--text);
  opacity: 0.8;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.6s forwards;
}

.hero-cta {
  display: inline-flex;
  gap: 1rem;
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.8s forwards;
}

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

/* Liquid Glass Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 2px solid var(--glass-border);
  box-shadow: 0 8px 32px var(--glass-shadow);
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow:
    0 8px 32px rgba(59, 130, 246, 0.4),
    inset 0 0 20px rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow:
    0 15px 50px rgba(59, 130, 246, 0.6),
    0 0 30px rgba(59, 130, 246, 0.4),
    inset 0 0 30px rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.6);
}

.btn-primary:active {
  transform: translateY(-1px) scale(1.02);
}

.btn-secondary {
  background: var(--glass-bg);
  color: var(--text);
  border: 2px solid var(--glass-border);
  box-shadow:
    0 8px 32px var(--glass-shadow),
    inset 0 0 15px rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px) scale(1.05);
  box-shadow:
    0 15px 50px var(--glass-shadow),
    inset 0 0 25px rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-secondary:active {
  transform: translateY(-1px) scale(1.02);
}

/* Sections */
.section {
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  text-align: center;
  color: var(--text);
  opacity: 0.7;
  margin-bottom: 4rem;
  font-size: 1.1rem;
}

/* About Section */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text {
  font-size: 1.1rem;
  line-height: 1.8;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.skill-item {
  background: var(--card-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
  border: 2px solid var(--glass-border);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 8px 32px var(--glass-shadow),
    inset 0 0 15px rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.skill-item:hover {
  transform: translateY(-8px) scale(1.08);
  box-shadow:
    0 20px 50px var(--glass-shadow),
    0 0 30px rgba(59, 130, 246, 0.3),
    inset 0 0 25px rgba(255, 255, 255, 0.15);
  background: var(--glass-bg);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Floating glass particles for skills */
.skill-item::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  animation: rotate 10s linear infinite;
}

.skill-item:hover::before {
  opacity: 1;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--card-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid var(--glass-border);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow:
    0 8px 32px var(--glass-shadow),
    inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.project-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--shimmer-gradient);
  transition: left 0.7s;
  pointer-events: none;
}

.project-card:hover::after {
  left: 100%;
}

.project-card:hover {
  transform: translateY(-12px) scale(1.03);
  box-shadow:
    0 25px 70px var(--glass-shadow),
    0 0 40px rgba(59, 130, 246, 0.2),
    inset 0 0 30px rgba(255, 255, 255, 0.1);
  background: var(--glass-bg);
  border-color: rgba(255, 255, 255, 0.4);
}

.project-image {
  height: 200px;
  background: var(--gradient);
  position: relative;
  overflow: hidden;
}

/* Project image effects */
.project-image {
  height: 200px;
  background: var(--gradient);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-card:hover .project-image {
  transform: scale(1.02);
}

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

/* Simple hover effects for icons */
.project-image img[alt="Circuit Optimization"] {
  width: 100px !important;
  height: 100px !important;
  object-fit: contain !important;
  filter: brightness(0) invert(1);
  transition: all 0.3s ease;
}

.project-card:hover .project-image img[alt="Circuit Optimization"] {
  transform: scale(1.15);
  filter: brightness(0) invert(1) drop-shadow(0 0 15px rgba(255, 255, 255, 0.7));
}

.project-content {
  padding: 2rem;
}

.project-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.project-description {
  color: var(--text);
  opacity: 0.8;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.project-actions {
  display: flex;
  gap: 1rem;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-radius: 25px;
}

/* Liquid Glass Contact Cards */
.contact-card {
  background: var(--card-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  padding: 2rem;
  border-radius: 20px;
  text-align: center;
  border: 2px solid var(--glass-border);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 8px 32px var(--glass-shadow),
    inset 0 0 20px rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.contact-card:hover {
  transform: translateY(-8px) scale(1.04);
  box-shadow:
    0 25px 60px var(--glass-shadow),
    0 0 40px rgba(59, 130, 246, 0.2),
    inset 0 0 30px rgba(255, 255, 255, 0.1);
  background: var(--glass-bg);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Liquid glass shimmer effect */
.contact-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--shimmer-gradient);
  transition: left 0.7s;
  z-index: 1;
}

.contact-card:hover::before {
  left: 100%;
}

.contact-card > * {
  position: relative;
  z-index: 2;
}

.contact-card h3 {
  margin-bottom: 0.5rem;
  color: var(--text);
}

.contact-card p {
  opacity: 0.7;
  margin-bottom: 0;
}

/* Contact Form */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  background: var(--card-bg);
  padding: 3rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px var(--shadow);
}

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

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text);
}

.form-input {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Footer */
.footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  text-align: center;
}

/* Liquid Glass Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(var(--glass-blur-strong));
  -webkit-backdrop-filter: blur(var(--glass-blur-strong));
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  box-sizing: border-box;
  overflow-y: auto;
}

.modal-content {
  background: var(--card-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--card-text);
  padding: 2.5rem;
  border-radius: 20px;
  width: min(90vw, 700px);
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  position: relative;
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 60px var(--glass-shadow);
  animation: modalSlideIn 0.3s ease-out;
  box-sizing: border-box;
  margin: auto;
  overscroll-behavior: contain;
}

.modal-content h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  line-height: 1.3;
  word-wrap: break-word;
}

.modal-content h3 {
  font-size: 1.3rem;
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
  line-height: 1.3;
}

.modal-content p {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.modal-content ul, .modal-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.modal-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.modal-content strong, .modal-content b {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.modal-content code {
  word-break: break-all;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.modal-content * {
  max-width: 100%;
  box-sizing: border-box;
}

/* Responsive adjustments for modals */
@media (max-width: 768px) {
  .modal {
    padding: 0.5rem;
    align-items: flex-start;
  }

  .modal-content {
    width: calc(100vw - 1rem);
    max-width: 95vw;
    max-height: calc(100vh - 1rem);
    padding: 1.5rem;
    border-radius: 16px;
    margin: 0.5rem auto;
  }

  .modal-content h2 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    padding-right: 2rem; /* Space for close button */
  }

  .modal-content h3 {
    font-size: 1.1rem;
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
  }

  .modal-content p {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .modal-content ul, .modal-content ol {
    margin-left: 1.2rem;
    font-size: 0.95rem;
  }

  .modal-content li {
    margin-bottom: 0.4rem;
    line-height: 1.5;
  }

  /* Fix grid layouts in modals on tablets too */
  .modal-content div[style*="display: grid"],
  .modal-content div[style*="grid-template-columns"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.85rem !important;
  }

  /* Ensure all nested elements respect boundaries */
  .modal-content div > * {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .modal {
    padding: 0;
    align-items: flex-start;
  }

  .modal-content {
    width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
    padding: 1rem;
    padding-top: 3rem; /* Space for close button */
    border-radius: 0;
    margin: 0;
    overflow-x: hidden; /* Prevent horizontal overflow */
  }

  .modal-content h2 {
    font-size: 1.25rem;
    margin-bottom: 0.7rem;
    padding-right: 2.5rem;
    line-height: 1.3;
    word-break: break-word;
  }

  .modal-content h3 {
    font-size: 1rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    word-break: break-word;
  }

  .modal-content p {
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 0.8rem;
    word-break: break-word;
  }

  .modal-content ul, .modal-content ol {
    margin-left: 1.2rem;
    padding-left: 0;
    font-size: 0.875rem;
  }

  .modal-content li {
    margin-bottom: 0.4rem;
    line-height: 1.55;
    word-break: break-word;
    padding-right: 0.5rem;
  }

  /* Fix for tables or wide content */
  .modal-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Ensure all child elements respect boundaries */
  .modal-content > * {
    max-width: 100%;
    overflow-wrap: break-word;
  }

  /* Fix grid layouts in modals on mobile */
  .modal-content div[style*="display: grid"],
  .modal-content div[style*="grid-template-columns"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  /* Fix padding for nested content boxes */
  .modal-content div[style*="padding: 1rem"] {
    padding: 0.75rem !important;
  }

  /* Fix any flex containers */
  .modal-content div[style*="display: flex"] {
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }

  /* Ensure badges and tags don't overflow */
  .modal-content span[style*="border-radius: 20px"] {
    display: inline-block;
    max-width: 100%;
    word-break: break-word;
    white-space: normal !important;
  }

  .modal-close {
    top: 0.8rem;
    right: 0.8rem;
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 50%;
    box-shadow: 0 2px 8px var(--shadow);
    z-index: 10;
  }
}

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

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: var(--border);
}

/* Scroll animations */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Ripple Effect */
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  width: 100px;
  height: 100px;
  margin-left: -50px;
  margin-top: -50px;
  animation: ripple-animation 0.6s ease-out;
  pointer-events: none;
  z-index: 10;
}

@keyframes ripple-animation {
  from {
    transform: scale(0);
    opacity: 1;
  }
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .about-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .section {
    padding: 4rem 1rem;
  }

  /* Fix button text wrapping on mobile */
  .btn {
    padding: 0.9rem 1.5rem;
    font-size: 0.95rem;
    white-space: nowrap;
    min-width: fit-content;
  }

  .btn-small {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }

  /* Fix hero text sizing */
  .hero-title {
    font-size: clamp(2rem, 10vw, 3.5rem);
    line-height: 1.2;
    word-break: break-word;
  }

  .hero-subtitle {
    font-size: 1.1rem;
    line-height: 1.5;
  }

  /* Fix project card content */
  .project-content {
    padding: 1.5rem;
  }

  .project-title {
    font-size: 1.2rem;
    line-height: 1.3;
  }

  .project-description {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  /* Fix contact card text */
  .contact-card {
    padding: 1.5rem;
  }

  .contact-card h3 {
    font-size: 1.1rem;
  }

  .contact-card p {
    font-size: 0.9rem;
  }

  /* Fix skill items */
  .skill-item {
    padding: 0.8rem;
    font-size: 0.9rem;
  }

  /* Fix modal on mobile */
  .modal-content {
    font-size: 0.95rem;
  }

  .modal-content h2 {
    font-size: 1.5rem;
  }

  .modal-content h3 {
    font-size: 1.2rem;
  }
}

/* Extra small devices (iPhone SE, etc.) */
@media (max-width: 375px) {
  .btn {
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
  }

  .hero-title {
    font-size: clamp(1.6rem, 11vw, 2.5rem);
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .hero-greeting {
    font-size: 0.9rem;
  }

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

  .project-title {
    font-size: 1.1rem;
  }

  .project-actions .btn {
    font-size: 0.8rem;
    padding: 0.6rem 1rem;
  }

  .nav-container {
    padding: 0 1rem;
  }

  .logo {
    font-size: 1.1rem;
  }
}