/* ============================================================
   CONTACT HERO — BE.SUPERINTENDENT
   Loaded only on page-contact-us.php
   ============================================================ */

/* ── Root element ───────────────────────────────────────── */
.bes-contact-hero {
  position: relative;
  box-sizing: border-box; /* FIX 1: padding safety */
  min-height: 92vh; /* fallback */
  min-height: 92svh; /* FIX 2: mobile-safe height */
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  overflow: hidden;
  overflow-x: hidden; /* FIX 3: explicit x-safe */
  padding: 140px 20px 120px;
  padding-bottom: max(
    120px,
    120px + env(safe-area-inset-bottom)
  ); /* FIX 4: notch-safe */
  isolation: isolate;
}

.bes-contact-hero *,
.bes-contact-hero *::before,
.bes-contact-hero *::after {
  box-sizing: border-box; /* FIX 1: children inherit */
}

/* ── Background layers ─────────────────────────────────── */
.bes-contact-hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bes-contact-hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(247, 183, 49, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247, 183, 49, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(
    ellipse at center,
    #000 10%,
    transparent 75%
  );
  mask-image: radial-gradient(ellipse at center, #000 10%, transparent 75%);
  animation: besGridFade 3s ease-out both;
}

.bes-contact-hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px); /* reduced on mobile — see below */
  will-change: transform, opacity;
}

.bes-contact-hero__orb--1 {
  width: 480px;
  height: 480px;
  top: -160px;
  right: -120px;
  background: radial-gradient(circle, #f7b731 0%, transparent 70%);
  opacity: 0.28;
  animation: besFloat 9s ease-in-out infinite;
}

.bes-contact-hero__orb--2 {
  width: 560px;
  height: 560px;
  bottom: -200px;
  left: -140px;
  background: radial-gradient(circle, #f7b731 0%, transparent 70%);
  opacity: 0.18;
  animation: besFloat 12s ease-in-out infinite reverse;
}

.bes-contact-hero__orb--3 {
  width: 340px;
  height: 340px;
  top: 50%;
  left: 50%;
  background: radial-gradient(circle, #ffe082 0%, transparent 70%);
  opacity: 0.1;
  transform: translate(-50%, -50%);
  animation: besPulse 7s ease-in-out infinite;
}

.bes-contact-hero__line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(247, 183, 49, 0.45),
    transparent
  );
  opacity: 0.6;
  transform-origin: center; /* FIX 5: explicit grow origin */
  animation: besLineGrow 1.6s 0.4s ease-out both;
}

/* ── Content ───────────────────────────────────────────── */
.bes-contact-hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

/* Badge */
.bes-contact-hero__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 18px;
  margin-bottom: 32px;
  max-width: calc(100% - 24px); /* FIX 6: prevent overflow on FR */
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(247, 183, 49, 0.28);
  border-radius: 999px;
  color: #dcdcdc;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45; /* FIX 6: multi-line safety */
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  white-space: normal; /* FIX 6: allow wrap on FR */
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: besFadeDown 0.9s 0.1s ease-out both;
}

.bes-contact-hero__dot {
  position: relative;
  width: 7px;
  height: 7px;
  background: #f7b731;
  border-radius: 50%;
  box-shadow: 0 0 12px #f7b731;
  flex-shrink: 0;
}

.bes-contact-hero__dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid #f7b731;
  border-radius: 50%;
  animation: besPing 2s ease-out infinite;
}

/* Title */
.bes-contact-hero__title {
  font-size: clamp(2.6rem, 7.2vw, 5.6rem);
  font-weight: 900;
  line-height: 1.03;
  letter-spacing: -0.035em;
  color: #fff;
  margin: 0 0 26px;
  text-wrap: balance; /* FIX 7: nicer line breaks */
  animation: besFadeUp 0.9s 0.2s ease-out both;
}

.bes-contact-hero__title > span:first-child {
  display: block;
}

.bes-contact-hero__title-accent {
  display: inline-block;
  position: relative;
  color: #f7b731; /* fallback colour */
  animation: besShimmer 4.5s ease-in-out infinite;
  isolation: isolate; /* FIX 8: keep ::after behind text */
}

/* Only apply gradient-text when the browser actually supports it,
   otherwise leave the solid gold colour as-is.                       */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .bes-contact-hero__title-accent {
    background: linear-gradient(110deg, #f7b731 0%, #ffe082 45%, #f7b731 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

.bes-contact-hero__title-accent::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: 6px;
  height: 10px;
  background: rgba(247, 183, 49, 0.18);
  border-radius: 2px;
  transform: skewX(-12deg);
  z-index: -1;
}

/* Subtitle */
.bes-contact-hero__subtitle {
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  line-height: 1.65;
  color: #9a9a9a;
  max-width: 620px;
  margin: 0 auto 44px;
  animation: besFadeUp 0.9s 0.35s ease-out both;
}

/* ── Quick chips ───────────────────────────────────────── */
.bes-contact-hero__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  animation: besFadeUp 0.9s 0.5s ease-out both;
}

.bes-contact-hero__chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  color: #eaeaea;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition:
    transform 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.bes-contact-hero__chip svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.bes-contact-hero__chip:hover {
  background: rgba(247, 183, 49, 0.1);
  border-color: rgba(247, 183, 49, 0.45);
  color: #f7b731;
  transform: translateY(-2px);
}

.bes-contact-hero__chip:focus-visible {
  /* FIX 9: keyboard visibility */
  outline: 2px solid #f7b731;
  outline-offset: 3px;
}

.bes-contact-hero__chip--static {
  cursor: default;
  color: #b4b4b4;
}

.bes-contact-hero__chip--static:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.09);
  color: #b4b4b4;
  transform: none;
}

/* ── Scroll cue ────────────────────────────────────────── */
.bes-contact-hero__scroll {
  position: absolute;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #6c6c6c;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  animation: besFadeUp 0.9s 0.7s ease-out both;
  transition: color 0.25s ease;
}

.bes-contact-hero__scroll:hover,
.bes-contact-hero__scroll:focus-visible {
  color: #f7b731;
}

.bes-contact-hero__scroll-line {
  position: relative;
  width: 1px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.bes-contact-hero__scroll-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 14px;
  background: #f7b731;
  border-radius: 1px;
  animation: besScrollDot 2.2s ease-in-out infinite;
}

/* ── Keyframes ─────────────────────────────────────────── */
@keyframes besFadeDown {
  from {
    opacity: 0;
    transform: translateY(-22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes besFadeUp {
  from {
    opacity: 0;
    transform: translateY(34px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes besGridFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes besFloat {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-30px, -40px) scale(1.08);
  }
}

@keyframes besPulse {
  0%,
  100% {
    opacity: 0.08;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.16;
    transform: translate(-50%, -50%) scale(1.15);
  }
}

@keyframes besPing {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

@keyframes besShimmer {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes besLineGrow {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 0.6;
  }
}

@keyframes besScrollDot {
  0% {
    transform: translateY(-16px);
    opacity: 0;
  }
  45% {
    opacity: 1;
  }
  100% {
    transform: translateY(46px);
    opacity: 0;
  }
}

/* ── Tablet ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .bes-contact-hero {
    padding: 130px 24px 110px;
    padding-bottom: max(110px, 110px + env(safe-area-inset-bottom));
  }
  .bes-contact-hero__orb {
    filter: blur(80px);
  } /* FIX 10: lighter blur */
}

/* ── Mobile ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .bes-contact-hero {
    min-height: 82vh;
    min-height: 82svh;
    padding: 120px 20px 110px;
    padding-bottom: max(110px, 110px + env(safe-area-inset-bottom));
  }

  .bes-contact-hero__orb {
    filter: blur(60px);
  } /* FIX 10: lighter still */
  .bes-contact-hero__orb--1,
  .bes-contact-hero__orb--2 {
    width: 300px;
    height: 300px;
  }
  .bes-contact-hero__orb--3 {
    width: 220px;
    height: 220px;
  }

  .bes-contact-hero__badge {
    margin-bottom: 24px;
    padding: 7px 14px;
    font-size: 10px;
    letter-spacing: 0.14em;
  }

  .bes-contact-hero__subtitle {
    margin-bottom: 32px;
  }

  .bes-contact-hero__chips {
    gap: 8px;
  }
  .bes-contact-hero__chip {
    padding: 10px 16px;
    font-size: 12.5px;
  }
  .bes-contact-hero__chip svg {
    width: 14px;
    height: 14px;
  }

  .bes-contact-hero__scroll {
    bottom: 22px;
    gap: 8px;
    font-size: 9px;
  }
  .bes-contact-hero__scroll-line {
    height: 34px;
  }
}

/* ── Very small phones ─────────────────────────────────── */
@media (max-width: 400px) {
  .bes-contact-hero {
    padding: 110px 16px 100px;
  }
  .bes-contact-hero__chips {
    gap: 6px;
  }
  .bes-contact-hero__chip {
    padding: 9px 14px;
    font-size: 12px;
    gap: 8px;
  }
  .bes-contact-hero__chip svg {
    width: 13px;
    height: 13px;
  }
  .bes-contact-hero__title {
    margin-bottom: 20px;
  }
}

/* ── Reduced motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .bes-contact-hero__badge,
  .bes-contact-hero__title,
  .bes-contact-hero__subtitle,
  .bes-contact-hero__chips,
  .bes-contact-hero__scroll,
  .bes-contact-hero__orb,
  .bes-contact-hero__grid,
  .bes-contact-hero__line,
  .bes-contact-hero__dot::after,
  .bes-contact-hero__title-accent,
  .bes-contact-hero__scroll-dot {
    animation: none !important;
  }
}
