/*
  Agencies hero: dimensional soundstage.
  Visual-only layer — campaign media, playback, preload, and switching logic
  remain owned by the existing implementation.
*/

.site-shell--agencies.agency-depth-v1 {
  --agency-stage: #fff;
  --agency-stage-highlight: #fff;
}

.site-shell--agencies.agency-depth-v1 .agency-campaign-hero {
  min-height: clamp(650px, 88svh, 760px);
  padding-top: clamp(99px, 11.05vh, 129px);
  padding-bottom: clamp(64px, 7.2vh, 78px);
  background:
    linear-gradient(180deg, transparent 0 84%, rgba(255, 255, 255, 0.5) 93%, #fff 100%),
    radial-gradient(circle at 74% 43%, rgba(255, 255, 255, 0.98), transparent 29%),
    #fff;
}

.site-shell--agencies.agency-depth-v1 .agency-campaign-hero::before {
  z-index: 0;
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.98) 0%,
      rgba(255, 255, 255, 0.92) 23%,
      rgba(255, 255, 255, 0.42) 42%,
      transparent 69%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.34),
      transparent 46%,
      rgba(225, 225, 225, 0.14)
    );
}

.site-shell--agencies.agency-depth-v1 .agency-campaign-hero::after {
  content: "";
  position: absolute;
  inset: 48px -8% 38px 24%;
  z-index: 0;
  background:
    radial-gradient(ellipse at 70% 48%, rgba(255, 255, 255, 0.76) 0%, transparent 34%),
    repeating-radial-gradient(
      ellipse 67% 78% at 70% 48%,
      transparent 0 30px,
      rgba(72, 72, 72, 0.075) 31px,
      rgba(255, 255, 255, 0.78) 32px,
      transparent 34px 57px
    );
  opacity: 0.68;
  pointer-events: none;
  transform: translate3d(0, 0, 0) rotate(-2deg) scale(1.08);
  transform-origin: 70% 48%;
  -webkit-mask-image: radial-gradient(
    ellipse 78% 80% at 70% 48%,
    #000 0%,
    rgba(0, 0, 0, 0.92) 58%,
    transparent 88%
  );
  mask-image: radial-gradient(
    ellipse 78% 80% at 70% 48%,
    #000 0%,
    rgba(0, 0, 0, 0.92) 58%,
    transparent 88%
  );
  animation: agency-stage-breathe 22s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
}

.site-shell--agencies.agency-depth-v1 .agency-campaign-hero__copy {
  z-index: 4;
  transform: translate3d(0, clamp(74px, 9vh, 86px), 0);
}

.site-shell--agencies.agency-depth-v1 .agency-campaign-wall {
  --agency-primary-scroll-y: 0px;
  --agency-primary-scroll-z: 0px;
  --agency-primary-scroll-yaw: 0deg;
  --agency-primary-scroll-pitch: 0deg;
  --agency-primary-scroll-scale: 1;
  --agency-support-scroll-x: 0px;
  --agency-support-scroll-y: 0px;
  --agency-support-scroll-z: 0px;
  --agency-support-scroll-yaw: 0deg;
  --agency-support-scroll-pitch: 0deg;
  z-index: 2;
  height: clamp(470px, 58vh, 600px);
  perspective: 1500px;
  transform-style: preserve-3d;
}

.site-shell--agencies.agency-depth-v1 .agency-campaign-wall::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 3%;
  left: 8%;
  z-index: 0;
  height: 24%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse,
    rgba(57, 50, 39, 0.16) 0%,
    rgba(57, 50, 39, 0.065) 38%,
    transparent 72%
  );
  filter: blur(24px);
  opacity: 0.72;
  pointer-events: none;
  transform: perspective(700px) rotateX(68deg) translate3d(0, 18px, 0);
  display: none;
}

.site-shell--agencies.agency-depth-v1 .agency-campaign-wall__primary {
  box-shadow: none;
  transform:
    translate3d(
      0,
      calc(-51% + var(--agency-primary-scroll-y)),
      calc(22px + var(--agency-primary-scroll-z))
    )
    rotateY(var(--agency-primary-scroll-yaw))
    rotateX(calc(0.35deg + var(--agency-primary-scroll-pitch)))
    scale(var(--agency-primary-scroll-scale));
  transform-origin: 64% 50%;
  transition:
    box-shadow 700ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.site-shell--agencies.agency-depth-v1 .agency-campaign-wall__support {
  transform:
    translate3d(
      calc(56% + var(--agency-support-scroll-x)),
      calc(-50% + var(--agency-support-scroll-y)),
      calc(74px + var(--agency-support-scroll-z))
    )
    rotateY(var(--agency-support-scroll-yaw))
    rotateX(var(--agency-support-scroll-pitch));
  transform-origin: left center;
}

.site-shell--agencies.agency-depth-v1 .agency-campaign-card {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: none;
}

.site-shell--agencies.agency-depth-v1 .agency-campaign-hero__discipline-rail {
  position: absolute;
  right: max(var(--mp-layout-gutter, clamp(22px, 4.2vw, 64px)), calc((100vw - 1920px) / 2 + 64px));
  bottom: 20px;
  left: max(var(--mp-layout-gutter, clamp(22px, 4.2vw, 64px)), calc((100vw - 1920px) / 2 + 64px));
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(18px, 2.8vw, 48px);
  padding-top: 12px;
  border-top: 1px solid rgba(5, 5, 5, 0.12);
  background: #fff;
  box-shadow: 0 0 0 18px #fff;
  color: rgba(5, 5, 5, 0.5);
}

.site-shell--agencies.agency-depth-v1 .agency-campaign-hero__discipline-rail span {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.site-shell--agencies.agency-depth-v1 .agency-campaign-hero__discipline-rail small {
  color: #e50914;
  font-size: 0.52rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

@media (hover: hover) and (pointer: fine) {
  .site-shell--agencies.agency-depth-v1
    .agency-campaign-wall:hover
    .agency-campaign-wall__primary {
    box-shadow: none;
    transform:
      translate3d(
        0,
        calc(-51% + var(--agency-primary-scroll-y)),
        calc(28px + var(--agency-primary-scroll-z))
      )
      rotateY(var(--agency-primary-scroll-yaw))
      rotateX(calc(0.12deg + var(--agency-primary-scroll-pitch)))
      scale(var(--agency-primary-scroll-scale));
  }
}

@media (max-width: 1080px) and (min-width: 781px) {
  .site-shell--agencies.agency-depth-v1 .agency-campaign-hero {
    padding-top: 102px;
    padding-bottom: 78px;
  }

  .site-shell--agencies.agency-depth-v1 .agency-campaign-wall {
    height: clamp(450px, 56vh, 560px);
  }

  .site-shell--agencies.agency-depth-v1 .agency-campaign-hero::after {
    left: 20%;
  }
}

@media (min-width: 781px) and (max-width: 859px) {
  .site-shell--agencies.agency-depth-v1 .agency-campaign-wall__support {
    transform:
      translate3d(
        calc(40% + var(--agency-support-scroll-x)),
        calc(-50% + var(--agency-support-scroll-y)),
        calc(74px + var(--agency-support-scroll-z))
      )
      rotateY(var(--agency-support-scroll-yaw))
      rotateX(var(--agency-support-scroll-pitch));
  }
}

@media (min-width: 781px) {
  .site-shell--agencies.agency-depth-v1 .agency-campaign-hero {
    min-height: clamp(720px, 96svh, 860px);
    padding-bottom: clamp(88px, 10vh, 112px);
  }

  .site-shell--agencies.agency-depth-v1
    .agency-campaign-hero__discipline-rail {
    bottom: 28px;
    padding-top: 16px;
  }

  .site-shell--agencies.agency-depth-v1 .agency-campaign-hero + .agency-cinema--lead {
    margin-top: clamp(24px, 3.2vw, 48px);
    background:
      linear-gradient(180deg, var(--agency-stage) 0%, #fff 13%, #fff 100%);
  }

  .site-shell--agencies.agency-depth-v1
    .agency-cinema--lead
    .agency-cinema__frame {
    transform-origin: 50% 0%;
  }

  html.agency-cinema-header-clear
    .site-shell--agencies.agency-depth-v1
    .home-header:not(.is-open)
    .home-header__brand,
  html.agency-cinema-header-clear
    .site-shell--agencies.agency-depth-v1
    .home-header:not(.is-open)
    .home-header__brand-mark,
  html.agency-cinema-header-clear
    .site-shell--agencies.agency-depth-v1
    .home-header:not(.is-open)
    .home-header__brand-name {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }
}

@media (max-width: 780px) {
  .site-shell--agencies.agency-depth-v1 .agency-campaign-hero {
    padding: calc(82px + env(safe-area-inset-top)) var(--mp-layout-gutter, 22px) 46px;
    background:
      linear-gradient(180deg, transparent 0 88%, rgba(255, 255, 255, 0.72) 97%, #fff 100%),
      radial-gradient(circle at 74% 28%, rgba(255, 255, 255, 0.98), transparent 31%),
      #fff;
  }

  .site-shell--agencies.agency-depth-v1 .agency-campaign-hero::before {
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.2),
      transparent 45%,
      rgba(225, 225, 225, 0.12)
    );
  }

  .site-shell--agencies.agency-depth-v1 .agency-campaign-hero::after {
    inset: 54px -54% 23% -30%;
    opacity: 0.43;
    transform: translate3d(0, 0, 0) rotate(8deg) scale(1.14);
    -webkit-mask-image: radial-gradient(
      ellipse 82% 82% at 54% 40%,
      #000 0%,
      rgba(0, 0, 0, 0.86) 56%,
      transparent 88%
    );
    mask-image: radial-gradient(
      ellipse 82% 82% at 54% 40%,
      #000 0%,
      rgba(0, 0, 0, 0.86) 56%,
      transparent 88%
    );
  }

  .site-shell--agencies.agency-depth-v1 .agency-campaign-hero__copy {
    margin-top: 18px;
    transform: none;
  }

  .site-shell--agencies.agency-depth-v1 .agency-campaign-wall {
    height: auto;
    perspective: 1100px;
    transform-style: preserve-3d;
  }

  .site-shell--agencies.agency-depth-v1 .agency-campaign-wall::after {
    display: none;
  }

  .site-shell--agencies.agency-depth-v1 .agency-campaign-wall__primary {
    box-shadow: none;
    transform:
      translate3d(
        0,
        var(--agency-primary-scroll-y),
        var(--agency-primary-scroll-z)
      )
      rotateY(var(--agency-primary-scroll-yaw))
      rotateX(var(--agency-primary-scroll-pitch))
      scale(var(--agency-primary-scroll-scale));
    transform-origin: 50% 14%;
  }

  .site-shell--agencies.agency-depth-v1 .agency-campaign-wall__support {
    transform:
      translate3d(
        var(--agency-support-scroll-x),
        var(--agency-support-scroll-y),
        var(--agency-support-scroll-z)
      )
      rotateY(var(--agency-support-scroll-yaw))
      rotateX(var(--agency-support-scroll-pitch));
    transform-origin: 50% 0%;
  }

  .site-shell--agencies.agency-depth-v1 .agency-campaign-card {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: none;
  }

  .site-shell--agencies.agency-depth-v1 .agency-campaign-hero__discipline-rail {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    order: 3;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px 18px;
    width: 100%;
    margin-top: 38px;
    padding-top: 18px;
  }

  .site-shell--agencies.agency-depth-v1 .agency-campaign-hero__discipline-rail span {
    font-size: 0.58rem;
  }

  .site-shell--agencies.agency-depth-v1 .agency-campaign-hero + .agency-cinema--lead {
    padding-top: clamp(78px, 19vw, 106px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-shell--agencies.agency-depth-v1 .agency-campaign-hero::after {
    animation: none;
  }

  .site-shell--agencies.agency-depth-v1 .agency-campaign-wall__primary {
    transition: none;
  }
}

@keyframes agency-stage-breathe {
  from {
    transform: translate3d(-0.6%, 0, 0) rotate(-2deg) scale(1.08);
  }

  to {
    transform: translate3d(0.8%, -0.5%, 0) rotate(-1.5deg) scale(1.095);
  }
}

/*
 * Flat lead film with one short full-screen hold.
 * Keep the approved caption, controls, scrim, playback, and mobile treatment;
 * remove the desktop perspective presentation and let the viewport stay on the
 * film for one brief extra beat before normal page flow resumes.
 */
@media (min-width: 781px) and (prefers-reduced-motion: no-preference) {
  .site-shell--agencies.agency-depth-v1 .agency-cinema--lead,
  html.agency-cinema-motion
    .site-shell--agencies.agency-depth-v1
    .agency-cinema--lead {
    height: 132svh;
    min-height: 132svh;
    margin-top: 0;
    background: #050505;
  }

  .site-shell--agencies.agency-depth-v1
    .agency-cinema--lead
    .agency-cinema__sticky,
  html.agency-cinema-motion
    .site-shell--agencies.agency-depth-v1
    .agency-cinema--lead
    .agency-cinema__sticky {
    position: sticky;
    top: 0;
    width: 100vw;
    height: 100svh;
    min-height: 100svh;
    overflow: clip;
  }

  .site-shell--agencies.agency-depth-v1
    .agency-cinema--lead
    .agency-cinema__frame,
  html.agency-cinema-motion
    .site-shell--agencies.agency-depth-v1
    .agency-cinema--lead
    .agency-cinema__frame {
    width: 100vw;
    height: 100svh;
    border-radius: 0 !important;
    background: #050505;
    box-shadow: none !important;
    transform: none !important;
    transition: none !important;
    will-change: auto;
  }

  .site-shell--agencies.agency-depth-v1
    .agency-cinema--lead
    :is(.agency-cinema__video, .agency-cinema__poster),
  .site-shell--agencies.agency-depth-v1
    .agency-cinema--lead
    .agency-cinema__frame.is-video-ready
    :is(.agency-cinema__video, .agency-cinema__poster) {
    inset: -4%;
    width: 108%;
    height: 108%;
    object-fit: cover;
    transform: none !important;
  }

  .site-shell--agencies.agency-depth-v1
    .agency-cinema--lead
    .agency-cinema__video {
    transition: opacity 420ms cubic-bezier(0.22, 1, 0.36, 1);
  }
}

/*
 * Spectrum scroll story.
 * One continuous 16:9 film opens full-bleed, then shrinks to reveal the neutral
 * landscape device frame it has been playing inside the entire time.
 */
@media (min-width: 781px) and (prefers-reduced-motion: no-preference) {
  .site-shell--agencies.agency-depth-v1 .agency-cinema--pair,
  html.agency-cinema-motion
    .site-shell--agencies.agency-depth-v1
    .agency-cinema--pair {
    --agency-spectrum-frame-width: 100vw;
    --agency-spectrum-frame-height: 100svh;
    --agency-spectrum-frame-radius: 0px;
    --agency-spectrum-frame-border: 0px;
    --agency-spectrum-screen-inset: 0px;
    --agency-spectrum-hardware-opacity: 0;
    height: 245svh;
    min-height: 245svh;
    margin: 0;
    background: #050505;
  }

  .site-shell--agencies.agency-depth-v1
    .agency-cinema--pair
    .agency-cinema__sticky {
    position: sticky;
    top: 0;
    display: grid;
    width: 100vw;
    height: 100svh;
    overflow: clip;
    place-items: center;
    background: #050505;
  }

  .site-shell--agencies.agency-depth-v1
    .agency-cinema--pair
    .agency-cinema__pair-layout {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
  }

  .site-shell--agencies.agency-depth-v1
    .agency-cinema--pair
    .agency-cinema__frame {
    position: absolute;
    margin: 0;
    box-shadow: none !important;
  }

  .site-shell--agencies.agency-depth-v1
    .agency-cinema--pair
    .agency-cinema__frame--landscape {
    top: 50%;
    left: 50%;
    z-index: 4;
    width: var(--agency-spectrum-frame-width);
    height: var(--agency-spectrum-frame-height);
    max-height: none;
    overflow: visible;
    border: var(--agency-spectrum-frame-border) solid transparent;
    border-radius: var(--agency-spectrum-frame-radius) !important;
    background:
      linear-gradient(#171719, #171719) padding-box,
      linear-gradient(
        135deg,
        #d6d6d8 0%,
        #717176 18%,
        #202023 46%,
        #8c8c91 76%,
        #d0d0d3 100%
      ) border-box;
    box-shadow:
      inset 0 0 0 1px rgb(
        255 255 255 /
        calc(0.15 * var(--agency-spectrum-hardware-opacity))
      ),
      0 0 0 1px rgb(
        0 0 0 /
        calc(0.92 * var(--agency-spectrum-hardware-opacity))
      ),
      0 34px 96px rgb(
        0 0 0 /
        calc(0.64 * var(--agency-spectrum-hardware-opacity))
      ) !important;
    transform: translate3d(-50%, -50%, 0) !important;
    transition: none;
    will-change: width, height, border-radius;
  }

  .site-shell--agencies.agency-depth-v1
    .agency-cinema--pair
    .agency-cinema__frame--portrait {
    display: none;
  }

  .agency-spectrum-device__screen--landscape {
    position: absolute;
    inset: var(--agency-spectrum-screen-inset);
    overflow: hidden;
    border-radius: max(
      0px,
      calc(
        var(--agency-spectrum-frame-radius) -
        var(--agency-spectrum-frame-border) - 3px
      )
    );
    background: #050505;
    box-shadow:
      0 0 0 1px rgb(
        255 255 255 /
        calc(0.1 * var(--agency-spectrum-hardware-opacity))
      ),
      inset 0 0 12px rgb(
        0 0 0 /
        calc(0.52 * var(--agency-spectrum-hardware-opacity))
      );
  }

  .site-shell--agencies.agency-depth-v1
    .agency-cinema--pair
    .agency-spectrum-device__screen--landscape
    :is(.agency-cinema__video, .agency-cinema__poster) {
    inset: -4px;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
  }

  .agency-spectrum-device__camera--landscape {
    position: absolute;
    top: 50%;
    left: clamp(8px, 1vw, 12px);
    z-index: 8;
    width: clamp(14px, 1.8svh, 18px);
    height: clamp(50px, 6.5svh, 64px);
    border-radius: 999px;
    background:
      radial-gradient(circle at 50% 82%, #18202c 0 3px, #050505 4px),
      #050505;
    box-shadow: 0 1px 1px rgba(255, 255, 255, 0.12);
    opacity: var(--agency-spectrum-hardware-opacity);
    transform: translateY(-50%);
    pointer-events: none;
  }

  .agency-spectrum-device__button {
    position: absolute;
    z-index: 1;
    border-radius: 2px;
    background: linear-gradient(90deg, #0c0c0d, #545458);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.72);
    opacity: var(--agency-spectrum-hardware-opacity);
  }

  .agency-spectrum-device__button--landscape-action {
    top: -10px;
    left: 18%;
    width: clamp(34px, 4vw, 46px);
    height: 3px;
  }

  .agency-spectrum-device__button--landscape-volume-up {
    top: -10px;
    left: 29%;
    width: clamp(48px, 5vw, 62px);
    height: 3px;
  }

  .agency-spectrum-device__button--landscape-volume-down {
    top: -10px;
    left: 39%;
    width: clamp(48px, 5vw, 62px);
    height: 3px;
  }

  .agency-spectrum-device__button--landscape-power {
    right: 24%;
    bottom: -10px;
    width: clamp(68px, 7vw, 88px);
    height: 3px;
  }

  .agency-spectrum-device__button--landscape-camera-control {
    right: 10%;
    bottom: -10px;
    width: clamp(42px, 4.8vw, 58px);
    height: 3px;
  }

  .site-shell--agencies.agency-depth-v1
    .agency-cinema--pair
    .agency-cinema__frame--portrait
    .agency-cinema__label {
    display: none;
  }

  .site-shell--agencies.agency-depth-v1
    .agency-cinema--pair
    .agency-spectrum-caption {
    top: calc(100% + clamp(20px, 2.4svh, 28px));
    right: auto;
    bottom: auto;
    left: 50%;
    width: min(88vw, 520px);
    gap: 6px;
    padding: 0;
    opacity: var(--agency-spectrum-hardware-opacity);
    text-align: center;
    transform: translate3d(-50%, 10px, 0);
  }

  .site-shell--agencies.agency-depth-v1
    .agency-cinema--pair.is-agency-cinema-active
    .agency-spectrum-caption {
    opacity: var(--agency-spectrum-hardware-opacity);
    transform: translate3d(-50%, 0, 0);
  }

  .site-shell--agencies.agency-depth-v1
    .agency-cinema--pair
    .agency-spectrum-caption
    :is(strong, span) {
    text-shadow: none;
  }

}

/* Keep the approved card scale while letting the film fill the card. */
.site-shell--agencies .agency-proof-panel {
  box-shadow:
    0 1px 2px rgba(5, 5, 5, 0.06),
    0 10px 26px rgba(5, 5, 5, 0.055) !important;
}

/* Keep the chevron above the following process surface; its extended shaft
   intentionally overlaps that section's edge. */
.site-shell--agencies .agency-transition-arrow {
  z-index: 2;
}

@media (min-width: 781px) {
  .site-shell--agencies .agency-transition-arrow {
    --agency-transition-arrow-shift: clamp(32px, 3vw, 44px);
    height: calc(clamp(96px, 9vw, 132px) + var(--agency-transition-arrow-shift));
    margin-bottom: calc(-1 * var(--agency-transition-arrow-shift));
  }

  .site-shell--agencies .agency-transition-arrow::before {
    top: var(--agency-transition-arrow-shift);
    height: calc(100% - var(--agency-transition-arrow-shift) - 18px);
  }

  .site-shell--agencies .agency-transition-arrow::after {
    bottom: 4px;
  }

  .site-shell--agencies .agency-proof-panel {
    --agency-proof-frame: 0px;
    flex-basis: min(80vw, 1080px);
    border-radius: clamp(32px, 3vw, 44px);
  }

  .site-shell--agencies .agency-proof-panel__link {
    border-radius: inherit;
  }
}

@media (max-width: 780px) {
  .site-shell--agencies .agency-transition-arrow {
    --agency-transition-arrow-shift: 24px;
    height: calc(92px + var(--agency-transition-arrow-shift));
    margin-bottom: calc(-1 * var(--agency-transition-arrow-shift));
  }

  .site-shell--agencies .agency-transition-arrow::before {
    top: var(--agency-transition-arrow-shift);
    height: calc(100% - var(--agency-transition-arrow-shift) - 18px);
  }

  .site-shell--agencies .agency-transition-arrow::after {
    bottom: 4px;
  }
}
