/*
 * Apex — hero.
 * Measured in Figma (Hero Section / SHOWREEL - Background+Border):
 * full-viewport block (1999×1200, ratio 0.6003), 64px top padding, 75px bottom
 * (clears the scroll pill), 1px bottom border. Heading row: padding-left 16px,
 * right 32px, gap 64px. Showreel label: Inter 700 12/16, ls 1.2px, #1F2937.
 */

.apex-hero {
  position: relative;
  isolation: isolate; /* keeps the heading blend inside the hero */
  min-height: 100vh;
  min-height: max(100svh, 60.03vw);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-block: 4rem 4.6875rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.apex-hero__media {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #000;
}

.apex-hero__media img,
.apex-hero__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.apex-hero__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  text-align: center;
  gap: 0.875rem; /* 14px, matches the design's play-to-label distance */
}

.apex-hero__play > * { margin: 0; }

/* Temporarily hidden at the client's request (markup kept intact). To bring the
   showreel play button back, delete this single rule. */
.apex-hero__play { display: none; }

.apex-hero__play-btn {
  width: 4.75rem;
  height: 4.75rem;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: var(--apex-radius-full);
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #1f2937; /* glyph color measured in Figma */
  font-size: 0;
  cursor: pointer;
  transition: transform var(--apex-transition), background var(--apex-transition);
}

.apex-hero__play-btn::after {
  content: "";
  width: 1.875rem; /* 30px, icon's native size from Figma */
  height: 1.875rem;
  background-color: currentColor;
  -webkit-mask: var(--apex-play-icon) center / contain no-repeat;
  mask: var(--apex-play-icon) center / contain no-repeat;
}

.apex-hero__play-btn:hover {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.28);
}

.apex-hero__play-label {
  font-size: 0.75rem; /* 12px, measured in Figma */
  font-weight: 700;
  line-height: 1.3333; /* 16px */
  letter-spacing: 0.1em; /* 1.2px */
  text-transform: uppercase;
  color: #1f2937; /* measured in Figma */
}

.apex-hero__bottom {
  display: flex;
  align-items: center; /* tagline vertically centred against the heading */
  justify-content: space-between;
  gap: 4rem; /* 64px, measured in Figma */
  padding-left: 1rem; /* 16px, measured in Figma */
  padding-right: 2rem; /* 32px, measured in Figma */
}

.apex-hero__title {
  /* 135px at the 1999px design width, scaling with the viewport as in Figma */
  font-size: clamp(2.5rem, 6.755vw, 8.4375rem);
  text-transform: uppercase;
  line-height: 0.98; /* 132.3 / 135, token: h1 heroheader */
  letter-spacing: 0;
  margin-bottom: -0.04em;
  background: var(--apex-metallic);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  mix-blend-mode: exclusion; /* video shows through, hue shifts with footage */
}

.apex-hero__tagline {
  flex-shrink: 0;
  display: grid;
  gap: 1rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--wp--custom--color--text--100);
}

.apex-hero__tagline p { margin: 0; }

.apex-hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 0.75rem; /* 12px above the section edge (Figma) */
  transform: translateX(-50%);
  width: 2rem; /* 32px, measured in Figma */
  height: 3rem; /* 48px, measured in Figma */
  border: 1px solid #fff;
  border-radius: var(--apex-radius-full);
  opacity: 0.5; /* measured in Figma */
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: opacity var(--apex-transition);
}

.apex-hero__scroll:hover { opacity: 0.85; }

.apex-hero__scroll-dot {
  width: 0.875rem;
  height: 0.875rem;
  background: #fff;
  -webkit-mask: var(--apex-arrow-down-icon) center / contain no-repeat;
  mask: var(--apex-arrow-down-icon) center / contain no-repeat;
  animation: apex-scroll-hint 2s ease-in-out infinite;
}

@keyframes apex-scroll-hint {
  0%, 100% { transform: translateY(-2px); opacity: 1; }
  50% { transform: translateY(4px); opacity: 0.5; }
}

@media (max-width: 960px) {
  .apex-hero__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
  }

  /* Keep the play group clear of the stacked heading on small screens */
  .apex-hero__play { top: 32%; }
}

/* -------------------------------------------------- Showreel modal player */

.apex-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
}

.apex-modal[hidden] { display: none; }

.apex-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  animation: apex-modal-fade 0.3s var(--apex-ease);
}

.apex-modal__dialog {
  position: relative;
  width: 100%;
  max-width: min(88rem, 92vw);
  animation: apex-modal-rise 0.4s var(--apex-ease);
}

.apex-modal__player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.apex-modal__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.apex-modal__close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2; /* sit above the video (which paints over it otherwise on mobile) */
  transform: translateY(calc(-100% - 0.75rem));
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 0;
  cursor: pointer;
  border-radius: var(--apex-radius-full);
  transition: background var(--apex-transition), color var(--apex-transition);
}

.apex-modal__close::after {
  content: "";
  width: 1.25rem;
  height: 1.25rem;
  background-color: currentColor;
  -webkit-mask: var(--apex-close-icon) center / contain no-repeat;
  mask: var(--apex-close-icon) center / contain no-repeat;
}

.apex-modal__close:hover { background: #fff; color: #000; }

@keyframes apex-modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes apex-modal-rise {
  from { opacity: 0; transform: translateY(1.5rem) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 720px) {
  .apex-modal__close {
    top: 0.75rem;
    right: 0.75rem;
    transform: none;
    background: rgba(0, 0, 0, 0.6);
  }
}
