/* Best Buy case study — minimal narrative treatment */

.page-bestbuy {
  background-color: #ffffff;
}

.page-bestbuy .nav-block {
  background-color: #ffffff;
}

/* Logo — Best Buy blue, same frame height as Prosper logo cycle */
.bestbuy-logo {
  display: block;
  width: 100%;
  aspect-ratio: 2352 / 1110;
  background: #0046be;
  overflow: hidden;
  box-sizing: border-box;
}

.bestbuy-logo__frame {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.65s cubic-bezier(0.77, 0, 0.175, 1);
  will-change: clip-path;
}

.bestbuy-logo.is-visible .bestbuy-logo__frame {
  clip-path: inset(0 0 0 0);
}

.page-bestbuy .project-gallery .bestbuy-logo img {
  display: block;
  width: min(560px, 84vw);
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.bb-story-copy {
  --hero-lead: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: var(--story-chapter-pad-top) var(--page-inset) var(--story-chapter-pad-bottom);
  text-align: center;
  background: #fff;
  box-sizing: border-box;
}

.page-bestbuy .bb-story-copy .project-title {
  grid-column: auto;
  grid-row: auto;
  align-self: center;
  width: 100%;
  max-width: 100%;
  margin: 0 0 var(--hero-lead);
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  color: var(--black);
}

.page-bestbuy .bb-story-copy .project-title-sep {
  font-weight: 300;
}

.page-bestbuy .bb-story-copy .project-desc {
  margin-inline: auto;
  margin-bottom: 0;
  max-width: 52ch;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  color: var(--project-label-color);
}

.bb-story__outro {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--story-chapter-pad-top) var(--page-inset) var(--story-chapter-pad-top);
  text-align: center;
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

.page-bestbuy .bb-story__outro .project-title {
  grid-column: auto;
  grid-row: auto;
  align-self: center;
  width: 100%;
  max-width: 100%;
  margin: 0;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  color: var(--black);
}

/* Apple-style blur-up reveal */
.bb-apple-reveal,
.page-bestbuy .cs-reveal {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(12px);
  transition:
    opacity 0.95s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.95s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.95s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform, filter;
}

.bb-apple-reveal.is-visible,
.page-bestbuy .cs-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.page-bestbuy .bb-story-copy .cs-reveal:nth-child(2) {
  transition-delay: 0.14s;
}

@media (prefers-reduced-motion: reduce) {
  .bb-apple-reveal,
  .page-bestbuy .cs-reveal {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }

  .bestbuy-logo__frame {
    clip-path: none;
    transition: none;
  }
}

@media (max-width: 991px) {
  .bestbuy-logo {
    aspect-ratio: auto;
    height: auto;
    padding: calc(clamp(20px, 3vw, 28px) + 50px) 0;
  }

  .bestbuy-logo__frame {
    width: min(100%, 512px);
    min-height: min(312px, 72vw);
    height: auto;
    margin-inline: auto;
  }

  .page-bestbuy .project-gallery .bestbuy-logo img {
    width: 100%;
    max-width: min(448px, 83.2vw);
  }
}

@media (max-width: 767px) {
  .bestbuy-logo {
    padding: 66px 0 74px;
  }

  .bestbuy-logo__frame {
    width: min(100%, 384px);
    min-height: min(224px, 64vw);
  }

  .page-bestbuy .project-gallery .bestbuy-logo img {
    max-width: min(320px, 86.4vw);
  }
}

/* Brand color circle animation */
.bb-circles {
  display: block;
  width: 100%;
  margin: 0;
  background: #e9e9e9;
  overflow: hidden;
}

.bb-circles__stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.bb-circles__dot {
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0;
  transition:
    opacity 0.275s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.275s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.bb-circles__dot--corner {
  width: 18%;
}

.bb-circles__dot--sm {
  width: 18%;
  min-width: 94px;
  max-width: 173px;
}

.bb-circles__dot--md {
  width: 30%;
  min-width: 156px;
  max-width: 288px;
}

.bb-circles__dot--yellow {
  background: #f6eb16;
}

.bb-circles__dot--red {
  background: #e81c24;
}

.bb-circles__dot--blue {
  background: #0a4abf;
}

.bb-circles__dot--black {
  background: #000000;
}

.bb-circles__dot--tr {
  left: 88%;
  top: calc(12% + 100px);
  transform: translate(-50%, -50%) scale(0.35);
}

.bb-circles__dot--tl-float {
  left: calc(30% - 200px);
  top: calc(25% + 130px);
  transform: translate(-50%, -50%) scale(0);
}

.bb-circles__dot--br-float {
  left: calc(88% - 340px);
  top: calc(68% + 40px);
  transform: translate(-50%, -50%) scale(0);
}

.bb-circles__stage.is-playing .bb-circles__dot--tr.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.bb-circles__stage.is-playing .bb-circles__dot--br-float.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.bb-circles__stage.is-playing .bb-circles__dot--tl-float.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.bb-circles__burst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.bb-circles__burst.is-visible {
  opacity: 1;
  visibility: visible;
}

.bb-circles__burst-dot {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  background: #ffffff;
  transform: translate(-50%, -50%);
  will-change: transform, width, height, opacity;
}

.bb-circles__stage.is-complete .bb-circles__dot--tr {
  animation: bb-circles-breathe-tr 1.2s ease-in-out infinite;
}

.bb-circles__stage.is-complete .bb-circles__dot--br-float {
  animation: bb-circles-breathe-br-float 1.2s ease-in-out infinite 0.15s;
}

.bb-circles__stage.is-complete .bb-circles__dot--tl-float {
  animation: bb-circles-breathe-tl-float 1.2s ease-in-out infinite 0.3s;
}

@keyframes bb-circles-breathe-tr {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.04); }
}

@keyframes bb-circles-breathe-br-float {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.06); }
}

@keyframes bb-circles-breathe-tl-float {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.05); }
}

@media (max-width: 991px) {
  .bb-circles__stage {
    aspect-ratio: 4 / 3;
  }

  .bb-circles__dot--corner {
    width: 22%;
  }

  .bb-circles__dot--sm {
    width: 24%;
    min-width: 0;
    max-width: none;
  }

  .bb-circles__dot--md {
    width: 38%;
    min-width: 0;
    max-width: none;
  }

  .bb-circles__dot--tr {
    left: 78%;
    top: 22%;
  }

  .bb-circles__dot--tl-float {
    left: 34%;
    top: 44%;
  }

  .bb-circles__dot--br-float {
    left: 28%;
    top: 76%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bb-circles__dot {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
  }

  .bb-circles__dot--tr {
    left: 88%;
    top: calc(12% + 100px);
    transform: translate(-50%, -50%);
  }

  .bb-circles__dot--br-float {
    left: calc(88% - 340px);
    top: calc(68% + 40px);
    transform: translate(-50%, -50%);
  }

  .bb-circles__dot--tl-float {
    left: calc(30% - 200px);
    top: calc(25% + 130px);
    transform: translate(-50%, -50%);
  }

  .bb-circles__burst.is-static .bb-circles__burst-dot {
    opacity: 1;
  }
}

@media (max-width: 991px) and (prefers-reduced-motion: reduce) {
  .bb-circles__dot--tr {
    left: 78%;
    top: 22%;
    transform: translate(-50%, -50%);
  }

  .bb-circles__dot--tl-float {
    left: 34%;
    top: 44%;
    transform: translate(-50%, -50%);
  }

  .bb-circles__dot--br-float {
    left: 28%;
    top: 76%;
    transform: translate(-50%, -50%);
  }
}
