/*
 * Responsive display utilities for Webflow code components — a hand-written subset of
 * Tailwind's display classes behind mobile-first breakpoint variants. Plain CSS (no Tailwind
 * build step): each component renders in its own Shadow DOM, so every *.webflow.tsx imports
 * this file to get the utilities inside its shadow root.
 *
 * Breakpoints are the Edge Webflow site's own: tablet 768px, desktop 1024px (src/config/viewports.ts
 * keeps desktop at 992px for the prefabs/Storybook — these intentionally differ).
 *
 *   <div className="hidden tablet:flex">…</div>        hidden on mobile, flex from tablet up
 *   <span className="desktop-only:hidden">…</span>     hidden on desktop only
 *
 * Every declaration is !important so the utilities win over the component stylesheets
 * (e.g. `.hero-form { display: flex }`) regardless of selector specificity or load order.
 *
 * Rules are ordered base → mobile → tablet → desktop so a wider breakpoint wins when
 * several variants match (all selectors have equal specificity).
 */

.hidden {
  display: none !important;
}

.block {
  display: block !important;
}

.inline-block {
  display: inline-block !important;
}

.inline {
  display: inline !important;
}

.flex {
  display: flex !important;
}

.inline-flex {
  display: inline-flex !important;
}

.grid {
  display: grid !important;
}

.inline-grid {
  display: inline-grid !important;
}

.contents {
  display: contents !important;
}

/* Mobile and up (0px+) — the mobile-first base, no media query. */

.mobile\:hidden {
  display: none !important;
}
.mobile\:block {
  display: block !important;
}
.mobile\:inline-block {
  display: inline-block !important;
}
.mobile\:inline {
  display: inline !important;
}
.mobile\:flex {
  display: flex !important;
}
.mobile\:inline-flex {
  display: inline-flex !important;
}
.mobile\:grid {
  display: grid !important;
}
.mobile\:inline-grid {
  display: inline-grid !important;
}
.mobile\:contents {
  display: contents !important;
}

/* Mobile only (0–767px). */

@media (max-width: 767.98px) {
  .mobile-only\:hidden {
    display: none !important;
  }
  .mobile-only\:block {
    display: block !important;
  }
  .mobile-only\:inline-block {
    display: inline-block !important;
  }
  .mobile-only\:inline {
    display: inline !important;
  }
  .mobile-only\:flex {
    display: flex !important;
  }
  .mobile-only\:inline-flex {
    display: inline-flex !important;
  }
  .mobile-only\:grid {
    display: grid !important;
  }
  .mobile-only\:inline-grid {
    display: inline-grid !important;
  }
  .mobile-only\:contents {
    display: contents !important;
  }
}

/* Tablet and up (768px+). */

@media (min-width: 768px) {
  .tablet\:hidden {
    display: none !important;
  }
  .tablet\:block {
    display: block !important;
  }
  .tablet\:inline-block {
    display: inline-block !important;
  }
  .tablet\:inline {
    display: inline !important;
  }
  .tablet\:flex {
    display: flex !important;
  }
  .tablet\:inline-flex {
    display: inline-flex !important;
  }
  .tablet\:grid {
    display: grid !important;
  }
  .tablet\:inline-grid {
    display: inline-grid !important;
  }
  .tablet\:contents {
    display: contents !important;
  }
}

/* Tablet only (768–1023px). */

@media (min-width: 768px) and (max-width: 1023.98px) {
  .tablet-only\:hidden {
    display: none !important;
  }
  .tablet-only\:block {
    display: block !important;
  }
  .tablet-only\:inline-block {
    display: inline-block !important;
  }
  .tablet-only\:inline {
    display: inline !important;
  }
  .tablet-only\:flex {
    display: flex !important;
  }
  .tablet-only\:inline-flex {
    display: inline-flex !important;
  }
  .tablet-only\:grid {
    display: grid !important;
  }
  .tablet-only\:inline-grid {
    display: inline-grid !important;
  }
  .tablet-only\:contents {
    display: contents !important;
  }
}

/* Desktop and up (1024px+). */

@media (min-width: 1024px) {
  .desktop\:hidden {
    display: none !important;
  }
  .desktop\:block {
    display: block !important;
  }
  .desktop\:inline-block {
    display: inline-block !important;
  }
  .desktop\:inline {
    display: inline !important;
  }
  .desktop\:flex {
    display: flex !important;
  }
  .desktop\:inline-flex {
    display: inline-flex !important;
  }
  .desktop\:grid {
    display: grid !important;
  }
  .desktop\:inline-grid {
    display: inline-grid !important;
  }
  .desktop\:contents {
    display: contents !important;
  }
}

/* Desktop only (1024px+) — same range as desktop: (top of the scale). */

@media (min-width: 1024px) {
  .desktop-only\:hidden {
    display: none !important;
  }
  .desktop-only\:block {
    display: block !important;
  }
  .desktop-only\:inline-block {
    display: inline-block !important;
  }
  .desktop-only\:inline {
    display: inline !important;
  }
  .desktop-only\:flex {
    display: flex !important;
  }
  .desktop-only\:inline-flex {
    display: inline-flex !important;
  }
  .desktop-only\:grid {
    display: grid !important;
  }
  .desktop-only\:inline-grid {
    display: inline-grid !important;
  }
  .desktop-only\:contents {
    display: contents !important;
  }
}

/* Plain, hand-written CSS scoped under .story-video — rendered inside Webflow's shadow root, no Tailwind. */

.story-video,
.story-video *,
.story-video *::before,
.story-video *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family, 'IBM Plex Sans'), sans-serif;
}

.story-video {
  width: 100%;
  padding: 90px 16px 0;
  overflow-x: clip;
  color: #fff;
}

/* The glow canvas spills ~110px past this box, so it wraps the clipped card instead of living inside it. */
.story-video__stage {
  position: relative;
  opacity: 0;
  translate: 0 72px;
  transition:
    opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1),
    translate 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.story-video--in-view .story-video__stage {
  opacity: 1;
  translate: 0 0;
}

.story-video__card {
  position: relative;
  z-index: 2;
  width: 100%;
  aspect-ratio: 359 / 607;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
}

.story-video__card--shaped {
  background: none;
}

.story-video__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 767px) {
  .story-video__poster[src*='tfw-after-the-party'] {
    object-position: 24% 50%;
  }
}

.story-video__bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding: 56px 20px 21px;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.story-video__caption {
  min-width: 0;
  max-width: 75vw;
}

.story-video__heading {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  padding-bottom: 0.16em;
  margin-bottom: -0.16em;
  font-size: 27px;
  font-weight: 500;
  line-height: 1.36;
}

.story-video__byline {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 16px;
  line-height: 1.36;
}

.story-video__play {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  pointer-events: auto;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
}

.story-video__play:hover {
  background: #f0dab1;
  transform: scale(1.06);
}

.story-video__play:focus-visible {
  outline: 2px solid #e0b25c;
  outline-offset: 4px;
}

.story-video__play-icon {
  width: 18px;
  height: 21px;
  margin-left: 3px;
}

/* Phone and tablet tab = the desktop one (79px deep, 45px padding, 41px label) scaled to the 26px label (×0.634),
   so the slope sits the same distance from the title at every size. */
.story-video__tab {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 50px;
  padding: 0 29px;
  border-bottom-right-radius: 24px;
  background: #000;
}

.story-video__tab::before,
.story-video__tab::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  background: radial-gradient(circle at 100% 100%, transparent 24px, #000 24.5px);
}

.story-video__tab::before {
  top: 0;
  right: -24px;
}

.story-video__tab::after {
  bottom: -24px;
  left: 0;
}

/* Poster, shade, title, play button and player live in the media layer, which is clipped to the notch outline
   (notchShape.ts) once it's measured; the tab stays outside the clip, on the black card behind it. */
.story-video__media {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
}

.story-video__card--shaped .story-video__media {
  -webkit-clip-path: var(--story-card-shape);
  clip-path: var(--story-card-shape);
}

.story-video__card--shaped .story-video__tab {
  background: none;
}

.story-video__card--shaped .story-video__tab::before,
.story-video__card--shaped .story-video__tab::after {
  content: none;
}

.story-video__tab-icon {
  width: 19px;
  height: 12px;
}

.story-video__tab-label {
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.26px;
}

/* Video pop-up (Figma 9083:4427): 80% black over the page, a 16:9 player up to 1280px wide, and a 44px close
   button above its top-right corner. Clicking the backdrop or pressing Escape closes it. */
.story-video__modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: rgba(0, 0, 0, 0.8);
  animation: story_video_modal_in 0.25s ease-out both;
}

.story-video__modal-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  width: min(1280px, 100%, (100vh - 120px) * 16 / 9);
}

.story-video__player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.story-video__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.story-video__close {
  display: flex;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.story-video__close:hover {
  transform: scale(1.06);
}

.story-video__close:focus-visible {
  outline: 2px solid #e0b25c;
  outline-offset: 3px;
}

.story-video__close-icon {
  width: 100%;
  height: 100%;
}

@keyframes story_video_modal_in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-video__stage,
  .story-video__more-item {
    opacity: 1;
    translate: none;
  }

  .story-video__stage,
  .story-video__more-item,
  .story-video__thumb-play,
  .story-video__play,
  .story-video__close {
    transition: none;
  }

  .story-video__modal {
    animation: none;
  }
}

@media (min-width: 768px) {
  .story-video {
    padding: 70px 32px 0;
  }

  .story-video__bar {
    flex-direction: row;
    align-items: center;
    gap: 23px;
    padding: 72px 35px 31px;
  }

  .story-video__play {
    width: 89px;
    height: 89px;
  }

  .story-video__play-icon {
    width: 22px;
    height: 25px;
  }

  .story-video__heading {
    font-size: 42px;
    line-height: 45px;
  }

  .story-video__byline {
    font-size: 20px;
    line-height: 27px;
  }

  .story-video__card {
    aspect-ratio: 959 / 577;
    border-radius: 24px;
  }

  .story-video__tab {
    height: 50px;
    padding: 0 29px;
  }
}

@media (min-width: 1280px) {
  .story-video {
    padding: 100px max(79px, calc((100% - 1673px) / 2)) 0;
  }

  .story-video__bar {
    gap: 35px;
    padding: 120px 60px 47px;
  }

  .story-video__byline {
    margin-top: 6px;
  }

  .story-video__card {
    aspect-ratio: 1674 / 935;
  }

  .story-video__play {
    width: 118px;
    height: 118px;
  }

  .story-video__play-icon {
    width: 33px;
    height: 38px;
    margin-left: 4px;
  }

  .story-video__tab {
    gap: 8px;
    height: 79px;
    padding: 0 52px 0 45px;
  }

  .story-video__tab-icon {
    width: 30px;
    height: 18px;
  }

  .story-video__tab-label {
    font-size: 41px;
    letter-spacing: -0.4px;
  }
}

/* More stories (Figma 9144:41787): three cards under the featured one; everything inside scales with the card width
   (cqi), matching the 307px tablet/phone and 536px desktop frames. Phones scroll them sideways like the blog cards. */
.story-video__more {
  display: flex;
  gap: 18px;
  margin: 18px -16px 0;
  padding: 0 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 16px;
  scrollbar-width: none;
  list-style: none;
}

.story-video__more::-webkit-scrollbar {
  display: none;
}

.story-video__more-item {
  container-type: inline-size;
  flex: 0 0 auto;
  width: min(307px, calc(100% - 52px));
  scroll-snap-align: start;
  --story-video-stagger: 0ms;
  opacity: 0;
  translate: 0 40px;
  scale: 0.97;
  transition:
    opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1) var(--story-video-stagger),
    translate 0.9s cubic-bezier(0.16, 1, 0.3, 1) var(--story-video-stagger),
    scale 0.9s cubic-bezier(0.16, 1, 0.3, 1) var(--story-video-stagger);
}

/* Like the product phones: the small stories fade up once their row reaches the screen, one at a time from tablet up. */
@media (min-width: 768px) {
  .story-video__more-item:nth-child(2) {
    --story-video-stagger: 250ms;
  }

  .story-video__more-item:nth-child(3) {
    --story-video-stagger: 500ms;
  }
}

.story-video__more--in-view .story-video__more-item {
  opacity: 1;
  translate: 0 0;
  scale: 1;
}

.story-video__thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 536 / 336;
  border: 1px solid #383838;
  border-radius: 4.4cqi;
  overflow: hidden;
  background: #000;
  isolation: isolate;
}

.story-video__thumb-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.story-video__thumb-caption {
  margin-top: 2.24cqi;
}

.story-video__thumb-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: 5.6cqi;
  font-weight: 500;
  line-height: 1.18;
}

.story-video__thumb-byline {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1.12cqi;
  color: rgba(255, 255, 255, 0.72);
  font-size: 3.73cqi;
  line-height: 1.36;
}

.story-video__thumb-play {
  position: absolute;
  bottom: 4.2cqi;
  left: 5.4cqi;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 13.3cqi;
  height: 13.3cqi;
  border: 0;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
}

.story-video__thumb-play::after {
  content: '';
  position: absolute;
  inset: -1000px;
}

.story-video__thumb-play .story-video__play-icon {
  width: 25%;
  height: auto;
  margin-left: 6%;
}

.story-video__thumb-play--placeholder {
  cursor: default;
  pointer-events: none;
}

.story-video__thumb-play:hover {
  background: #f0dab1;
  transform: scale(1.06);
}

.story-video__thumb-play:focus-visible {
  outline: 2px solid #e0b25c;
  outline-offset: 4px;
}

@media (hover: hover) {
  .story-video__thumb:hover .story-video__thumb-image {
    transform: scale(1.04);
  }
}

@media (min-width: 768px) {
  .story-video__more {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 18px 0 0;
    padding: 0;
    overflow: visible;
  }

  .story-video__more-item {
    width: auto;
    max-width: none;
  }
}

@media (min-width: 1280px) {
  .story-video__more {
    gap: 32px;
    margin-top: 32px;
  }
}

/* Parallax: each small story's photo slides inside its card as the row passes, over-scaled so no edge shows. */
@keyframes story_video_image_drift {
  from {
    translate: 0 -6%;
  }
  to {
    translate: 0 6%;
  }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .story-video__more {
      view-timeline: --story-video-more block;
    }

    .story-video__thumb-image {
      scale: 1.16;
      animation: story_video_image_drift linear both;
      animation-timeline: --story-video-more;
      animation-range: cover;
    }
  }
}

/* Hover: small story cards lift and pick up a soft champagne edge glow, like the blog cards. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .story-video__thumb {
    transition:
      transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
      border-color 0.5s ease,
      box-shadow 0.5s ease;
  }

  .story-video__more-item:hover .story-video__thumb {
    border-color: rgba(240, 218, 177, 0.55);
    box-shadow:
      0 18px 40px rgba(0, 0, 0, 0.45),
      0 0 32px rgba(224, 178, 92, 0.22);
    transform: translateY(-6px);
  }
}

/* The featured play button catches a slow, minimal champagne light sweep every 7s, like the nav CTA. */
@keyframes story_video_play_shimmer {
  0%,
  78% {
    background-position: 160% 0;
  }
  100% {
    background-position: -60% 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .story-video__play {
    background-image: linear-gradient(105deg, transparent 44%, rgba(232, 196, 128, 0.6) 50%, transparent 56%);
    background-repeat: no-repeat;
    background-size: 250% 100%;
    background-position: 160% 0;
    animation: story_video_play_shimmer 7s cubic-bezier(0.45, 0, 0.25, 1) 2.4s infinite;
  }
}

/* Scroll-linked fade: the featured story fades up as it enters and is fully in once its top is a quarter of the way
   up the screen. Browsers without view timelines keep the time-based fade on --in-view. */
@keyframes story_video_fade_up {
  from {
    opacity: 0;
    translate: 0 60px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .story-video__stage {
      transition: none;
      animation: story_video_fade_up linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 25vh;
    }
  }
}

/* The Stories tab fades in with the notch (StoryVideo.webflow.tsx drives --story-notch-progress 0 → 1). */
.story-video__tab > * {
  opacity: clamp(0, (var(--story-notch-progress, 1) - 0.55) * 2.2, 1);
  translate: 0 calc((1 - var(--story-notch-progress, 1)) * 8px);
}

/* The caption holds to half the screen on desktop only; phones and tablets keep the 75vw cap. */
@media (min-width: 1280px) {
  .story-video__caption {
    max-width: 50vw;
  }
}

