/* ==========================================================================
   Brisk Forwarding - Hero Video Section Stylesheet
   File: css/hero-video.css
   Purpose: High-clarity, high-performance background video hero section with
            vivid contrast, balanced cinematic overlay, and consistent typography.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Hero Video Section Container
   -------------------------------------------------------------------------- */
.hero-section.hero-section--video {
  position: relative;
  width: 100%;
  height: calc(100vh - (var(--topbar-height, 36px) + var(--navbar-height, 80px)));
  min-height: 560px;
  overflow: hidden;
  background-color: #07101d;
  display: flex;
  align-items: center;
}

/* --------------------------------------------------------------------------
   2. Video Wrapper & Video Media (Clarity & Hardware Acceleration)
   -------------------------------------------------------------------------- */
.hero-video-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
  background-color: #07101d;
}

.hero-video-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  filter: brightness(0.96) contrast(1.04) saturate(1.06);
}

/* Fades in cleanly once video is loaded and ready */
.hero-video-media.is-ready,
.hero-video-media.is-playing {
  opacity: 1;
}

/* Fallback poster image */
.hero-video-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
  z-index: 0;
  transition: opacity 0.5s ease;
  filter: brightness(0.95) contrast(1.05);
}

.hero-video-wrapper.is-playing .hero-video-poster {
  opacity: 0;
  visibility: hidden;
}

/* --------------------------------------------------------------------------
   3. Balanced Video Overlay Gradient
   Provides smooth contrast for text legibility while showing the video clearly
   -------------------------------------------------------------------------- */
.hero-video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(7, 16, 29, 0.82) 0%,
    rgba(7, 16, 29, 0.68) 32%,
    rgba(7, 16, 29, 0.42) 58%,
    rgba(7, 16, 29, 0.22) 78%,
    rgba(7, 16, 29, 0.16) 100%
  );
  z-index: 2;
  pointer-events: none;
}

/* Subtle top & bottom edge shading for depth */
.hero-video-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.22) 0%,
    transparent 25%,
    transparent 75%,
    rgba(7, 16, 29, 0.45) 100%
  );
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   4. Content Wrapper & Typography
   -------------------------------------------------------------------------- */
.hero-section--video .hero-content-wrapper {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  z-index: 3;
}

.hero-section--video .hero-content {
  max-width: 840px;
  color: var(--color-white, #ffffff);
  padding: var(--space-4, 1rem) 0;
}

.hero-section--video .hero-title {
  font-family: var(--font-primary, 'Montserrat', sans-serif);
  font-size: clamp(2rem, 3.6vw, 3.15rem);
  font-weight: var(--fw-semibold, 600);
  color: var(--color-white, #ffffff);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4, 1rem);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85), 0 1px 3px rgba(0, 0, 0, 0.9);
}

.hero-title-line {
  display: block;
}

@media (min-width: 992px) {
  .hero-title-line {
    white-space: nowrap;
  }
}

.hero-section--video .hero-description {
  font-family: var(--font-primary, 'Montserrat', sans-serif);
  font-size: 1.125rem;
  font-weight: var(--fw-medium, 500);
  line-height: 1.65;
  color: var(--color-white, #ffffff);
  margin-bottom: var(--space-6, 1.5rem);
  max-width: 600px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85), 0 1px 3px rgba(0, 0, 0, 0.9);
}

.hero-section--video .hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4, 1rem);
}

/* --------------------------------------------------------------------------
   5. Ambient Video Controls (Bottom-Right)
   -------------------------------------------------------------------------- */
.hero-video-controls {
  position: absolute;
  right: var(--container-padding, 1.5rem);
  bottom: var(--space-8, 2rem);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--space-3, 0.75rem);
}

.hero-video-ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md, 6px);
  background-color: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--color-white, #ffffff);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  padding: 0;
  transition: background-color var(--transition-fast, 150ms ease),
              border-color var(--transition-fast, 150ms ease),
              color var(--transition-fast, 150ms ease),
              transform var(--transition-fast, 150ms ease);
}

.hero-video-ctrl-btn:hover {
  background-color: var(--color-primary, #416A9C);
  border-color: var(--color-primary, #416A9C);
  color: var(--color-white, #ffffff);
  transform: translateY(-1px);
}

.hero-video-ctrl-btn:focus-visible {
  outline: 2px solid var(--color-accent, #F97316);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   6. Responsive Layout
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  .hero-video-overlay {
    background: linear-gradient(
      180deg,
      rgba(7, 16, 29, 0.85) 0%,
      rgba(7, 16, 29, 0.70) 50%,
      rgba(7, 16, 29, 0.45) 80%,
      rgba(7, 16, 29, 0.25) 100%
    );
  }

  .hero-section--video .hero-content-wrapper {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 1.5rem;
    padding-bottom: 3.5rem;
  }

  .hero-section--video .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 580px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
  }

  .hero-section--video .hero-title {
    font-size: clamp(1.45rem, 5.2vw, 1.85rem);
    line-height: 1.24;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
  }

  .hero-section--video .hero-description {
    font-size: 0.875rem;
    font-weight: var(--fw-medium, 500);
    line-height: 1.5;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    max-width: 480px;
    margin-bottom: 1.25rem;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hero-section--video .hero-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
  }

  .hero-video-controls {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero-section.hero-section--video {
    min-height: 450px;
    max-height: 620px;
  }

  .hero-section--video .hero-content-wrapper {
    padding-top: 1rem;
    padding-bottom: 3rem;
  }

  .hero-section--video .hero-title {
    font-size: 1.35rem;
    line-height: 1.22;
  }

  .hero-title-line {
    display: inline;
  }

  .hero-section--video .hero-description {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.48;
    margin-bottom: 1.15rem;
    -webkit-line-clamp: 3;
  }

  .hero-section--video .hero-actions {
    max-width: 320px;
    gap: 8px;
  }
}

/* --------------------------------------------------------------------------
   7. Reduced Motion Accessibility
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .hero-video-media {
    transition: none !important;
  }
}
