/* AVI STUDIO V15 — two-phone mobile service showcase */

/* Never show the phones on desktop/tablet wider than 768px. */
.mobile-service-showcase {
  display: none !important;
}

@media (max-width: 768px) {
  /* This is intentionally very explicit so Cloudflare cannot inherit a desktop display rule. */
  .services-explorer .mobile-service-showcase {
    display: block !important;
    width: calc(100% + 36px) !important;
    max-width: none !important;
    margin: 34px -18px 2px !important;
    padding: 0 !important;
    opacity: 1;
    visibility: visible !important;
  }

  .mobile-phones-stage {
    position: relative;
    display: block !important;
    width: 100%;
    height: 535px;
    overflow: hidden;
    isolation: isolate;
  }

  .mobile-phones-stage::before {
    content: "";
    position: absolute;
    z-index: -2;
    left: 50%;
    bottom: -130px;
    width: 145%;
    height: 270px;
    border-radius: 50% 50% 0 0;
    background: rgba(184, 199, 211, .62);
    transform: translateX(-50%);
  }

  .mobile-phones-shape {
    position: absolute;
    z-index: -1;
    top: 58px;
    left: 50%;
    width: 270px;
    height: 320px;
    border: 1px solid rgba(117, 95, 79, .26);
    border-radius: 50%;
    transform: translateX(-50%) rotate(-12deg);
  }

  .mobile-phone {
    position: absolute;
    z-index: 2;
    width: min(47vw, 184px);
    aspect-ratio: 9 / 19;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 31px;
    background: var(--ink);
    box-shadow:
      0 18px 38px rgba(30, 29, 26, .22),
      inset 0 0 0 1px rgba(255, 255, 255, .10);
    transition:
      transform .75s cubic-bezier(.2,.75,.2,1),
      opacity .28s ease;
  }

  .mobile-phone-left {
    top: 18px;
    left: 5.5%;
    transform: rotate(-4deg);
  }

  .mobile-phone-right {
    top: 132px;
    right: 4.5%;
    transform: rotate(4deg);
  }

  .mobile-phone-side {
    position: absolute;
    top: 74px;
    width: 3px;
    height: 54px;
    border-radius: 3px;
    background: var(--ink);
  }

  .mobile-phone-side-left {
    left: -4px;
  }

  .mobile-phone-side-right {
    right: -4px;
  }

  .mobile-phone-screen {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 25px;
    background: var(--paper-2);
  }

  .mobile-phone-notch {
    position: absolute;
    z-index: 5;
    top: 7px;
    left: 50%;
    width: 36%;
    height: 17px;
    border-radius: 999px;
    background: var(--ink);
    transform: translateX(-50%);
  }

  .mobile-phone-screen img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 1;
    transform: scale(1.01);
    transition:
      opacity .28s ease,
      transform .72s cubic-bezier(.2,.75,.2,1);
  }

  .mobile-phone-screen::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 32%;
    pointer-events: none;
    background: linear-gradient(to top, rgba(30,29,26,.66), transparent);
  }

  .mobile-phone-caption {
    position: absolute;
    z-index: 4;
    right: 13px;
    bottom: 14px;
    left: 13px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    color: var(--paper);
  }

  .mobile-phone-caption span {
    font-family: "Cormorant Garamond", serif;
    font-size: 18px;
    line-height: 1;
  }

  .mobile-phone-caption strong {
    max-width: 74%;
    font-size: 7px;
    line-height: 1.3;
    letter-spacing: .11em;
    text-align: right;
    text-transform: uppercase;
  }

  .mobile-phones-stage.is-changing .mobile-phone-left {
    transform: rotate(-4deg) translateY(5px) scale(.985);
  }

  .mobile-phones-stage.is-changing .mobile-phone-right {
    transform: rotate(4deg) translateY(-5px) scale(.985);
  }

  .mobile-phones-stage.is-changing img {
    opacity: .24;
    transform: scale(1.055);
  }

  .mobile-service-dots {
    position: relative;
    z-index: 6;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: -12px 0 0;
  }

  .mobile-service-dots button {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 1px solid var(--ink);
    border-radius: 999px;
    background: transparent;
  }

  .mobile-service-dots button.active {
    width: 25px;
    background: var(--ink);
  }

  /* The photo remains beside the accordion on desktop only. */
  .service-visual {
    display: none !important;
  }

  .service-panel-media {
    display: none !important;
  }

  /*
   * Safe mobile reveal:
   * - without JS: content is visible;
   * - with JS: content animates into view;
   * - it can no longer remain permanently invisible.
   */
  .fade-in,
  .mobile-reveal,
  .mobile-scroll-reveal {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }

  html.avi-js .fade-in:not(.visible),
  html.avi-js .mobile-reveal:not(.visible),
  html.avi-js .mobile-scroll-reveal:not(.visible) {
    opacity: 0 !important;
    transform: translateY(26px) !important;
  }

  html.avi-js .fade-in.visible,
  html.avi-js .mobile-reveal.visible,
  html.avi-js .mobile-scroll-reveal.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition:
      opacity .72s cubic-bezier(.22,.61,.36,1),
      transform .72s cubic-bezier(.22,.61,.36,1);
    transition-delay: var(--reveal-delay, 0ms);
  }
}

@media (max-width: 390px) {
  .mobile-phones-stage {
    height: 505px;
  }

  .mobile-phone {
    width: min(46vw, 171px);
  }

  .mobile-phone-left {
    left: 4%;
  }

  .mobile-phone-right {
    top: 124px;
    right: 3%;
  }
}
