/* Mobile-first responsive design */
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 1rem;
}

@media (min-width: 768px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 2rem;
  }
}

@media (min-width: 1024px) {
  .portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    padding: 3rem;
  }
}

/* Touch-friendly interactive elements */
.btn,
button,
a {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  touch-action: manipulation;
}

/* Mobile navigation optimized for thumb reach */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: none;
  background: var(--nav-bg, #18181B);
  border-top: 1px solid var(--border-color, #27272A);
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
}

@media (max-width: 767px) {
  .mobile-nav {
    display: flex;
    justify-content: space-around;
    padding: 0.5rem;
  }
  
  .desktop-nav {
    display: none;
  }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  color: var(--text-secondary, #A1A1AA);
  text-decoration: none;
  font-size: 12px;
  transition: color 0.2s;
}

.mobile-nav-item:active,
.mobile-nav-item.active {
  color: var(--text-primary, #FFFFFF);
}

.mobile-nav-item svg {
  width: 24px;
  height: 24px;
}

/* Improved touch targets */
.clickable-card {
  position: relative;
  cursor: pointer;
}

.clickable-card::after {
  content: '';
  position: absolute;
  inset: -8px;
  z-index: -1;
}

/* Optimized scrolling */
.scroll-container {
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
}

.scroll-item {
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* Prevent text selection on interactive elements */
.no-select {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Optimized font sizes for mobile */
@media (max-width: 640px) {
  h1 {
    font-size: 2rem;
    line-height: 1.2;
  }
  
  h2 {
    font-size: 1.5rem;
    line-height: 1.3;
  }
  
  h3 {
    font-size: 1.25rem;
    line-height: 1.4;
  }
  
  body, p {
    font-size: 16px;
    line-height: 1.6;
  }
}

/* Safe area handling for modern phones */
.safe-area-padding {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* Performance optimizations handled by interaction-fix.css */

/* Reduced motion handled by interaction-fix.css */