/* =========================================================
   Avori Website - Responsive Overrides
   UI area affected: tablet/mobile layouts across the full page.
   Purpose: overrides desktop CSS for narrower screens: header,
   hero, grids, metric carousel, cloud logos, footer, and mobile
   hero image behavior.
   Important: keep this file loaded last so these overrides win.
========================================================= */

/* Tablet and smaller: collapse desktop nav/grid layouts and stack hero content. */
@media (max-width: 1100px) {
  .container {
    width: min(100% - 34px, var(--container));
  }

  .nav-row {
    grid-template-columns: 1fr auto;
  }

  .nav-links {
    display: none;
  }

  .hero::before {
    opacity: .35;
    background-position: right -70px top 115px;
  }

  .hero-inner {
    flex-direction: column;
  }

  .hero-copy {
    max-width: 100%;
    width: 100%;
  }

  .hero-visual {
    width: 100%;
    min-width: 0;
  }

  .trust-pills {
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid,
.value-grid {
    grid-template-columns: 1fr;
  }

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

  .enterprise-row,
.env-row,
.faq-row,
.footer-row {
    grid-template-columns: 1fr;
  }

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

  .security-item {
    border-right: 0;
  }

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

  .value-item {
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.18);
    padding-right: 0;
  }

  .footer-links {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 18px;
  }

  .legal {
    text-align: left;
  }
}

/* Small tablet/mobile: adjust headline, logo, CTAs, and one-column grids. */
@media (max-width: 650px) {
  h1 {
    font-size: 47px;
  }

  .hero-inner {
    padding-top: 42px;
  }

  .brand-img {
    width: 178px;
  }

  .nav .btn {
    display: none;
  }

  .trust-pills,
.domain-grid,
.cloud-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}

/* About section breakpoint: stack About copy and card. */
@media (max-width: 1040px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile spacing and carousel/text refinements. */
@media (max-width: 640px) {
  .logo-cloud,
.impact-metrics,
.testimonials,
.about-us {
    padding: 62px 0;
  }

  .testimonial-card {
    min-width: 300px;
    max-width: 300px;
  }

  .promo-track {
    animation-duration: 18s;
  }
}

@media (max-width: 1100px) {
    /* Hero image column becomes full-width below desktop. */
.hero-visual {
    width: 100%;
    flex-basis: auto;
    min-width: 0;
    max-width: 620px;
  }
}

@media (max-width: 650px) {
    /* Smaller metric illustration boxes on narrow screens. */
.metric-visual {
    width: 96px;
    height: 74px;
  }
}

@media (max-width: 1100px) {
  .hero-visual {
    width: 100% !important;
    flex-basis: auto !important;
    min-width: 0 !important;
    max-width: 680px;
  }
}

@media (max-width: 650px) {
  .metric-visual {
    height: 118px;
  }
}

@media (max-width: 1100px) {
  .hero-copy {
    max-width: 100%;
  }

  .hero-visual {
    width: 100%;
    min-width: 0;
  }

    /* Metric carousel card width for tablets. */
.metric-slide {
    min-width: 290px;
    max-width: 290px;
    flex-basis: 290px;
  }
}

@media (max-width: 640px) {
  .metric-slide {
    min-width: 260px;
    max-width: 260px;
    flex-basis: 260px;
    padding: 22px 20px;
  }

  .metric-slide h3 {
    font-size: 22px;
  }
}

@media (max-width: 1100px) {
  .hero-copy {
    max-width: 100%;
  }

  .hero-visual {
    width: 100%;
    min-width: 0;
  }

  .metric-slide {
    min-width: 280px;
    max-width: 280px;
    flex-basis: 280px;
  }
}

@media (max-width: 640px) {
  .metric-slide {
    min-width: 250px;
    max-width: 250px;
    flex-basis: 250px;
    padding: 22px 20px;
  }

  .metric-slide h3 {
    font-size: 21px;
  }
}

@media (max-width: 640px) {
    /* Mobile metric loop tuning: faster/narrower/no edge mask. */
.metric-loop {
    --metric-gap: 16px;
    --metric-duration: 28s;
    mask-image: none;
    -webkit-mask-image: none;
  }

  .metric-loop .metric-slide {
    min-width: 250px;
    max-width: 250px;
    flex-basis: 250px;
  }
}

@media (max-width: 1100px) {
  .hero-inner {
    flex-direction: column;
    align-items: stretch;
    min-height: auto;
  }

  .hero-copy {
    max-width: 100%;
    width: 100%;
  }

    /* Final hero artwork container stacks below the text on tablet/mobile. */
.hero-visual-blended {
    width: 100%;
    min-width: 0;
    flex-basis: auto;
    align-self: stretch;
    min-height: 420px;
    justify-content: center;
  }

  .hero-art-frame {
    width: min(760px, 100%);
    transform: none;
    aspect-ratio: 1.32 / 1;
  }

  .wave-lines {
    right: 50%;
    transform: translateX(50%);
    bottom: -8px;
    opacity: .10;
  }
}

@media (max-width: 640px) {
  .hero-visual-blended {
    min-height: 330px;
  }

  .hero-art-frame {
    width: 112%;
    aspect-ratio: 1.24 / 1;
  }

  .hero-art-image {
    -webkit-mask-image: radial-gradient(ellipse 78% 74% at 58% 50%, #000 58%, rgba(0,0,0,.92) 72%, rgba(0,0,0,.38) 88%, transparent 100%);
    mask-image: radial-gradient(ellipse 78% 74% at 58% 50%, #000 58%, rgba(0,0,0,.92) 72%, rgba(0,0,0,.38) 88%, transparent 100%);
  }
}