/* ==========================================================================
   RackTide landing page: video feature (in the hero, above the stats)
   The poster card opens the video in a lightbox. Lightbox base styles come
   from gallery.css (.lightbox, .lightbox__btn); this file adds the video
   variant. Depends on tokens in hero.css.
   ========================================================================== */

/* The card sits inside the hero, between the headline and the stats, so the
   live grid runs behind it. hero-grid.js treats it as solid (data-block). */
.hero__video {
  padding: 0 clamp(20px, 5.8vw, 83px);
  margin: clamp(40px, 6vw, 96px) 0 clamp(48px, 6vw, 88px);
}

/* With the video present the headline no longer needs to fill the screen. */
.hero:has(.hero__video) .hero__body {
  flex: 0 0 auto;
  padding-top: clamp(40px, 7vw, 110px);
  padding-bottom: 0;
}

.video-card {
  position: relative;
  display: block;
  width: 100%;
  max-width: 1274px;
  aspect-ratio: 1274 / 664;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #121920;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
  -webkit-tap-highlight-color: transparent;
}

.video-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
  transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.video-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(10, 15, 21, 0.48);
  transition: background-color 0.4s ease;
}

/* Hairline edge, same treatment as the story photo */
.video-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(120, 190, 255, 0.12);
  pointer-events: none;
}

.video-card__cta {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.video-card__play {
  display: grid;
  place-items: center;
  width: 50px;
  height: 52px;
  border-radius: 8px;
  background: var(--blue-bright);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(92, 196, 248, 0.5);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease, background-color 0.25s ease;
}

.video-card__play svg { width: 22px; height: 22px; margin-left: 2px; }

.video-card__label {
  font: 600 16px / 1 var(--font-body);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}

.video-card:hover .video-card__img,
.video-card:focus-visible .video-card__img { transform: scale(1.03); }

.video-card:hover::before,
.video-card:focus-visible::before { background-color: rgba(10, 15, 21, 0.38); }

.video-card:hover .video-card__play,
.video-card:focus-visible .video-card__play {
  transform: scale(1.08);
  background: #7ed0fa;
  box-shadow: 0 0 0 10px rgba(92, 196, 248, 0.18), 0 0 34px rgba(47, 176, 241, 0.55);
}

.video-card:focus-visible {
  outline: 3px solid var(--blue-bright);
  outline-offset: 4px;
}

/* --------------------------------------------------------------------------
   Video lightbox
   -------------------------------------------------------------------------- */
.lightbox--video .lightbox__frame {
  position: relative;
  width: min(1280px, calc(100vw - 176px), calc((100dvh - 120px) * 16 / 9));
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
}

.lightbox--video video {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 719px) {
  .video-card { aspect-ratio: 4 / 3; }
  .video-card__label { font-size: 14px; }
  .lightbox--video .lightbox__frame {
    width: min(calc(100vw - 24px), calc((100dvh - 160px) * 16 / 9));
    border-radius: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .video-card__img,
  .video-card::before,
  .video-card__play { transition: none; }
}
