/* ==========================================================================
   Purchase-page hero (products/information/hero.njk): the product banner from src/_data/productHeroes.json,
   the product name and headline along the bottom, and a price pill whose button mirrors the buy box's own
   Add to Cart (assets/js/product-hero.js). Ported from the hero block of product-page.css on
   premierrobotic-compare, so the hero looks the same on every sister site. Linked by base.njk on pages whose
   product has a hero; not part of the purged, inlined foundation.css.
   ========================================================================== */

/* The still at the picture's own shape, --pp-hero-ar, fading into a black band, --pp-hero-ext, that the
   product name, headline and price pill sit on. */
.pp-hero {
  --pp-d-ink: #f5f5f7;
  --pp-d-link: #2997ff;
  --pp-blue: #0071e3;
  --pp-blue-hover: #0077ed;
  --pp-ease: cubic-bezier(0.16, 0.84, 0.24, 1);
  /* --pp-hero-band (set inline from productHeroes.json "band") makes the band taller for a picture whose subject
     reaches down to the bottom edge, so the copy sits under it rather than across its tracks. */
  --pp-hero-ext: var(--pp-hero-band, clamp(3.5rem, 5.4vw, 6rem));
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-bottom: var(--pp-hero-ext);
  background: #000;
  color: var(--pp-d-ink);
  container-type: inline-size;
}

/* The max-height keeps the whole hero, pill included, on the first screen. */
.pp-hero-stage {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--pp-hero-ar, 2 / 1);
  min-height: 400px;
  max-height: calc(100vh - 12rem);
  overflow: hidden;
  background: #000;
}

@supports not (aspect-ratio: 1 / 1) {
  .pp-hero-stage {
    height: 60vh;
  }
}

.pp-hero-still,
.pp-hero-still img {
  display: block;
  width: 100%;
  height: 100%;
}

.pp-hero-still img {
  margin: 0;
  border-radius: 0;
  object-fit: cover;
  object-position: var(--pp-hero-focus, 50% 50%);
}

/* Not a static banner: the still settles in from a slight zoom on its subject over half a minute. */
.pp-hero--still .pp-hero-still img {
  transform-origin: var(--pp-hero-focus, 50% 50%);
  animation: pp-hero-drift 32s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  will-change: transform;
}

@keyframes pp-hero-drift {
  from { transform: scale(1.09); }
  to { transform: scale(1); }
}

/* Two shades: top to bottom, so the picture fades into the black band, and a side one on the left, behind
   the copy: the copy always reads from the left and the price pill always sits on the right. */
.pp-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.25) 14%, rgba(0, 0, 0, 0) 26%, rgba(0, 0, 0, 0) 44%, rgba(0, 0, 0, 0.55) 72%, #000 calc(100% - var(--pp-hero-ext)), #000 100%),
    linear-gradient(96deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.22) 30%, rgba(0, 0, 0, 0) 58%);
  pointer-events: none;
}

.pp-hero-lockup {
  position: absolute;
  left: clamp(1.25rem, 5cqw, 6rem);
  right: clamp(1.25rem, 5cqw, 6rem);
  bottom: clamp(1.5rem, 3cqw, 3.25rem);
  z-index: 6;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  animation: pp-hero-arrive 1100ms 350ms var(--pp-ease) both;
}

.pp-hero-copy {
  min-width: 0;
}

.pp-hero-name {
  margin: 0 0 0.45em;
  color: var(--pp-d-ink);
  font-size: clamp(1.05rem, 1.7cqw, 1.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.45);
}

/* Kept whole, so on a phone it drops to its own line instead of breaking mid-phrase. */
.pp-hero-condition {
  display: inline-block;
  color: #a1a1a6;
  font-weight: 400;
  white-space: nowrap;
}

.pp-hero-condition::before {
  content: "\00b7";
  margin: 0 0.35em;
}

.pp-hero-headline {
  margin: 0;
  /* Room for descenders (the g in "High-Tech"): background-clip: text paints only the box, so a tight
     line-height cut them off. The negative margin gives the space back. */
  padding-bottom: 0.2em;
  margin-bottom: -0.2em;
  background: linear-gradient(90deg, #ffffff 0%, #ffffff 55%, #bfe6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--pp-d-ink);
  font-size: clamp(2.3rem, 4.5cqw, 4.6rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.pp-hero-sub {
  max-width: 42cqw;
  margin: 0.85rem 0 0;
  color: #d2d2d7;
  font-size: clamp(0.875rem, 1.15cqw, 1.0625rem);
  line-height: 1.4;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}

/* The price pill: frosted, with the buy box's own button mirrored into it. */
.pp-hero-buy {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 1.2rem;
  padding: 0.65rem 0.65rem 0.65rem 1.5rem;
  border-radius: 980px;
  background: rgba(42, 42, 45, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.pp-hero-price {
  margin: 0;
  color: var(--pp-d-ink);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.pp-hero-now {
  font-size: 1.0625rem;
}

.pp-hero-was {
  margin-left: 0.3em;
  color: #a1a1a6;
  font-weight: 400;
  text-decoration: line-through;
}

.pp-hero-was[hidden] {
  display: none;
}

.pp-hero-terms {
  display: block;
  font-weight: 400;
}

.pp-hero .pp-hero-cta {
  display: inline-block;
  margin: 0;
  padding: 0.62rem 1.4rem;
  border: 0;
  border-radius: 980px;
  background: var(--pp-blue);
  color: #fff;
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.pp-hero .pp-hero-cta:hover,
.pp-hero .pp-hero-cta:focus-visible {
  background: var(--pp-blue-hover);
  color: #fff;
}

.pp-hero .pp-hero-cta.is-preorder:hover {
  background: #005bb5;
}

.pp-hero .pp-hero-cta.is-off,
.pp-hero .pp-hero-cta.is-off:hover {
  background: #3a3a3c;
  color: #a1a1a6;
  cursor: not-allowed;
}

/* Scroll hint at the bottom centre: a glass button whose chevron bobs, jumping to the buy box. Desktop only:
   on tablets and phones the lockup needs the full width and the buy box is already in view. */
.pp-hero-scroll {
  display: none;
}

@media screen and (min-width: 64.063em) {
  .pp-hero-scroll {
    position: absolute;
    left: 50%;
    bottom: clamp(0.75rem, 1.5cqw, 1.25rem);
    z-index: 6;
    display: grid;
    width: 46px;
    height: 46px;
    margin-left: -23px;
    place-items: center;
    border-radius: 50%;
    background: rgba(42, 42, 45, 0.72);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    color: var(--pp-d-ink);
    transition: background-color 0.2s ease;
    animation: pp-hero-arrive 1100ms 600ms var(--pp-ease) both;
  }

  .pp-hero-scroll:hover,
  .pp-hero-scroll:focus-visible {
    background: rgba(72, 72, 76, 0.92);
    color: #fff;
  }

  .pp-hero-scroll:focus-visible {
    outline: 2px solid var(--pp-d-link);
    outline-offset: 3px;
  }

  .pp-hero-scroll svg {
    display: block;
    width: 22px;
    height: 22px;
    animation: pp-hero-scroll-hint 1.9s ease-in-out 1.8s infinite;
  }
}

@keyframes pp-hero-scroll-hint {
  0%, 100% { transform: translateY(-3px); }
  50% { transform: translateY(4px); }
}

/* Starts just above zero so the browser still counts the lockup as painted from the first frame. */
@keyframes pp-hero-arrive {
  from { opacity: 0.01; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@media print, screen and (min-width: 48em) and (max-width: 64em) {
  .pp-hero-stage {
    aspect-ratio: 16 / 9;
    min-height: 0;
  }

  .pp-hero-sub {
    display: none;
  }
}

@media screen and (max-width: 47.937em) {
  .pp-hero {
    --pp-hero-ext: 7.5rem;
  }

  /* Square on phones, so the price pill stays on the first screen. */
  .pp-hero-stage {
    aspect-ratio: 1 / 1;
    min-height: 280px;
    max-height: calc(100vh - 17rem);
  }

  .pp-hero-lockup {
    flex-direction: column;
    align-items: stretch;
    left: 1.25rem;
    right: 1.25rem;
    bottom: 1.5rem;
  }

  .pp-hero-name {
    font-size: 1.15rem;
  }

  .pp-hero-headline {
    font-size: clamp(1.9rem, 9.5cqw, 3rem);
  }

  .pp-hero-sub {
    display: none;
  }

  .pp-hero-buy {
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pp-hero-lockup,
  .pp-hero-scroll,
  .pp-hero-scroll svg {
    animation: none;
  }

  .pp-hero--still .pp-hero-still img {
    animation: none;
  }
}
