@media (max-width: 767.98px) {
  h1, .h1 { 
    font-size: 2.5rem; 
    line-height: 1.2;
  }
  
  h2, .h2 { 
    font-size: 2rem;
    line-height: 1.3;
  }
  
  h3, .h3 { 
    font-size: 1.75rem;
    line-height: 1.4;
  }

  .lead {
    font-size: 1.1rem;
  }
  
  .section-padding {
    padding: 4rem 0;
  }
  
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .navbar {
    padding: 0.75rem 0;
  }

  .navbar-brand {
    font-size: 1.25rem;
  }

  .navbar-toggler {
    border: none;
    padding: 0.5rem;
    color: var(--text-primary);
  }

  .navbar-toggler:focus {
    box-shadow: none;
  }

  .offcanvas {
    max-width: 300px;
    background-color: var(--bg-primary);
  }

  .offcanvas .nav-link {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: var(--border-radius);
  }

  .offcanvas .nav-link i {
    width: 24px;
  }

  .hero {
    padding-top: 5rem;
    text-align: center;
  }

  .hero .badge {
    margin-bottom: 1.5rem;
  }

  .hero-image {
    margin-top: 2rem;
    max-width: 100%;
    height: auto;
  }

  .hero .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  .stats-card {
    padding: 1.5rem;
    margin-bottom: 1rem;
  }

  .expertise-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: left;
  }

  .expertise-icon {
    margin: 0 0 1.5rem 0;
  }

  .project-card {
    margin-bottom: 1.5rem;
    height: 300px;
  }

  .project-content {
    opacity: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
    transform: none;
    justify-content: flex-end;
  }

  .project-content h3 {
    font-size: 1.25rem;
  }

  .project-content p {
    font-size: 0.9rem;
  }

  .project-tags .badge {
    font-size: 0.75rem;
  }

  .skills-grid {
    gap: 1.5rem;
  }

  .skill-item {
    padding: 1.25rem;
  }

  .testimonial-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .contact-info {
    margin-bottom: 2rem;
  }

  .contact-form-wrapper {
    padding: 1.5rem;
  }

  .form-floating > label {
    padding: 0.75rem;
  }

  .form-control {
    font-size: 16px; 
    padding: 0.75rem;
  }

  .footer {
    text-align: center;
  }

  .footer-title {
    margin-top: 2rem;
  }

  .footer-title::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .footer-links {
    text-align: center;
  }

  .footer-links a {
    justify-content: center;
  }

  .social-links {
    justify-content: center;
    margin: 1.5rem 0;
  }

  .scroll-top {
    width: 40px;
    height: 40px;
    right: 1rem;
    bottom: 1rem;
  }

  .company-logo {
    max-height: 30px;
    width: auto;
  }

  .form-control, .btn {
    min-height: 44px; 
  }

  img {
    max-width: 100%;
    height: auto;
  }

  .filter-buttons {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    -webkit-overflow-scrolling: touch;
  }

  .filter-btn {
    flex: 0 0 auto;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
  }
  
  /* Front-end projects section responsive styles */
  .yp-project-card {
    margin-bottom: 1rem;
  }
  
  .yp-card-img-container {
    height: 120px;
  }
  
  .yp-project-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.4), transparent);
    justify-content: flex-end;
    align-items: flex-start;
    padding: 0.5rem;
  }
  
  .yp-project-overlay p {
    display: none;
  }
  
  .dark-mode .yp-project-card {
    background-color: var(--card-bg);
  }
  
  .dark-mode .yp-project-content {
    background-color: var(--card-bg);
    color: var(--text-primary);
  }
}

.project-card-mobile {
  background-color: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.project-content-mobile {
  padding: 1.5rem;
}

.project-content-mobile h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.project-content-mobile p {
  font-size: 0.97rem;
  line-height: 1.6;
}

@media (max-width: 575.98px) {
  .project-content-mobile p {
    font-size: 0.91rem;
  }
}

.dark-mode .project-card-mobile {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .section-padding {
    padding: 5rem 0;
  }

  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .hero {
    padding-top: 6rem;
  }

  .expertise-card,
  .project-card,
  .testimonial-card {
    margin-bottom: 2rem;
  }
}

@media (hover: none) {
  .expertise-card:hover,
  .project-card:hover,
  .testimonial-card:hover {
    transform: none;
  }

  .project-content {
    opacity: 1;
    transform: none;
  }

  .btn:active {
    transform: scale(0.98);
  }
}

@media (max-width: 767.98px) {

  .navbar > .container {
    padding-left: 1rem;
    padding-right: 1rem;
    flex-wrap: nowrap;
}

.navbar-toggler {
    order: 2; 
}

.navbar-brand img {
    width: 35px;
}

  .loading {
    min-height: 200px;
    position: relative;
    overflow: hidden;
  }

  .loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.2),
      transparent
    );
    animation: loading 1.5s infinite;
  }
}

@media print {
  .navbar,
  .scroll-top,
  .social-links,
  .btn {
    display: none !important;
  }

  .section-padding {
    padding: 1rem 0 !important;
  }

  .container {
    max-width: 100% !important;
    width: 100% !important;
  }
}

  @media (max-width: 399px) {
      .hero-image-container {
          display: none !important;
      }
  }