/*
 * Agencies landing: a clean full-stage Howdy hero followed by a contained
 * editorial screen for Summer Sleep Deals. This final page layer deliberately
 * reuses the site's shared media controls and leaves the underlying players,
 * preload behavior, and campaign switching logic intact.
 */

.site-shell--agencies:not(.site-shell--service-detail)
  .agency-campaign-wall__primary[data-agency-campaign-key="roku-howdy"] {
  --agency-campaign-poster: url("/work/posters/player/roku-howdy-august-iconic-moments.jpg?v=20260901roku-howdy-v1");
}

/* Keep the Howdy image completely untreated. */
.site-shell--agencies:not(.site-shell--service-detail)
  .agency-campaign-hero::before,
.site-shell--agencies:not(.site-shell--service-detail)
  .agency-campaign-hero::after {
  content: none !important;
}

.site-shell--agencies:not(.site-shell--service-detail)
  .agency-campaign-wall__scrim {
  display: none !important;
  background: none !important;
}

.site-shell--agencies:not(.site-shell--service-detail)
  .agency-campaign-wall__video {
  filter: none !important;
}

/* A short, one-time identity beat over the untreated Howdy footage. */
.agency-hero-intro {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: clamp(88px, 12vh, 136px) var(--mp-layout-gutter, 24px);
  color: #fff;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.agency-hero-intro__content {
  width: min(1120px, calc(100vw - 112px));
  transform: translate3d(0, 18px, 0);
}

.agency-hero-intro__title {
  margin: 0;
  color: #fff;
  font-family: var(--mp-font-display, Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif);
  font-size: clamp(4.75rem, 7.5vw, 8.1rem);
  font-weight: 900;
  letter-spacing: -0.032em;
  line-height: 0.86;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.62);
  text-transform: uppercase;
}

.agency-hero-intro__typed {
  min-height: 1.45em;
  max-width: 58rem;
  margin: 5px auto 0;
  color: #fff;
  font-family: var(--mp-font-body, "Helvetica Neue", Helvetica, Arial, sans-serif);
  font-size: clamp(1.375rem, 1.75vw, 1.6rem);
  font-weight: 450;
  letter-spacing: -0.018em;
  line-height: 1.2;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.76);
  white-space: pre-line;
}

.agency-hero-intro__typed [data-agency-hero-typewriter]::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 0.92em;
  margin-left: 0.16em;
  background: currentColor;
  vertical-align: -0.04em;
  opacity: 0;
  animation: none;
}

.agency-hero-intro__typed
  [data-agency-hero-typewriter].is-typing::after {
  opacity: 1;
  animation: agency-entry-caret 720ms steps(1, end) infinite;
}

.agency-hero-intro__typed
  [data-agency-hero-typewriter].is-complete::after {
  opacity: 0;
  animation: none;
}

html.agency-entry-pending .agency-hero-intro {
  opacity: 1;
  visibility: visible;
}

html.agency-entry-pending .agency-hero-intro__content {
  animation: agency-entry-content-in 440ms cubic-bezier(0.16, 1, 0.3, 1)
    40ms both;
}

html.agency-entry-revealing .agency-hero-intro {
  opacity: 0;
  visibility: visible;
  transition: opacity 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

html.agency-entry-revealing .agency-hero-intro__content {
  transform: translate3d(0, -12px, 0) scale(0.985);
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

html.agency-entry-complete .agency-hero-intro {
  display: none;
}

.site-shell--agencies:not(.site-shell--service-detail)
  :is(.agency-campaign-wall__caption, .agency-campaign-wall__playback) {
  transition: opacity 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

html:is(.agency-entry-pending, .agency-entry-revealing)
  .site-shell--agencies:not(.site-shell--service-detail)
  :is(.agency-campaign-wall__caption, .agency-campaign-wall__playback) {
  opacity: 0 !important;
  pointer-events: none;
}

@keyframes agency-entry-content-in {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes agency-entry-caret {
  0%,
  48% {
    opacity: 1;
  }
  49%,
  100% {
    opacity: 0;
  }
}

.site-shell--agencies:not(.site-shell--service-detail)
  :is(.agency-campaign-wall__sound, .agency-campaign-wall__play) {
  --mp-media-control-size: 40px !important;
  --mp-media-transparent-control-size: 40px !important;
  --mp-media-icon-size: 20.8px !important;
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  flex-basis: 40px !important;
}

.site-shell--agencies:not(.site-shell--service-detail)
  .agency-campaign-wall__playback {
  position: absolute;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 6px;
}

html
  body
  .site-shell--agencies:not(.site-shell--service-detail)
  .agency-campaign-wall__playback
  > :is(.agency-campaign-wall__sound, .agency-campaign-wall__play) {
  position: relative !important;
  inset: auto !important;
  margin: 0 !important;
}

.site-shell--agencies:not(.site-shell--service-detail)
  :is(
    .agency-campaign-wall__support,
    .agency-campaign-hero__discipline-rail
  ) {
  display: none !important;
}

@media (min-width: 781px) {
  .site-shell--agencies:not(.site-shell--service-detail)
    .agency-campaign-hero {
    --agency-header-offset: 48px;
    position: relative;
    display: block !important;
    min-height: calc(100vh - var(--agency-header-offset)) !important;
    min-height: calc(100svh - var(--agency-header-offset)) !important;
    margin-top: var(--agency-header-offset);
    padding: 0 !important;
    overflow: hidden;
    background: #050505 !important;
    color: #fff;
    isolation: isolate;
  }

  .site-shell--agencies:not(.site-shell--service-detail)
    .agency-campaign-wall {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    max-width: none;
    height: 100%;
    margin: 0;
    perspective: none;
    transform: none;
  }

  .site-shell--agencies:not(.site-shell--service-detail)
    .agency-campaign-wall__primary,
  .site-shell--agencies.agency-depth-v1:not(.site-shell--service-detail)
    .agency-campaign-wall:hover
    .agency-campaign-wall__primary {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
  }

  .site-shell--agencies:not(.site-shell--service-detail)
    .agency-campaign-wall__video {
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
    opacity: 1;
    transform: none;
  }

  .site-shell--agencies:not(.site-shell--service-detail)
    .agency-campaign-hero__copy {
    position: absolute;
    right: auto;
    bottom: clamp(92px, 10.5vh, 124px);
    left: 50%;
    z-index: 4;
    width: min(900px, calc(100% - 180px));
    max-width: 900px;
    margin: 0;
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 22px rgba(0, 0, 0, 0.72);
    transform: translateX(-50%) !important;
    pointer-events: none;
  }

  .site-shell--agencies:not(.site-shell--service-detail)
    .agency-campaign-hero__kicker {
    margin: 0 auto 14px;
    color: #fff;
    font-size: 0.68rem;
    letter-spacing: 0.16em;
  }

  .site-shell--agencies:not(.site-shell--service-detail)
    .agency-campaign-hero h1 {
    max-width: none;
    margin: 0;
    color: #fff;
    font-size: clamp(4.6rem, 7.8vw, 8.2rem);
    line-height: 0.84;
    -webkit-text-fill-color: #fff;
  }

  .site-shell--agencies:not(.site-shell--service-detail)
    .agency-campaign-hero__summary {
    max-width: 34ch;
    margin: 22px auto 0;
    color: #fff !important;
    font-size: clamp(1.15rem, 2.15vw, 2rem);
    font-weight: 700;
    line-height: 1.12;
    text-wrap: balance;
    -webkit-text-fill-color: #fff !important;
  }

  /* Home's approved desktop control geometry: 40px, 6px gap, 40/30 edges. */
  .site-shell--agencies:not(.site-shell--service-detail)
    .agency-campaign-wall__playback {
    right: 40px;
    bottom: 30px !important;
  }

  .site-shell--agencies:not(.site-shell--service-detail)
    .agency-campaign-wall__caption {
    right: auto;
    bottom: 30px;
    left: 40px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 3px 10px;
    width: min(440px, calc(100% - 220px));
  }

  .site-shell--agencies:not(.site-shell--service-detail)
    .agency-campaign-wall__caption > span {
    padding-right: 10px;
    font-size: 0.54rem;
  }

  .site-shell--agencies:not(.site-shell--service-detail)
    .agency-campaign-wall__caption strong {
    font-family: var(--mp-font-body, "Helvetica Neue", Helvetica, Arial, sans-serif);
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.025em;
    line-height: 1.1;
    text-transform: none;
  }

  .site-shell--agencies:not(.site-shell--service-detail)
    .agency-campaign-wall__caption small {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.66rem;
    font-weight: 600;
  }

  /* The contained editorial chapter must not trigger a transparent header. */
  html.agency-cinema-header-clear
    .site-shell--agencies
    .home-header:not(.is-open)::before,
  html.agency-cinema-header-clear
    .site-shell--agencies
    .home-header.is-scrolled:not(.is-open)::before {
    background: #fff !important;
    box-shadow: none !important;
    opacity: 1 !important;
  }

  html.agency-cinema-header-clear
    .site-shell--agencies
    .home-header:not(.is-open),
  html.agency-cinema-header-clear
    .site-shell--agencies
    .home-header:not(.is-open)
    :is(.home-header__brand, .home-header__nav > a, .home-header__menu-button) {
    color: #050505 !important;
    -webkit-text-fill-color: #050505 !important;
    text-shadow: none !important;
  }

  /* Summer Sleep Deals: editorial copy beside a restrained 16:9 screen. */
  .site-shell--agencies.agency-depth-v1 .agency-cinema--lead,
  html.agency-cinema-motion
    .site-shell--agencies.agency-depth-v1
    .agency-cinema--lead {
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: clamp(116px, 10vw, 172px) 0 clamp(132px, 11vw, 194px) !important;
    overflow: visible;
    background: #f5f5f7 !important;
    color: #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: relative !important;
    top: auto !important;
    display: block;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible;
  }

  .agency-cinema--lead .agency-cinema__editorial {
    display: grid;
    grid-template-columns: minmax(250px, 0.62fr) minmax(0, 1.38fr);
    gap: clamp(54px, 6vw, 112px);
    align-items: center;
    width: min(calc(100% - 80px), 1520px);
    margin: 0 auto;
  }

  .agency-cinema--lead .agency-cinema__editorial-copy {
    max-width: 30rem;
    color: #050505;
  }

  .agency-cinema--lead .agency-cinema__editorial-copy > p:first-child {
    margin: 0 0 20px;
    color: rgba(5, 5, 5, 0.48);
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.14em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .agency-cinema--lead .agency-cinema__editorial-copy h2 {
    margin: 0;
    color: #050505;
    font-family: var(--mp-font-body, "Helvetica Neue", Helvetica, Arial, sans-serif);
    font-size: clamp(2.55rem, 4.1vw, 5rem);
    font-weight: 750;
    letter-spacing: -0.045em;
    line-height: 0.95;
    text-wrap: balance;
  }

  .agency-cinema--lead .agency-cinema__editorial-copy > p:last-child {
    max-width: 31ch;
    margin: 28px 0 0;
    color: rgba(5, 5, 5, 0.56);
    font-size: clamp(1rem, 1.25vw, 1.2rem);
    font-weight: 600;
    line-height: 1.45;
    text-wrap: pretty;
  }

  .agency-cinema--lead .agency-cinema__display {
    position: relative;
    width: 100%;
  }

  .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 {
    position: relative;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 16 / 9 !important;
    margin: 0;
    border: clamp(6px, 0.62vw, 10px) solid #1d1d1f;
    border-radius: clamp(10px, 0.95vw, 16px) !important;
    overflow: hidden;
    background: #050505;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.24) inset,
      0 28px 66px rgba(5, 5, 5, 0.2) !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: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    transform: none !important;
  }

  .agency-cinema--lead .agency-cinema__scrim,
  .agency-cinema--lead .agency-cinema__label {
    display: none;
  }
}

@media (max-width: 780px) {
  .agency-hero-intro {
    top: calc(-1 * var(--agency-global-header-height, 48px));
    bottom: 0;
    padding: 0 var(--mp-layout-gutter, 18px);
  }

  .agency-hero-intro__title {
    font-size: clamp(3.2rem, 15vw, 5rem);
  }

  .agency-hero-intro__content {
    width: calc(100vw - 32px);
  }

  .agency-hero-intro__typed {
    width: min(22rem, calc(100vw - 36px));
    min-height: 2.5em;
    margin-top: 4px;
    font-size: clamp(1.02rem, 4.6vw, 1.15rem);
    line-height: 1.25;
    white-space: normal;
  }

  .agency-hero-intro__typed [data-agency-hero-typewriter] {
    display: inline-block;
    text-align: center;
    white-space: nowrap;
  }

  .site-shell--agencies:not(.site-shell--service-detail)
    .agency-campaign-hero {
    min-height: 100vh !important;
    min-height: 100svh !important;
    padding-bottom: max(34px, env(safe-area-inset-bottom)) !important;
  }

  .site-shell--agencies:not(.site-shell--service-detail)
    .agency-campaign-wall {
    height: clamp(270px, 76vw, 340px) !important;
  }

  .site-shell--agencies:not(.site-shell--service-detail)
    .agency-campaign-hero__copy {
    box-sizing: border-box;
    width: min(100%, 680px);
    margin: clamp(22px, 4vh, 36px) auto 0 !important;
    padding-inline: var(--mp-layout-gutter, 18px);
  }

  .site-shell--agencies:not(.site-shell--service-detail)
    .agency-campaign-wall__playback {
    right: max(20px, env(safe-area-inset-right, 0px));
    top: 20px;
    bottom: auto !important;
  }

  /* Mobile sound and pause controls are usable during the intro, not after it. */
  html:is(.agency-entry-pending, .agency-entry-revealing)
    .site-shell--agencies:not(.site-shell--service-detail)
    .agency-campaign-wall__playback {
    opacity: 1 !important;
    pointer-events: auto;
    transition: none;
  }

  .site-shell--agencies .agency-cinema--lead {
    padding: clamp(70px, 17vw, 94px) var(--mp-layout-gutter, 16px)
      clamp(84px, 20vw, 112px) !important;
    background: #f5f5f7 !important;
  }

  .site-shell--agencies .agency-cinema--lead .agency-cinema__mobile {
    padding: 0;
  }

  .site-shell--agencies
    .agency-cinema--lead
    .agency-cinema__mobile-frame {
    aspect-ratio: 16 / 9;
    border: 5px solid #1d1d1f;
    border-radius: 9px;
    box-shadow: 0 20px 42px rgba(5, 5, 5, 0.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .agency-hero-intro {
    display: none !important;
  }

  .site-shell--agencies:not(.site-shell--service-detail)
    .agency-campaign-wall__video,
  .site-shell--agencies .agency-cinema--lead .agency-cinema__video {
    transition: none;
  }
}
