/* ========================================
   Responsive — Mobile-first media queries
   ======================================== */

/* --- Mobile (max 768px) --- */
@media (max-width: 768px) {

  /* Navigation mobile */
  .nav__toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background-color: var(--color-white);
    flex-direction: column;
    align-items: flex-start;
    padding: 6rem var(--space-xl) var(--space-xl);
    box-shadow: var(--shadow-xl);
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    z-index: var(--z-overlay);
  }

  .nav.is-open {
    transform: translateX(0);
  }

  .nav__overlay {
    display: block;
    position: fixed;
    inset: 0;
    background-color: rgba(9, 18, 23, 0.5);
    z-index: var(--z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
  }

  .nav__overlay.is-visible {
    opacity: 1;
    visibility: visible;
  }

  .nav__list {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 0;
  }

  .nav__link,
  .nav__dropdown-toggle {
    padding: var(--space-md) 0;
    font-size: var(--text-base);
    width: 100%;
    border-bottom: 1px solid var(--color-gray-bg);
  }

  .nav__item--dropdown {
    width: 100%;
  }

  .nav__dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding: 0 0 0 var(--space-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
  }

  .nav__item--dropdown.is-open .nav__dropdown {
    max-height: 300px;
  }

  .nav .btn {
    margin-top: var(--space-lg);
    width: 100%;
  }

  /* Hero */
  .hero__inner {
    flex-direction: column;
    text-align: center;
  }

  .hero__content {
    max-width: 100%;
  }

  .hero__subtitle {
    max-width: 100%;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__visual {
    display: none;
  }

  /* Stats */
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl) var(--space-lg);
  }

  /* Steps */
  .steps {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .step:not(:last-child)::after {
    display: none;
  }

  /* Services */
  .services-grid,
  .services-grid--4 {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  /* About brief */
  .about-brief {
    flex-direction: column;
    text-align: center;
  }

  .about-brief__visual {
    width: 200px;
    height: 200px;
    order: -1;
  }

  /* Contact */
  .contact-section {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .form__row {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }

  /* Content blocks (sub-pages) */
  .content-block,
  .content-block--reverse {
    flex-direction: column;
  }

  .content-block__visual {
    width: 100%;
    height: 200px;
    order: -1;
  }

  /* Values */
  .values-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  /* Profile */
  .profile {
    flex-direction: column;
    text-align: center;
  }

  .profile__photo {
    width: 180px;
    height: 180px;
  }

  /* CTA Banner */
  .cta-banner__title {
    font-size: var(--text-2xl);
  }
}

/* --- Tablet (max 1024px) --- */
@media (max-width: 1024px) and (min-width: 769px) {

  .nav__toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    height: 100vh;
    background-color: var(--color-white);
    flex-direction: column;
    align-items: flex-start;
    padding: 6rem var(--space-xl) var(--space-xl);
    box-shadow: var(--shadow-xl);
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    z-index: var(--z-overlay);
  }

  .nav.is-open {
    transform: translateX(0);
  }

  .nav__overlay {
    display: block;
    position: fixed;
    inset: 0;
    background-color: rgba(9, 18, 23, 0.5);
    z-index: var(--z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
  }

  .nav__overlay.is-visible {
    opacity: 1;
    visibility: visible;
  }

  .nav__list {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 0;
  }

  .nav__link,
  .nav__dropdown-toggle {
    padding: var(--space-md) 0;
    font-size: var(--text-base);
    width: 100%;
  }

  .nav__item--dropdown {
    width: 100%;
  }

  .nav__dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding: 0 0 0 var(--space-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
  }

  .nav__item--dropdown.is-open .nav__dropdown {
    max-height: 300px;
  }

  .nav .btn {
    margin-top: var(--space-lg);
    width: 100%;
  }

  /* Services */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .services-grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .services-grid > :last-child {
    grid-column: 1 / -1;
    max-width: 50%;
    margin: 0 auto;
  }

  .services-grid--4 > :last-child {
    grid-column: auto;
    max-width: 100%;
    margin: 0;
  }

  /* Stats */
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Steps */
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .step:not(:last-child)::after {
    display: none;
  }

  /* Footer */
  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2xl);
  }

  /* Content blocks */
  .content-block__visual {
    width: 280px;
    height: 240px;
  }

  /* Values */
  .values-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Large screens --- */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
}
