/* ========================================
   OPTIMIZED PORTFOLIO CSS - ABISHEK THAPA
   Modern responsive design with dark/light themes, smooth animations, and accessibility
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ========================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ======================================== */
:root {
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-offset: 14px;
  --nav-bg: rgba(20,20,24,0.28);
  --nav-control-size: 46px;
  --nav-icon-size: 22px;

  --white: #ffffff;
  --black: #000000;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --primary-50: #f0f9ff;
  --primary-100: #e0f2fe;
  --primary-200: #bae6fd;
  --primary-300: #7dd3fc;
  --primary-400: #38bdf8;
  --primary-500: #0ea5e9;
  --primary-600: #0284c7;
  --primary-700: #0369a1;
  --primary-800: #075985;
  --primary-900: #0c4a6e;

  --secondary-50: #fdf4ff;
  --secondary-100: #fae8ff;
  --secondary-200: #f5d0fe;
  --secondary-300: #f0abfc;
  --secondary-400: #e879f9;
  --secondary-500: #d946ef;
  --secondary-600: #c026d3;
  --secondary-700: #a21caf;
  --secondary-800: #86198f;
  --secondary-900: #701a75;

  --accent-50: #f0fdfa;
  --accent-100: #ccfbf1;
  --accent-200: #99f6e4;
  --accent-300: #5eead4;
  --accent-400: #2dd4bf;
  --accent-500: #14b8a6;
  --accent-600: #0d9488;
  --accent-700: #0f766e;
  --accent-800: #115e59;
  --accent-900: #134e4a;
}

/* Light mode palette inversion */
html:not(.dark) {
  --white: #111827;
  --black: #ffffff;

  --gray-50: #111827;
  --gray-100: #1f2937;
  --gray-200: #374151;
  --gray-300: #4b5563;
  --gray-400: #6b7280;
  --gray-500: #9ca3af;
  --gray-600: #d1d5db;
  --gray-700: #e5e7eb;
  --gray-800: #f3f4f6;
  --gray-900: #f9fafb;

  --primary-50: #0c4a6e;
  --primary-100: #075985;
  --primary-200: #0369a1;
  --primary-300: #0284c7;
  --primary-400: #0ea5e9;
  --primary-500: #38bdf8;
  --primary-600: #7dd3fc;
  --primary-700: #bae6fd;
  --primary-800: #e0f2fe;
  --primary-900: #f0f9ff;

  --secondary-50: #701a75;
  --secondary-100: #86198f;
  --secondary-200: #a21caf;
  --secondary-300: #c026d3;
  --secondary-400: #d946ef;
  --secondary-500: #e879f9;
  --secondary-600: #f0abfc;
  --secondary-700: #f5d0fe;
  --secondary-800: #fae8ff;
  --secondary-900: #fdf4ff;

  --accent-50: #134e4a;
  --accent-100: #115e59;
  --accent-200: #0f766e;
  --accent-300: #0d9488;
  --accent-400: #14b8a6;
  --accent-500: #2dd4bf;
  --accent-600: #5eead4;
  --accent-700: #99f6e4;
  --accent-800: #ccfbf1;
  --accent-900: #f0fdfa;
}

/* ========================================
   GLOBAL RESET & BASE STYLES
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  transition: var(--transition);
}

/* Prevent horizontal scroll on mobile across all pages */
html, body { max-width: 100%; overflow-x: hidden; }

/* Media elements responsive defaults */
img, svg, video, canvas, iframe, object { max-width: 100%; height: auto; }
object { display: block; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

/* ========================================
   BACKGROUND EFFECTS & ANIMATIONS
   Dynamic particles, bubbles, and visual effects
   ======================================== */
.particles-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-400), var(--accent-400));
  opacity: 0.1;
  animation: particleFloat 20s linear infinite;
}

html:not(.dark) .particle {
  opacity: 0.05;
}

.particle-1 { width: 4px; height: 4px; top: 20%; left: 10%; animation-delay: 0s; }
.particle-2 { width: 6px; height: 6px; top: 60%; left: 80%; animation-delay: 4s; }
.particle-3 { width: 3px; height: 3px; top: 40%; left: 20%; animation-delay: 8s; }
.particle-4 { width: 5px; height: 5px; top: 80%; left: 70%; animation-delay: 12s; }
.particle-5 { width: 4px; height: 4px; top: 30%; left: 90%; animation-delay: 16s; }
.particle-6 { width: 6px; height: 6px; top: 70%; left: 30%; animation-delay: 20s; }

/* ========================================
   DYNAMIC BACKGROUND BUBBLES
   ======================================== */
.bg-bubble { 
  position:absolute; 
  border-radius:50%; 
  pointer-events:none; 
  opacity:0.06; 
  backdrop-filter: blur(3px); 
  -webkit-backdrop-filter: blur(3px); 
  will-change: transform, opacity; 
  mix-blend-mode: screen; 
}

html:not(.dark) .bg-bubble { 
  mix-blend-mode: multiply; 
  opacity:0.035; 
}

.bg-bubble { 
  background: radial-gradient(circle at 30% 30%, var(--accent-400), transparent 70%); 
}

/* ========================================
   LIGHTBOX OVERRIDES (prevent color tint/overlay)
   ======================================== */
#lightbox-modal { isolation: isolate; }
#lightbox-modal img { mix-blend-mode: normal !important; filter: none !important; backdrop-filter: none !important; }

/* ========================================
   TYPING ANIMATION MOBILE OPTIMIZATION
   ======================================== */
#typing-roles {
  transition: opacity 0.3s ease-in-out;
}

/* Ensure fade animations work properly on mobile */
.typed-fade-out {
  opacity: 0.2 !important;
  transition: opacity 0.4s ease-in-out !important;
}

.typed-fade-in {
  opacity: 1 !important;
  transition: opacity 0.4s ease-in-out !important;
}

/* ========================================
   ENHANCED UX IMPROVEMENTS
   ======================================== */

/* Scroll Progress Indicator */
#scroll-progress {
  transform-origin: left;
  animation: none;
}

/* Enhanced Section Transitions */
.section-active {
  transform: translateY(0) !important;
  opacity: 1 !important;
}

section[id] {
  will-change: transform, opacity;
}

/* Enhanced Back to Top Button */
.back-to-top-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(14, 184, 166, 0.4);
}

.back-to-top-btn:active {
  transform: translateY(0) scale(0.95);
}

/* Smooth page transitions */
@media (prefers-reduced-motion: no-preference) {
  section[id] {
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .animate-on-scroll {
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  }
}

.bg-bubble.layer-1 { animation: bubbleDriftA var(--dur) linear infinite; }
.bg-bubble.layer-2 { animation: bubbleDriftB var(--dur) linear infinite; }
.bg-bubble.layer-3 { animation: bubbleDriftC var(--dur) linear infinite; }

@keyframes bubbleDriftA { 
  0% { transform: translate3d(0,0,0) scale(var(--scale,1)); opacity:0; } 
  12% { opacity:1; } 
  88% { opacity:1; } 
  100% { transform: translate3d(var(--dx,30px), -115vh,0) scale(var(--scale,1)); opacity:0; } 
}

@keyframes bubbleDriftB { 
  0% { transform: translate3d(0,0,0) scale(var(--scale,1)); opacity:0; } 
  15% { opacity:.85; } 
  85% { opacity:.85; } 
  100% { transform: translate3d(var(--dx,-40px), -120vh,0) scale(var(--scale,1)); opacity:0; } 
}

@keyframes bubbleDriftC { 
  0% { transform: translate3d(0,0,0) scale(var(--scale,1)); opacity:0; } 
  18% { opacity:.8; } 
  82% { opacity:.8; } 
  100% { transform: translate3d(var(--dx,15px), -125vh,0) scale(var(--scale,1)); opacity:0; } 
}

@media (prefers-reduced-motion: reduce) { 
  .bg-bubble { animation: none !important; opacity:0.1; } 
}

/* ========================================
   HERO SECTION STYLING
   Main landing area with profile image and CTA buttons
   ======================================== */
#home::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 50%;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 90px 90px;
  mask: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 60%, rgba(0,0,0,0) 100%);
  -webkit-mask: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 60%, rgba(0,0,0,0) 100%);
  pointer-events: none;
  z-index: 0;
}

html:not(.dark) #home::before {
  background-image: 
    linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
}

#home > * {
  position: relative;
  z-index: 1;
}

/* ========================================
   NAVIGATION STYLES
   ======================================== */
.floating-nav { position:fixed; top:var(--nav-offset); left:50%; transform:translateX(-50%); z-index:60; display:flex; align-items:center; gap:.7rem; padding:.45rem .75rem; border-radius:999px; background:rgba(20,20,24,0.28); backdrop-filter:blur(12px) saturate(130%); border:1px solid rgba(255,255,255,0.08); box-shadow:0 2px 10px -4px rgba(0,0,0,0.55); transition:background .55s cubic-bezier(.65,.05,.36,1), box-shadow .55s ease, border-color .55s ease; overflow:hidden; height:calc(var(--nav-control-size) + 6px); }
/* Accent outline for better contrast, especially in dark mode */
.floating-nav::before { content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none; border:1px solid var(--accent-400); opacity:.28; }
html:not(.dark) .floating-nav::before { opacity:.18; }
.dark .floating-nav::before { opacity:.38; }
html:not(.dark) .floating-nav { background:rgba(255,255,255,0.42); border-color:rgba(0,0,0,0.08); box-shadow:0 2px 10px -4px rgba(0,0,0,0.25); }
.floating-nav:hover { background:rgba(20,20,24,0.34); }

html:not(.dark) .floating-nav:hover { 
  background:rgba(255,255,255,0.42); 
  box-shadow: 
    0 2px 10px -4px rgba(0,0,0,0.25),
    0 0 0 1px rgba(14,165,233,0.3),
    0 0 20px -5px rgba(14,165,233,0.15),
    0 0 40px -10px rgba(168,85,247,0.1);
}

.floating-nav.scrolled { background:var(--nav-bg); backdrop-filter:blur(20px) saturate(140%); border:1px solid rgba(255,255,255,0.12); box-shadow:0 4px 16px -8px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(255,255,255,0.04); }

html:not(.dark) .floating-nav.scrolled { background:rgba(255,255,255,0.42); border:1px solid rgba(0,0,0,0.08); box-shadow:0 4px 16px -8px rgba(0,0,0,0.22), 0 0 0 1px rgba(255,255,255,0.35); }

.floating-nav.scrolled:hover { background:var(--nav-bg); box-shadow:0 4px 18px -8px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.05); }

html:not(.dark) .floating-nav.scrolled:hover { 
  background:rgba(255,255,255,0.42); 
  box-shadow:
    0 4px 16px -8px rgba(0,0,0,0.22),
    0 0 0 1px rgba(14,165,233,0.3),
    0 0 20px -5px rgba(14,165,233,0.15),
    0 0 40px -10px rgba(168,85,247,0.1);
}

.site-logo-svg { position:fixed; top:var(--nav-offset); left:18px; z-index:70; display:inline-flex; align-items:center; justify-content:center; height:calc(var(--nav-control-size) + 6px); padding:0 .5rem; background:rgba(20,20,24,0.28); backdrop-filter:blur(12px) saturate(130%); border-radius:999px; text-decoration:none; border:1px solid rgba(255,255,255,0.08); box-shadow:0 6px 18px -6px rgba(0,0,0,0.6); transition:transform .55s cubic-bezier(.6,.05,.3,1), box-shadow .55s ease, background .55s cubic-bezier(.65,.05,.36,1); }
/* Match nav pill accent outline for visual consistency */
.site-logo-svg::before { content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none; border:1px solid var(--accent-400); opacity:.28; }
html:not(.dark) .site-logo-svg::before { opacity:.18; }
.dark .site-logo-svg::before { opacity:.38; }

.site-logo-svg:hover { background:rgba(20,20,24,0.34); transform:translateY(-3px) scale(1.05); }

.site-logo-svg .logo-container { pointer-events: none; height:28px; width:72px; }

.site-logo-svg object { pointer-events: none; }

html:not(.dark) .site-logo-svg { background:rgba(255,255,255,0.42); border:1px solid rgba(0,0,0,0.08); box-shadow:0 6px 18px -6px rgba(0,0,0,0.35); }
html:not(.dark) .site-logo-svg:hover { background:rgba(255,255,255,0.42); }

@media (max-width:640px){ .site-logo-svg { left:12px; padding:.5rem .75rem; } .site-logo-svg .logo-container { width:5rem; height:2rem; } }

.nav-links { position:relative; display:flex; align-items:center; gap:.3rem; padding:.2rem; border-radius:999px; }

.nav-pill-link { position:relative; font-size:.9rem; font-weight:500; letter-spacing:.02em; padding:.6rem 1.1rem; border-radius:999px; color:rgba(255,255,255,0.75); text-decoration:none; z-index:2; transition:color .4s ease; }

.nav-pill-link i { font-size:.85rem; margin-right:.5rem; opacity:.85; transition:transform .55s cubic-bezier(.6,.05,.3,1), opacity .4s ease; width:16px; text-align:center; }

.nav-pill-link:hover i { transform:translateY(-2px) scale(1.15); opacity:1; }

html:not(.dark) .nav-pill-link { color:rgba(0,0,0,0.65); }

.nav-pill-link:hover { color:#fff; }

html:not(.dark) .nav-pill-link:hover { color:#000; }

.nav-indicator { position:absolute; top:3px; left:3px; height:calc(100% - 6px); width:0; background:linear-gradient(90deg,var(--primary-500),var(--accent-500)); border-radius:999px; box-shadow:0 3px 12px -5px rgba(0,0,0,0.55); transition: all .55s cubic-bezier(.65,.05,.36,1); opacity:.9; }

html:not(.dark) .nav-indicator { box-shadow:0 4px 12px -4px rgba(0,0,0,0.25); }

.nav-pill-link.active { color:#fff; font-weight:600; }

html:not(.dark) .nav-pill-link.active { color:#000; }

/* ========================================
   MOBILE OPTIMIZATION FOR LARGER SCREENS
   ======================================== */
@media (max-width: 1024px) and (min-width: 769px) {
  .floating-nav {
    gap: 0.8rem;
    padding: 0.6rem 1rem;
    transform: translateX(-50%);
    left: calc(50% + 10px);
    top: var(--nav-offset);
  }
  /* Home page: match Yelp nav pill sizing on tablets */
  .home-page .floating-nav { gap: 0.9rem; padding: 0.65rem 1.05rem; transform: translateX(-50%); }
  .home-page .nav-pill-link { font-size: 0.92rem; padding: 0.62rem 1.15rem; }
  .home-page .theme-toggle-btn, .floating-nav .nav-theme { width: calc(var(--nav-control-size) - 6px); height: calc(var(--nav-control-size) - 6px); }
  
  .nav-pill-link {
    padding: 0.7rem 1rem;
    font-size: 0.88rem;
  }
  
  .nav-pill-link i {
    font-size: 0.8rem;
    margin-right: 0.4rem;
  }
  
  .site-logo-svg { top: var(--nav-offset); height: calc(var(--nav-control-size) + 6px); }
}

/* Tablet and large mobile landscape */
@media (max-width: 768px) and (min-width: 481px) {
  .floating-nav {
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    transform: translateX(-50%);
    left: calc(50% + 8px);
    top: var(--nav-offset);
  }
  /* Home page: match Yelp nav pill sizing on iPad mini / landscape */
  .home-page .floating-nav { gap: 0.6rem; padding: 0.55rem 0.9rem; transform: translateX(-50%); }
  .home-page .nav-pill-link { font-size: 0.9rem; padding: 0.6rem 1.05rem; }
  .home-page .theme-toggle-btn, .floating-nav .nav-theme { width: calc(var(--nav-control-size) - 6px); height: calc(var(--nav-control-size) - 6px); }
  
  .nav-pill-link {
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
  }
  
  .nav-pill-link i {
    font-size: 0.75rem;
    margin-right: 0.35rem;
  }
  
  .nav-indicator {
    top: 2px;
    left: 2px;
    height: calc(100% - 4px);
  }
  
  .site-logo-svg { top: var(--nav-offset); height: calc(var(--nav-control-size) + 6px); }
  
  .site-logo-svg .logo-container {
    width: 4.5rem;
    height: 1.8rem;
  }
}

/* Standard mobile devices */
@media (max-width: 480px) and (min-width: 361px) {
  .floating-nav {
    gap: 0.4rem;
    padding: 0.45rem 0.7rem;
    transform: translateX(-50%);
    top: var(--nav-offset);
  }
  
  .nav-pill-link {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
  }
  
  .nav-pill-link i {
    font-size: 0.7rem;
    margin-right: 0.3rem;
  }
  
  .nav-indicator {
    top: 2px;
    left: 2px;
    height: calc(100% - 4px);
  }
  
  .site-logo-svg { top: var(--nav-offset); left: 12px; padding: 0.5rem 0.75rem; height: calc(var(--nav-control-size) + 6px); }
  
  .site-logo-svg .logo-container {
    width: 4rem;
    height: 1.6rem;
  }
}

/* Small mobile devices */
@media (max-width: 360px) {
  .floating-nav {
    gap: 0.3rem;
    padding: 0.4rem 0.6rem;
    transform: translateX(-50%);
    top: var(--nav-offset);
  }
  
  .nav-pill-link {
    padding: 0.45rem 0.7rem;
    font-size: 0.75rem;
  }
  
  .nav-pill-link i {
    font-size: 0.65rem;
    margin-right: 0.25rem;
  }
  
  .nav-indicator {
    top: 1px;
    left: 1px;
    height: calc(100% - 2px);
  }
  
  .site-logo-svg { top: var(--nav-offset); left: 10px; padding: 0.4rem 0.6rem; height: calc(var(--nav-control-size) + 6px); }
  
  .site-logo-svg .logo-container {
    width: 3.5rem;
    height: 1.4rem;
  }
}

/* ===== MOBILE SAFE AREA SUPPORT ===== */
@supports (padding: max(0px)) {
  @media (max-width: 1024px) {
    .floating-nav {
      top: max(16px, env(safe-area-inset-top, 16px));
    }
    
    .site-logo-svg {
      top: max(20px, calc(env(safe-area-inset-top, 20px) + 4px));
    }
  }
  
  @media (max-width: 768px) {
    .floating-nav {
      top: max(18px, env(safe-area-inset-top, 18px));
    }
    
    .site-logo-svg {
      top: max(22px, calc(env(safe-area-inset-top, 22px) + 4px));
    }
  }
  
  @media (max-width: 480px) {
    .floating-nav {
      top: max(20px, env(safe-area-inset-top, 20px));
    }
    
    .site-logo-svg {
      top: max(24px, calc(env(safe-area-inset-top, 24px) + 4px));
    }
  }
  
  @media (max-width: 360px) {
    .floating-nav {
      top: max(22px, env(safe-area-inset-top, 22px));
    }
    
    .site-logo-svg {
      top: max(26px, calc(env(safe-area-inset-top, 26px) + 4px));
    }
  }
}

/* ===== ENHANCED MOBILE INTERACTIONS ===== */
@media (max-width: 1024px) {
  .nav-pill-link {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
  }
  
  .nav-pill-link:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.15);
  }
  
  .site-logo-svg {
    min-height: 44px;
    min-width: 44px;
    -webkit-tap-highlight-color: transparent;
  }
  
  .site-logo-svg:active {
    transform: scale(0.95);
  }
  
  .floating-nav {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  @media (hover: hover) {
    .nav-pill-link:hover {
      transform: translateY(-1px) scale(1.02);
      background: rgba(255, 255, 255, 0.12);
    }
    
    .site-logo-svg:hover {
      transform: translateY(-2px) scale(1.05);
    }
  }
}

/* ===== FLUID RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 1200px) and (min-width: 1025px) {
  .floating-nav {
    gap: 0.7rem;
    padding: 0.5rem 0.8rem;
  }
  
  .nav-pill-link {
    padding: 0.65rem 1rem;
    font-size: 0.87rem;
  }
}

/* ===== MODERN MOBILE ANIMATIONS ===== */
@keyframes subtle-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

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

@media (max-width: 1024px) {
  .nav-pill-link.active {
    animation: subtle-bounce 0.6s ease-in-out;
  }
  
  .site-logo-svg:focus {
    animation: gentle-scale 0.4s ease-in-out;
  }
  
  .nav-indicator {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */
@media (max-width: 1024px) {
  .nav-pill-link:focus-visible {
    outline: 2px solid var(--accent-400);
    outline-offset: 2px;
    border-radius: 999px;
  }
  
  .site-logo-svg:focus-visible {
    outline: 2px solid var(--accent-400);
    outline-offset: 2px;
    border-radius: 999px;
  }
  
  html:not(.dark) .nav-pill-link:focus-visible,
  html:not(.dark) .site-logo-svg:focus-visible {
    outline: 2px solid var(--accent-600);
  }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
@media (max-width: 1024px) {
  .floating-nav,
  .nav-pill-link,
  .site-logo-svg,
  .nav-indicator {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
  }
}

/* ===== NAVIGATION OVERFLOW PROTECTION ===== */
@media (max-width: 1024px) {
  .floating-nav {
    max-width: calc(100vw - 32px);
    overflow: visible;
  }
  
  .nav-links {
    flex-wrap: nowrap;
    overflow: visible;
  }
  
  .nav-pill-link {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .floating-nav {
    margin-left: 16px;
    margin-right: 16px;
    width: calc(100% - 32px);
  }
}

/* ========================================
   HAMBURGER MENU ANIMATION
   ======================================== */
.hamburger-btn .hamburger-box { 
  width: 28px; 
  height: 20px; 
  position: relative; 
  display: block; 
}

.hamburger-btn .hamburger-line { 
  position: absolute; 
  left: 0; 
  width: 100%; 
  height: 3px; 
  background: linear-gradient(135deg, var(--primary-500), var(--accent-500)); 
  border-radius: 2px; 
  transition: top 0.2s ease, transform 0.2s ease, opacity 0.16s ease; 
}

.hamburger-btn .line-1 { top: 0; }

.hamburger-btn .line-2 { top: 50%; transform: translateY(-50%); }

.hamburger-btn .line-3 { top: 100%; transform: translateY(-100%); }


.hamburger-btn.open .line-1,
.hamburger-btn.is-open .line-1 { top: 50%; transform: translateY(-50%) rotate(45deg); }

.hamburger-btn.open .line-2,
.hamburger-btn.is-open .line-2 { opacity: 0; }

.hamburger-btn.open .line-3,
.hamburger-btn.is-open .line-3 { top: 50%; transform: translateY(-50%) rotate(-45deg); }

/* ========================================
   THEME TOGGLE SYSTEM
   Dark/light mode switcher with smooth animations
   ======================================== */
.theme-toggle-btn {
  position: relative;
  width: var(--nav-control-size);
  height: var(--nav-control-size);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
  backdrop-filter: blur(10px);
  display:flex;
  align-items:center;
  justify-content:center;
}

html:not(.dark) .theme-toggle-btn {
  background: rgba(0, 0, 0, 0.1);
  border: 0.5px solid rgba(0, 0, 0, 0.2);
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.04);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.35);
}
/* Decrease toggle circle in nav across subpages to avoid touching nav pill */
.floating-nav .nav-theme { width: calc(var(--nav-control-size) - 6px); height: calc(var(--nav-control-size) - 6px); }
/* Decrease home page toggle circle so it doesn't touch nav pill */
.home-page .theme-toggle-btn { width: calc(var(--nav-control-size) - 6px); height: calc(var(--nav-control-size) - 6px); }

html:not(.dark) .theme-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(0, 0, 0, 0.3);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.theme-toggle-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-page .nav-theme { --nav-icon-size: 26px; }

.theme-toggle-inner svg { position:absolute; width:var(--nav-icon-size); height:var(--nav-icon-size); transition: all .55s cubic-bezier(.6,.05,.3,1); }

.theme-toggle-inner .icon-moon { opacity:0; transform: scale(.4) rotate(-45deg); filter: drop-shadow(0 0 4px rgba(14,165,233,0.35)); }

.theme-toggle-inner .icon-sun { opacity:1; transform: scale(1) rotate(0deg); filter: drop-shadow(0 0 4px rgba(14,165,233,0.35)); }

.dark .theme-toggle-inner .icon-sun { opacity:0; transform: scale(.4) rotate(45deg); }

.dark .theme-toggle-inner .icon-moon { opacity:1; transform: scale(1.15) rotate(0deg); filter: drop-shadow(0 0 6px rgba(168,85,247,0.45)); }

html:not(.dark) .theme-toggle-inner .icon-sun { filter: drop-shadow(0 0 2px rgba(0,0,0,0.25)); }

.theme-toggle-inner .icon-sun .rays line { stroke-width:2; stroke-linecap:round; transform-origin: 12px 12px; animation: sunRayPulse 4s ease-in-out infinite; }

@keyframes sunRayPulse { 0%,100% { stroke-opacity:.9; } 50% { stroke-opacity:.4; } }

.burst-lines { position:absolute; inset:0; pointer-events:none; }

.burst-line { position:absolute; top:50%; left:50%; width:6px; height:2px; background: linear-gradient(90deg,var(--primary-400),var(--accent-400)); border-radius:2px; transform-origin: left center; opacity:0; transform: rotate(calc(var(--i)*30deg)) translateY(-1px) scaleX(0); }

html:not(.dark) .burst-line { background: linear-gradient(90deg,var(--primary-500),var(--accent-500)); }

#theme-toggle.modern-switching .burst-line { animation: burstLine 650ms cubic-bezier(.6,.05,.3,1) forwards; animation-delay: calc(var(--i)*8ms); }

@keyframes burstLine { 0% { opacity:0; transform: rotate(var(--angle)) translateY(-1px) scaleX(0); } 15% { opacity:1; } 55% { opacity:1; } 100% { opacity:0; transform: rotate(var(--angle)) translateY(-1px) scaleX(1); } }

.burst-line { --angle: calc(var(--i)*30deg); }

/* ========================================
   MODERN THEME TOGGLE MICRO-INTERACTION
   ======================================== */
#theme-toggle::after, #theme-toggle::before { content:""; position:absolute; inset:0; pointer-events:none; }

#theme-toggle::after { 
  background: radial-gradient(circle at center, rgba(255,255,255,0.65) 0%, rgba(255,255,255,0.15) 35%, rgba(255,255,255,0) 70%);
  opacity:0; transform: scale(0.25); transition: none; border-radius:50%;
}

html:not(.dark) #theme-toggle::after { background: radial-gradient(circle at center, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.15) 35%, rgba(0,0,0,0) 70%); }

#theme-toggle.modern-switching::after { animation: themeRipple 680ms cubic-bezier(.55,.15,.35,1) forwards; }

#theme-toggle.modern-switching .theme-toggle-inner { animation: themePulse 600ms cubic-bezier(.55,.15,.35,1); }

#theme-toggle.modern-switching .icon-sun, 
#theme-toggle.modern-switching .icon-moon { animation: themeIconSpin 640ms cubic-bezier(.6,.05,.3,1); }

@keyframes themeRipple {
  0% { opacity:0.0; transform:scale(0.15); }
  25% { opacity:0.55; }
  55% { opacity:0.35; }
  100% { opacity:0; transform:scale(1.35); }
}

@keyframes themePulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.15); }
  60% { transform: scale(0.92); }
  100% { transform: scale(1); }
}

@keyframes themeIconSpin {
  0% { transform: rotate(0deg) scale(1); }
  40% { transform: rotate(200deg) scale(0.4); opacity:0.2; }
  60% { transform: rotate(280deg) scale(0.75); opacity:0.8; }
  100% { transform: rotate(360deg) scale(1); opacity:1; }
}

@media (prefers-reduced-motion: reduce) {
  #theme-toggle.modern-switching::after, 
  #theme-toggle.modern-switching .theme-toggle-inner, 
  #theme-toggle.modern-switching .icon-sun, 
  #theme-toggle.modern-switching .icon-moon { animation: none !important; }
}

/* ========================================
   BUTTONS
   ======================================== */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 1rem 2rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  text-decoration: none;
  position: relative;
  z-index: 10;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-600), var(--accent-600));
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

html:not(.dark) .btn-primary {
  background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
  color: white;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

html:not(.dark) .btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-600), var(--accent-600));
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(14, 165, 233, 0.4);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

html:not(.dark) .btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--gray-800);
  border: 1px solid rgba(0, 0, 0, 0.2);
}

html:not(.dark) .btn-secondary:hover {
  background: rgba(255, 255, 255, 1);
  color: var(--accent-700);
  border-color: var(--accent-500);
}

/* ========================================
   SOCIAL MEDIA LINKS
   Hero and footer social icons with hover effects
   ======================================== */
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--accent-300);
  transition: transform 0.25s ease, background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.35s ease;
  font-size: 1rem;
  backdrop-filter: blur(10px);
}

.social-link:hover {
  background: linear-gradient(135deg, var(--accent-400)/20, var(--primary-400)/15);
  border-color: var(--accent-400)/30;
  color: var(--accent-200);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

html:not(.dark) .social-link {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--accent-500);
  backdrop-filter: blur(15px);
}

html:not(.dark) .social-link:hover {
  background: linear-gradient(135deg, var(--accent-400)/15, var(--primary-400)/10);
  border-color: var(--accent-400)/25;
  color: var(--accent-700);
}

.social-link.hero {
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
}

/* ========================================
   BASE CARD STYLES
   ======================================== */
.about-card, .contact-form-card, .skill-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  padding: 2rem;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

html:not(.dark) .about-card, html:not(.dark) .contact-form-card, html:not(.dark) .skill-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* ========================================
   SKILLS SECTION COMPONENTS
   Filter buttons, skill cards, and interactive filtering system
   ======================================== */
.skill-filters { display:flex; flex-wrap:wrap; gap:.6rem; justify-content:center; margin:0 auto 2.5rem; max-width:880px; }

.skill-filter { padding:.55rem 1.05rem; font-size:.75rem; letter-spacing:.05em; font-weight:600; text-transform:uppercase; border:1px solid rgba(255,255,255,0.15); background:rgba(255,255,255,0.06); color:var(--white); border-radius:999px; cursor:pointer; transition:background .35s, border-color .35s, color .25s; display:inline-flex; align-items:center; gap:.4rem; }

.skill-filter:hover { background:rgba(255,255,255,0.12); }

.skill-filter.active { background:linear-gradient(90deg,var(--accent-500),var(--primary-500)); border-color:transparent; box-shadow:0 4px 18px -4px rgba(0,0,0,.45); }

html:not(.dark) .skill-filter { background:rgba(0,0,0,0.06); border:1px solid rgba(0,0,0,0.15); color:#000; }

html:not(.dark) .skill-filter:hover { background:rgba(0,0,0,0.12); }

html:not(.dark) .skill-filter.active { 
  background:linear-gradient(90deg,#0891b2,#0369a1); 
  color:#fff; 
  box-shadow:0 4px 18px -4px rgba(0,0,0,.35); 
}

.skills-grid { 
  display:grid; 
  grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); 
  gap:1.1rem 1.1rem; 
  max-width:1080px; 
  margin:0 auto; 
}

/* placeholder removed to satisfy linter */

.skills-grid.secondary { margin-top:1.2rem; }

.skill-card { 
  position:relative; 
  padding:1.05rem 1rem 1.15rem; 
  min-height:150px; 
  display:flex; 
  flex-direction:column; 
  align-items:flex-start; 
  gap:.4rem; 
  box-shadow:none; 
  background:rgba(255,255,255,0.05); 
  border:1px solid rgba(255,255,255,0.1); 
  opacity:1; 
  transform:translateX(0) translateY(0) scale(1); 
  will-change:opacity,transform; 
  transform-origin:center center;
  transition:opacity .35s ease, transform .35s ease, background .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.skill-card.filter-hide { opacity:0; transform:translateY(6px) scale(0.98); pointer-events:none; }

.skill-card.collapse { display:none; }

.skill-card .skill-icon { width:34px; height:34px; display:flex; align-items:center; justify-content:center; font-size:1.15rem; background:linear-gradient(135deg,var(--accent-400),var(--primary-400)); color:#fff; border-radius:10px; box-shadow:0 4px 12px -3px rgba(0,0,0,.55); }

.skill-card .skill-title { font-size:.9rem; font-weight:600; letter-spacing:.03em; margin:.15rem 0 0; background:linear-gradient(90deg,var(--primary-300),var(--accent-300)); -webkit-background-clip:text; background-clip:text; color:transparent; }

.skill-card .skill-description { font-size:.68rem; margin:0; opacity:.8; line-height:1.35; letter-spacing:.02em; }

.skill-card:hover:not(.filter-hide) { 
  transform:translateX(0) translateY(-3px) scale(1.02); 
  border-color:var(--accent-400); 
  box-shadow:0 8px 25px -6px rgba(0,0,0,.4),0 0 0 1px rgba(255,255,255,0.08); 
  background:linear-gradient(145deg,rgba(255,255,255,0.08),rgba(255,255,255,0.04)); 
}

.skill-card.filter-push { transform:translateY(-1px) scale(1.008); transition:transform .22s ease; }

html:not(.dark) .skill-card { background:rgba(255,255,255,0.85); }

html:not(.dark) .skill-card:hover:not(.filter-hide) { background:#fff; }

.skill-card .skill-proficiency { position:relative; width:100%; height:3px; background:rgba(255,255,255,0.08); border-radius:2px; overflow:hidden; margin-top:.15rem; }

.skill-card .skill-proficiency span { position:absolute; inset:0; width:var(--pct); background:linear-gradient(90deg,var(--accent-500),var(--primary-500)); transition:width .6s cubic-bezier(.6,.2,.2,1); }

html:not(.dark) .skill-proficiency { background:rgba(0,0,0,0.08); }

.more-skills-wrapper { max-width:1080px; margin:2.4rem auto 0; text-align:center; }

.more-skills-toggle { position:relative; display:inline-flex; align-items:center; gap:.55rem; padding:.75rem 1.2rem; font-size:.75rem; letter-spacing:.05em; font-weight:600; text-transform:uppercase; color:var(--white); background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.15); border-radius:999px; cursor:pointer; transition:background .35s,border-color .35s,transform .35s; }

.more-skills-toggle:hover { background:rgba(255,255,255,0.14); }

.more-skills-toggle .label-active { display:none; }

.more-skills-toggle[aria-expanded="true"] .label-default { display:none; }

.more-skills-toggle[aria-expanded="true"] .label-active { display:inline; }

.more-skills-toggle .toggle-icon { transition:transform .45s cubic-bezier(.6,.2,.2,1); }

.more-skills-toggle[aria-expanded="true"] .toggle-icon { transform:rotate(180deg); }

html:not(.dark) .more-skills-toggle { background:rgba(0,0,0,0.06); border:1px solid rgba(0,0,0,0.15); color:#000; }

html:not(.dark) .more-skills-toggle:hover { background:rgba(0,0,0,0.12); }

.more-skills-panel { margin-top:1.4rem; animation:fadeIn .55s ease; }

@media (max-width: 640px) {
  .skills-grid { grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:.85rem; }
  .skill-card { min-height:140px; padding:.95rem .85rem 1rem; }
  .skill-card .skill-icon { width:30px; height:30px; font-size:1rem; }
}

/* ========================================
   BACK TO TOP BUTTON
   ======================================== */
.back-to-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3.5rem;
  height: 3.5rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.back-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.back-to-top-btn:hover {
  transform: translateY(-4px) scale(1.05);
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.back-to-top-btn:active {
  transform: translateY(-2px) scale(0.98);
  transition: all 0.1s ease;
}

.back-to-top-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
}

.back-to-top-icon {
  width: 1.5rem;
  height: 1.5rem;
  transition: transform 0.3s ease;
}

.back-to-top-btn:hover .back-to-top-icon {
  transform: translateY(-2px);
}

.back-to-top-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: all 0.6s ease;
  pointer-events: none;
}

.back-to-top-btn:active .back-to-top-ripple {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
}

/* Light mode */
:root:not(.dark) .back-to-top-btn {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

:root:not(.dark) .back-to-top-btn:hover {
  background: rgba(0, 0, 0, 0.15);
  border-color: rgba(0, 0, 0, 0.25);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

:root:not(.dark) .back-to-top-ripple {
  background: radial-gradient(circle, rgba(0, 0, 0, 0.2) 0%, transparent 70%);
}

:root:not(.dark) .back-to-top-btn:active .back-to-top-ripple {
  background: radial-gradient(circle, rgba(0, 0, 0, 0.15) 0%, transparent 70%);
}

/* Responsive */
@media (max-width: 768px) {
  .back-to-top-btn {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
  }
  
  .back-to-top-icon {
    width: 1.25rem;
    height: 1.25rem;
  }
}

/* ========================================
   PROFESSIONAL FOOTER
   ======================================== */
.site-footer { background:linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0.75)); position:relative; }

html:not(.dark) .site-footer { background:linear-gradient(to bottom, rgba(255,255,255,0.75), rgba(255,255,255,0.95)); }

.footer-grid { display:grid; gap:1.8rem 1.4rem; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); }

.footer-col { min-width:0; }

.footer-brand { display:flex; align-items:center; gap:.6rem; margin-bottom:.5rem; }

.footer-logo { display:inline-flex; align-items:center; justify-content:center; width:42px; height:42px; font-weight:700; font-size:1rem; letter-spacing:.05em; border-radius:12px; background:linear-gradient(135deg,var(--accent-500),var(--primary-500)); color:#fff; box-shadow:0 6px 18px -6px rgba(0,0,0,.6); }

.footer-name { font-size:1rem; margin:0; font-weight:600; background:linear-gradient(90deg,var(--primary-300),var(--accent-300)); -webkit-background-clip:text; background-clip:text; color:transparent; }

.footer-tagline { font-size:.72rem; line-height:1.32; max-width:220px; color:rgba(255,255,255,0.7); margin:0 0 .65rem; }

html:not(.dark) .footer-tagline { color:rgba(0,0,0,0.65); }

.footer-social { display:flex; gap:.6rem; }

.footer-icon { width:36px; height:36px; display:flex; align-items:center; justify-content:center; border-radius:10px; background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.12); color:var(--white); font-size:.9rem; transition:background .35s, transform .35s, border-color .35s; }

.footer-icon:hover { background:linear-gradient(135deg,var(--accent-500),var(--primary-500)); transform:translateY(-3px); border-color:transparent; }

html:not(.dark) .footer-icon { background:rgba(0,0,0,0.06); border:1px solid rgba(0,0,0,0.15); color:#000; }

html:not(.dark) .footer-icon:hover { 
  background: linear-gradient(135deg, var(--accent-500), var(--primary-500));
  border-color: transparent;
  color: #fff;
}

.footer-heading { font-size:.7rem; letter-spacing:.14em; text-transform:uppercase; font-weight:600; margin:0 0 .85rem; color:var(--accent-400); transition:color 0.3s ease; }

html:not(.dark) .footer-heading { color:var(--accent-600); }

.footer-links { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:.35rem; }

.footer-links.compact { gap:.35rem; }

.footer-link, .footer-text { font-size:.72rem; letter-spacing:.02em; line-height:1.35; color:rgba(255,255,255,0.7); text-decoration:none; position:relative; transition:color 0.3s ease; }

html:not(.dark) .footer-link, html:not(.dark) .footer-text { color:rgba(0,0,0,0.68); }

.footer-link:hover { color:var(--accent-300); }

html:not(.dark) .footer-link:hover { color:var(--accent-600); }

.footer-link::after { content:""; position:absolute; left:0; bottom:-2px; width:0; height:1px; background:linear-gradient(90deg,var(--accent-400),var(--primary-400)); transition:width .4s cubic-bezier(.45,.2,.3,1); }

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

.footer-meta-wrapper { background:rgba(255,255,255,0.02); backdrop-filter:blur(12px); }

html:not(.dark) .footer-meta-wrapper { background:rgba(0,0,0,0.04); }

.footer-meta { margin:0; white-space:nowrap; }

@media (max-width:640px){ .footer-meta { white-space:normal; text-align:center; line-height:1.3; } }

@media (max-width:640px){ .footer-grid { grid-template-columns:1fr 1fr; } .footer-col:first-child { grid-column:1/-1; } .footer-tagline { max-width:100%; } }

/* ========================================
   EDUCATION TIMELINE
   ======================================== */
.education-timeline { 
  margin:0; 
  padding:0 0 0 0.5rem; 
  list-style:none; 
  display:flex; 
  flex-direction:column; 
  flex:1;
  justify-content:space-evenly;
}

.education-timeline::before { 
  content:""; 
  position:absolute; 
  left:0.75rem; 
  top:1.2rem; 
  bottom:1.2rem; 
  width:2px; 
  background:linear-gradient(to bottom, rgba(255,255,255,0.2), rgba(255,255,255,0.1), rgba(255,255,255,0.05)); 
  border-radius:1px;
  transform:scaleY(0);
  transform-origin:top;
  animation:timelineLineDraw 1.2s ease-out 0.3s forwards;
}

html:not(.dark) .education-timeline::before {
  background:linear-gradient(to bottom, rgba(0,0,0,0.15), rgba(0,0,0,0.1), rgba(0,0,0,0.05));
}

.timeline-item { 
  position:relative; 
  padding-left:1.75rem; 
  display:flex; 
  flex-direction:column; 
  justify-content:center;
  margin-bottom:2rem;
}

.timeline-item:last-child { margin-bottom:0; }

.timeline-point { 
  position:absolute; 
  left:0rem; 
  top:50%; 
  transform:translateY(-50%) scale(0); 
  width:0.9rem; 
  height:0.9rem; 
  border-radius:50%; 
  background:linear-gradient(135deg,var(--accent-400),var(--primary-400)); 
  box-shadow:0 0 0 3px rgba(255,255,255,0.08); 
  opacity:0;
  transition:all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  animation:timelinePointFlyIn 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.timeline-content { 
  position:relative; 
  opacity:0;
  transform:translateX(-20px) translateY(10px);
  animation:timelineContentSlideIn 0.8s ease-out forwards;
}

.timeline-meta { font-size:0.75rem; font-weight:600; letter-spacing:.05em; text-transform:uppercase; color:var(--accent-400); margin-bottom:0.25rem; opacity:.85; }

.timeline-title { font-size:0.95rem; font-weight:600; color:var(--white); margin:0 0 0.25rem; line-height:1.35; }

.timeline-desc { font-size:0.8rem; line-height:1.45; color:rgba(255,255,255,0.75); margin:0; }

html:not(.dark) .timeline-desc { color:rgba(0,0,0,0.7); }

html:not(.dark) .timeline-point { box-shadow:0 0 0 3px rgba(0,0,0,0.08); }

.timeline-item:hover .timeline-point { transform:translateY(-50%) scale(1.08); box-shadow:0 0 0 4px rgba(45,212,191,0.25); transition:all .4s cubic-bezier(.55,.15,.35,1); }

/* Timeline Point Animation */
@keyframes timelinePointFlyIn {
  0% { transform: translateY(-50%) scale(0) translateX(-30px); opacity: 0; }
  60% { transform: translateY(-50%) scale(1.3) translateX(5px); opacity: 0.9; }
  80% { transform: translateY(-50%) scale(0.9) translateX(0); opacity: 1; }
  100% { transform: translateY(-50%) scale(1) translateX(0); opacity: 1; }
}

/* Timeline Content Animation */
@keyframes timelineContentSlideIn {
  0% { opacity: 0; transform: translateX(-20px) translateY(10px); }
  100% { opacity: 1; transform: translateX(0) translateY(0); }
}

/* Timeline Line Drawing Animation */
@keyframes timelineLineDraw {
  0% { transform: scaleY(0); }
  100% { transform: scaleY(1); }
}

/* Staggered animation delays */
.timeline-item:nth-child(1) .timeline-point { animation-delay: 0.2s; }
.timeline-item:nth-child(2) .timeline-point { animation-delay: 0.4s; }
.timeline-item:nth-child(3) .timeline-point { animation-delay: 0.6s; }

.timeline-item:nth-child(1) .timeline-content { animation-delay: 0.4s; }
.timeline-item:nth-child(2) .timeline-content { animation-delay: 0.6s; }
.timeline-item:nth-child(3) .timeline-content { animation-delay: 0.8s; }

/* Soft flashing effect for the first timeline item */
.timeline-item:nth-child(1) .timeline-point {
  animation: timelinePointFlyIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards, softFlash 3s ease-in-out 2s infinite;
}

.timeline-item:nth-child(1) .timeline-content {
  animation: timelineContentSlideIn 0.6s ease-out forwards;
}

/* Soft flashing keyframe */
@keyframes softFlash {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,255,255,0.08); }
  50% { box-shadow: 0 0 0 6px rgba(45,212,191,0.3), 0 0 20px rgba(45,212,191,0.2); }
}

@media (max-width:640px){ .timeline-item { padding-left:1.5rem; } .timeline-title { font-size:0.9rem; } .timeline-desc { font-size:0.75rem; } }

/* ========================================
   PROJECT CARDS & COMPONENTS
   Interactive project showcase cards with animations
   ======================================== */
.card {
  --grad: linear-gradient(90deg, var(--primary-400), var(--accent-400), var(--secondary-400));
  --card-hover-scale: 1.015;
  padding: 1.35rem 1.45rem;
  background: rgba(14,14,16,0.25);
  backdrop-filter: blur(18px);
  border-radius: 1rem;
  gap: 0.85rem;
  display: grid;
  grid-template: 'title icon' auto 'content content' 1fr / 1fr auto;
  position: relative;
  box-shadow:
    0 1px 2px -1px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.05);
  transition: transform .28s cubic-bezier(.4,.2,.2,1), box-shadow .32s ease, background .35s ease;
  height: 100%;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(45,212,191,0.15), transparent 60%),
              linear-gradient(140deg, rgba(217,70,239,0.08), rgba(14,165,233,0.05));
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
}

.card:hover::before { opacity: 1; }

html:not(.dark) .card {
  background: linear-gradient(to bottom left, #ffffff, #f2f6f9);
  box-shadow: 
    inset -1px 1px 1px hsl(0 0% 100% / 1),
    -10px 10px 25px hsl(0 0% 0% / 0.1);
}

.card:hover {
  transform: translateY(-4px) scale(var(--card-hover-scale));
  box-shadow:
    0 4px 14px -3px rgba(0,0,0,0.55),
    0 8px 28px -6px rgba(0,0,0,0.45),
    0 0 0 1px rgba(45,212,191,0.25);
}

html:not(.dark) .card:hover {
  box-shadow:
    0 4px 14px -3px rgba(0,0,0,0.25),
    0 10px 32px -6px rgba(0,0,0,0.25),
    0 0 0 1px rgba(14,165,233,0.35);
}

.card .title {
  font-size: 1.25rem;
  grid-area: title;
  align-self: end;
  font-weight: 600;
}

.card .icon {
  grid-area: icon;
  font-size: 2rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card .icon > i {
  color: transparent;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  transition: transform .45s cubic-bezier(.4,.2,.2,1);
}

.card:hover .icon > i { transform: translateY(-2px) scale(1.08); }

.gear-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 100%;
}

.gear-container .fa-cog {
  font-size: 2.2rem;
  color: transparent;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  transition: all 0.3s ease;
}

.gear-one {
  position: relative;
  left: 6px;
}

.gear-two {
  position: relative;
  right: 6px;
  top: 25px;
}

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

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

.card:hover .gear-one { animation: rotate-clockwise 6s linear infinite; }

.card:hover .gear-two { animation: rotate-counter-clockwise 6s linear infinite; }

@keyframes busMove {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.card:hover .fa-bus-simple { animation: busMove 2.2s ease-in-out infinite; }

@keyframes crashShake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-2px, -1px) rotate(-1deg); }
  50% { transform: translate(2px, 1px) rotate(1deg); }
  75% { transform: translate(-1px, 2px) rotate(-0.5deg); }
}

.card:hover .fa-car-burst { animation: crashShake 1.4s ease-in-out infinite; }

.card .content {
  grid-area: content;
  text-align: center;
}

.card .content p {
  margin-bottom: 0.75rem;
  font-size: clamp(0.8rem, 0.78rem + 0.25vw, 0.95rem);
  line-height: 1.5;
}

.card .content p:first-of-type { margin-top: 1rem; }

.card .project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.card .content .mt-6, .card .content .mt-4 {
  display: flex;
  justify-content: center;
}

.card .tech-tag {
  padding: 0.3rem 0.6rem;
  background: rgba(255,255,255,0.08);
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.12);
  white-space: nowrap;
}

html:not(.dark) .card .tech-tag {
  background: rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.12);
}

.card--featured {
  box-shadow:
    0 0 0 1px rgba(45,212,191,0.5),
    0 4px 16px -2px rgba(0,0,0,0.6),
    0 8px 32px -6px rgba(0,0,0,0.45);
  position: relative;
}

.card--featured::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, var(--accent-400), var(--primary-400), var(--secondary-400));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .6;
  pointer-events: none;
}

.card:focus-visible {
  outline: 2px solid var(--accent-400);
  outline-offset: 4px;
}

.card .view-analysis {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(45, 212, 191, 0.3);
}

.card:hover .view-analysis {
  background: linear-gradient(135deg, var(--accent-400), var(--accent-500));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 212, 191, 0.4);
}

.card .view-analysis .bounce-arrow {
  margin-left: 0.5rem;
  animation: bounceArrow 1.5s ease-in-out infinite;
}

.card:hover .view-analysis .bounce-arrow {
  animation: bounceArrowFast 0.6s ease-in-out infinite;
}

@keyframes bounceArrow {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

@keyframes bounceArrowFast {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}

html:not(.dark) .card .view-analysis {
  background: linear-gradient(135deg, var(--accent-600), var(--accent-700));
  box-shadow: 0 4px 15px rgba(45, 212, 191, 0.2);
}

html:not(.dark) .card:hover .view-analysis {
  background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
  box-shadow: 0 6px 20px rgba(45, 212, 191, 0.3);
}

.card::after {
  content: "";
  grid-area: bar;
  height: 3px;
  background-image: var(--grad);
  border-radius: 2px;
  align-self: end;
}

/* ========================================
   SKILL CARD STYLES
   ======================================== */
.skill-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: var(--transition);
}

.skill-card:hover:not(.filter-hide) .skill-icon {
  transform: scale(1.05) rotate(3deg);
  transition: transform 0.3s ease;
}

.skill-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.skill-description {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ========================================
   CONTACT FORM STYLING
   Form inputs, validation states, and error messages
   ======================================== */
.form-input, .form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.75rem;
  font-size: 1rem;
  transition: var(--transition);
}

.form-textarea {
  resize: vertical;
  min-height: 140px;
  max-height: 320px;
  line-height: 1.5;
}

@media (max-width:480px){
  .form-textarea { min-height: 120px; }
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--gray-400);
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-400);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.1);
}

html:not(.dark) .form-input, html:not(.dark) .form-textarea {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.2);
}

html:not(.dark) .form-input::placeholder, html:not(.dark) .form-textarea::placeholder {
  color: var(--gray-500);
}

html:not(.dark) .form-input:focus, html:not(.dark) .form-textarea:focus {
  border-color: var(--accent-500);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.2);
}

.form-input.invalid {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248,113,113,0.15);
}

html:not(.dark) .form-input.invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.15);
}

.form-error {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8rem;
  margin-top: 0.5rem;
  font-weight: 500;
  color: #fca5a5;
  line-height: 1.3;
  background: linear-gradient(135deg, rgba(239,68,68,0.08), rgba(239,68,68,0.02));
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 0.65rem;
  backdrop-filter: blur(6px);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .35s ease, transform .35s ease;
}

html:not(.dark) .form-error { color: #dc2626; border-color: rgba(220,38,38,0.35); }

.form-error::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 12% 18%, rgba(239,68,68,0.25), transparent 70%);
  opacity: 0.55;
  pointer-events: none;
}

.form-error-icon { line-height: 1; display: flex; align-items: center; font-size: 0.9rem; }

.form-error-text { font-family: 'Inter', sans-serif; letter-spacing: .2px; }

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

input.valid:not(:focus), textarea.valid:not(:focus) { border-color: var(--accent-400); box-shadow: 0 0 0 3px rgba(45,212,191,0.12); }

html:not(.dark) input.valid:not(:focus), html:not(.dark) textarea.valid:not(:focus) { border-color: var(--accent-500); }

/* ========================================
   CONTACT SECTION
   ======================================== */
.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

html:not(.dark) .contact-item {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.contact-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.contact-text {
  font-weight: 500;
}

/* ========================================
   FOOTER SOCIAL LINKS
   ======================================== */
.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  transition: var(--transition);
}

.footer-social-link:hover {
  background: var(--accent-500);
  border-color: var(--accent-500);
  transform: translateY(-2px);
}

html:not(.dark) .footer-social-link {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

html:not(.dark) .footer-social-link:hover {
  background: var(--accent-500);
  border-color: var(--accent-500);
}

/* ========================================
   ANIMATIONS & KEYFRAMES
   Reusable animations for UI interactions and effects
   ======================================== */
@keyframes particleFloat {
  0% { transform: translateY(0px) translateX(0px); opacity: 0; }
  10% { opacity: 0.1; }
  90% { opacity: 0.1; }
  100% { transform: translateY(-100vh) translateX(50px); opacity: 0; }
}

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

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

@keyframes hero-float {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-8px) scale(1.02); }
}

@keyframes scroll-boom {
  0% { transform: scale(1) rotate(0deg); opacity: 1; }
  30% { transform: scale(1.3) rotate(-5deg); opacity: 0.8; }
  60% { transform: scale(0.9) rotate(3deg); opacity: 0.6; }
  80% { transform: scale(1.1) rotate(-1deg); opacity: 0.4; }
  100% { transform: scale(0) rotate(0deg); opacity: 0; }
}

@keyframes glow {
  0% { box-shadow: 0 0 20px rgba(45, 212, 191, 0.5); }
  100% { box-shadow: 0 0 40px rgba(45, 212, 191, 0.8); }
}

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

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

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

@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

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

.animate-float { animation: float 6s ease-in-out infinite; }

.animate-hero-float { animation: hero-float 4s ease-in-out infinite; }

.animate-scroll-boom { animation: scroll-boom 0.7s ease-out forwards; }

.animate-glow { animation: glow 2s ease-in-out infinite alternate; }

.animate-bounce-gentle { animation: bounceGentle 2s ease-in-out infinite; }

.animate-pulse-soft { animation: pulseSoft 3s ease-in-out infinite; }

.animate-scroll-bounce { animation: scrollBounce 2s ease-in-out infinite; }

.animate-bounce-down { animation: none; }

.btn-primary:hover .animate-bounce-down { animation: bounceDown 2s ease-in-out infinite; }

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
  .container { padding: 0 1rem; }
  .btn-primary, .btn-secondary { padding: 0.75rem 1.5rem; font-size: 0.875rem; }
  .social-link { width: 32px; height: 32px; font-size: 0.9rem; }
  .social-link.hero { width: 48px; height: 48px; font-size: 1.125rem; }
  .skill-card, .contact-form-card, .card { padding: 1.5rem; }
}

@media (max-width: 640px) {
  .project-tech {
    gap: 0.25rem;
  }
  
  .tech-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }
}

@media (max-width: 480px) {
  .card { padding: 1.1rem 1.1rem; gap: 0.7rem; border-radius: 0.85rem; }
  .card .title { font-size: 1.15rem; }
  .card .icon { font-size: 1.7rem; }
  .card .content p { font-size: 0.8rem; }
  .view-project-btn { padding: 0.5rem 0.9rem; font-size: 0.78rem; }
  .skill-card, .contact-form-card { padding: 1.1rem; }
  .about-card { padding: 1.25rem; }
  section#home { padding-top: 6.5rem; }
  section#home h1 { font-size: 2.5rem; }
}

@media (min-width: 640px) and (max-width: 820px) {
  #projects .grid { gap: 1.75rem; }
  .card { padding: 1.3rem 1.4rem; }
  .view-project-btn { font-size: 0.85rem; }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent-400);
  outline-offset: 2px;
}

html:not(.dark) button:focus-visible, html:not(.dark) a:focus-visible, 
html:not(.dark) input:focus-visible, html:not(.dark) textarea:focus-visible {
  outline: 2px solid var(--accent-600);
}

::selection {
  background: rgba(14, 184, 166, 0.28);
  color: #ffffff;
}

html:not(.dark) ::selection {
  background: rgba(14, 165, 233, 0.28);
  color: #111111;
}

/* ========================================
   PAPER PLANE SEND ANIMATION
   ======================================== */
#submit-btn { position: relative; overflow: hidden; }

#submit-btn.plane-launching { cursor: default; }

.paper-plane-flight {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%) scale(1);
  color: #fff;
  display: inline-flex;
  font-size: 1.05rem;
  z-index: 30;
  animation: planeFlight 1.15s cubic-bezier(.65,.05,.36,1) forwards;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.35));
}

.paper-plane-flight::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 50%;
  width: 140px;
  height: 8px;
  transform: translateY(-50%) scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(255,255,255,0.65), rgba(255,255,255,0) 70%);
  filter: blur(2px);
  animation: planeTrail 0.9s ease-out forwards 0.05s;
  pointer-events: none;
}

@keyframes planeFlight {
  0% { transform: translate(0, -50%) scale(1) rotate(0deg); opacity:1; }
  15% { transform: translate(30px, -60%) scale(1) rotate(-8deg); }
  40% { transform: translate(110px, -95%) scale(.95) rotate(12deg); }
  70% { transform: translate(200px, -150%) scale(.9) rotate(18deg); opacity:1; }
  100% { transform: translate(260px, -190%) scale(.85) rotate(25deg); opacity:0; }
}

@keyframes planeTrail {
  0% { opacity:0; transform: translateY(-50%) scaleX(0); }
  15% { opacity:1; transform: translateY(-50%) scaleX(.25); }
  55% { opacity:0.9; }
  100% { opacity:0; transform: translateY(-50%) scaleX(1); }
}

#submit-btn.plane-launching #submit-text { opacity:0; }

#submit-btn.plane-launching #submit-icon { opacity:0; }

#submit-btn.sent { background: linear-gradient(135deg,var(--accent-500),var(--primary-500)); }

#submit-btn.sent::after {
  content:'Sent!';
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-weight:600; letter-spacing:.5px; animation: sentFade 0.4s ease-in forwards; 
}

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

html:not(.dark) #submit-btn.sent { box-shadow: 0 0 0 3px rgba(0,0,0,0.08), 0 8px 22px -6px rgba(0,0,0,0.25); }

/* ========================================
   HERO BUTTONS ENHANCEMENT
   ======================================== */
.hero-action { position:relative; overflow:hidden; isolation:isolate; --shine:rgba(255,255,255,0.65); --ring:rgba(255,255,255,0.15); --grad:linear-gradient(135deg,var(--primary-500),var(--accent-500)); background:var(--grad); padding:0.95rem 2.1rem; border-radius:0.9rem; letter-spacing:.4px; }

.hero-action.alt { --grad:linear-gradient(135deg,var(--accent-500),var(--secondary-500)); }

.hero-action.outline-cta { background:rgba(255,255,255,0.05); --grad:none; border:1px solid rgba(255,255,255,0.25); color:#fff; }

.hero-action.outline-cta:hover { background:rgba(255,255,255,0.12); border-color:rgba(255,255,255,0.4); }

html:not(.dark) .hero-action.outline-cta { background:rgba(0,0,0,0.04); color:#111827; border:1px solid rgba(0,0,0,0.15); }

html:not(.dark) .hero-action.outline-cta:hover { background:rgba(0,0,0,0.08); border-color:rgba(0,0,0,0.3); }

.hero-action.outline-cta::before { display:none; }

.hero-action.outline-cta .icon-wrap { display:none; }

.hero-action .label { position:relative; z-index:3; display:inline-flex; align-items:center; font-weight:600; font-size:1rem; }

.hero-action .icon-wrap { position:relative; z-index:3; display:inline-flex; align-items:center; margin-left:.65rem; transition:transform .55s cubic-bezier(.6,.05,.3,1); }

.hero-action::before, .hero-action::after { content:""; position:absolute; inset:0; }

.hero-action::before { background:linear-gradient(120deg,transparent 0%,rgba(255,255,255,0.18) 45%,rgba(255,255,255,0.5) 50%,rgba(255,255,255,0.18) 55%,transparent 100%); transform:translateX(-120%) skewX(-18deg); transition:transform 1.2s cubic-bezier(.65,.05,.36,1); z-index:1; }

.hero-action::after { background:radial-gradient(circle at var(--mx,50%) var(--my,50%), var(--ring) 0%, transparent 70%); opacity:0; transition:opacity .6s ease; z-index:2; }

.hero-action:hover::before { transform:translateX(130%) skewX(-18deg); }

.hero-action:hover .icon-wrap { transform:translateX(6px) rotate(8deg); }

.hero-action:active .icon-wrap { transform:translateX(2px) rotate(0deg) scale(.9); transition-duration:.25s; }

.hero-action.hero-glow { box-shadow:0 0 0 0 rgba(45,212,191,0.0),0 4px 18px -4px rgba(0,0,0,.45); transition:box-shadow .65s cubic-bezier(.55,.15,.25,1), transform .55s cubic-bezier(.55,.15,.25,1); }

.hero-action.hero-glow:hover { box-shadow:0 0 0 3px rgba(255,255,255,0.08),0 10px 38px -8px rgba(0,0,0,.6), 0 0 22px -8px rgba(45,212,191,0.45); transform:translateY(-4px); }

.primary-cta.hero-action.hero-glow:hover { box-shadow:0 0 0 3px rgba(255,255,255,0.12),0 14px 44px -10px rgba(0,0,0,.65), 0 0 26px -2px rgba(45,212,191,0.55); }

.hero-action.hero-glow:active { box-shadow:0 0 0 2px rgba(255,255,255,0.12),0 4px 18px -4px rgba(0,0,0,.55); }

.hero-action { --mx:50%; --my:50%; }

.hero-action:hover::after { opacity:1; }

.hero-action:not(:hover)::after { transition:opacity .4s ease .15s; }

html:not(.dark) .hero-action.hero-glow { box-shadow:0 0 0 0 rgba(0,0,0,0.05),0 4px 12px -2px rgba(0,0,0,.15); }

html:not(.dark) .hero-action.hero-glow:hover { box-shadow:0 0 0 3px rgba(0,0,0,0.05),0 10px 30px -6px rgba(0,0,0,.25), 0 0 18px -2px rgba(45,212,191,0.4); }

html:not(.dark) .hero-action { color:#fff; }

@media (prefers-reduced-motion: reduce) { .hero-action::before { display:none; } .hero-action .icon-wrap { transition:none; } }

/* ========================================
   BACK TO PROJECTS BUTTON
   ======================================== */
.back-to-projects-btn {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, 
    var(--primary-500) 0%, 
    var(--accent-500) 50%, 
    var(--secondary-500) 100%);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(16px);
  box-shadow: 
    0 8px 25px -5px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset,
    0 4px 12px -2px var(--primary-500/20);
  padding: 0.875rem 2rem;
  border-radius: 1rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  min-width: 200px;
}

.back-to-projects-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    var(--primary-400) 0%, 
    var(--accent-400) 50%, 
    var(--secondary-400) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.back-to-projects-btn:hover::before {
  opacity: 1;
}

.back-to-projects-btn:hover {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 
    0 12px 35px -8px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.25) inset,
    0 0 25px -3px var(--primary-400),
    0 0 50px -12px var(--accent-400),
    0 0 0 3px rgba(255, 255, 255, 0.1);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
  transform: translateY(-2px) scale(1.02);
}

.back-to-projects-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 
    0 2px 8px -2px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.back-to-projects-btn i {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-to-projects-btn:hover i {
  transform: translateX(-4px) rotate(-5deg);
}

/* Focus states */
.back-to-projects-btn:focus {
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 
    0 12px 35px -8px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.25) inset,
    0 0 25px -3px var(--primary-400),
    0 0 50px -12px var(--accent-400),
    0 0 0 3px var(--primary-400);
}

.back-to-projects-btn:focus:not(:hover) {
  transform: translateY(0) scale(1);
}

/* Light theme */
html:not(.dark) .back-to-projects-btn {
  background: linear-gradient(135deg, 
    var(--primary-600) 0%, 
    var(--accent-600) 50%, 
    var(--secondary-600) 100%);
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 
    0 8px 25px -5px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.4) inset,
    0 4px 12px -2px var(--primary-600/20);
}

html:not(.dark) .back-to-projects-btn::before {
  background: linear-gradient(135deg, 
    var(--primary-500) 0%, 
    var(--accent-500) 50%, 
    var(--secondary-500) 100%);
}

html:not(.dark) .back-to-projects-btn:hover {
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 
    0 12px 35px -8px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset,
    0 0 25px -3px var(--primary-500),
    0 0 50px -12px var(--accent-500),
    0 0 0 3px rgba(255, 255, 255, 0.15);
  transform: translateY(-2px) scale(1.02);
}

html:not(.dark) .back-to-projects-btn:focus {
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 
    0 12px 35px -8px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset,
    0 0 25px -3px var(--primary-500),
    0 0 50px -12px var(--accent-500),
    0 0 0 3px var(--primary-500);
}

html:not(.dark) .back-to-projects-btn:focus:not(:hover) {
  transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .back-to-projects-btn {
    transform: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
  }
  
  .back-to-projects-btn::before {
    display: none;
  }
  
  .back-to-projects-btn i {
    transition: none;
  }
  
  .back-to-projects-btn:hover i {
    transform: none;
  }
}

.back-to-projects-btn {
  opacity: 1;
  visibility: visible;
  color: white;
}

.back-to-projects-btn span,
.back-to-projects-btn i {
  color: white;
  opacity: 1;
}

/* ================= NAV IMPROVEMENTS (LARGE MOBILE PARITY) ================= */
@media (pointer: coarse) and (min-width: 430px) and (max-width: 820px) {
  .floating-nav {
    transform: translateX(-50%) scale(1);
    gap: .7rem;
    padding: .45rem .75rem;
    width: auto;
    margin: 0;
    top: var(--nav-offset);
  }
  .nav-pill-link { font-size:.9rem; }
  .nav-pill-link i { font-size:.85rem; }
}

@media (pointer: coarse) and (max-width: 429px) and (min-width: 380px) {
  .floating-nav { transform: translateX(-50%) scale(.95); }
}

@keyframes navEnter { from { opacity:0; transform:translate(-50%, -12px); } to { opacity:1; transform:translate(-50%, 0); } }

.floating-nav.nav-mounted { animation: navEnter .55s cubic-bezier(.65,.05,.36,1); }

.floating-nav .nav-indicator { transition: width .5s cubic-bezier(.34,1.56,.4,1), transform .6s cubic-bezier(.34,1.56,.4,1); }

.floating-nav.nav-hidden { pointer-events:none; opacity:0; transform:translate(-50%, -40px) scale(.97); transition:opacity .35s ease, transform .45s cubic-bezier(.65,.05,.36,1); }

@media (prefers-reduced-motion: reduce) { .floating-nav.nav-hidden { transform:translate(-50%, -20px); } }

.floating-nav { max-width: calc(100vw - 16px); }

.floating-nav.nav-compact { padding:.35rem .55rem; gap:.45rem; }

.floating-nav.nav-compact .nav-links { gap:.25rem; }

.floating-nav.nav-compact .nav-pill-link { padding:.5rem .85rem; font-size:.82rem; }

.floating-nav.nav-compact .nav-pill-link i { margin-right:.4rem; font-size:.78rem; }

.floating-nav.nav-compact .theme-toggle-btn { width:34px; height:34px; }

.floating-nav.nav-compact { top:2px; top:2px; left:2px; height:calc(100% - 4px); }

/* ================== MOBILE HEADER (LARGE PHONE) ================== */
.mobile-header { display:none; }

@media (pointer: coarse) and (max-width: 820px) {
  .mobile-header { position:fixed; top:0; left:0; right:0; height:58px; display:flex; align-items:center; justify-content:space-between; padding:0 1rem; z-index:120; backdrop-filter:blur(14px) saturate(150%); background:rgba(20,20,24,0.55); border-bottom:1px solid rgba(255,255,255,0.08); }
  html:not(.dark) .mobile-header { background:rgba(255,255,255,0.55); border-bottom:1px solid rgba(0,0,0,0.08); }
  .mobile-header-logo { display:inline-flex; height:40px; width:120px; align-items:center; justify-content:flex-start; filter:drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }
  .mobile-header-logo object { pointer-events:none; }
  .floating-nav, .site-logo-svg { display:none; }
  #home { padding-top: 58px; min-height: calc(100vh - 58px); }
}
/* Size-only fallback: show mobile header on narrow desktop widths too */
@media (max-width: 820px) {
  .mobile-header { position:fixed; top:0; left:0; right:0; height:58px; display:flex; align-items:center; justify-content:space-between; padding:0 1rem; z-index:120; backdrop-filter:blur(14px) saturate(150%); background:rgba(20,20,24,0.55); border-bottom:1px solid rgba(255,255,255,0.08); }
  html:not(.dark) .mobile-header { background:rgba(255,255,255,0.55); border-bottom:1px solid rgba(0,0,0,0.08); }
  .mobile-header-logo { display:inline-flex; height:40px; width:120px; align-items:center; justify-content:flex-start; filter:drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }
  .mobile-header-logo object { pointer-events:none; }
  .floating-nav, .site-logo-svg { display:none; }
  #home { padding-top: 58px; min-height: calc(100vh - 58px); }
}

@supports (height: 100svh) {
  @media (pointer: coarse) and (max-width: 820px) {
    #home { min-height: calc(100svh - 58px); }
  }
}

/* ================= MOBILE HERO PRIORITIZATION ================= */
@media (max-width: 480px) {
  /* Reduce top padding and tighten vertical spacing */
  #home { padding-top: 12px; }
  #home .grid { gap: 1rem; }
  /* Shrink hero profile photo container to keep CTAs in view */
  #home .animate-hero-float > div:first-child { width: 8.5rem; height: 8.5rem; }
  /* Bring CTAs and social closer */
  #home .hero-cta-row { margin-top: 0.5rem; }
  #home .hero-social-row { margin-top: 0.4rem; }
  /* Keep "Contact Me ->" on a single line and centered */
  .primary-cta { display:inline-flex; align-items:center; justify-content:center; gap:.65rem; white-space:nowrap; padding-right: initial; }
  .primary-cta .label { margin: 0; }
  .primary-cta .icon-wrap { position: static; margin-left: 0; transform: none; }
}

/* Small tablets / large phones */
@media (min-width: 481px) and (max-width: 640px) {
  #home { padding-top: 16px; }
  #home .grid { gap: 1.25rem; }
  #home .animate-hero-float > div:first-child { width: 10rem; height: 10rem; }
  #home .hero-cta-row { margin-top: 0.6rem; }
  #home .hero-social-row { margin-top: 0.5rem; }
  /* Ensure CTA label and arrow stay inline and centered */
  .primary-cta { display:inline-flex; align-items:center; justify-content:center; gap:.65rem; white-space:nowrap; }
  .primary-cta .label { margin: 0; }
  .primary-cta .icon-wrap { position: static; margin-left: 0; transform: none; }
}

/* Tablet optimization */
@media (pointer: coarse) and (min-width: 768px) and (max-width: 1024px) {
  .mobile-header { display:none; }
  .floating-nav, .site-logo-svg { display:flex; }
  #home { padding-top: 0; }
  .floating-nav { gap:.85rem; padding:.55rem 1rem; height: calc(var(--nav-control-size) + 6px); }
  .nav-pill-link { font-size:.95rem; padding:.65rem 1.15rem; }
  .nav-pill-link i { font-size:.9rem; }
  /* Keep smaller home toggle to avoid touching nav */
  .home-page .theme-toggle-btn { width: calc(var(--nav-control-size) - 6px); height: calc(var(--nav-control-size) - 6px); }
  .home-page .theme-toggle-btn .theme-toggle-inner svg { width: var(--nav-icon-size); height: var(--nav-icon-size); }
  /* Make hero social icons natural-sized on iPad */
  .hero-social-row .social-link.hero { width: 48px; height: 48px; font-size: 1.125rem; }
  /* Center CTA buttons and social icons on iPad */
  .hero-cta-row, .hero-social-row { justify-content:center; }
}

/* iPad 11"–13" */
@media (pointer: coarse) and (min-width: 834px) and (max-width: 1366px) {
  .floating-nav { left:calc(50% + 12px); right:auto; transform:translateX(-50%); margin:0; width:auto; max-width:none; height:calc(var(--nav-control-size) + 6px); padding:.45rem .70rem; display:flex; align-items:center; }
  .floating-nav .nav-indicator { top:3px; height:calc(100% - 6px); }
  .floating-nav.nav-compact { transform:none; }
  .site-logo-svg { left:24px; top:var(--nav-offset); padding:0 .5rem; height:calc(var(--nav-control-size) + 6px); display:flex; align-items:center; }
  .site-logo-svg .logo-container { width:6.3rem; height:2rem; display:flex; align-items:center; }
  .nav-links { height:100%; display:flex; align-items:center; }
  .nav-pill-link { font-size:.86rem; padding:.5rem .9rem; line-height:1.1; }
  .nav-pill-link i { font-size:.78rem; }
  .hero-cta-row, .hero-social-row { justify-content:center; }
  .scroll-down-btn { transform:translateX(-50%) scale(.85); }
  .scroll-down-btn { background:transparent; transition:filter .5s ease; }
  .scroll-down-btn span { font-size:.60rem; letter-spacing:.06em; }
  .scroll-down-btn .w-5.h-8 { width:16px; height:26px; }
  .scroll-down-btn { filter:drop-shadow(0 0 4px rgba(45,212,191,0.25)); transition:filter .5s ease, transform .5s ease; }
  .scroll-down-btn:hover { filter:drop-shadow(0 0 6px rgba(45,212,191,0.4)); transform:translateX(-50%) scale(.9); }
  /* Keep smaller home toggle to avoid touching nav */
  .home-page .theme-toggle-btn { width: calc(var(--nav-control-size) - 6px); height: calc(var(--nav-control-size) - 6px); }
  .home-page .theme-toggle-btn .theme-toggle-inner svg { width: var(--nav-icon-size); height: var(--nav-icon-size); }
  /* Make hero social icons natural-sized on larger iPads */
  .hero-social-row .social-link.hero { width: 48px; height: 48px; font-size: 1.125rem; }
}

/* Safe-area adjustments */
@supports (padding:max(0px)) {
  @media (pointer: coarse) and (min-width:834px) and (max-width:1366px) and (max-width:1366px) {
  .floating-nav { left:calc(50% + 12px); right:auto; transform:translateX(-50%); }
  .site-logo-svg { left: calc(20px + env(safe-area-inset-left, 0px)); }
  }
}

/* ========================================
   MOBILE MENU PANEL
   ======================================== */
@media (pointer: coarse) and (max-width: 820px) {
  .mobile-menu-panel { 
    position:fixed; 
    top:58px; 
    left:0; 
    right:0; 
    padding:1.5rem 1.25rem 2.5rem; 
    background:rgba(20,20,24,0.25); 
    backdrop-filter:blur(32px) saturate(200%); 
    border-bottom:1px solid rgba(255,255,255,0.15); 
    box-shadow:
      0 25px 50px -12px rgba(0,0,0,0.4),
      0 0 0 1px rgba(255,255,255,0.08),
      inset 0 1px 0 rgba(255,255,255,0.15); 
    z-index:110; 
    display:block; 
    opacity:0; 
    transform:translateY(-20px) scale(0.95); 
    transition:opacity .6s cubic-bezier(.65,.05,.36,1), transform .6s cubic-bezier(.65,.05,.36,1); 
  }
  html:not(.dark) .mobile-menu-panel { 
    background:rgba(255,255,255,0.35); 
    border-bottom:1px solid rgba(0,0,0,0.15); 
    box-shadow:
      0 25px 50px -12px rgba(0,0,0,0.15),
      0 0 0 1px rgba(0,0,0,0.08),
      inset 0 1px 0 rgba(255,255,255,0.6); 
  }
  .mobile-menu-panel.open { opacity:1; transform:translateY(0); }
  .mobile-menu-nav { display:flex; flex-direction:column; gap:.4rem; }
  .mobile-menu-link, .mobile-theme-toggle { 
    position:relative; 
    display:flex; 
    align-items:center; 
    gap:.85rem; 
    padding:1rem 1.25rem; 
    border-radius:1.25rem; 
    font-weight:600; 
    font-size:.95rem; 
    letter-spacing:.4px; 
    color:#fff; 
    background:transparent; 
    border:1px solid rgba(255,255,255,0.2); 
    backdrop-filter:blur(12px) saturate(120%); 
    transition:all .45s cubic-bezier(.65,.05,.36,1); 
    box-shadow:0 2px 8px -2px rgba(0,0,0,0.1); 
  }
  /* Thinner border specifically for the Theme toggle entry */
  .mobile-theme-toggle { border-width: 0.5px; }
  html:not(.dark) .mobile-menu-link, html:not(.dark) .mobile-theme-toggle { 
    color:#111; 
    background:transparent; 
    border-color:rgba(0,0,0,0.15); 
    box-shadow:0 2px 6px -2px rgba(0,0,0,0.05); 
  }
  .mobile-menu-link i { width:20px; text-align:center; font-size:1rem; opacity:.9; }
  .mobile-menu-link:focus-visible, .mobile-theme-toggle:focus-visible { outline:2px solid var(--accent-400); outline-offset:2px; }
  html:not(.dark) .mobile-menu-link:focus-visible { outline-color:var(--accent-600); }
  .mobile-menu-link:hover { 
    background:transparent; 
    border-color:rgba(255,255,255,0.3); 
    transform:translateY(-2px); 
    box-shadow:0 4px 15px -6px rgba(0,0,0,.2), 0 0 0 1px rgba(255,255,255,0.15); 
  }
  .mobile-menu-link:active { transform:translateY(0) scale(.98); }
  .mobile-menu-link.active { 
    background:linear-gradient(135deg,var(--primary-500),var(--accent-500)); 
    color:#fff; 
    border-color:transparent; 
    box-shadow:0 8px 28px -10px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,0.2); 
  }
  .mobile-theme-toggle { justify-content:flex-start; cursor:pointer; }
  /* Align mobile theme toggle like other menu links */
  .mobile-theme-toggle .theme-toggle-inner { 
    width:20px; 
    height:20px; 
    flex: 0 0 20px; 
    justify-content:center; 
  }
  .mobile-theme-toggle .theme-toggle-inner svg { 
    inset: 0; 
    margin: auto; 
    width:20px; 
    height:20px; 
  }
  .mobile-theme-toggle:hover { 
    background:transparent; 
    border-color:rgba(255,255,255,0.3); 
    transform:translateY(-2px); 
  }
  html:not(.dark) .mobile-menu-link:hover, html:not(.dark) .mobile-theme-toggle:hover { 
    background:transparent; 
    border-color:rgba(0,0,0,0.25); 
    box-shadow:0 4px 15px -6px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,0.1); 
  }
}
/* Size-only fallback: mobile menu styles on narrow desktop widths too */
@media (max-width: 820px) {
  .mobile-menu-panel { 
    position:fixed; 
    top:58px; 
    left:0; 
    right:0; 
    padding:1.5rem 1.25rem 2.5rem; 
    background:rgba(20,20,24,0.25); 
    backdrop-filter:blur(32px) saturate(200%); 
    border-bottom:1px solid rgba(255,255,255,0.15); 
    box-shadow:
      0 25px 50px -12px rgba(0,0,0,0.4),
      0 0 0 1px rgba(255,255,255,0.08),
      inset 0 1px 0 rgba(255,255,255,0.15); 
    z-index:110; 
    display:block; 
    opacity:0; 
    transform:translateY(-20px) scale(0.95); 
    transition:opacity .6s cubic-bezier(.65,.05,.36,1), transform .6s cubic-bezier(.65,.05,.36,1); 
  }
  html:not(.dark) .mobile-menu-panel { 
    background:rgba(255,255,255,0.35); 
    border-bottom:1px solid rgba(0,0,0,0.15); 
    box-shadow:
      0 25px 50px -12px rgba(0,0,0,0.15),
      0 0 0 1px rgba(0,0,0,0.08),
      inset 0 1px 0 rgba(255,255,255,0.6); 
  }
  .mobile-menu-panel.open { opacity:1; transform:translateY(0); }
  .mobile-menu-nav { display:flex; flex-direction:column; gap:.4rem; }
  .mobile-menu-link, .mobile-theme-toggle { 
    position:relative; 
    display:flex; 
    align-items:center; 
    gap:.85rem; 
    padding:1rem 1.25rem; 
    border-radius:1.25rem; 
    font-weight:600; 
    font-size:.95rem; 
    letter-spacing:.4px; 
    color:#fff; 
    background:transparent; 
    border:1px solid rgba(255,255,255,0.2); 
    backdrop-filter:blur(12px) saturate(120%); 
    transition:all .45s cubic-bezier(.65,.05,.36,1); 
    box-shadow:0 2px 8px -2px rgba(0,0,0,0.1); 
  }
  .mobile-theme-toggle { border-width: 0.5px; }
  html:not(.dark) .mobile-menu-link, html:not(.dark) .mobile-theme-toggle { 
    color:#111; 
    background:transparent; 
    border-color:rgba(0,0,0,0.15); 
    box-shadow:0 2px 6px -2px rgba(0,0,0,0.05); 
  }
  .mobile-menu-link i { width:20px; text-align:center; font-size:1rem; opacity:.9; }
  .mobile-menu-link:focus-visible, .mobile-theme-toggle:focus-visible { outline:2px solid var(--accent-400); outline-offset:2px; }
  html:not(.dark) .mobile-menu-link:focus-visible { outline-color:var(--accent-600); }
  .mobile-menu-link:hover { 
    background:transparent; 
    border-color:rgba(255,255,255,0.3); 
    transform:translateY(-2px); 
    box-shadow:0 4px 15px -6px rgba(0,0,0,.2), 0 0 0 1px rgba(255,255,255,0.15); 
  }
  .mobile-menu-link:active { transform:translateY(0) scale(.98); }
  .mobile-menu-link.active { 
    background:linear-gradient(135deg,var(--primary-500),var(--accent-500)); 
    color:#fff; 
    border-color:transparent; 
    box-shadow:0 8px 28px -10px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,0.2); 
  }
  .mobile-theme-toggle { justify-content:flex-start; cursor:pointer; }
  .mobile-theme-toggle .theme-toggle-inner { 
    width:20px; 
    height:20px; 
    flex: 0 0 20px; 
    justify-content:center; 
  }
  .mobile-theme-toggle .theme-toggle-inner svg { 
    inset: 0; 
    margin: auto; 
    width:20px; 
    height:20px; 
  }
  .mobile-theme-toggle:hover { 
    background:transparent; 
    border-color:rgba(255,255,255,0.3); 
    transform:translateY(-2px); 
  }
  html:not(.dark) .mobile-menu-link:hover, html:not(.dark) .mobile-theme-toggle:hover { 
    background:transparent; 
    border-color:rgba(0,0,0,0.25); 
    box-shadow:0 4px 15px -6px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,0.1); 
  }
}

/* Responsive mobile menu */
@media (pointer: coarse) and (max-width: 480px) {
  .mobile-menu-panel { padding:1.25rem 1rem 2rem; }
  .mobile-menu-link, .mobile-theme-toggle { 
    padding:.85rem 1rem; 
    font-size:.9rem; 
  }
}

@media (pointer: coarse) and (max-width: 360px) {
  .mobile-menu-panel { padding:1rem .75rem 1.5rem; }
  .mobile-menu-link, .mobile-theme-toggle { 
    padding:.75rem .85rem; 
    font-size:.85rem; 
    gap:.7rem; 
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-menu-panel { transition:none; }
  .hamburger-btn .hamburger-line { transition:none; }
  .mobile-menu-link, .mobile-theme-toggle { transition:none; }
}

/* ========================================
   REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}