/* Home V1 responsive refinements and viewport-specific adjustments. */
@media (min-width: 1040px) and (max-height: 900px) {
  .home-v1-hero {
    --home-v1-hero-portrait-max-height: min(50vh, 28rem);
    gap: 2.25rem;
  }

  .home-v1-section--hero {
    padding: 2rem 0 1.5rem;
  }

  .home-v1-hero__visual-frame {
    width: min(
      100%,
      32rem,
      calc(var(--home-v1-hero-portrait-max-height) * 1.1)
    );
  }

  .home-v1-hero__portrait {
    padding: 0.25rem 0.25rem 0;
  }

  .home-v1-hero__portrait img,
  .home-v1-hero__image-placeholder {
    max-width: 100%;
  }

  .home-v1-hero__content {
    gap: 1rem;
  }

  .home-v1-hero__description {
    line-height: 1.45;
  }

  .home-v1-hero__actions .home-v1-button {
    min-height: 3.3rem;
    padding: 0.8rem 1.6rem;
  }

  .home-v1-stat-card {
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    padding: 0.9rem 1rem;
  }
}

@media (max-width: 1120px) {
  .home-v1-section--hero {
    padding: clamp(1.25rem, 3vh, 2rem) 0 clamp(0.85rem, 2.2vh, 1.5rem);
  }

  .site-header__inner--home-v1,
  .site-footer__inner--home-v1,
  .home-v1-shell {
    padding-inline: 4.25rem;
  }

  .main-navigation--home-v1 ul {
    gap: 1rem;
  }

  .home-v1-about,
  .home-v1-contact {
    grid-template-columns: 1fr;
  }

  .home-v1-contact {
    gap: 3rem;
  }

  .home-v1-projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-v1-team-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .home-v1-stat-card {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }

  .site-footer__inner--home-v1 {
    grid-template-columns: 1fr;
  }

  .site-footer__meta {
    width: 100%;
  }

  .site-footer__menus {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer__utility {
    flex-direction: column-reverse;
    align-items: flex-start;
  }

  .site-footer--home-v1 .site-footer__translate {
    justify-content: flex-start;
    width: 100%;
    max-width: 20rem;
  }

  .site-footer--home-v1 .site-footer__translate-mount {
    flex: 1 1 auto;
    max-width: none;
  }

  .site-footer--home-v1
    .site-footer__translate-mount
    .goog-te-gadget
    .goog-te-combo,
  .site-footer--home-v1
    .site-footer__translate-mount
    .goog-te-gadget-simple
    .goog-te-menu-value {
    max-width: none !important;
  }

  .site-header__translate {
    align-self: flex-end;
    margin-left: 0;
  }
}

@media (min-width: 768px) and (max-width: 1120px) {
  .site-header__inner--home-v1 {
    padding-inline: 1.5rem;
  }

  .site-header__nav-group {
    flex-wrap: nowrap;
    gap: 0.5rem 0.75rem;
  }

  .main-navigation--home-v1 ul {
    gap: 0.8rem;
  }

  .site-header__translate {
    align-self: center;
  }

  .home-v1-section--hero {
    justify-content: center;
    padding: 1.35rem 0 1rem;
  }

  /* Same element: .home-v1-shell.home-v1-hero — flex + justify-content spaces copy vs portrait like desktop grid */
  .home-v1-hero {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    --home-v1-hero-visual-max-width: 38rem;
    --home-v1-hero-portrait-max-height: min(58vh, 35rem);
  }

  .home-v1-hero__content {
    flex: 1 1 auto;
    min-width: 0;
    order: 1;
    max-width: 34rem;
    gap: 1.05rem;
    margin-top: 0;
    padding: 0;
    border-radius: 0;
    background: none;
    backdrop-filter: none;
  }

  .home-v1-pill-label {
    padding: 0.35rem 0.75rem;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
  }

  .home-v1-hero__title {
    font-size: clamp(2.05rem, 4.45vw, 3.15rem);
    line-height: 1.16;
  }

  .home-v1-hero__description {
    max-width: 30rem;
    font-size: 1.06rem;
    line-height: 1.42;
  }

  .home-v1-hero__actions {
    gap: 0.75rem;
  }

  .home-v1-hero__actions .home-v1-button {
    min-height: 3.15rem;
    padding: 0.82rem 1.35rem;
    font-size: 1rem;
    border-radius: 2rem;
  }

  .home-v1-stat-card {
    left: 0.7rem;
    right: 0.7rem;
    bottom: 0.7rem;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
  }

  .home-v1-stat-card__value {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
  }

  .home-v1-stat-card__avatars span {
    width: 2rem;
    height: 2rem;
  }

  .home-v1-hero__visual {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    order: 2;
    justify-content: flex-end;
  }
}

@media (min-width: 768px) and (max-width: 1120px) and (orientation: portrait) {
  .home-v1-section--hero {
    justify-content: center;
    padding: clamp(1.5rem, 4.5vh, 3rem) 0;
  }

  .home-v1-hero {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    align-items: center;
    align-content: center;
    gap: 1.2rem;
    width: min(100%, 40rem);
    margin-inline: auto;
    --home-v1-hero-visual-max-width: min(96vw, 44rem);
    --home-v1-hero-portrait-max-height: min(66vh, 44rem);
  }

  .home-v1-hero__content {
    order: 1;
    width: 100%;
    max-width: 34rem;
    justify-items: center;
    gap: 1.1rem;
    text-align: center;
  }

  .home-v1-hero__title {
    max-width: none;
    font-size: clamp(2.3rem, 5.55vw, 3.5rem);
  }

  .home-v1-hero__description {
    max-width: 31rem;
    font-size: 1.08rem;
    line-height: 1.42;
  }

  .home-v1-hero__actions {
    justify-content: center;
  }

  .home-v1-hero__actions .home-v1-button {
    min-height: 3.2rem;
    padding: 0.82rem 1.45rem;
    font-size: 1rem;
  }

  .home-v1-hero__visual {
    order: 2;
    width: 100%;
    justify-content: center;
  }

  .home-v1-stat-card {
    left: 0.7rem;
    right: 0.7rem;
    bottom: 0.7rem;
  }
}

@media (max-width: 860px) {
  .site-header__nav-group {
    flex-direction: column;
    align-items: flex-start;
  }

  .main-navigation--home-v1 ul {
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 0.75rem;
  }

  .home-v1-section--hero,
  .home-v1-section--competencies,
  .home-v1-section--problems-we-solve,
  .home-v1-section--about,
  .home-v1-section--contact {
    padding: 2rem 0;
  }

  .home-v1-section--hero {
    padding: 0.85rem 0;
  }

  .home-v1-section--problems-we-solve {
    padding: 1.25rem 0;
  }

  .home-v1-section--projects {
    padding: 2rem 0 2.5rem;
  }

  .home-v1-section--team {
    padding: 2rem 0;
  }

  .home-v1-split-heading__main {
    flex-wrap: wrap;
  }

  .home-v1-team-layout,
  .home-v1-form-placeholder__row {
    grid-template-columns: 1fr;
  }

  .home-v1-projects-scroll {
    margin-inline: -1.25rem;
    padding-inline: 1.25rem;
  }

  .home-v1-projects-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 1.5rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-inline-end: 1rem;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .home-v1-projects-grid .home-v1-project-card {
    flex: 0 0 auto;
    scroll-snap-align: start;
    width: min(22rem, 88vw);
  }

  .home-v1-hero__title {
    max-width: none;
  }

  .home-v1-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    --home-v1-hero-visual-max-width: min(100vw, 32rem);
    --home-v1-hero-portrait-max-height: min(60vh, 28rem);
  }

  .home-v1-hero__visual {
    width: 100%;
    order: 1;
    justify-content: center;
  }

  .home-v1-hero__content {
    order: 2;
    position: relative;
    z-index: 2;
    margin-top: -3rem;
    gap: 0.7rem;
    padding: 0.85rem 0.95rem;
    border-radius: 1.25rem;
    background: linear-gradient(
      180deg,
      rgba(0, 63, 110, 0.82) 0%,
      rgba(0, 63, 110, 0.66) 100%
    );
    backdrop-filter: blur(4px);
  }

  .home-v1-pill-label {
    padding: 0.3rem 0.6rem;
    font-size: 0.58rem;
    letter-spacing: 0.08em;
  }

  .home-v1-hero__title {
    font-size: clamp(1.64rem, 6.9vw, 2.25rem);
    line-height: 1.16;
  }

  .home-v1-hero__description {
    font-size: 0.92rem;
    line-height: 1.34;
  }

  .home-v1-hero__actions {
    gap: 0.5rem;
  }

  .home-v1-hero__actions .home-v1-button {
    min-height: 2.8rem;
    padding: 0.68rem 0.95rem;
    font-size: 0.88rem;
    border-radius: 2rem;
  }

  .home-v1-stat-card {
    left: 0.6rem;
    right: 0.6rem;
    bottom: 0.6rem;
    padding: 0.5rem 0.7rem;
    border-radius: 0.75rem;
    gap: 0.5rem;
  }

  .home-v1-stat-card__label {
    margin: 0 0 0.15rem;
    font-size: 0.58rem;
  }

  .home-v1-stat-card__value {
    font-size: 1rem;
  }

  .home-v1-stat-card__avatars span {
    width: 1.55rem;
    height: 1.55rem;
    margin-left: -0.45rem;
  }

  .home-v1-section--contact .home-v1-form-shell p:has(input[type="submit"]),
  .home-v1-section--contact .home-v1-form-shell p:has(button[type="submit"]) {
    justify-content: stretch;
  }

  .home-v1-section--contact .home-v1-form-shell input[type="submit"],
  .home-v1-section--contact .home-v1-form-shell button[type="submit"] {
    width: 100%;
    min-width: 0;
  }

  .home-v1-contact__email--after-form {
    align-items: center;
    text-align: center;
  }

  .home-v1-form-placeholder--contact .home-v1-form-placeholder__actions {
    justify-content: stretch;
  }

  .home-v1-form-placeholder--contact .home-v1-form-placeholder__submit {
    width: 100%;
    min-width: 0;
  }

  .home-v1-final-cta__content {
    padding: 4rem 2rem;
  }

  .site-footer__menus {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 560px) {
  .aiagency-wez-home-v1-template {
    --home-v1-header-logo-max-height: 4.125rem;
  }

  .home-v1-shell {
    width: min(calc(100% - 1rem), 1280px);
    padding-inline: 0.5rem;
  }

  .home-v1-projects-scroll {
    margin-inline: -0.5rem;
    padding-inline: 0.5rem;
  }

  .site-header__inner--home-v1,
  .site-footer__inner--home-v1 {
    width: min(calc(100% - 1rem), 1280px);
    padding-inline: 0.5rem;
  }

  .site-footer__contact-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .site-header__inner--home-v1 {
    min-height: var(--home-v1-header-height);
  }

  .home-v1-hero__actions,
  .home-v1-button,
  .home-v1-button--inverse,
  .site-header__cta {
    width: 100%;
  }

  .home-v1-hero {
    --home-v1-hero-visual-max-width: min(100vw, 28rem);
    --home-v1-hero-portrait-max-height: min(58vh, 24rem);
  }

  .home-v1-hero__content {
    margin-top: -2.5rem;
    gap: 0.55rem;
    padding: 0.68rem 0.72rem;
  }

  .home-v1-section--hero {
    padding: 0.5rem 0;
  }

  .home-v1-hero__title {
    font-size: clamp(1.42rem, 7.5vw, 1.87rem);
  }

  .home-v1-hero__description {
    font-size: 0.86rem;
    line-height: 1.32;
  }

  .home-v1-hero__actions .home-v1-button {
    min-height: 2.45rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.8rem;
  }

  .home-v1-hero__visual-frame {
    transform: none;
  }

  .home-v1-stat-card {
    position: static;
    margin-top: 0.75rem;
  }

  .home-v1-project-card {
    min-height: 20rem;
  }
}

@media (min-width: 768px) and (max-width: 1120px) and (max-height: 820px) {
  .home-v1-section--hero {
    padding: 0.85rem 0 0.65rem;
  }

  .home-v1-hero {
    gap: 0.85rem;
    --home-v1-hero-portrait-max-height: min(54vh, 32rem);
  }

  .home-v1-hero__content {
    gap: 0.8rem;
  }

  .home-v1-hero__title {
    font-size: clamp(1.85rem, 4.05vw, 2.7rem);
  }

  .home-v1-hero__description {
    font-size: 1rem;
    line-height: 1.36;
  }

  .home-v1-hero__actions .home-v1-button {
    min-height: 2.95rem;
    padding: 0.74rem 1.1rem;
    font-size: 0.96rem;
  }

  .home-v1-stat-card {
    left: 0.55rem;
    right: 0.55rem;
    bottom: 0.55rem;
    padding: 0.58rem 0.72rem;
  }
}

@media (max-width: 860px) and (max-height: 820px) {
  .home-v1-section--hero {
    padding: 0.6rem 0;
  }

  .home-v1-hero {
    gap: 0.75rem;
    --home-v1-hero-visual-max-width: min(92vw, 24rem);
    --home-v1-hero-portrait-max-height: min(46vh, 26rem);
  }

  .home-v1-hero__content {
    margin-top: -2.6rem;
    gap: 0.6rem;
    padding: 0.72rem 0.82rem;
  }

  .home-v1-hero__title {
    font-size: clamp(1.52rem, 6.45vw, 2.02rem);
  }

  .home-v1-hero__description {
    font-size: 0.88rem;
    line-height: 1.28;
  }

  .home-v1-hero__actions .home-v1-button {
    min-height: 2.6rem;
    padding: 0.58rem 0.82rem;
    font-size: 0.82rem;
  }

  .home-v1-stat-card {
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
    padding: 0.45rem 0.62rem;
  }
}

@media (max-width: 560px) and (max-height: 740px) {
  .home-v1-hero {
    --home-v1-hero-visual-max-width: min(92vw, 22rem);
    --home-v1-hero-portrait-max-height: min(42vh, 18rem);
  }

  .home-v1-hero__content {
    margin-top: -2.15rem;
    padding: 0.62rem 0.68rem;
  }

  .home-v1-hero__title {
    font-size: clamp(1.28rem, 6.9vw, 1.7rem);
  }

  .home-v1-hero__description {
    font-size: 0.82rem;
    line-height: 1.24;
  }

  .home-v1-hero__actions .home-v1-button {
    min-height: 2.3rem;
    padding: 0.5rem 0.68rem;
    font-size: 0.77rem;
  }
}
