/* ===== RESPONSIVE DESIGN ===== */


/* ===== LARGE DEVICES (1024px and up) ===== */
@media screen and (min-width: 1024px) {
  .container {
    margin-left: auto;
    margin-right: auto;
  }
  
  .section {
    padding: 6rem 0 2rem;
  }
  
  .section__title {
    font-size: 2.5rem;
  }
  
  .hero__title {
    font-size: 4rem;
  }
  
  .nav__list {
    column-gap: 3rem;
  }
}

/* ===== MEDIUM DEVICES (768px and up) ===== */
@media screen and (min-width: 768px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  
  .section {
    padding: 5rem 0 2rem;
  }
  
  .section__title {
    font-size: 2rem;
  }
  
  .hero__title {
    font-size: 3rem;
  }
  
  .services__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .projects__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .contact__container {
    grid-template-columns: 1fr 1fr;
  }
  
  .footer__content {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* ===== SMALL DEVICES (576px and up) ===== */
@media screen and (min-width: 576px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .hero__buttons {
    flex-direction: row;
  }
  
  .about__stats {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .contact__info {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .contact__item {
    flex: 1;
    min-width: 250px;
  }
}

/* ===== MOBILE DEVICES (up to 767px) ===== */
@media screen and (max-width: 767px) {
  /* Navigation */
  .nav__menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    height: 100vh;
    background: var(--bg-color);
    padding: 4rem 0 0 3rem;
    transition: var(--transition);
    box-shadow: var(--shadow-medium);
    z-index: var(--z-fixed);
  }
  
  .nav__menu.show {
    right: 0;
  }
  
  .nav__list {
    flex-direction: column;
    row-gap: 2rem;
  }
  
  .nav__link {
    font-size: var(--h3-font-size);
    font-weight: var(--font-semi-bold);
    color: var(--text-color-dark);
  }
  
  .nav__toggle,
  .nav__close {
    display: none;
  }
  
  .nav__close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
  }
  
  /* Hero Section */
  .hero {
    padding: 4rem 0 2rem;
  }
  
  .hero__container {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  
  .hero__title {
    font-size: 2.5rem;
  }
  
  .hero__logo-top {
    display: block;
    text-align: center;
    margin-bottom: 2rem;
  }

  .hero__logo-top-img {
    width: 200px;
    height: 200px;
  }

  .hero__logo {
    display: none;
  }
  
  .hero__buttons {
    justify-content: center;
    flex-direction: column;
    align-items: center;
  }
  
  .hero__buttons .btn {
    width: 100%;
    max-width: 300px;
  }
  
  /* Services */
  .services__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .service__card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .service__header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    width: 100%;
  }
  
  .service__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
  }
  
  .service__icon-image {
    width: 280px !important;
    height: 280px !important;
    object-fit: cover !important;
    border-radius: var(--border-radius-lg) !important;
    box-shadow: var(--shadow-medium) !important;
  }
  
  .service__title {
    font-size: var(--h2-font-size);
    margin-bottom: 1rem;
    color: var(--text-color-dark);
  }
  
  .service__description {
    color: #333;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    text-align: center;
  }
  
  /* About */
  .about__container {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  
  .about__stats {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .stat__item {
    padding: 1.5rem;
  }
  
  /* Projects */
  .projects__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  /* References Grid */
  .references__grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.8rem;
  }
  
  .project__img {
    height: 200px;
  }
  
  /* Contact Options */
  .contact__options {
    flex-direction: column;
    gap: 0.8rem;
  }
  
  .contact__options .btn {
    width: 100%;
  }
  
  /* Contact */
  .contact__container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .contact__info {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .contact__item {
    min-height: auto;
  }
  
  .contact__item {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .contact__form {
    padding: 1.5rem;
  }
  
  /* About Image */
  .about__img {
    width: 256px;
    height: 256px;
  }
  
  /* Footer */
  .footer__content {
    flex-direction: column;
    gap: 2rem;
    text-align: center;
  }
  
  .footer__social {
    justify-content: center;
  }
  
  .footer__bottom {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .footer__legal {
    justify-content: center;
  }
  
  /* Page Header */
  .page-header {
    padding: 4rem 0 2rem;
  }
  
  .page-header__title {
    font-size: 2.5rem;
  }
  
  .breadcrumb {
    flex-wrap: wrap;
  }
  
  /* Section Titles */
  .section__title {
    font-size: 1.75rem;
  }
  
  .section__subtitle {
    font-size: var(--small-font-size);
  }
  
  /* Buttons */
  .btn {
    padding: 0.75rem 1.25rem;
    font-size: var(--small-font-size);
  }
  
  /* Scroll to Top */
  .scroll-top {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }
}

/* ===== EXTRA SMALL DEVICES (up to 575px) ===== */
@media screen and (max-width: 575px) {
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  .section {
    padding: 3rem 0 1.5rem;
  }
  
  .hero__title {
    font-size: 2rem;
  }
  
  .hero__description {
    font-size: var(--small-font-size);
  }
  
  .service__card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .service__header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    margin-bottom: 1rem;
    width: 100%;
  }
  
  .service__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
  }
  
  .service__icon-image {
    width: 250px !important;
    height: 250px !important;
    object-fit: cover !important;
    border-radius: var(--border-radius-lg) !important;
    box-shadow: var(--shadow-medium) !important;
  }
  
  .service__title {
    font-size: var(--h3-font-size);
    margin-bottom: 0.5rem;
    color: var(--text-color-dark);
  }
  
  .service__description {
    color: #333;
    margin-bottom: 1rem;
    line-height: 1.6;
    text-align: center;
    font-size: var(--small-font-size);
  }
  
  .project__content {
    padding: 1rem;
  }
  
  .contact__form {
    padding: 1rem;
  }
  
  .form__input {
    padding: 0.75rem;
  }
  
  .page-header__title {
    font-size: 2rem;
  }
  
  .section__title {
    font-size: 1.5rem;
  }
  
  .nav__menu {
    width: 100%;
    padding: 4rem 0 0 2rem;
  }
  
  .nav__close {
    right: 1rem;
  }
}

/* ===== LANDSCAPE ORIENTATION ===== */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding: 2rem 0;
  }
  
  .hero__container {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  
  .hero__title {
    font-size: 2rem;
  }
  
  .hero__description {
    font-size: var(--small-font-size);
  }
  
  .page-header {
    padding: 2rem 0;
  }
  
  .page-header__title {
    font-size: 2rem;
  }
}

/* ===== HIGH DPI DISPLAYS ===== */
@media screen and (-webkit-min-device-pixel-ratio: 2),
       screen and (min-resolution: 192dpi) {
  .hero__img,
  .about__img,
  .project__img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .header,
  .nav__toggle,
  .nav__close,
  .scroll-top,
  .footer__social,
  .btn {
    display: none !important;
  }
  
  .main {
    margin-top: 0;
  }
  
  .section {
    padding: 1rem 0;
    page-break-inside: avoid;
  }
  
  .hero {
    background: none;
    padding: 1rem 0;
  }
  
  .hero__title {
    color: var(--black-color);
  }
  
  .service__card,
  .project__card,
  .contact__item {
    box-shadow: none;
    border: 1px solid var(--gray);
  }
  
  .footer {
    background: none;
    color: var(--black-color);
  }
  
  .footer__link {
    color: var(--black-color);
  }
}

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

@media (prefers-color-scheme: dark) {
  :root {
    --white-color: #1a1a1a;
    --light-gray: #2d2d2d;
    --gray: #404040;
    --text-color: #ffffff;
    --text-color-light: #cccccc;
    --text-color-lighter: #999999;
  }
  
  .hero {
    background: linear-gradient(135deg, #2d2d2d 0%, #404040 100%);
  }
  
  .service__card,
  .project__card,
  .contact__item,
  .contact__form {
    background: var(--light-gray);
    border-color: var(--gray);
  }
}

/* ===== FOCUS STYLES FOR ACCESSIBILITY ===== */
@media (prefers-reduced-motion: no-preference) {
  .btn:focus,
  .nav__link:focus,
  .form__input:focus,
  .scroll-top:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
  }
}

/* ===== CONTAINER QUERIES (Future-proofing) ===== */
@supports (container-type: inline-size) {
  .services__grid {
    container-type: inline-size;
  }
  
  @container (max-width: 300px) {
    .service__card {
      padding: 1rem;
    }
    
    .service__icon {
      width: 50px;
      height: 50px;
      font-size: 1.25rem;
    }
  }
}

/* ===== GRID FALLBACKS ===== */
@supports not (display: grid) {
  .hero__container,
  .about__container,
  .contact__container,
  .services__grid,
  .projects__grid {
    display: flex;
    flex-wrap: wrap;
  }
  
  .hero__content,
  .hero__image,
  .about__content,
  .about__image,
  .contact__info,
  .contact__form {
    flex: 1;
    min-width: 300px;
  }
  
  .service__card,
  .project__card {
    flex: 1;
    min-width: 300px;
    margin-bottom: 2rem;
  }
}

/* ===== FLEXBOX FALLBACKS ===== */
@supports not (display: flex) {
  .nav,
  .hero__buttons,
  .contact__item,
  .footer__bottom {
    display: block;
  }
  
  .nav__logo,
  .nav__list {
    display: inline-block;
    vertical-align: middle;
  }
  
  .nav__list li {
    display: inline-block;
    margin-right: 1rem;
  }
  
  .hero__buttons .btn {
    display: inline-block;
    margin-right: 1rem;
    margin-bottom: 1rem;
  }
  
}





