/* Bear Streak landing v2.2.0 - motion overlay styles (additive only). */
.bs-clip-video {
  position: absolute;
  display: block;
  object-fit: cover;
  background: #0e0b09;
  z-index: 3;
  pointer-events: none;
}

/* Do not show the counter's scroll-observer reset ("0 of 301 days").
   The invisible sizing number remains in flow, so hiding the transient
   absolute number neither shifts the chip nor changes its layout. */
span[data-bs-count-protected] > span.absolute {
  visibility: hidden;
}
span[data-bs-count-protected].bs-count-ready > span.absolute {
  visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
  /* Clips are hidden for reduced-motion users, so the real screenshot
     underneath is what they see. */
  .bs-clip-video {
    animation: none !important;
    display: none !important;
  }
}

/* the hero carousel crossfades its slides over 700 ms, so mid-swap both
   stills are semi-transparent and the fan cards show through the phone.
   Kill the fade on the slide images only (object-contain) - the swap becomes
   instant, the phone is never transparent. The fan posters keep their own
   900 ms entrance (they do not carry object-contain). */
.hero-phone img.object-contain {
  transition: none !important;
}

/* at desktop widths the year phone renders larger (300 -> 420 px) so the
   grid carries the section and the whole phone still fits a 900 px
   viewport. The new re-crop is wider (ratio 0.58 vs 0.43), so 420 px
   wide is only 720 px tall. The wrapper is the max-width constraint;
   widening it grows the grid row (items-center) and the section - no
   overlap, no horizontal overflow (verified at 1200/1440). */
@media (min-width: 1024px) {
  section:has(img[src*="year-run"]) div:has(> .glow) {
    max-width: 420px !important;
  }
}

/* the year video and the year screenshot are phone captures with
   transparent corners outside the bezel; clip both to the bezel shape
   so no square box shows on the page background. The radii match the
   bezel (about 12% of the width, 7% of the height, measured on the
   re-cropped frame: corner radius ~100 px of 816x1400). The img tag
   still carries the old 599x1400 width/height attributes, which the
   browser uses as the aspect ratio before the image loads - override
   it to the new 816x1400 so the frame is never stretched to the old
   tall ratio. */
video[data-bs-clip="year"],
img[src*="year-run"] {
  clip-path: inset(0 round 12% 7%) !important;
}
img[src*="year-run"] {
  aspect-ratio: 816 / 1400 !important;
}

/* on mobile (<= 430 px) every phone frame is at most ~72% of the
   viewport width, so the block title and the whole phone fit in one
   screen and the Safari bottom bar never covers the numbers chip.
   The hero phone (61%), the rest phone (64%) and the widget-strip
   phones (40-44%) already sit under the cap; the year phone was the
   tall one and is now 281 px wide x 482 tall at 390. The rest phone
   is NOT in the rule below on purpose: the bundle already caps it
   below 72vw, and a max-width here would only raise that cap. The 3D
   tilt is kept exactly as rev 6 - only the size is capped, never the
   angle. */
@media (max-width: 430px) {
  .hero-phone,
  section:has(img[src*="year-run"]) div:has(> .glow) {
    max-width: 72vw !important;
  }

  /* The phone drawing is right-heavy inside the exported stage.  Move that
     artwork and its count as one visible group; rebuild the quiet stage below
     it at the true page centre so the dark rounded frame stays balanced. */
  section:has(img[src*="year-run"]) div.relative:has(> .glow) {
    transform: translateX(-12.5%);
  }
  section:has(img[src*="year-run"]) div.relative:has(> .glow)::before {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(12.5%);
    border-radius: 12% / 7%;
    background: #080705;
    z-index: 0;
    pointer-events: none;
  }
  section:has(img[src*="year-run"]) div.relative:has(> .glow) > .glow,
  section:has(img[src*="year-run"]) div.relative:has(> .glow) > div.absolute {
    position: relative;
    z-index: 1;
  }
  section:has(img[src*="year-run"]) div.relative:has(> .glow) > div.absolute {
    position: absolute;
    z-index: 2;
  }

  /* The counter remains inside the media footprint. Tighten only this
     section's mobile stack so the media sits closer to its copy. */
  section:has(img[src*="year-run"]) {
    padding-bottom: 40px !important;
  }
  section:has(img[src*="year-run"]) > div {
    gap: 24px !important;
  }
  section:has(img[src*="year-run"]) div:has(> .glow) > div.absolute {
    right: 0 !important;
  }
}

/* at tablet/desktop widths the Rest image grows (270 -> 340 px) so the
   Rest and Health media are comparable in area (340x589 vs 480x439). The
   clip keeps its aspect (object-fit: cover, video re-syncs via
   ResizeObserver), so nothing is cropped. Mobile widths keep the base. */
@media (min-width: 768px) {
  img[src*="rest-wake"] {
    max-width: 340px !important;
  }
}

/* The two real-life cards are independent stories.  At tablet and desktop
   widths the grid's default stretch made the shorter Health story inherit
   Rest's tall phone height, leaving a large artificial void before its
   health widget.  Let that card end at its own media instead. */
@media (min-width: 768px) {
  article:has(#health-title) {
    align-self: start;
  }
}

/* A short landscape phone needs the hero's two columns before the normal
   1024px desktop breakpoint.  This keeps both store badges in the first
   viewport without changing portrait/tablet or the phone's 3D artwork. */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 900px) {
  main > section[aria-labelledby="hero-title"] {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }
  main > section[aria-labelledby="hero-title"] > div {
    grid-template-columns: minmax(0, 1.25fr) minmax(170px, .75fr) !important;
    column-gap: 24px !important;
    row-gap: 0 !important;
  }
  #hero-title {
    font-size: 32px !important;
  }
  .hero-phone {
    width: 172px !important;
  }
  .hero-phone + div,
  .hero-phone ~ div {
    display: none;
  }
  .hero-phone + div {
    display: none;
  }
  main > section[aria-labelledby="hero-title"] .hero-phone + div {
    display: none;
  }
}

/* the year section's floating count chip sits over the year phone; its
   glass background lets the video's own stats row read through, so two
   sets of numbers show at once. Make the chip solid in its own colour
   so only the chip's number is readable. Scoped to the year section so
   the hero streak label keeps its own style. */
section:has(img[src*="year-run"]) [class*="bg-ink-2/90"] {
  background-color: #17120e !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* the widget marquee already fades its edges, but over 6% of the width
   (86 px at 1440) - a label crossing the edge reads as accidentally cut.
   A fixed 32 px fade makes the cut look intentional. */
.marquee {
  -webkit-mask-image: linear-gradient(to right, transparent, black 32px, black calc(100% - 32px), transparent) !important;
  mask-image: linear-gradient(to right, transparent, black 32px, black calc(100% - 32px), transparent) !important;
}
