/* Mobile Portfolio/Works Carousel - iOS-inspired Design */
/* ====================================================== */

@media screen and (max-width: 991px) {
  /* Hide desktop filter */
  .portfolio-filter {
    display: none !important;
  }

  /* Portfolio section adjustments */
  #works {
    padding: 60px 0 40px 0 !important;
    overflow: hidden;
  }

  /* Mobile filter as segmented control (iOS style) */
  .pf-filter-wrapper {
    margin-bottom: 30px;
    padding: 0 20px;
  }

  .portfolio-filter-mobile {
    width: 100%;
    background: rgba(255, 76, 96, 0.05);
    border: 2px solid rgba(255, 76, 96, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 500;
    color: #454360;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ff4c60' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    transition: all 0.3s ease;
  }

  .portfolio-filter-mobile:focus {
    outline: none;
    border-color: #ff4c60;
    box-shadow: 0 0 0 4px rgba(255, 76, 96, 0.1);
  }

  /* Convert portfolio wrapper to carousel */
  .portfolio-wrapper {
    display: flex !important;
    flex-direction: column;
    gap: 20px;
    margin: 0 -20px;
  }

  /* Individual content rows as carousels */
  #developmentContent,
  #videoContent,
  #photographyContent {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 20px !important;
    gap: 20px !important;
    margin: 0 !important;
  }

  #developmentContent::-webkit-scrollbar,
  #videoContent::-webkit-scrollbar,
  #photographyContent::-webkit-scrollbar {
    display: none !important;
  }

  /* Large portfolio cards for mobile */
  .portfolio-wrapper .col-md-4,
  .portfolio-wrapper .col-sm-6,
  .portfolio-wrapper .grid-item {
    flex: 0 0 85% !important;
    max-width: 85% !important;
    scroll-snap-align: center !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* First and last card spacing */
  .portfolio-wrapper .grid-item:first-child {
    margin-left: calc((100% - 85%) / 2) !important;
  }

  .portfolio-wrapper .grid-item:last-child {
    margin-right: calc((100% - 85%) / 2) !important;
  }

  /* Enhanced card design for mobile */
  .work-content {
    display: block !important;
    height: 100% !important;
    text-decoration: none !important;
  }

  .ios-card {
    background: white;
    border-radius: 20px !important;
    overflow: hidden;
    box-shadow: 
      0 10px 30px rgba(0, 0, 0, 0.08),
      0 2px 10px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 1px solid rgba(0, 0, 0, 0.05);
    height: 450px !important;
    display: flex;
    flex-direction: column;
  }

  /* Card image container */
  .ios-card .card-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  }

  .ios-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
  }

  /* Card content */
  .ios-card .card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .ios-card .card-category {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #ff4c60;
    letter-spacing: 1px;
    margin-bottom: 8px;
  }

  .ios-card .card-title {
    font-size: 18px;
    font-weight: 700;
    color: #454360;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .ios-card .card-description {
    font-size: 14px;
    color: #7c7c8a;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
  }

  .ios-card .card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
  }

  .ios-card .card-date {
    font-size: 13px;
    color: #a8a8b8;
  }

  .ios-card .card-action {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #ff4c60;
  }

  .ios-card .card-action i {
    font-size: 12px;
    transition: transform 0.3s ease;
  }

  /* Active card state */
  .ios-card:active {
    transform: scale(0.98);
    box-shadow: 
      0 5px 20px rgba(0, 0, 0, 0.1),
      0 2px 8px rgba(0, 0, 0, 0.05) !important;
  }

  /* Dark mode support */
  [data-theme="dark"] .ios-card {
    background: linear-gradient(135deg, 
      rgba(22, 22, 31, 0.95) 0%, 
      rgba(30, 30, 41, 0.95) 100%);
    border-color: rgba(255, 76, 96, 0.1);
    box-shadow: 
      0 10px 30px rgba(0, 0, 0, 0.3),
      0 2px 10px rgba(255, 76, 96, 0.05) !important;
  }

  [data-theme="dark"] .ios-card .card-title {
    color: #ffffff;
  }

  [data-theme="dark"] .ios-card .card-description {
    color: #a8a8b8;
  }

  [data-theme="dark"] .ios-card .card-meta {
    border-top-color: rgba(255, 255, 255, 0.1);
  }

  [data-theme="dark"] .portfolio-filter-mobile {
    background: rgba(255, 76, 96, 0.1);
    border-color: rgba(255, 76, 96, 0.3);
    color: #ffffff;
  }

  /* Scroll indicators */
  .portfolio-scroll-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding-bottom: 10px;
  }

  .scroll-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 76, 96, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
  }

  .scroll-dot.active {
    width: 24px;
    border-radius: 4px;
    background: #ff4c60;
  }

  /* Category headers */
  .portfolio-category-header {
    padding: 0 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .category-title {
    font-size: 16px;
    font-weight: 600;
    color: #454360;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .category-title i {
    color: #ff4c60;
    font-size: 14px;
  }

  .category-count {
    font-size: 13px;
    color: #a8a8b8;
    background: rgba(255, 76, 96, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
  }

  [data-theme="dark"] .category-title {
    color: #ffffff;
  }

  [data-theme="dark"] .category-count {
    background: rgba(255, 76, 96, 0.15);
    color: #ff7a8a;
  }

  /* View all link */
  .view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 500;
    color: #ff4c60;
    text-decoration: none;
    margin: 20px auto;
    padding: 10px 20px;
    background: rgba(255, 76, 96, 0.1);
    border-radius: 20px;
    transition: all 0.3s ease;
  }

  .view-all-link:hover {
    background: rgba(255, 76, 96, 0.15);
    transform: translateX(5px);
  }

  .view-all-link i {
    transition: transform 0.3s ease;
  }

  .view-all-link:hover i {
    transform: translateX(3px);
  }

  /* Loading skeleton for cards */
  .ios-card.loading {
    position: relative;
    overflow: hidden;
  }

  .ios-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.2),
      transparent
    );
    animation: loading-skeleton 1.5s infinite;
  }

  @keyframes loading-skeleton {
    0% { left: -100%; }
    100% { left: 100%; }
  }

  /* Small mobile adjustments */
  @media screen and (max-width: 576px) {
    .portfolio-wrapper .col-md-4,
    .portfolio-wrapper .col-sm-6,
    .portfolio-wrapper .grid-item {
      flex: 0 0 90% !important;
      max-width: 90% !important;
    }

    .portfolio-wrapper .grid-item:first-child {
      margin-left: 5% !important;
    }

    .portfolio-wrapper .grid-item:last-child {
      margin-right: 5% !important;
    }

    .ios-card {
      height: 400px !important;
    }

    .ios-card .card-image {
      height: 220px;
    }

    .ios-card .card-title {
      font-size: 16px;
    }

    .ios-card .card-description {
      font-size: 13px;
      -webkit-line-clamp: 2;
    }
  }

  /* Landscape adjustments */
  @media screen and (max-width: 991px) and (orientation: landscape) {
    .portfolio-wrapper .col-md-4,
    .portfolio-wrapper .col-sm-6,
    .portfolio-wrapper .grid-item {
      flex: 0 0 60% !important;
      max-width: 60% !important;
    }

    .ios-card {
      height: 350px !important;
    }

    .ios-card .card-image {
      height: 180px;
    }
  }
}

/* Desktop - keep original layout */
@media screen and (min-width: 992px) {
  .portfolio-scroll-indicator,
  .portfolio-category-header,
  .view-all-link {
    display: none !important;
  }
}/* Mobile Collaborators Grid - 2 Column Layout */
/* ============================================= */

/* Mobile screens - 2 columns */
@media screen and (max-width: 991px) {
  .collaborators-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
    padding: 20px 10px !important;
  }
  
  .collaborator-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px 15px !important;
    min-height: 120px !important;
    width: 100%;
    background: rgba(249, 249, 255, 0.5);
    border: 1px solid rgba(94, 92, 127, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
  }

  /* Dark mode collaborator items */
  [data-theme="dark"] .collaborator-item {
    background: rgba(22, 22, 31, 0.5);
    border: 1px solid rgba(139, 92, 246, 0.15);
  }
  
  .collaborator-logo {
    width: 110px !important;
    height: 55px !important;
    object-fit: contain !important;
    filter: grayscale(100%) opacity(0.7);
    transition: all 0.3s ease;
  }

  /* Dark mode logo adjustments */
  [data-theme="dark"] .collaborator-logo {
    filter: grayscale(100%) opacity(0.6) brightness(1.5);
  }

  /* Touch feedback */
  .collaborator-item:active {
    transform: scale(0.98);
  }

  /* Hover effect on mobile (for devices that support it) */
  @media (hover: hover) {
    .collaborator-item:hover {
      transform: translateY(-2px);
      box-shadow: 0 5px 15px rgba(139, 92, 246, 0.15);
    }

    .collaborator-item:hover .collaborator-logo {
      filter: grayscale(0%) opacity(1);
    }

    [data-theme="dark"] .collaborator-item:hover .collaborator-logo {
      filter: grayscale(0%) opacity(1) brightness(1.2);
    }
  }
}

/* Small mobile screens */
@media screen and (max-width: 576px) {
  .collaborators-grid {
    gap: 15px !important;
    padding: 15px 5px !important;
  }
  
  .collaborator-item {
    padding: 20px 12px !important;
    min-height: 100px !important;
    border-radius: 10px;
  }
  
  .collaborator-logo {
    width: 95px !important;
    height: 45px !important;
  }
}

/* Very small screens (below 400px) */
@media screen and (max-width: 400px) {
  .collaborators-grid {
    gap: 12px !important;
  }
  
  .collaborator-item {
    padding: 18px 10px !important;
    min-height: 90px !important;
  }
  
  .collaborator-logo {
    width: 85px !important;
    height: 40px !important;
  }
}

/* Landscape orientation adjustments */
@media screen and (max-width: 991px) and (orientation: landscape) {
  .collaborators-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 15px !important;
  }
  
  .collaborator-item {
    min-height: 90px !important;
    padding: 15px 10px !important;
  }
  
  .collaborator-logo {
    width: 90px !important;
    height: 40px !important;
  }
}

/* Ensure section has proper spacing */
@media screen and (max-width: 991px) {
  section#collaborators {
    padding: 40px 0 !important;
  }
  
  section#collaborators .section-title {
    font-size: 24px !important;
    margin-bottom: 20px !important;
  }
  
  section#collaborators .spacer[data-height="40"] {
    height: 20px !important;
  }
}/* Mobile Portfolio Filter System with Category Tags */
/* ================================================= */

@media screen and (max-width: 991px) {
  /* Hide desktop filter and old mobile dropdown */
  .portfolio-filter,
  .pf-filter-wrapper {
    display: none !important;
  }

  /* Mobile Filter Pills Container */
  .mobile-portfolio-filters {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    background: transparent;
  }

  .mobile-portfolio-filters::-webkit-scrollbar {
    display: none;
  }

  /* Filter Pills/Chips */
  .filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 25px;
    background: rgba(240, 240, 245, 0.8);
    border: 2px solid transparent;
    color: #454360;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
  }

  .filter-pill i {
    font-size: 13px;
    transition: transform 0.3s ease;
  }

  /* Filter pill hover/active states */
  .filter-pill:active {
    transform: scale(0.95);
  }

  .filter-pill.active {
    background: linear-gradient(135deg, #ff4c60 0%, #ff6b7a 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(255, 76, 96, 0.3);
  }

  .filter-pill.active i {
    transform: rotate(360deg);
  }

  /* Ripple effect on tap */
  .filter-pill::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
  }

  .filter-pill:active::after {
    width: 100px;
    height: 100px;
  }

  /* Category specific colors */
  .filter-pill[data-filter="ai"] {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
  }

  .filter-pill[data-filter="ai"].active {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
  }

  .filter-pill[data-filter="webapp"] {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
  }

  .filter-pill[data-filter="webapp"].active {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  }

  .filter-pill[data-filter="youtube"] {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
  }

  .filter-pill[data-filter="youtube"].active {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
  }

  .filter-pill[data-filter="game"] {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
  }

  .filter-pill[data-filter="game"].active {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  }

  .filter-pill[data-filter="crypto"] {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
  }

  .filter-pill[data-filter="crypto"].active {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  }

  /* Counter badge on filter pills */
  .filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 4px;
  }

  .filter-pill.active .filter-count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
  }

  /* Category tags on cards */
  .card-category-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
  }

  .category-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .category-tag i {
    font-size: 10px;
  }

  /* Category tag colors matching filters */
  .category-tag.tag-ai {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
  }

  .category-tag.tag-webapp {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
  }

  .category-tag.tag-youtube {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
  }

  .category-tag.tag-game {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
  }

  .category-tag.tag-crypto {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
  }

  /* Dark mode support for filters */
  [data-theme="dark"] .mobile-portfolio-filters {
    background: transparent;
  }

  [data-theme="dark"] .filter-pill {
    background: rgba(30, 30, 41, 0.8);
    color: #a8a8b8;
    border-color: rgba(255, 255, 255, 0.05);
  }

  [data-theme="dark"] .filter-pill.active {
    color: white;
  }

  [data-theme="dark"] .category-tag {
    background: rgba(255, 255, 255, 0.05);
  }

  [data-theme="dark"] .category-tag.tag-ai {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
  }

  [data-theme="dark"] .category-tag.tag-webapp {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
  }

  [data-theme="dark"] .category-tag.tag-youtube {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
  }

  [data-theme="dark"] .category-tag.tag-game {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
  }

  [data-theme="dark"] .category-tag.tag-crypto {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
  }

  /* Results counter */
  .filter-results {
    padding: 0 20px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #7c7c8a;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .filter-results strong {
    color: #ff4c60;
    font-weight: 600;
  }

  .clear-filters {
    font-size: 12px;
    color: #ff4c60;
    text-decoration: none;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(255, 76, 96, 0.1);
    transition: all 0.3s ease;
  }

  .clear-filters:hover {
    background: rgba(255, 76, 96, 0.2);
  }

  [data-theme="dark"] .filter-results {
    color: #a8a8b8;
  }

  /* Animation for filtered items */
  .portfolio-item {
    animation: fadeInUp 0.4s ease;
  }

  .portfolio-item.hidden {
    display: none !important;
  }

  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Empty state */
  .no-results {
    text-align: center;
    padding: 60px 20px;
    color: #7c7c8a;
  }

  .no-results i {
    font-size: 48px;
    color: rgba(255, 76, 96, 0.3);
    margin-bottom: 20px;
  }

  .no-results h3 {
    font-size: 18px;
    color: #454360;
    margin-bottom: 10px;
  }

  .no-results p {
    font-size: 14px;
    margin-bottom: 20px;
  }

  [data-theme="dark"] .no-results h3 {
    color: #ffffff;
  }

  [data-theme="dark"] .no-results p {
    color: #a8a8b8;
  }

  /* Small screen adjustments */
  @media screen and (max-width: 400px) {
    .mobile-portfolio-filters {
      padding: 10px 15px;
    }

    .filter-pill {
      padding: 8px 14px;
      font-size: 13px;
    }

    .filter-pill i {
      font-size: 12px;
    }
  }
}

/* Desktop - hide mobile filters */
@media screen and (min-width: 992px) {
  .mobile-portfolio-filters,
  .filter-results,
  .no-results {
    display: none !important;
  }
}/* Mobile Dark Mode Toggle - Show in sidebar only */
/* =============================================== */

@media screen and (max-width: 991px) {
  /* Hide toggle from mobile header bar */
  .mobile-header-1 .mobile-theme-toggle {
    display: none !important;
  }
  
  /* Ensure toggle shows in sidebar menu */
  .desktop-header-1 .nav-theme-toggle {
    display: block !important;
  }
}/**
 * Comprehensive Mobile Responsiveness Fixes
 * Addresses all identified mobile issues
 */

/* ===================================================================
   CRITICAL MOBILE FIXES
   =================================================================== */

@media screen and (max-width: 991px) {
  /* 1. Prevent horizontal scroll from all sources */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    position: relative;
  }

  /* 2. Ensure all containers respect viewport width */
  * {
    max-width: 100vw;
    box-sizing: border-box;
  }

  /* 3. Fix parallax container to prevent overflow */
  .parallax {
    position: fixed !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
  }

  /* 4. Ensure parallax icons stay within bounds */
  .parallax-icon {
    max-width: 60px !important;
    max-height: 60px !important;
  }

  .parallax-icon .app-icon-parallax {
    max-width: 100% !important;
    max-height: 100% !important;
  }

  /* 5. Fix sections to prevent overflow */
  section {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  /* 6. Container max-width fixes */
  .container {
    max-width: 100% !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    overflow-x: hidden !important;
  }

  /* 7. Service cards visibility fix for dark mode */
  .service-card,
  .service-card * {
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* 8. Improve touch target sizes (44x44px minimum) */
  .menu-icon button,
  .carousel-nav-arrow,
  .carousel-dot,
  .social-icons a,
  .ios-button,
  button,
  a[href] {
    min-width: 44px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  /* 9. Fix keyboard pushing layout on iOS */
  body.keyboard-open {
    position: fixed !important;
    width: 100% !important;
  }

  /* 10. Optimize images for mobile */
  img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* 11. Better text rendering on mobile */
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

  /* 12. Fix z-index stacking issues */
  .mobile-header-1 {
    z-index: 10000 !important;
  }

  .services-carousel-wrapper {
    z-index: 100 !important;
  }

  .carousel-nav-arrow {
    z-index: 200 !important;
  }

  .menu-overlay {
    z-index: 9999 !important;
  }

  .desktop-header-1 {
    z-index: 10001 !important;
  }

  /* 13. Performance optimizations */
  * {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
  }

  /* Allow touch callout for links and images */
  a, img {
    -webkit-touch-callout: default;
  }

  /* 14. Smooth scrolling with momentum */
  .services-grid,
  .portfolio-wrapper,
  body {
    -webkit-overflow-scrolling: touch;
  }

  /* 15. Fix collaborator grid on mobile */
  .collaborators-grid {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* 16. Better form rendering */
  input,
  textarea,
  select {
    font-size: 16px !important; /* Prevents iOS zoom */
    max-width: 100% !important;
  }

  /* 17. Fix CTA banner width */
  .cta-banner {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  /* 18. Globe container sizing */
  #globe-container {
    max-width: 100% !important;
    overflow: hidden !important;
  }
}

/* ===================================================================
   LANDSCAPE MOBILE OPTIMIZATIONS
   =================================================================== */

@media screen and (max-width: 991px) and (orientation: landscape) {
  /* Compact everything in landscape */
  .mobile-header-1 {
    padding: 2px 0 !important;
  }

  section.home {
    min-height: 100vh !important;
    padding: 40px 0 !important;
  }

  section.home img.circle {
    width: 120px !important;
    height: 120px !important;
  }

  h1 {
    font-size: 20px !important;
  }

  .text-rotating {
    font-size: 14px !important;
  }

  /* Hide parallax icons in landscape for performance */
  .parallax-icon {
    display: none !important;
  }
}

/* ===================================================================
   EXTRA SMALL DEVICES (iPhone SE, etc.)
   =================================================================== */

@media screen and (max-width: 375px) {
  /* Further size reductions */
  h1 {
    font-size: 22px !important;
  }

  h2.section-title {
    font-size: 18px !important;
  }

  .section-title:before {
    width: 30px !important;
    height: 30px !important;
  }

  .service-card {
    min-height: 380px !important;
    padding: 20px !important;
  }

  .social-icons a {
    width: 40px !important;
    height: 40px !important;
    font-size: 20px !important;
  }

  /* Reduce padding globally */
  section {
    padding: 50px 0 !important;
  }

  .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

/* ===================================================================
   SAFE AREA INSETS (Notched Devices)
   =================================================================== */

@media screen and (max-width: 991px) {
  /* Apply safe areas to all fixed/sticky elements */
  .mobile-header-1 {
    top: max(8px, env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
  }

  .desktop-header-1 {
    padding-top: max(40px, calc(40px + env(safe-area-inset-top)));
    padding-bottom: max(40px, calc(40px + env(safe-area-inset-bottom)));
  }

  main.content {
    padding-top: max(60px, calc(60px + env(safe-area-inset-top)));
  }

  section.home {
    padding-top: max(80px, calc(80px + env(safe-area-inset-top))) !important;
    padding-bottom: max(80px, calc(80px + env(safe-area-inset-bottom))) !important;
  }

  /* Floating button safe area */
  div[style*="position: fixed"] {
    bottom: max(20px, calc(20px + env(safe-area-inset-bottom))) !important;
    right: max(20px, calc(20px + env(safe-area-inset-right))) !important;
  }
}

/* ===================================================================
   DARK MODE MOBILE SPECIFIC FIXES
   =================================================================== */

@media screen and (max-width: 991px) {
  [data-theme="dark"] .service-card {
    background: #1e1e2e !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  [data-theme="dark"] .service-card * {
    opacity: 1 !important;
    visibility: visible !important;
  }

  [data-theme="dark"] .mobile-header-1 {
    background: rgba(22, 22, 31, 0.98) !important;
  }

  [data-theme="dark"] .parallax-icon .app-icon-parallax {
    filter: brightness(0.9);
  }
}

/* ===================================================================
   ACCESSIBILITY IMPROVEMENTS
   =================================================================== */

@media screen and (max-width: 991px) {
  /* Focus indicators */
  *:focus {
    outline: 3px solid #ff4c60;
    outline-offset: 2px;
  }

  /* Skip focus for mouse users */
  *:focus:not(:focus-visible) {
    outline: none;
  }

  /* Better contrast for outdoor viewing */
  body {
    color: #353353;
  }

  [data-theme="dark"] body {
    color: #e4e4e9;
  }

  /* Readable link sizes */
  a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* ===================================================================
   REDUCED MOTION SUPPORT
   =================================================================== */

@media (prefers-reduced-motion: reduce) and (max-width: 991px) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .parallax-icon {
    transform: none !important;
  }

  .service-card {
    transform: none !important;
  }
}

/* ===================================================================
   iOS SPECIFIC FIXES
   =================================================================== */

@supports (-webkit-touch-callout: none) {
  /* iOS Safari specific fixes */
  @media screen and (max-width: 991px) {
    /* Fix viewport height calculation */
    .home {
      min-height: -webkit-fill-available;
    }

    /* Prevent iOS bounce scroll */
    body {
      position: fixed;
      overflow: hidden;
      width: 100%;
      height: 100%;
    }

    main.content {
      position: absolute;
      overflow-y: scroll;
      -webkit-overflow-scrolling: touch;
      height: 100%;
      width: 100%;
    }

    /* Fix input zoom on iOS */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
      font-size: 16px !important;
    }

    /* Prevent iOS from styling form elements */
    input,
    textarea,
    select,
    button {
      -webkit-appearance: none;
      appearance: none;
      border-radius: 0;
    }

    /* Re-add border radius for design */
    .ios-form-control,
    .ios-button {
      border-radius: 12px !important;
    }
  }
}

/* ===================================================================
   ANDROID SPECIFIC FIXES
   =================================================================== */

@media screen and (max-width: 991px) {
  /* Android Chrome specific */
  .parallax {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
  }

  /* Better rendering on Android */
  * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* ===================================================================
   PERFORMANCE OPTIMIZATIONS
   =================================================================== */

@media screen and (max-width: 991px) {
  /* Use transform instead of position changes */
  .mobile-header-1.hide-header {
    transform: translateY(calc(-100% - 20px));
  }

  /* GPU acceleration for smooth animations */
  .service-card,
  .parallax-icon,
  .mobile-header-1,
  .desktop-header-1 {
    will-change: transform;
    transform: translate3d(0, 0, 0);
  }

  /* Optimize repaints */
  .services-grid {
    will-change: scroll-position;
  }

  /* Reduce paint areas */
  .service-card::before,
  .collaborator-item::before {
    will-change: opacity;
  }
}

/* ===================================================================
   PRINT STYLES FOR MOBILE
   =================================================================== */

@media print {
  .mobile-header-1,
  .desktop-header-1,
  .menu-icon,
  .parallax,
  .ios-button,
  div[style*="position: fixed"],
  .carousel-nav-arrow,
  .carousel-indicators,
  .menu-overlay {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  section {
    page-break-inside: avoid;
  }
}
/* ===================================================================
   CONSOLIDATED MOBILE STYLES FOR PERFORMANCE
   Combines: mobile-optimizations, mobile-nav-clean,
            mobile-services-carousel-modern, bubble fixes
   =================================================================== */

/* ===================================================================
   1. BASE MOBILE STYLES & TYPOGRAPHY
   =================================================================== */
@media screen and (max-width: 991px) {
  /* Performance optimizations */
  * {
    -webkit-overflow-scrolling: touch;
    animation-duration: 0.3s !important;
  }

  /* Profile & Typography */
  section.home img.circle {
    width: 200px !important;
    height: 200px !important;
    margin-bottom: 20px;
  }

  h1 {
    font-size: 28px !important;
    line-height: 1.3;
  }

  h2.section-title {
    font-size: 24px !important;
    margin-bottom: 10px;
  }

  .text-rotating {
    font-size: 16px !important;
    line-height: 1.6;
  }

  /* ===================================================================
     2. MOBILE NAVIGATION - Premium floating header
     =================================================================== */

  /* Ensure sidebar starts closed */
  header.desktop-header-1:not(.open) {
    transform: translate3d(-290px, 0, 0) !important;
  }

  /* Premium floating header */
  header.mobile-header-1 {
    position: fixed;
    top: max(8px, env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    z-index: 10000;
    background: rgba(249, 249, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    box-shadow:
      0 0 0 1px rgba(139, 92, 246, 0.05),
      0 2px 8px -2px rgba(139, 92, 246, 0.12),
      0 12px 24px -8px rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(139, 92, 246, 0.08);
  }

  [data-theme="dark"] header.mobile-header-1 {
    background: rgba(22, 22, 31, 0.95);
    box-shadow:
      0 0 0 1px rgba(139, 92, 246, 0.1),
      0 2px 8px -2px rgba(139, 92, 246, 0.2),
      0 12px 24px -8px rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.15);
  }

  header.mobile-header-1 .container {
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    gap: 12px;
  }

  /* Brand name in center */
  header.mobile-header-1 .container::after {
    content: 'Szymon Ruciński';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: 600;
    color: #353353;
    letter-spacing: -0.3px;
    pointer-events: none;
    opacity: 0.9;
  }

  [data-theme="dark"] header.mobile-header-1 .container::after {
    color: #e4e4e9;
  }

  /* Modern Hamburger Menu */
  .menu-icon button {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(139, 92, 246, 0.08);
  }

  .menu-icon span {
    width: 18px;
    height: 2px;
    background: linear-gradient(90deg, #8b5cf6, #7c3aed);
    display: block;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
  }

  .menu-icon span:before,
  .menu-icon span:after {
    content: '';
    position: absolute;
    width: 14px;
    height: 2px;
    background: linear-gradient(90deg, #8b5cf6, #7c3aed);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
  }

  .menu-icon span:before { top: -6px; left: 2px; }
  .menu-icon span:after { top: 6px; left: 2px; }

  /* Animate to X when open */
  .menu-open .menu-icon span {
    background: transparent;
  }

  .menu-open .menu-icon span:before,
  .menu-open .menu-icon span:after {
    top: 0;
    width: 20px;
    left: 0;
    background: #ff4c60;
  }

  .menu-open .menu-icon span:before { transform: rotate(45deg); }
  .menu-open .menu-icon span:after { transform: rotate(-45deg); }

  /* Side navigation */
  header.desktop-header-1 {
    position: fixed;
    top: 0;
    left: 0;
    width: 290px;
    height: 100vh;
    z-index: 1000;
    transform: translate3d(-290px, 0, 0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  header.desktop-header-1.open {
    transform: translate3d(0, 0, 0) !important;
  }

  /* Main content shift */
  main.content {
    margin-left: 0 !important;
    padding-top: 60px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  main.content.open {
    transform: translateX(290px);
  }

  /* Menu overlay */
  .menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .menu-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* ===================================================================
     3. PARALLAX BUBBLES - Fixed positioning
     =================================================================== */

  .parallax {
    display: block !important;
    opacity: 0.9;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    overflow: visible !important;
    pointer-events: none;
    z-index: 0;
  }

  /* Hide some icons for performance */
  .parallax-icon.icon5,
  .parallax-icon.icon6,
  .parallax-icon.icon7,
  .parallax-icon.icon8,
  .parallax-icon.icon9,
  .parallax-icon.icon10,
  .parallax-icon.icon11 {
    display: none !important;
  }

  .parallax-icon {
    position: absolute !important;
    pointer-events: auto;
  }

  /* Fixed bubble sizes */
  .app-icon-parallax {
    width: 50px !important;
    height: 50px !important;
    animation: gentleFloat 8s ease-in-out infinite;
  }

  .icon1 .app-icon-parallax { width: 50px !important; height: 50px !important; }
  .icon2 .app-icon-parallax { width: 42px !important; height: 42px !important; }
  .icon3 .app-icon-parallax { width: 46px !important; height: 46px !important; }
  .icon4 .app-icon-parallax { width: 44px !important; height: 44px !important; }

  @keyframes gentleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
  }

  /* ===================================================================
     4. SERVICES CAROUSEL - Modern 3D carousel
     =================================================================== */

  #services {
    perspective: 1200px;
    overflow: visible;
  }

  .services-grid {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 20px !important;
    padding: 40px 20px !important;
    margin: 0 !important;
    transform-style: preserve-3d;
  }

  .services-grid::-webkit-scrollbar {
    display: none !important;
  }

  .service-card {
    flex: 0 0 88% !important;
    max-width: 88% !important;
    scroll-snap-align: center !important;
    margin: 0 !important;
    min-height: 420px !important;
    padding: 30px 25px !important;
    background-color: #ffffff !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08) !important;
    transform: scale(0.9) translateZ(-50px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 1px solid rgba(255, 76, 96, 0.1) !important;
  }

  .service-card.active {
    transform: scale(1) translateZ(0) translateY(-10px) !important;
    box-shadow:
      0 20px 60px rgba(255, 76, 96, 0.2),
      0 15px 40px rgba(0, 0, 0, 0.1) !important;
    border-color: rgba(255, 76, 96, 0.3) !important;
  }

  .service-card:first-child {
    margin-left: calc((100% - 88%) / 2) !important;
  }

  .service-card:last-child {
    margin-right: calc((100% - 88%) / 2) !important;
  }

  /* ===================================================================
     5. TERMINAL & CONTENT OPTIMIZATIONS
     =================================================================== */

  .Terminal__body {
    font-size: 14px !important;
    padding: 15px !important;
  }

  .terminal-content {
    padding: 10px !important;
  }

  /* ===================================================================
     6. FORMS & BUTTONS
     =================================================================== */

  .ios-form-control {
    font-size: 16px !important;
    padding: 15px 15px 15px 50px !important;
    -webkit-text-size-adjust: 100%;
  }

  .ios-button {
    width: 100% !important;
    padding: 15px 25px !important;
    font-size: 16px !important;
    margin-bottom: 15px;
  }

  /* ===================================================================
     7. GLOBE & CONTACT
     =================================================================== */

  #globe-container {
    max-width: 250px !important;
    margin: 30px auto !important;
  }

  /* ===================================================================
     8. COLLABORATORS
     =================================================================== */

  .collaborators-grid {
    padding: 0 20px;
  }

  .collaborator-logo {
    width: 100px !important;
    height: 40px !important;
  }

  /* ===================================================================
     9. FOOTER & LANGUAGE FLAGS
     =================================================================== */

  .footer {
    padding: 20px 15px !important;
    text-align: center;
  }

  .footer .list-inline {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
  }

  .footer .list-inline-item {
    margin: 0 !important;
  }

  /* ===================================================================
     10. DISABLE HOVER ON TOUCH DEVICES
     =================================================================== */

  @media (hover: none) {
    .service-card:hover,
    .ios-button:hover {
      transform: none !important;
    }

    .app-icon-parallax:hover {
      transform: none !important;
    }
  }

  /* ===================================================================
     11. TOUCH-FRIENDLY INTERACTIONS
     =================================================================== */

  @media (pointer: coarse) {
    a, button, .ios-button, .menu-icon button {
      min-height: 44px;
      min-width: 44px;
    }

    .social-icons a {
      padding: 10px;
      margin: 0 5px;
      font-size: 26px !important;
      width: 56px !important;
      height: 56px !important;
    }

    input, textarea, select {
      min-height: 48px;
    }
  }

  /* ===================================================================
     12. HOME SECTION
     =================================================================== */

  section.home {
    padding: 80px 0 !important;
    min-height: 100vh;
    overflow: visible !important;
  }

  /* ===================================================================
     13. VIEWPORT HEIGHT FIX
     =================================================================== */

  .home {
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
  }
}

/* ===================================================================
   SMALL MOBILE (max-width: 576px)
   =================================================================== */
@media screen and (max-width: 576px) {
  h1 { font-size: 24px !important; }
  h2.section-title { font-size: 20px !important; }

  section.home img.circle {
    width: 170px !important;
    height: 170px !important;
  }

  .social-icons a {
    font-size: 24px !important;
    width: 48px !important;
    height: 48px !important;
  }

  section { padding: 60px 0 !important; }

  .services-grid { grid-template-columns: 1fr !important; }

  .service-card {
    flex: 0 0 92% !important;
    max-width: 92% !important;
    min-height: 400px !important;
    padding: 25px 20px !important;
  }
}

/* ===================================================================
   LANDSCAPE MOBILE
   =================================================================== */
@media screen and (max-width: 991px) and (orientation: landscape) {
  header.mobile-header-1 .container {
    height: 36px;
  }

  main.content {
    padding-top: 48px;
  }

  section.home {
    padding: 60px 0 !important;
  }

  section.home img.circle {
    width: 140px !important;
    height: 140px !important;
  }

  h1 { font-size: 24px !important; }

  .text-rotating { display: none !important; }
}

/* ===================================================================
   iOS SPECIFIC FIXES
   =================================================================== */
@supports (-webkit-touch-callout: none) {
  @media screen and (max-width: 991px) {
    header.mobile-header-1 {
      padding: 3px 0 !important;
    }

    main.content {
      padding-top: 36px !important;
    }

    input, textarea, select {
      font-size: 16px !important;
    }

    button, .ios-button {
      -webkit-appearance: none;
    }

    header.desktop-header-1,
    main.content,
    header.mobile-header-1 {
      -webkit-transform: translate3d(0, 0, 0);
      -webkit-backface-visibility: hidden;
    }
  }
}

/* ===================================================================
   REDUCED MOTION SUPPORT
   =================================================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }

  .app-icon-parallax {
    transition: none !important;
  }
}

/* ===================================================================
   PERFORMANCE: Reduce animations & shadows
   =================================================================== */
@media screen and (max-width: 991px) {
  .wow {
    animation: none !important;
  }

  img {
    image-rendering: -webkit-optimize-contrast;
  }

  .shadow-dark {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1) !important;
  }
}

/* ===================================================================
   TOUCH FEEDBACK
   =================================================================== */
.touch-active {
  transform: scale(0.98) !important;
  opacity: 0.9 !important;
  transition: all 0.1s ease !important;
}

/* ===================================================================
   ACCESSIBILITY
   =================================================================== */
@media screen and (max-width: 991px) {
  body {
    color: #454360;
  }

  .vertical-menu a {
    padding: 15px 20px;
    font-size: 16px;
  }

  a:focus, button:focus, input:focus, textarea:focus {
    outline: 3px solid #ff4c60;
    outline-offset: 2px;
  }
}
