/* ==========================================================================
   HYGI Air — Responsive overrides
   Breakpoints:
     1200px  small desktops / large tablets landscape
     1024px  tablets landscape
     860px   tablets portrait (mobile-menu cutover)
     640px   large phones
     480px   small/medium phones
     380px   very small phones
   ========================================================================== */

/* ----- Small desktops ----- */
@media (max-width: 1200px) {
  :root { --shell-pad: clamp(20px, 4vw, 32px); }

  .nav { gap: 32px; }
  .why { gap: 50px; }
  .footer__grid { gap: 32px; }
}

/* ----- Large tablets & small desktops ----- */
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(3, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .steps   { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .steps::before { display: none; }

  /* allow long titles to wrap below desktop to avoid horizontal overflow */
  .section__title { white-space: normal; }

  .why { grid-template-columns: 1fr; gap: 50px; }
  .why__media {
    order: 2;
    min-height: auto;
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
  }
  .why__media-stat { left: 0; bottom: -20px; }
  .why__media-badge { top: 16px; right: 16px; padding: 10px 14px 10px 10px; }

  .contact { grid-template-columns: 1fr; gap: 32px; }

  .footer__grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}

/* ----- Tablets (mobile menu kicks in) ----- */
@media (max-width: 860px) {
  :root { --header-h: 64px; }

  .section { padding: clamp(48px, 8vw, 64px) 0; }
  .section__head { margin-bottom: 40px; }

  /* ----- Header / Nav ----- */
  .nav { display: none; }
  .header__cta { display: none; }
  .nav-toggle { display: inline-flex; }

  /* Make hamburger always readable over hero */
  .site-header:not(.is-scrolled) .nav-toggle span { background: #fff; }

  .nav.is-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: 6px var(--shell-pad) 14px;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  .nav.is-open a {
    width: 100%;
    padding: 14px 4px;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
    color: var(--slate-700);
    text-shadow: none;
  }
  .nav.is-open a:last-child { border-bottom: 0; }
  .nav.is-open a::after { display: none; }
  .nav.is-open a:hover { color: var(--green-700); }

  /* ----- Hero ----- */
  .hero {
    min-height: 88vh;
    height: auto;
    padding-top: calc(var(--header-h) + 56px);
    padding-bottom: 120px;
  }
  .hero__content { max-width: 100%; }
  .hero__title { margin: 18px 0 14px; }
  .hero__lead { font-size: 16.5px; margin-bottom: 28px; }
  .hero__pills li { font-size: 13.5px; padding: 9px 14px; }

  .hero__arrow { width: 40px; height: 40px; opacity: 1; }
  .hero__arrow svg { width: 18px; height: 18px; }
  .hero__arrow--prev { left: 10px; }
  .hero__arrow--next { right: 10px; }

  .hero__dots {
    bottom: 28px;
    right: 50%;
    transform: translateX(50%);
    padding: 7px 12px;
  }
  .hero__veil {
    background: linear-gradient(
      180deg,
      rgba(11, 18, 32, 0.55) 0%,
      rgba(11, 18, 32, 0.55) 60%,
      rgba(11, 18, 32, 0.78) 100%
    );
  }

  /* ----- Trust ----- */
  .trust__inner { grid-template-columns: repeat(2, 1fr); gap: 30px 20px; }
  .trust__item + .trust__item::before { display: none; }

  /* ----- Features ----- */
  .features { gap: 20px; }
  .feature  { padding: 28px 24px 26px; }

  /* ----- Steps ----- */
  .step { padding: 24px 22px; }

  /* ----- Why / About ----- */
  .why__media-card { max-width: 100%; }
  .why__cta { gap: 12px; }

  /* ----- CTA Banner ----- */
  .cta-banner { padding: 48px 0; }
  .cta-banner__inner { gap: 24px; }
  .cta-banner h2 { font-size: clamp(22px, 4.5vw, 28px); }

  /* ----- Contact ----- */
  .contact__form { padding: 26px 22px; }
  .info-card { padding: 16px 18px; }

  /* ----- Footer ----- */
  .site-footer { padding-top: 56px; }
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding-bottom: 40px;
  }
  .footer__brand { grid-column: 1 / -1; }
  .footer__brand p { max-width: none; }
}

/* ----- Large phones ----- */
@media (max-width: 640px) {
  .grid--4 { grid-template-columns: 1fr 1fr; gap: 16px; }
  .grid--3 { grid-template-columns: 1fr; gap: 18px; }
  .steps   { grid-template-columns: 1fr; gap: 16px; }

  .section { padding: 56px 0; }
  .section__head { margin-bottom: 36px; }
  .section__title { font-size: clamp(24px, 7vw, 32px); }
  .section__sub  { font-size: 15.5px; }

  /* ----- Hero ----- */
  .hero {
    min-height: 84vh;
    padding-top: calc(var(--header-h) + 40px);
    padding-bottom: 110px;
  }
  .hero__title {
    font-size: clamp(28px, 9vw, 38px);
    margin: 16px 0 12px;
  }
  .hero__lead { font-size: 15.5px; line-height: 1.55; margin-bottom: 24px; }
  .hero__pills { gap: 8px; }
  .hero__pills li { font-size: 12.5px; padding: 8px 12px; }

  /* Hide side arrows on small phones — dots are enough */
  .hero__arrow { display: none; }
  .hero__dots { bottom: 22px; padding: 6px 10px; gap: 8px; }
  .hero__dot { width: 22px; height: 5px; }
  .hero__dot.is-active { width: 34px; }

  /* ----- Buttons ----- */
  .btn { padding: 13px 22px; font-size: 14.5px; }
  .why__cta { flex-direction: column; align-items: stretch; }
  .why__cta .btn { width: 100%; }

  /* ----- Features ----- */
  .features { gap: 16px; }
  .feature  { padding: 26px 22px 22px; border-radius: var(--radius-lg); }
  .feature::before { height: 3px; }
  .feature::after  { top: -40px; right: -40px; width: 140px; height: 140px; opacity: 1; transform: scale(1); }
  .feature__icon {
    width: 52px; height: 52px; border-radius: 14px; margin-bottom: 16px;
    box-shadow: 0 10px 22px -10px rgba(22, 163, 74, 0.5);
  }
  .feature__icon svg { width: 24px; height: 24px; }
  .feature h3 { font-size: 18px; margin-bottom: 8px; }
  .feature p  { font-size: 14.5px; line-height: 1.6; }
  /* On touch devices, show the top gradient bar without needing hover */
  .feature::before { transform: scaleX(1); }

  /* ----- Steps ----- */
  .step { padding: 22px 20px; }
  .step__num { width: 46px; height: 46px; font-size: 16px; border-radius: 12px; margin-bottom: 14px; }

  /* ----- Solutions ----- */
  .solution { padding: 22px 18px; }
  .solution__ico { width: 46px; height: 46px; border-radius: 12px; }
  .solution__ico svg { width: 22px; height: 22px; }

  /* ----- Why ----- */
  .why { gap: 36px; }
  .why__media { max-width: 100%; }
  .why__media-img { border-radius: var(--radius-lg); }
  .why__media-card { border-radius: var(--radius-lg); }
  .why__media-badge {
    top: 12px;
    right: 12px;
    padding: 8px 12px 8px 8px;
    gap: 10px;
  }
  .why__media-badge-ico { width: 30px; height: 30px; }
  .why__media-badge-ico svg { width: 16px; height: 16px; }
  .why__media-badge strong { font-size: 13px; }
  .why__media-badge span  { font-size: 11px; }
  .why__media-stat {
    left: 12px;
    bottom: -18px;
    padding: 14px 18px;
    min-width: 138px;
  }
  .why__media-stat-num { font-size: 28px; }
  .why__media-stat-num small { font-size: 18px; }
  .why__media-stat-lbl { font-size: 12px; }

  /* ----- CTA Banner ----- */
  .cta-banner { padding: 44px 0; }
  .cta-banner__inner {
    text-align: center;
    justify-content: center;
    gap: 18px;
  }
  .cta-banner__inner > div { width: 100%; }
  .cta-banner h2 { font-size: clamp(22px, 6vw, 26px); }
  .cta-banner p  { font-size: 15px; }
  .cta-banner .btn { width: 100%; }

  /* ----- Contact ----- */
  .contact { gap: 24px; }
  .contact__form { padding: 22px 18px; border-radius: var(--radius-lg); }
  .field input,
  .field select,
  .field textarea { padding: 12px 13px; font-size: 15px; }
  .field-row { grid-template-columns: 1fr; gap: 14px; }
  .info-card { grid-template-columns: 44px 1fr; gap: 12px; padding: 14px 16px; }
  .info-card__ico { width: 44px; height: 44px; border-radius: 12px; }
  .info-card__ico svg { width: 20px; height: 20px; }
  .info-card strong { font-size: 14.5px; }
  .map iframe { height: 200px; }

  /* ----- Footer ----- */
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px 20px;
    padding-bottom: 32px;
  }
  .footer__brand { grid-column: 1 / -1; }
  .footer__col:last-child { grid-column: 1 / -1; }
  .footer__col h5 { margin-bottom: 12px; }
  .footer__base {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 6px;
  }

  /* ----- To top ----- */
  .to-top {
    right: 14px;
    bottom: 14px;
    width: 42px; height: 42px;
  }
  .to-top svg { width: 18px; height: 18px; }
}

/* ----- Small phones ----- */
@media (max-width: 480px) {
  .grid--4 { grid-template-columns: 1fr; }

  .shell { padding-left: 18px; padding-right: 18px; }

  .brand__logo { height: 32px; }
  .nav-toggle { width: 38px; height: 38px; }

  .hero { padding-bottom: 100px; }
  .hero__title { font-size: clamp(26px, 8.5vw, 34px); }
  .hero__lead  { font-size: 15px; }
  .hero__pills li { font-size: 12px; padding: 7px 12px; }

  .section__title { font-size: clamp(22px, 6.5vw, 28px); }

  .feature h3, .step h3 { font-size: 17px; }
  .solution h4 { font-size: 15.5px; }

  .contact__form { padding: 20px 16px; }
  .info-card strong { font-size: 14px; word-break: break-word; }
}

/* ----- Very small phones ----- */
@media (max-width: 380px) {
  .btn { padding: 12px 18px; font-size: 14px; }
  .hero__pills li { font-size: 11.5px; padding: 6px 10px; }
  .hero__dot { width: 18px; }
  .hero__dot.is-active { width: 28px; }
  .why__media-badge span { display: none; }
}

/* ----- Short landscape phones ----- */
@media (max-height: 520px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    height: auto;
    padding-top: calc(var(--header-h) + 30px);
    padding-bottom: 80px;
  }
  .hero__title { font-size: clamp(24px, 5vw, 34px); margin: 12px 0 10px; }
  .hero__lead  { margin-bottom: 18px; }
  .hero__dots  { bottom: 16px; }
}

/* ----- Touch devices: keep hero arrows visible without hover ----- */
@media (hover: none) {
  .hero__arrow { opacity: 1; }
}

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