/* ==========================================================================
   VIDEO HERO – responsive styles (separate file, used only by index.html)
   Load AFTER assets/css/style.css. It reuses the site's colour variables with safe fallbacks,
   so it also works if you copy the hero into another page.

   How the hero adapts
   -  < 480px   small phones      : tall portrait hero, text at the bottom, mobile video (854px)
   -  480-899px large phones/tablet: same stacked layout, a little more air
   -  900px+    laptops/desktops  : text on the left, video subject visible on the right
   -  1600px+   large monitors    : hero height is capped so the video is never over-cropped
   -  landscape phones (short)    : compact hero so the buttons stay visible
   -  reduced motion / data saver : video is not loaded, the poster image is shown instead
   ========================================================================== */

.vhero {
  --vh-ink: #081816;                                   /* overlay colour (deep green-black) */
  --vh-orange: var(--orange, #d96300);
  --vh-mint: var(--mint-2, #b0f0d8);
  --vh-ease: var(--ease, cubic-bezier(.22, 1, .36, 1));
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: flex-end;                                /* phones: text sits at the bottom */
  min-height: 460px;                                    /* fallback for browsers without svh */
  min-height: clamp(440px, 62svh, 540px);
  color: #fff;
  background: var(--vh-ink) url('../video/hero-poster-sm.jpg') 50% 45% / cover no-repeat;
}

/* ---------- media layer ---------- */
.vhero__media { position: absolute; inset: 0; z-index: -1; }
.vhero__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;                                    /* fills any screen shape without stretching */
  object-position: 50% 45%;                             /* keep the ladle / pour in view when cropped */
  opacity: 0;
  transition: opacity 1.2s ease;
  background: transparent;
  pointer-events: none;                                 /* never blocks taps or text selection */
}
.vhero.is-ready .vhero__video { opacity: 1; }

/* dark gradient so white text is always readable (stronger on phones) */
.vhero__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(0deg, rgba(8, 24, 22, .92) 0%, rgba(8, 24, 22, .74) 50%, rgba(8, 24, 22, .46) 100%);
}

/* ---------- content ---------- */
.vhero__content { position: relative; width: 100%; padding-block: 40px 84px; }
.vhero__bar { display: block; width: 0; height: 4px; margin-bottom: 20px; border-radius: 2px; background: var(--vh-orange); animation: vhBar .9s var(--vh-ease) .3s both; }
@keyframes vhBar { to { width: 84px; } }
.vhero__title {
  max-width: 18ch;
  color: #fff;
  font-size: clamp(2rem, 7.6vw, 2.8rem);              /* phones */
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .35);
}
.vhero .word { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .04em .14em 0; margin-bottom: -.14em; }
.vhero .word > span { display: inline-block; transform: translateY(115%); animation: vhWord 1s var(--vh-ease) both; animation-delay: calc(var(--w, 0) * 75ms + 350ms); }
@keyframes vhWord { from { transform: translateY(115%); } to { transform: none; } }
.vhero__lead { max-width: 46ch; margin: 14px 0 0; color: #dcebe7; font-size: 1rem; line-height: 1.6; animation: vhUp 1s var(--vh-ease) .95s both; }
.vhero__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; animation: vhUp 1s var(--vh-ease) 1.1s both; }
.vhero__actions .sa-btn { width: 100%; justify-content: center; }      /* full-width, thumb-friendly buttons on phones */
.vhero__facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; animation: vhUp 1s var(--vh-ease) 1.25s both; }
.vhero__facts li { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px; border: 1px solid rgba(255, 255, 255, .24); border-radius: 999px; background: rgba(255, 255, 255, .1); font-size: .88rem; line-height: 1.2; }
.vhero__facts svg { flex: none; color: var(--vh-mint); }
@keyframes vhUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* white-outline button needs to read on video */
.vhero .sa-btn--white-line { background: rgba(255, 255, 255, .06); }

/* ---------- controls ---------- */
.vhero__toggle {
  position: absolute; right: 16px; bottom: 74px;       /* sits above the overlapping feature bar */
  z-index: 3; display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; padding: 0;
  border: 1.5px solid rgba(255, 255, 255, .55); border-radius: 50%;
  background: rgba(8, 24, 22, .45); color: #fff;
  transition: background-color .25s, color .25s, transform .35s var(--vh-ease), border-color .25s;
}
.vhero__toggle:hover { background: #fff; color: var(--vh-ink); border-color: #fff; transform: scale(1.06); }
.vhero__toggle:focus-visible, .vhero__scroll:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.vhero__toggle[hidden] { display: none; }
.vhero__scroll { display: none; }

/* ---------- 480px+ : big phones, small tablets ---------- */
@media (min-width: 480px) {
  .vhero__title { font-size: clamp(2.2rem, 6.2vw, 3.2rem); }
  .vhero__actions { flex-direction: row; flex-wrap: wrap; }
  .vhero__actions .sa-btn { width: auto; }
  .vhero__lead { font-size: 1.12rem; }
}

/* ---------- 700px+ : use the full 1280 video (also switched in JS) ---------- */
@media (min-width: 700px) {
  .vhero { background-image: url('../video/hero-poster.jpg'); }
  .vhero__content { padding-block: 52px 96px; }
  .vhero__toggle { right: 24px; }
}

/* ---------- 900px+ : text left, subject right ---------- */
@media (min-width: 900px) {
  .vhero { align-items: center; min-height: clamp(480px, 62vh, 580px); background-position: 0% 50%; }
  /* video is 20% wider than the hero and anchored left, so the ladle moves right, away from the text */
  .vhero__video { inset: 0 auto 0 0; width: 120%; object-position: 50% 50%; }
  .vhero__shade {
    background:
      linear-gradient(0deg, rgba(8, 24, 22, .6) 0%, rgba(8, 24, 22, 0) 38%),
      linear-gradient(90deg, rgba(8, 24, 22, .9) 0%, rgba(8, 24, 22, .74) 34%, rgba(8, 24, 22, .28) 62%, rgba(8, 24, 22, .08) 100%);
  }
  .vhero__content { padding-block: 48px 92px; }
  .vhero__title { font-size: clamp(2.6rem, 1rem + 3vw, 3.8rem); max-width: 20ch; }
  .vhero__lead { font-size: 1.12rem; }
  .vhero__toggle { bottom: 80px; }
  .vhero__scroll {
    position: absolute; right: 86px; bottom: 80px; z-index: 3; display: flex; align-items: center; justify-content: center;      /* beside the pause button, clear of the text */
    width: 32px; height: 52px;
    border: 2px solid rgba(255, 255, 255, .6); border-radius: 18px; color: #fff;
  }
  .vhero__scroll::after { content: ''; width: 4px; height: 9px; border-radius: 2px; background: #fff; animation: vhScroll 1.8s ease-in-out infinite; }
}
@keyframes vhScroll { 0% { transform: translateY(-8px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(10px); opacity: 0; } }

/* ---------- very wide / ultrawide monitors: don't let the hero grow forever ---------- */
@media (min-width: 1600px) {
  .vhero { min-height: clamp(540px, 60vh, 640px); }
  .vhero__title { font-size: 4.2rem; }
}
@media (min-aspect-ratio: 21/9) and (min-width: 900px) {
  .vhero { min-height: 58vh; }
  .vhero__video { width: 140%; object-position: 50% 45%; }     /* subject moves further right on very wide screens */
}

/* ---------- landscape phones / short windows: keep the buttons on screen ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  .vhero { min-height: 0; align-items: center; }
  .vhero__content { padding-block: 26px 64px; }
  .vhero__bar, .vhero__lead { display: none; }
  .vhero__title { font-size: clamp(1.7rem, 4.6vw, 2.4rem); max-width: 22ch; }
  .vhero__actions { margin-top: 14px; }
  .vhero__actions .sa-btn { height: 46px; }
  .vhero__facts, .vhero__scroll { display: none; }
    .vhero__toggle { bottom: 64px; }
  .vhero__shade { background: linear-gradient(90deg, rgba(8, 24, 22, .88) 0%, rgba(8, 24, 22, .6) 55%, rgba(8, 24, 22, .25) 100%); }
}

/* ---------- very small phones (320px) ---------- */
@media (max-width: 359px) {
  .vhero__content { padding-block: 36px 84px; }
  .vhero__facts li:nth-child(3) { display: none; }
}

/* ---------- no video: poster only (reduced motion, data saver, or video failed) ---------- */
.vhero.is-static .vhero__video { display: none; }
.vhero.is-static .vhero__toggle { display: none; }
@media (prefers-reduced-motion: reduce) {
  .vhero__video, .vhero__toggle { display: none; }
  .vhero__bar { width: 84px; animation: none; }
  .vhero .word > span { transform: none; animation: none; }
  .vhero__lead, .vhero__actions, .vhero__facts { animation: none; }
  .vhero__scroll::after { animation: none; opacity: 1; }
}
@media (print) { .vhero__video, .vhero__toggle, .vhero__scroll { display: none; } .vhero { color: #000; background: none; } .vhero__title { color: #000; text-shadow: none; } }
