/* =====================================================================
   New Home only (new-home.html)
   This stylesheet is linked exclusively by new-home.html and every
   selector uses the nh- prefix or the .new-home-page body class, so
   editing it never affects the main home (index.html) or other pages.
   ===================================================================== */

/* Animated hero headline: Storytelling -> Creative -> Pitch -> Deck.
   These static styles describe the FINAL state ("Deck").
   The Interactions timelines "New Home · Headline word cycle" (desktop
   and tablet, plus a phone version) apply the starting state and play
   the sequence after the page loader. */
.nh-word-cycle {
  position: relative;
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  width: 2.382em; /* width of "Deck"; the timeline animates it per word */
  line-height: 1;
  vertical-align: baseline;
  white-space: nowrap;
}

.nh-word-cycle__word {
  grid-area: 1 / 1;
  white-space: nowrap;
  opacity: 0;
}

.nh-word-cycle__word--final {
  opacity: 1;
}

/* Built for timer bar: only used by the phone layout below. */
.nh-built-for-timer {
  display: none;
}

/* ---------------------------------------------------------------------
   Phones, matching the Figma "Home | Mobile" frame. 767px is where the
   shared site switches to its phone layout.
   --------------------------------------------------------------------- */
@media (max-width: 767px) {
  /* Hero: the animated headline replaces the separate phone headline. */
  .new-home-page .hero__title-copy--default {
    display: block;
  }

  .new-home-page .hero__title-copy--mobile {
    display: none;
  }

  .new-home-page .nh-word-cycle {
    display: grid;
    width: auto;
    justify-items: center;
    line-height: inherit;
  }

  /* Hero light placed like the Figma video (1243 x 648 at -67px, -34px)
     with its "Rectangle 418" fade. On phones the light layer sits 24px
     above the hero, hence the 24px offsets. */
  .new-home-page .hero__signal {
    -webkit-mask: none;
    mask: none;
  }

  .new-home-page .hero__video {
    top: -35.5px;
    left: -67px;
    width: 1242.92px;
    height: 699.14px;
    transform: none;
  }

  .new-home-page .hero__video-frame::after {
    inset: auto;
    top: 70px;
    bottom: 0; /* the Figma fade, then solid black to the end of the hero */
    left: calc(50% - 300.5px);
    width: 1440px;
    height: auto;
    background:
      linear-gradient(200.97deg, rgba(8, 8, 8, 0) 41.139%, #000 70.477%) top / 100% 581px no-repeat,
      linear-gradient(180deg, rgba(8, 8, 8, 0) 0%, #000 63.992%) top / 100% 581px no-repeat,
      linear-gradient(#000, #000) bottom / 100% max(0px, calc(100% - 580px)) no-repeat;
    transform: translateX(-50%);
  }

  /* Built for: one highlighted sector at a time, with a timer bar.
     js/new-home-built-for.js switches the deck to this mode. */
  .new-home-page .built-for__header {
    text-align: center;
  }

  .new-home-page .built-for__description {
    width: 100%;
    margin-top: 24px;
    font-size: 20px;
    letter-spacing: -0.6px;
    line-height: 24px;
    text-align: center;
  }

  .new-home-page .built-for__cards.nh-cycle {
    --nh-built-for-duration: 6s; /* how long each sector stays highlighted */

    margin-top: 24px;
    gap: 16px;
  }

  .new-home-page .nh-cycle .built-for__card {
    height: var(--nh-card-height, auto);
    min-height: 0;
    justify-content: flex-end;
    padding: 73px 24px 24px;
    transition:
      height 640ms cubic-bezier(0.22, 1, 0.36, 1),
      box-shadow 480ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .new-home-page .nh-cycle .built-for__card.is-active {
    height: 340px;
  }

  .new-home-page .nh-cycle .built-for__card::before {
    background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 345 340' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><rect x='0' y='0' height='100%' width='100%' fill='url(%23grad)' opacity='1'/><defs><radialGradient id='grad' gradientUnits='userSpaceOnUse' cx='0' cy='0' r='10' gradientTransform='matrix(-18.5 -49.343 48.471 -36.405 273 456.87)'><stop stop-color='rgba(197,132,16,1)' offset='0'/><stop stop-color='rgba(162,130,35,1)' offset='0.083893'/><stop stop-color='rgba(128,127,55,1)' offset='0.16779'/><stop stop-color='rgba(93,125,74,1)' offset='0.25168'/><stop stop-color='rgba(58,122,93,1)' offset='0.33557'/><stop stop-color='rgba(29,105,97,1)' offset='0.49068'/><stop stop-color='rgba(15,97,98,1)' offset='0.56823'/><stop stop-color='rgba(0,88,100,1)' offset='0.64578'/><stop stop-color='rgba(0,51,75,1)' offset='1'/></radialGradient></defs></svg>");
    background-position: center;
    background-size: 100% 100%;
  }

  .new-home-page .nh-cycle .built-for__card-title,
  .new-home-page .nh-cycle .built-for__card.is-active .built-for__card-title {
    top: 24px;
    right: 24px;
    left: 24px;
    font-family: "Sora", sans-serif;
    font-size: 20px;
    font-variation-settings: normal;
    letter-spacing: normal;
    line-height: normal;
    transform: none;
  }

  .new-home-page .nh-cycle .built-for__card-arrow {
    display: none;
  }

  .new-home-page .nh-cycle .built-for__card-list,
  .new-home-page .nh-cycle .built-for__card.is-active .built-for__card-list {
    max-width: 62%;
    margin-top: auto;
    gap: 0;
    font-size: 16px;
    letter-spacing: normal;
    line-height: 28px;
    visibility: visible;
  }

  .new-home-page .nh-cycle .built-for__card-list > .built-for__list-item {
    min-height: 28px;
  }

  .new-home-page .nh-cycle .built-for__card:not(.is-active) .built-for__card-list {
    color: #000;
  }

  .new-home-page .nh-cycle .built-for__card.is-active .built-for__card-title,
  .new-home-page .nh-cycle .built-for__card.is-active .built-for__card-list {
    color: #faf3ec;
  }

  .new-home-page .nh-cycle .nh-built-for-timer {
    position: absolute;
    z-index: 5;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    height: 2.5px;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 320ms ease;
  }

  .new-home-page .nh-cycle .built-for__card.is-active .nh-built-for-timer {
    opacity: 1;
  }

  .new-home-page .nh-cycle.is-static .nh-built-for-timer {
    display: none;
  }

  .new-home-page .nh-built-for-timer__fill {
    display: block;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    transform: scaleX(0);
    transform-origin: left center;
  }

  .new-home-page .nh-cycle:not(.is-static) .built-for__card.is-active .nh-built-for-timer__fill {
    animation: nh-built-for-timer var(--nh-built-for-duration) linear forwards;
  }

  .new-home-page .nh-cycle.is-paused .built-for__card.is-active .nh-built-for-timer__fill {
    animation-play-state: paused;
  }

  /* Header: no glass while the hero fills the screen with the menu closed;
     the glass fades back in once the second section reaches mid-screen.
     js/new-home-header.js toggles .nh-header-clear. */
  .new-home-page .site-header {
    transition: border-color 480ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .new-home-page .site-header.is-mobile-menu-transitioning {
    transition:
      background-color 600ms cubic-bezier(0.22, 1, 0.36, 1),
      border-color 600ms ease,
      color 600ms ease;
  }

  .new-home-page .site-header::after {
    transition:
      clip-path 600ms cubic-bezier(0.22, 1, 0.36, 1),
      background-color 480ms cubic-bezier(0.22, 1, 0.36, 1),
      opacity 480ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .new-home-page .site-header.nh-header-clear:not(.is-mobile-menu-open) {
    border-bottom-color: transparent;
  }

  .new-home-page .site-header.nh-header-clear:not(.is-mobile-menu-open)::after {
    opacity: 0;
  }
}

@keyframes nh-built-for-timer {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}
