/*
 * Homepage hero: scroll-scrubbed wand pull (WINNER clip).
 *
 * Tier rule, kept identical to manifest.json "mediaM" and the JS:
 *   m (phone):    (orientation: portrait), (max-width: 767px)
 *   d (desktop):  (orientation: landscape) and (min-width: 768px)
 *
 * Without .hs-on (no JS, reduced motion, Data Saver) the hero is one screen tall and shows the poster.
 */

.hs {
  position: relative;
  height: calc(100vh - var(--header-h));
  height: calc(100svh - var(--header-h));
  min-height: 460px;
}
.hs-on .hs {
  height: 300vh;   /* about two screens of scroll scrub the full stroke */
  height: 300svh;
}

.hs-stage {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  height: calc(100svh - var(--header-h));
  min-height: 460px;
  overflow: hidden;
  background: var(--charcoal);
}

/* layers: poster < canvas < scrim < copy < cue/rail */
.hs-poster, .hs-poster img, .hs-canvas, .hs-scrim { position: absolute; inset: 0; width: 100%; height: 100%; }
.hs-poster img { object-fit: cover; object-position: 75% 50%; }     /* matches tier d focus */
.hs-canvas { display: block; opacity: 0; transition: opacity .3s ease; }
.hs.is-live .hs-canvas { opacity: 1; }

/* ---------- phone: copy at the bottom, scrim rises from the bottom ---------- */
.hs-scrim {
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(12, 14, 16, .1) 34%, rgba(12, 14, 16, .74) 68%, rgba(12, 14, 16, .94) 100%);
}
.hs-copy {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0;
  padding: 0 20px calc(30px + env(safe-area-inset-bottom)) 20px;
}
.hs-kicker {
  margin: 0 0 10px; font-size: 11px; letter-spacing: .17em; text-transform: uppercase;
  color: var(--amber); font-weight: 700;
}
.hs-copy h1 {
  margin: 0 0 10px;
  font-size: clamp(32px, 9vw, 64px); line-height: 1.02; letter-spacing: -.02em; font-weight: 800;
  text-wrap: balance; text-shadow: 0 2px 18px rgba(0, 0, 0, .5);
}
.hs-brand { display: block; color: var(--amber); }
.hs-lede { margin: 0 0 16px; font-size: clamp(15px, 3.9vw, 18px); line-height: 1.45; color: rgba(244, 241, 236, .88); max-width: 36ch; }
.hs-calls { display: flex; flex-wrap: wrap; gap: 9px; }
.hs-calls .btn { flex: 1 1 150px; }
.hs-note { margin: 12px 0 0; font-size: 13px; color: rgba(244, 241, 236, .62); }

@media (orientation: portrait), (max-width: 767px) {
  .hs-poster img { object-position: 50% 50%; }                      /* matches tier m focus */
}

/* ---------- desktop: copy on the left, scrim from the left; the wand works on the right ---------- */
@media (orientation: landscape) and (min-width: 768px) {
  .hs-scrim {
    background:
      linear-gradient(90deg, rgba(12, 14, 16, .9) 0%, rgba(12, 14, 16, .66) 30%, rgba(12, 14, 16, .12) 54%, transparent 64%),
      linear-gradient(0deg, rgba(12, 14, 16, .45) 0%, transparent 30%);
  }
  .hs-copy {
    right: auto; top: 0;
    width: min(50%, 640px);
    display: flex; flex-direction: column; justify-content: center;
    padding: 0 clamp(28px, 4.5vw, 72px) clamp(28px, 6vh, 64px);
  }
  .hs-calls .btn { flex: 0 0 auto; min-width: 190px; }
}

/* short landscape screens (phones turned sideways): tighten the type */
@media (orientation: landscape) and (max-height: 520px) {
  .hs-copy h1 { font-size: clamp(26px, 5.4vw, 40px); }
  .hs-lede, .hs-note { display: none; }
}

/* ---------- scroll cue and progress rail ---------- */
.hs-cue {
  position: absolute; z-index: 4; left: 50%; top: 16px;
  width: 26px; height: 42px; margin-left: -13px;
  border: 2px solid rgba(244, 241, 236, .55); border-radius: 14px;
  transition: opacity .25s;
}
.hs-cue span {
  position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: var(--amber);
  animation: hs-wheel 1.6s ease-in-out infinite;
}
@keyframes hs-wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

.hs-rail { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .08); }
.hs-rail i {
  display: block; width: 100%; height: 100%;
  background: var(--amber);
  transform: scaleX(0); transform-origin: left center; will-change: transform;
}

/* the cue and rail only mean something when scrolling drives the frames */
html:not(.hs-on) .hs-cue, html:not(.hs-on) .hs-rail { display: none; }

@media (prefers-reduced-motion: reduce) {
  .hs-cue span { animation: none; }
}
