/* Video Hero – fully scoped, compatible with WordPress and Divi 5. */
.rn-vh {
  position: relative;
  display: block;
  box-sizing: border-box;
  isolation: isolate;
  /* Use the real layout viewport (excluding browser scrollbar width), set by JS.
     This also breaks out of narrow Divi columns without causing horizontal overflow. */
  width: var(--rn-vh-viewport-width, 100vw);
  max-width: none;
  margin-left: calc(50% - var(--rn-vh-half-viewport-width, 50vw));
  margin-right: 0;
  min-height: 100vh;
  min-height: 100svh;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--rn-vh-color, #ff2b12);
  line-height: normal;
}
.rn-vh--height-80 { min-height: 80svh; height: 80svh; }
.rn-vh--height-70 { min-height: 70svh; height: 70svh; }
.rn-vh *, .rn-vh *::before, .rn-vh *::after { box-sizing: border-box; }
.rn-vh__video,
.rn-vh__poster {
  display: block;
  position: absolute;
  width: 100%; height: 100%;
  inset: 0;
  object-fit: cover;
  object-position: 50% 50%;
  pointer-events: none;
  border: 0;
  padding: 0;
  margin: 0;
}
.rn-vh__poster { z-index: 0; }
.rn-vh__video {
  z-index: 1;
  opacity: 0;
  transition: opacity .55s ease;
}
.rn-vh--ready .rn-vh__video { opacity: 1; }
.rn-vh__overlay {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.rn-vh__svg { display: block; width: 100%; height: 100%; }
/* Keep the brand-colour mask in place until the initial font measurement and
   proportional layout are complete. Never reveal the oversized source glyphs. */
.rn-vh:not(.rn-vh--layout-ready) .rn-vh__mask-letters { visibility: hidden; }
/* 1.5.0: progressive SVG mask reveal before either marquee starts.
   Both alternatives fade once; the default fades only the mask cutouts,
   leaving the solid brand-colour overlay visible throughout the intro. */
.rn-vh--intro-letters:not(.rn-vh--intro-done) .rn-vh__mask-letters { opacity: 0; }
.rn-vh--intro-overlay:not(.rn-vh--intro-done) .rn-vh__overlay { opacity: 0; }
.rn-vh--intro-running.rn-vh--intro-letters .rn-vh__mask-letters,
.rn-vh--intro-running.rn-vh--intro-overlay .rn-vh__overlay {
  animation-name: rn-vh-intro-fade;
  animation-duration: var(--rn-vh-intro-duration, 1.5s);
  animation-delay: var(--rn-vh-intro-delay, .2s);
  animation-iteration-count: 1;
  animation-timing-function: ease-out;
  animation-fill-mode: both;
}
.rn-vh--intro-done .rn-vh__mask-letters,
.rn-vh--intro-done .rn-vh__overlay { opacity: 1; }
/* While fading: marquee at its FIRST keyframe; glyphs at their neutral
   positions, never frozen midway through a staggered effect. */
.rn-vh--intro-enabled:not(.rn-vh--intro-done) .rn-vh__moving-text {
  animation-play-state: paused !important;
}
.rn-vh--intro-enabled:not(.rn-vh--intro-done) .rn-vh__glyph-motion {
  animation: none !important;
}
/* Video paused or tab/hero hidden: preserve partial fade, do not finish it. */
.rn-vh--intro-running.rn-vh--has-video:not(.rn-vh--playing) .rn-vh__mask-letters,
.rn-vh--intro-running.rn-vh--has-video:not(.rn-vh--playing) .rn-vh__overlay {
  animation-play-state: paused;
}
@keyframes rn-vh-intro-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
/* The responsive font size is applied to the SVG group itself. Glyph widths are
   recomputed after the font or viewport changes; no horizontal scaling animation. */
.rn-vh__moving-text {
  font-size: calc(var(--rn-vh-base-font-size, 380px) * var(--rn-vh-desktop-scale, .8) * var(--rn-vh-height-scale, 1));
  transform-box: view-box;
  transform-origin: 0 0;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}
.rn-vh__moving-text--left { animation-name: rn-vh-move-left; }
.rn-vh__moving-text--right { animation-name: rn-vh-move-right; }
.rn-vh--has-video:not(.rn-vh--playing) .rn-vh__moving-text,
.rn-vh--has-video:not(.rn-vh--playing) .rn-vh__glyph-motion {
  animation-play-state: paused;
}
/* Per-letter motions are nested INSIDE the running SVG marquee group.
   This ensures the video cutout is still one coherent SVG mask. */
.rn-vh__glyph-motion {
  transform-box: fill-box;
  transform-origin: center center;
  animation-duration: var(--rn-vh-glyph-duration, 3s);
  animation-delay: var(--rn-vh-glyph-delay, 0s);
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}
/* The glyphs now move AWAY from the shared centreline. For scaleY
   effects, pin their inner edge so the two lines cannot collide. */
.rn-vh__moving-text--line-1 .rn-vh__glyph-motion { transform-origin: center bottom; }
.rn-vh__moving-text--line-2 .rn-vh__glyph-motion { transform-origin: center top; }
.rn-vh__glyph-motion--wave { animation-name: rn-vh-glyph-wave; }
.rn-vh__glyph-motion--pulse { animation-name: rn-vh-glyph-pulse; }
.rn-vh__glyph-motion--glitch { animation-name: rn-vh-glyph-glitch; animation-timing-function: steps(1, end); }
.rn-vh__glyph-motion--cascade { animation-name: rn-vh-glyph-cascade; }
@keyframes rn-vh-glyph-wave {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(var(--rn-vh-wave-y, -16px)); }
  75% { transform: translateY(0); }
}
@keyframes rn-vh-glyph-pulse {
  0%, 100% { transform: scale(1); }
  /* Keep the width fixed so neighboring letters never collide. */
  50% { transform: scaleY(var(--rn-vh-pulse-scale, 1.12)); }
}
@keyframes rn-vh-glyph-glitch {
  /* Vertical glitch keeps the character in its horizontal slot. */
  0%, 75%, 100% { transform: translateY(0) skewY(0deg); }
  77% { transform: translateY(var(--rn-vh-glitch-y, 8px)) skewY(1deg); }
  79% { transform: translateY(var(--rn-vh-glitch-half, -4px)) skewY(-1deg); }
  81% { transform: translateY(0) skewY(0deg); }
  83% { transform: translateY(var(--rn-vh-glitch-y, 8px)); }
  85% { transform: translateY(0); }
}
@keyframes rn-vh-glyph-cascade {
  0%, 15%, 100% { transform: translateY(0); opacity: 1; }
  40% { transform: translateY(var(--rn-vh-rise-y, 34px)); opacity: .04; }
  65% { transform: translateY(0); opacity: 1; }
}


/* 1.4.0 – Five energetic presets. Every transform keeps scaleX = 1 and the
   fixed glyph-position slot unchanged, preventing R/A or repeat collisions. */
.rn-vh__glyph-motion--slam { animation-name: rn-vh-glyph-slam; animation-timing-function: cubic-bezier(.32,0,.7,1); }
.rn-vh__glyph-motion--jump { animation-name: rn-vh-glyph-jump; animation-timing-function: ease-out; }
.rn-vh__glyph-motion--staccato { animation-name: rn-vh-glyph-staccato; animation-timing-function: steps(1, end); }
.rn-vh__glyph-motion--elastic { animation-name: rn-vh-glyph-elastic; animation-timing-function: ease-in-out; }
.rn-vh__glyph-motion--burst { animation-name: rn-vh-glyph-burst; animation-timing-function: ease-out; }
@keyframes rn-vh-glyph-slam {
  0%, 8%, 78%, 100% { transform: scaleY(1); }
  14% { transform: scaleY(var(--rn-vh-slam-low, .82)); }
  23% { transform: scaleY(var(--rn-vh-slam-high, 1.22)); }
  35% { transform: scaleY(.9); }
  49% { transform: scaleY(1.08); }
  62% { transform: scaleY(1); }
}
@keyframes rn-vh-glyph-jump {
  0%, 8%, 45%, 56%, 100% { transform: translateY(0); }
  17% { transform: translateY(var(--rn-vh-jump-up, -38px)); }
  27% { transform: translateY(var(--rn-vh-jump-down, 4.56px)); }
  36% { transform: translateY(0); }
  64% { transform: translateY(var(--rn-vh-jump-mid, -22.8px)); }
  74% { transform: translateY(var(--rn-vh-jump-small-down, 3.04px)); }
  84% { transform: translateY(0); }
}
@keyframes rn-vh-glyph-staccato {
  0%, 9%, 38%, 47%, 70%, 100% { transform: translateY(0); }
  10%, 15% { transform: translateY(var(--rn-vh-staccato-up, -22px)); }
  16%, 21% { transform: translateY(var(--rn-vh-staccato-y, 22px)); }
  22%, 27% { transform: translateY(var(--rn-vh-staccato-mid, -13.2px)); }
  28%, 37% { transform: translateY(0); }
  48%, 54% { transform: translateY(var(--rn-vh-staccato-y, 22px)); }
  55%, 61% { transform: translateY(var(--rn-vh-staccato-up, -22px)); }
  62%, 69% { transform: translateY(0); }
}
@keyframes rn-vh-glyph-elastic {
  0%, 7%, 85%, 100% { transform: translateY(0) scaleY(1); }
  12% { transform: translateY(0) scaleY(.72); }
  24% { transform: translateY(var(--rn-vh-elastic-up, -20.9px)) scaleY(var(--rn-vh-elastic-high, 1.3)); }
  39% { transform: translateY(0) scaleY(.86); }
  53% { transform: translateY(var(--rn-vh-elastic-small-up, -5.7px)) scaleY(1.12); }
  68% { transform: translateY(0) scaleY(.96); }
}
@keyframes rn-vh-glyph-burst {
  0%, 12%, 67%, 100% { transform: translateY(0) scaleY(1); opacity: 1; }
  18% { transform: translateY(var(--rn-vh-burst-y, 20px)) scaleY(.72); opacity: .86; }
  26% { transform: translateY(var(--rn-vh-burst-up, -20px)) scaleY(var(--rn-vh-slam-high, 1.22)); opacity: 1; }
  37% { transform: translateY(0) scaleY(.88); opacity: 1; }
  50% { transform: translateY(0) scaleY(1.05); opacity: 1; }
}

@keyframes rn-vh-move-left {
  from { transform: translateX(0); }
  to   { transform: translateX(var(--rn-vh-translate-negative, -1600px)); }
}
@keyframes rn-vh-move-right {
  from { transform: translateX(var(--rn-vh-translate-negative, -1600px)); }
  to   { transform: translateX(0); }
}
.rn-vh__accessible-name {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  border: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}
.rn-vh__toggle {
  display: inline-flex;
  position: absolute;
  z-index: 5;
  right: clamp(16px, 3vw, 44px);
  bottom: clamp(16px, 3vw, 40px);
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  background: rgba(0, 0, 0, .64);
  color: #fff;
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: none;
  line-height: 1;
  transition: background .2s ease;
}
.rn-vh__toggle:hover { background: rgba(0, 0, 0, .9); }
.rn-vh__toggle:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.rn-vh__icon { display: block; flex: 0 0 18px; }
.rn-vh__play-icon { display: none; }
.rn-vh:not(.rn-vh--playing) .rn-vh__pause-icon { display: none; }
.rn-vh:not(.rn-vh--playing) .rn-vh__play-icon { display: block; }
@media (prefers-reduced-motion: reduce) {
  .rn-vh__moving-text { animation: none !important; transform: none !important; }
  .rn-vh__glyph-motion { animation: none !important; transform: none !important; opacity: 1 !important; }
  .rn-vh__video { transition: none; }
  /* Always display the finished cutout in reduced-motion mode. */
  .rn-vh--intro-enabled .rn-vh__mask-letters,
  .rn-vh--intro-enabled .rn-vh__overlay { opacity: 1 !important; animation: none !important; }
}

/* 1.3.2: a compact, readable hero on smartphones. Desktop uses 80% of the
   saved base SVG size by default; the WordPress settings can override it. */
@media (max-width: 767px) {
  .rn-vh,
  .rn-vh--height-70,
  .rn-vh--height-80 {
    height: var(--rn-vh-mobile-height, 60vh);
    min-height: var(--rn-vh-mobile-height, 60vh);
  }
  .rn-vh__moving-text {
    font-size: calc(var(--rn-vh-base-font-size, 380px) * var(--rn-vh-mobile-scale, .7) * var(--rn-vh-height-scale, 1));
  }
  .rn-vh__toggle { width: 40px; height: 40px; min-width: 40px; right: 14px; bottom: 14px; }
}

/* 1.5.8: full video background for native Divi headings. */
.rn-vh--background::after { content:""; position:absolute; inset:0; z-index:2; pointer-events:none; background:rgba(0,0,0,.4); }
