/* Edge-to-edge hero filling the landing screen (one viewport tall; 100svh
   keeps it fully visible under mobile browser chrome, 100vh is the
   fallback), starting at the top of the page behind the translucent menu
   (see hero-header.css). The video covers the box (object-fit: cover).
   Desktop first; mobile variations to follow. */
#hero {
  position: relative;
  /* #hero is a flex item of #content (.site-main: column + wrap); an
     explicit width keeps its size definite there. */
  flex: 0 0 auto;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

/* #content normally clears the fixed header with margin-top: 5rem (theme
   styles.css). When it starts with the hero, drop that offset so the hero
   starts at the very top and the header overlays it. */
#content:has(> #hero) {
  margin-top: 0;
}

/* Scrim: guarantees text contrast over any footage */
#hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--hero-scrim);
  pointer-events: none;
}

.region-hero > .container {
  max-width: 100%;
  margin: 0 auto;
}

/* Text over the footage/panel is always literal white. Some themes
   (apebox_theme and its sub-themes) use --color-white as a scheme-aware
   "paper" surface that is dark in the dark scheme, so pin it for the block. */
.home-hero-video-block {
  --color-white: #ffffff;
}
.home-hero-video-block .hero-video {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
  -o-object-position: bottom right;
     object-position: bottom right;
}
/* Scroll parallax (hero-video.js): the footage drifts down slower than
   the page. .has-parallax (JS-added, skipped under reduced motion) bleeds
   the video 25% above the crop so the downward shift never exposes a gap;
   the shift itself is capped at that bleed. */
.home-hero-video-block.has-parallax .hero-video {
  top: -25%;
  height: 125%;
  will-change: transform;
}
/* Overlaid header + rotating tags: text stack bottom-left of the hero.
   Above the scrim (#hero::after, z0). */
.home-hero-video-block .hero-banner-content {
  position: absolute;
  /* Anchored from the bottom: the text stack's bottom edge sits one fifth
     of the hero's height up from the bottom (bottom % = containing block
     height). Height follows the content. */
  inset: auto 0 20% 0;
  /* Text stays within the page content width: same cap and side inset as
     .container, centred (auto margins on an absolutely positioned box with
     left/right 0), so it lines up with the blocks below. */
  max-width: var(--content-max-width);
  margin: 0 auto;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: var(--space-lg);
  padding: 0 var(--space-md);
  pointer-events: none;
}
.home-hero-video-block .hero-banner-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
/* Header line — styled as .hero-banner-subtitle. */
.home-hero-video-block .main-hero-title {
  margin: 0;
  color: var(--color-primary);
  font-weight: 600;
  font-size: clamp(var(--font-size-lg), 1.8vw, var(--font-size-display));
  line-height: var(--leading-tight);
}
/* Tags stack in one grid cell so they can crossfade in place. */
.home-hero-video-block .hero-tags {
  display: grid;
}
/* Rotating tag lines — styled as .hero-banner-title. */
.home-hero-video-block .hero-tag {
  grid-area: 1 / 1;
  margin: 0;
  color: var(--color-white);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  transition: opacity 0.5s ease-in-out;
}
/* Value line under the header: white ink over the scrim (mode-stable). */
.home-hero-video-block .hero-intro {
  margin: var(--space-xs) 0 0;
  color: var(--color-white);
  font-size: clamp(var(--font-size-xl), 1.4vw, var(--font-size-display));
}
/* Link bar: pinned to the bottom of the hero with breathing room, within
   the page content width (same cap + side inset as .container). Sits
   above the scrim and the pointer-events:none content overlay. */
.home-hero-video-block .hero-links {
  position: absolute;
  inset: auto 0 0 0;
  max-width: var(--content-max-width);
  margin: 0 auto;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  padding: 0 var(--space-md) var(--space-xxl);
}
/* Registered so the hover tint can animate (unregistered custom
   properties snap). */
@property --segment-tint {
  syntax: '<color>';
  inherits: false;
  initial-value: transparent;
}
/* Link = powerline chain of two segments: a translucent, blurred label
   segment (rounded left corners) and a primary-colour end cap — a square
   box running out into an arrow tip, with rounded corners.
   Text is eyebrow-style (.text-eyebrow: 700 / uppercase), one step larger
   (xl). Fixed white ink — the surface sits on footage and must not
   mode-flip. */
.home-hero-video-block .hero-link {
  --segment-arrow: 0.6em;
  --segment-tint: color-mix(in srgb, var(--color-white) 15%, transparent);
  position: relative;
  display: inline-flex;
  align-items: stretch;
  color: var(--color-white);
  font-weight: 600;
  font-size: var(--font-size-xl);
  line-height: 1.5;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: --segment-tint 0.2s ease;
}
.home-hero-video-block .hero-link:hover,
.home-hero-video-block .hero-link:focus-visible {
  --segment-tint: color-mix(in srgb, var(--color-white) 30%, transparent);
}
.home-hero-video-block .hero-link__label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background-color: var(--segment-tint);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
}
/* End-cap icon: inline SVG line icon, 1.25em tall with a 2px line weight
   (non-scaling stroke). Nudged right
   by a quarter of the tip depth so it sits on the visual centre of the
   square + arrow shape rather than the square alone. */
.home-hero-video-block .hero-link__icon {
  flex: 0 0 auto;
  width: 1.25em;
  height: 1.25em;
  color: var(--color-brand-teal);
  transform: translateX(calc(var(--segment-arrow) / 4));
}
/* End cap: a primary-colour square (height transferred to width) that runs
   out into an arrow tip one em deep. The shape is an SVG mask rather than
   a clip-path polygon so its corners can be rounded: the polygon is drawn
   with a 12-unit round-joined stroke, i.e. a 6px radius at the tip and the
   two right corners — the same value as --radius-md on the label's left
   corners, so the whole link reads as one uniform shape. The path runs
   past the left edge so the seam with the label stays square. The viewBox
   matches the box (45.5 tall + 21 tip at the xl size); mask alpha only. */
.home-hero-video-block .hero-link__end {
  --segment-arrow: 1em;
  aspect-ratio: 1 / 1;
  box-sizing: content-box;
  padding-right: var(--segment-arrow);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 66.5 45.5' preserveAspectRatio='none'%3E%3Cpath d='M-20 6H42.9L57.7 22.75 42.9 39.5H-20Z' fill='%23000' stroke='%23000' stroke-width='12' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 66.5 45.5' preserveAspectRatio='none'%3E%3Cpath d='M-20 6H42.9L57.7 22.75 42.9 39.5H-20Z' fill='%23000' stroke='%23000' stroke-width='12' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  background-color: var(--color-primary);
}
.home-hero-video-block .hero-video::-webkit-media-controls,
.home-hero-video-block .hero-video::-webkit-media-controls-panel,
.home-hero-video-block .hero-video::-webkit-media-controls-play-button,
.home-hero-video-block .hero-video::-webkit-media-controls-start-playback-button {
  display: none !important;
}

@media (max-width: 47.99em) {
  #hero {
    height: auto;
    min-height: 100svh;
  }

  /* Keep the text and links in one flow so stacked links cannot overlap
     the intro, including on short screens or with larger text. */
  .home-hero-video-block {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: var(--space-lg);
    width: 100%;
    min-height: 100svh;
    padding: 8rem 0 var(--space-lg);
  }

  .home-hero-video-block .hero-banner-content,
  .home-hero-video-block .hero-links {
    position: relative;
    inset: auto;
    margin: 0;
  }

  .home-hero-video-block .hero-links {
    flex-direction: column;
    padding-bottom: 0;
  }

  .home-hero-video-block .hero-link {
    max-width: 100%;
    font-size: var(--font-size-md);
    white-space: normal;
  }

  .home-hero-video-block .hero-link__label {
    min-width: 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
  }

  /* End cap leads the label on small screens; same arrow mask as desktop,
     with a shallower tip and a fixed square. */
  .home-hero-video-block .hero-link__end {
    --segment-arrow: 0.6em;
    flex: 0 0 auto;
    order: -1;
    width: calc(1.5em + 2 * var(--space-xs));
    height: calc(1.5em + 2 * var(--space-xs));
    aspect-ratio: auto;
    padding: 0 var(--segment-arrow) 0 0;
  }
}

