/* -------------------------------------------------------
   Homepage hero
   Height comes from the theme's .full-screen / .ipad-top-space-margin
   handling in main.js; behaviour lives in assets/js/hero-x.js.
------------------------------------------------------- */
.hero-x {
  --hx-base: var(--base-color, #dd6531);
  --hx-coral: #ef5f43;
  --hx-peach: #f38c4b;
  --hx-ink: var(--dark-gray, #292d36);
  --hx-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --hx-ease-spring: cubic-bezier(0.2, 0.9, 0.25, 1.25);
  background: #15171c;
}

.hx-stage {
  position: relative;
  min-height: 560px;
  height: 100vh;
  overflow: hidden;
  overflow: clip;
  color: #fff;
  isolation: isolate;
}

/* Background layers */
.hx-media {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hx-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: hx-zoom 24s ease-in-out infinite alternate;
}

.hx-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(21, 23, 28, 0.75) 0%, rgba(21, 23, 28, 0.35) 40%, rgba(21, 23, 28, 0.85) 100%),
    radial-gradient(ellipse at center, transparent 30%, rgba(21, 23, 28, 0.6) 100%);
}

.hx-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 70px 70px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse at center, #000 10%, transparent 70%);
}

.hx-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  mix-blend-mode: screen;
}

.hx-glow-1 {
  width: 520px;
  height: 520px;
  left: -140px;
  bottom: -200px;
  background: var(--hx-base);
  opacity: 0.35;
  animation: hx-drift 16s ease-in-out infinite;
}

.hx-glow-2 {
  width: 420px;
  height: 420px;
  right: -120px;
  top: -120px;
  background: var(--hx-peach);
  opacity: 0.22;
  animation: hx-drift 20s ease-in-out infinite reverse;
}

/* Light that follows the pointer */
.hx-spot {
  position: absolute;
  inset: 0;
  background: radial-gradient(600px circle at var(--hx-x, 50%) var(--hx-y, 50%), rgba(243, 140, 75, 0.14), transparent 60%);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.hx-stage.is-pointer .hx-spot {
  opacity: 1;
}

/* Layout */
.hx-inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.hx-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 130px;
  text-align: center;
}

.hx-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(16px, 3vh, 26px);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.hx-eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hx-peach);
  animation: hx-pulse 1.8s ease-out infinite;
}

/* Rotating slides */
.hx-slides {
  display: grid;
  width: 100%;
}

.hx-slide {
  grid-area: 1 / 1;
  pointer-events: none;
}

.hx-slide.is-active {
  pointer-events: auto;
}

.hx-title {
  margin: 0 0 22px;
  font-size: clamp(40px, min(8vw, 13vh), 120px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #fff;
}

.hx-word {
  display: inline-block;
  overflow: hidden;
  padding: 0.04em 0.02em 0.1em;
  margin-bottom: -0.1em;
  vertical-align: top;
}

.hx-word > span {
  display: inline-block;
  transform: translateY(115%) rotate(4deg);
  transform-origin: left bottom;
  transition: transform 0.9s var(--hx-ease-out);
}

.hx-accent {
  display: inline-block;
}

.hx-accent > span {
  font-weight: 700;
  background: linear-gradient(90deg, var(--hx-peach), var(--hx-base), var(--hx-coral), var(--hx-peach));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: hx-text-flow 8s linear infinite;
}

.hx-slide.is-active .hx-word > span {
  transform: none;
}

.hx-slide.is-active .hx-word:nth-child(2) > span { transition-delay: 0.08s; }
.hx-slide.is-active .hx-word:nth-child(3) > span { transition-delay: 0.16s; }

.hx-slide.is-leaving .hx-word > span {
  transform: translateY(-115%) rotate(-4deg);
  transition-duration: 0.6s;
}

.hx-sub {
  margin: 0;
  font-size: 20px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.4s ease, transform 0.6s var(--hx-ease-out);
}

.hx-slide.is-active .hx-sub {
  opacity: 1;
  transform: none;
  transition-delay: 0.3s;
}

.hx-sub a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(var(--hx-peach), var(--hx-peach)) left bottom / 100% 1px no-repeat;
  transition: background-size 0.4s var(--hx-ease-out), color 0.3s ease;
}

.hx-sub a:hover,
.hx-sub a:focus-visible {
  color: var(--hx-peach);
  background-size: 0 1px;
}

.hx-sub a i {
  transition: transform 0.4s var(--hx-ease-spring);
}

.hx-sub a:hover i {
  transform: translate(3px, -3px);
}

/* Buttons */
.hx-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: clamp(24px, 4vh, 40px);
}

.hx-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.35s var(--hx-ease-out), box-shadow 0.35s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.hx-btn:focus-visible {
  outline: 3px solid rgba(243, 140, 75, 0.6);
  outline-offset: 3px;
}

.hx-btn-primary {
  padding: 8px 8px 8px 28px;
  background: linear-gradient(90deg, var(--hx-peach), var(--hx-coral));
  box-shadow: 0 18px 40px -16px rgba(239, 95, 67, 0.9);
}

/* Shine that sweeps across the primary button */
.hx-btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  z-index: -1;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  animation: hx-shine 4s ease-in-out 2s infinite;
}

.hx-btn-primary:hover,
.hx-btn-primary:focus-visible {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 24px 46px -16px rgba(239, 95, 67, 1);
}

.hx-btn-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 18px;
  color: var(--hx-coral);
  background: #fff;
  transition: transform 0.45s var(--hx-ease-spring);
}

.hx-btn-primary:hover .hx-btn-icon {
  transform: translateX(4px) rotate(-45deg);
}

.hx-btn-ghost {
  padding: 8px 28px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.hx-btn-ghost:hover,
.hx-btn-ghost:focus-visible {
  color: var(--hx-ink);
  background: #fff;
  border-color: #fff;
  transform: translateY(-3px);
}

/* Bottom bar: slide picker + scroll cue */
.hx-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0 32px;
}

.hx-dots {
  display: flex;
  gap: 18px;
}

.hx-dot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: color 0.3s ease;
}

.hx-dot:hover,
.hx-dot.is-active {
  color: #fff;
}

.hx-dot:focus-visible {
  outline: 2px solid var(--hx-peach);
  outline-offset: 4px;
  border-radius: 4px;
}

.hx-dot-num {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
}

.hx-dot-bar {
  position: relative;
  width: 70px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.hx-dot-bar span {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--hx-peach), var(--hx-base));
  transform: scaleX(0);
  transform-origin: left center;
}

.hx-dot.is-active .hx-dot-bar span {
  transform: scaleX(1);
}

.hx-stage.is-autoplay .hx-dot.is-active .hx-dot-bar span {
  animation: hx-progress var(--hx-duration, 6500ms) linear forwards;
}

.hx-stage.is-paused .hx-dot.is-active .hx-dot-bar span {
  animation-play-state: paused;
}

.hx-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.3s ease, transform 0.4s var(--hx-ease-out);
}

.hx-scroll:hover,
.hx-scroll:focus-visible {
  color: #fff;
  transform: translateY(4px);
}

.hx-mouse {
  position: relative;
  width: 26px;
  height: 40px;
  border: 2px solid currentColor;
  border-radius: 14px;
}

.hx-mouse span {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--hx-peach);
  animation: hx-wheel 1.8s ease-in-out infinite;
}

.hx-scroll-text {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* First load: everything rises in */
.hx-js .hx-eyebrow,
.hx-js .hx-actions,
.hx-js .hx-footer {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.9s var(--hx-ease-out);
}

.hx-js .hx-stage.is-ready .hx-eyebrow,
.hx-js .hx-stage.is-ready .hx-actions,
.hx-js .hx-stage.is-ready .hx-footer {
  opacity: 1;
  transform: none;
}

.hx-js .hx-stage.is-ready .hx-actions {
  transition-delay: 0.45s;
}

.hx-js .hx-stage.is-ready .hx-footer {
  transition-delay: 0.7s;
}

/* Hold the first slide hidden until the page is ready, then let it rise */
.hx-js .hx-stage:not(.is-ready) .hx-slide.is-active .hx-word > span {
  transform: translateY(115%) rotate(4deg);
}

.hx-js .hx-stage:not(.is-ready) .hx-slide.is-active .hx-sub {
  opacity: 0;
}

/* Keyframes */
@keyframes hx-zoom {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

@keyframes hx-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, -40px) scale(1.15); }
}

@keyframes hx-pulse {
  0% { box-shadow: 0 0 0 0 rgba(243, 140, 75, 0.7); }
  100% { box-shadow: 0 0 0 10px rgba(243, 140, 75, 0); }
}

@keyframes hx-text-flow {
  to { background-position: 300% 0; }
}

@keyframes hx-shine {
  0% { left: -60%; }
  40%, 100% { left: 130%; }
}

@keyframes hx-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes hx-wheel {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* Responsive */
@media (max-width: 991px) {
  .hx-content {
    padding-top: 130px;
  }

  .hx-sub {
    font-size: 18px;
  }

  .hx-actions {
    margin-top: 32px;
  }
}

@media (max-width: 767px) {
  .hx-content {
    padding-top: 90px;
  }
}

@media (max-width: 575px) {
  .hx-title {
    font-size: clamp(36px, 11vw, 56px);
  }

  .hx-eyebrow {
    margin-bottom: 18px;
    font-size: 12px;
  }

  .hx-sub {
    font-size: 16px;
  }

  .hx-actions {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .hx-btn {
    justify-content: center;
    width: 100%;
    max-width: 320px;
  }

  .hx-btn-primary {
    justify-content: space-between;
  }

  .hx-footer {
    justify-content: center;
    padding-bottom: 26px;
  }

  .hx-dot-bar {
    width: 44px;
  }

  .hx-scroll {
    display: none;
  }
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  .hero-x *,
  .hero-x *::before,
  .hero-x *::after {
    animation: none !important;
    transition: none !important;
  }

  .hx-slide:not(.is-active) {
    visibility: hidden;
  }

  .hx-slide.is-active .hx-word > span,
  .hx-js .hx-stage:not(.is-ready) .hx-slide.is-active .hx-word > span {
    transform: none;
  }
}
