/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #0b162a;
  --primary-light: #1e3a5f;
  --primary-dark: #051018;
  --secondary-color: #f59e0b;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-accent: #f3f4f6;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --background-color: #ffffff;
  --hover-background: #f3f4f6;
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --gradient-primary: linear-gradient(135deg, #0b162a 0%, #1e3a5f 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  font-display: swap;
}

/* Font loading optimization */
@font-face {
  font-family: 'Inter-fallback';
  src: local('Arial'), local('Helvetica');
  font-display: swap;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-md);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.nav-logo a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: var(--primary-color);
}

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

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

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.bar {
  width: 25px;
  height: 3px;
  background-color: var(--text-primary);
  margin: 3px 0;
  transition: 0.3s;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #0b162a 0%, #1e3a5f 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><radialGradient id="a" cx="50%" cy="50%"><stop offset="0%" stop-color="rgba(255,255,255,.1)"/><stop offset="100%" stop-color="rgba(255,255,255,0)"/></radialGradient></defs><circle fill="url(%23a)" cx="50" cy="10" r="10"/></svg>') repeat;
  opacity: 0.3;
}

.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.gradient-text {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.hero-description {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.875rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn-primary {
  background: var(--secondary-color);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: #d97706;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

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

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

.skills-showcase {
  width: 450px;
  height: 250px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  contain: layout style paint;
}

.skills-showcase::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: rotate 4s linear infinite;
  opacity: 0.7;
  will-change: transform;
}

@keyframes rotate {
  0% { transform: rotate3d(0, 0, 1, 0deg); }
  100% { transform: rotate3d(0, 0, 1, 360deg); }
}

.skills-showcase .skill-item {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.8rem;
  font-weight: 600;
  background: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: #fbbf24;
  text-align: center;
  padding: 20px 30px;
  opacity: 0;
  visibility: hidden;
  text-shadow: none;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 400px;
  line-height: 1.4;
  word-wrap: break-word;
  hyphens: auto;
  z-index: 2;
  will-change: opacity, transform;
  contain: layout style paint;
}

.skills-showcase .skill-item.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1.05);
}

/* Section Styles */
section {
  padding: 5rem 0;
}

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

/* About Section */
.about {
  background: var(--bg-secondary);
}

.about-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 800px;
  margin: 0 auto 3rem;
  line-height: 1.7;
}

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

.skills-grid .skill-item {
  background: white;
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-color);
  position: relative;
  opacity: 1;
  visibility: visible;
  overflow: hidden;
  will-change: transform;
  contain: layout style paint;
}

.skills-grid .skill-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  transition: transform 0.6s;
  will-change: transform;
}

.skills-grid .skill-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-color);
}

.skills-grid .skill-item:hover::before {
  transform: translateX(200%);
}

.skills-grid .skill-item:hover i {
  color: var(--secondary-color);
  transform: scale(1.1);
}

.skill-item i {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.skill-item h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.skill-item p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Experience Section */
.timeline {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 30px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gradient-primary);
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  padding-left: 80px;
}

.timeline-dot {
  position: absolute;
  left: 21px;
  top: 0;
  width: 20px;
  height: 20px;
  background: var(--primary-color);
  border-radius: 50%;
  border: 4px solid white;
  box-shadow: var(--shadow-md);
}

.timeline-content {
  background: white;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  will-change: transform;
  contain: layout style paint;
}

.timeline-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-primary);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s ease;
  will-change: transform;
}

.timeline-content:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px) translateX(8px);
  border-color: var(--primary-color);
}

.timeline-content:hover::before {
  transform: scaleY(1);
}

.timeline-content:hover h3 {
  color: var(--primary-color);
}

.timeline-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.company {
  color: var(--primary-color);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.duration {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.description {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Blog Section */
.blog {
  background: var(--bg-secondary);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.blog-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-color);
  position: relative;
  will-change: transform;
  contain: layout style paint;
}

.blog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(245, 158, 11, 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.blog-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-color);
}

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

.blog-card:hover .blog-image {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

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

.blog-image {
  height: 200px;
  background: #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

.blog-image i {
  font-size: 3rem;
  color: white;
  transition: all 0.3s ease;
}

.blog-content {
  padding: 2rem;
}

.blog-category {
  background: var(--primary-light);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.blog-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.blog-card p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.blog-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-light);
}

.blog-cta {
  text-align: center;
}

/* Contact Section */
.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  max-width: 1000px;
  margin: 0 auto;
}

.contact-info h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.contact-info p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-method {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-method:hover {
  color: var(--primary-color);
}

.contact-method i {
  font-size: 1.25rem;
  color: var(--primary-color);
}

.contact-form {
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: 15px;
  border: 1px solid var(--border-color);
}

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

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  background: white;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

/* Footer */
.footer {
  background: var(--text-primary);
  color: white;
  padding: 2rem 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: white;
}

/* Mobile Footer Styles */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
    justify-content: center;
  }

  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
  }

  .footer-links a {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .footer {
    padding: 1.5rem 0;
  }
  
  .footer-content {
    gap: 1rem;
  }
  
  .footer-links {
    gap: 1rem;
  }
  
  .footer-links a {
    font-size: 0.85rem;
  }
}

/* Skills Filter Styles */
.skills-filter-container {
  margin-bottom: 2rem;
  text-align: center;
}

.skills-filter-buttons {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  font-size: 0.875rem;
  backdrop-filter: blur(10px);
  will-change: transform, background-color, border-color;
}

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

.filter-btn.active {
  background: var(--secondary-color);
  border-color: var(--secondary-color);
  color: white;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.filter-btn.active:hover {
  background: #d97706;
  border-color: #d97706;
}

/* Skills showcase updates for filtering */
.skills-showcase .skill-item {
  display: block;
}

.skills-showcase .skill-item.filtered-out {
  display: none;
}

/* Responsive skills showcase sizing */
@media (max-width: 768px) {
  .skills-showcase {
    width: 90vw;
    max-width: 360px;
    height: 200px;
    margin: 0 auto;
  }
  
  .skills-showcase .skill-item {
    font-size: 1.4rem;
    max-width: 320px;
    padding: 15px 20px;
  }
}

@media (max-width: 480px) {
  .skills-showcase {
    width: 95vw;
    max-width: 300px;
    height: 180px;
    margin: 0 auto;
  }
  
  .skills-showcase .skill-item {
    font-size: 1.2rem;
    max-width: 260px;
    padding: 12px 16px;
    line-height: 1.3;
  }
}

@media (max-width: 375px) {
  .skills-showcase {
    width: 95vw;
    max-width: 280px;
    height: 160px;
  }
  
  .skills-showcase .skill-item {
    font-size: 1.1rem;
    max-width: 240px;
    padding: 10px 14px;
  }
}

/* Mobile responsive filter buttons */
@media (max-width: 768px) {
  .skills-filter-buttons {
    gap: 0.4rem;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .filter-btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .skills-filter-buttons {
    gap: 0.3rem;
    padding: 0 0.5rem;
  }
  
  .filter-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 20px;
  }
}

@media (max-width: 375px) {
  .skills-filter-buttons {
    gap: 0.25rem;
    padding: 0;
  }
  
  .filter-btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
    border-radius: 18px;
  }
}

/* Mobile Hero Responsiveness */
@media (max-width: 968px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
    padding: 2rem 1rem;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 6rem 0 3rem;
  }
  
  .hero-container {
    gap: 2rem;
    padding: 1rem;
  }
  
  .hero-title {
    font-size: 2.2rem;
  }
  
  .skills-filter-container {
    margin-bottom: 1.5rem;
  }
  
  .skills-filter-buttons {
    gap: 0.5rem;
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.8rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .hero-description {
    font-size: 0.9rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    gap: 1rem;
  }
  
  .skills-filter-buttons {
    padding: 0 0.5rem;
  }
  
  .filter-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    min-width: auto;
  }
}

/* Performance optimizations */
* {
  /* Enable hardware acceleration for interactive elements */
  will-change: auto;
}

.hamburger,
.nav-link,
.filter-btn,
.skill-item,
.btn {
  /* Enable compositing layer for interactive elements */
  will-change: transform;
  /* Ensure smooth transitions */
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Optimize transitions for 60fps performance */
.hamburger .bar {
  /* ...existing code... */
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

.nav-menu {
  /* ...existing code... */
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(-100%);
}

.nav-menu.active {
  transform: translateX(0);
}

.filter-btn {
  /* ...existing code... */
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-item {
  /* ...existing code... */
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Reduce paint complexity */
.skills-showcase {
  contain: layout style paint;
}

/* Optimize for touch devices */
@media (hover: none) and (pointer: coarse) {
  .hamburger,
  .filter-btn,
  .nav-link {
    /* Larger touch targets for mobile */
    min-height: 44px;
    min-width: 44px;
    /* Remove hover states on touch devices */
    transition: transform 0.1s ease;
  }
  
  .nav-link:active,
  .filter-btn:active {
    transform: scale(0.95);
  }
}

/* Mobile Navigation Styles - Optimized for INP */
@media (max-width: 768px) {
  .nav-container {
    justify-content: space-between;
  }

  .nav-menu {
    position: fixed;
    left: 0;
    top: 70px;
    flex-direction: column;
    background-color: var(--background-color);
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    padding: 2rem 0;
    gap: 0;
    /* Optimize for INP - use transform instead of left */
    transform: translateX(-100%);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    /* Enable hardware acceleration */
    will-change: transform;
    backface-visibility: hidden;
  }

  .nav-menu.active {
    transform: translateX(0);
  }

  .nav-item {
    margin: 1rem 0;
    /* Reduce paint complexity */
    contain: layout;
  }

  .nav-link {
    font-size: 1.1rem;
    display: block;
    padding: 1rem;
    /* Optimize transitions for faster response */
    transition: background-color 0.1s ease, color 0.1s ease;
    /* Enable hardware acceleration */
    transform: translateZ(0);
    /* Larger touch target for better accessibility */
    min-height: 44px;
    line-height: 1.5;
  }

  .nav-link:hover,
  .nav-link:active {
    background-color: var(--hover-background);
    color: var(--primary-color);
  }

  .hamburger {
    display: flex;
    z-index: 1001;
    /* Optimize for touch */
    padding: 8px;
    /* Ensure minimum touch target */
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    align-items: center;
  }

  /* Optimized hamburger animation for ultra-fast INP */
  .hamburger .bar {
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.1s ease;
    transform-origin: center;
  }

  .hamburger.active .bar:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* Ensure navbar has proper background on mobile */
  .navbar {
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    /* Optimize for scrolling performance */
    contain: layout style;
  }

  .navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
  }
}

/* Additional mobile improvements */
@media (max-width: 480px) {
  .nav-logo a {
    font-size: 1.3rem;
  }

  .nav-menu {
    top: 60px;
    padding: 1.5rem 0;
  }

  .nav-link {
    font-size: 1rem;
    padding: 0.8rem;
  }

  .hamburger {
    scale: 0.9;
  }
}

/* Ultra-fast INP optimizations - CSS-only instant feedback */
.filter-btn:active,
.nav-link:active {
  /* Instant visual feedback via CSS */
  transform: scale(0.95);
  transition: transform 0.05s ease;
}

.hamburger:active {
  transform: scale(0.9);
  transition: transform 0.05s ease;
}

/* Ensure buttons respond instantly to touch */
@media (hover: none) and (pointer: coarse) {
  .filter-btn,
  .nav-link,
  .hamburger {
    /* Remove any hover delays on touch devices */
    touch-action: manipulation;
    /* Instant visual response */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  }
  
  .filter-btn:active {
    background-color: var(--primary-color);
    color: white;
    transform: scale(0.95);
  }
  
  .nav-link:active {
    background-color: var(--primary-color);
    color: white;
    transform: scale(0.98);
  }
}

/* Optimize filter buttons for minimal layout shifts */
.filter-btn {
  /* Prevent layout shifts during state changes */
  box-sizing: border-box;
  border: 2px solid transparent;
  /* Enable hardware acceleration */
  will-change: transform, background-color;
  /* Reduce transition time for faster perceived response */
  transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-btn.active {
  border-color: var(--primary-color);
  /* Prevent additional layout calculations */
  transform: translateZ(0);
}

/* Optimize nav menu for fastest possible transitions */
.nav-menu {
  /* Use GPU acceleration for smoothest animation */
  transform: translate3d(-100%, 0, 0);
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-menu.active {
  transform: translate3d(0, 0, 0);
}
