/* ============================================================
   eMotion Video floating capsule header (option 1c)
   Built against brand/brand-system.css v2026-07-31f.
   Every colour and type value here is a token. No raw hexes.
   If a value you need is missing, add it to brand-system.css and
   bump the version. Do not hardcode.

   The five rgba() lines are FALLBACKS ONLY, each paired with the
   color-mix() declaration immediately after it and labelled with the
   token it resolves. Browsers without color-mix() take the rgba line,
   everything else takes the token. If a base hex changes in
   brand-system.css, update the paired fallback in the same commit.
   ============================================================ */

html {
  scroll-padding-top: 96px;
}

/* ---------- Wrapper: floats over the hero, no band ---------- */
.ev-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: var(--sp-3);
  pointer-events: none; /* let hero controls through the gutter */
}

.ev-header > * {
  pointer-events: auto;
}

.ev-header[data-state="stuck"] {
  position: fixed;
}

/* ---------- The capsule ---------- */
.ev-capsule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  max-width: 1360px;
  margin: 0 auto;
  padding: 5px 5px 5px var(--sp-4);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.62); /* fallback: --colour-white at 62% */
  background: color-mix(in srgb, var(--colour-white) 62%, transparent);
  border: 1px solid var(--colour-border-muted);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 6px 16px rgba(17, 34, 85, 0.14);
  transition: padding 220ms ease, background-color 220ms ease;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ev-capsule {
    background: rgba(255, 255, 255, 0.94); /* fallback: --colour-white at 94% */
    background: color-mix(in srgb, var(--colour-white) 94%, transparent);
  }
}

.ev-header[data-state="stuck"] .ev-capsule {
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4);
  background: rgba(255, 255, 255, 0.78); /* fallback: --colour-white at 78% */
  background: color-mix(in srgb, var(--colour-white) 78%, transparent);
}

/* ---------- Logo ---------- */
.ev-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.ev-logo img {
  display: block;
  height: 36px;
  width: auto;
  transition: height 220ms ease;
}

.ev-header[data-state="stuck"] .ev-logo img {
  height: 32px;
}

/* ---------- Nav ---------- */
.ev-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  flex: 1;
  white-space: nowrap;
}

.ev-nav__list { flex: 1; justify-content: center; }

.ev-nav__list {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  list-style: none;
  margin: 0;
  padding: 0;
}

.ev-nav__list a {
  display: block;
  padding: 7px var(--sp-3);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--w-semibold);
  line-height: 1;
  color: var(--colour-ink);
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease;
}

.ev-nav__list a:hover {
  background: var(--navy-050);
  color: var(--colour-navy);
}

.ev-nav__list a[aria-current="page"] {
  background: var(--navy-050);
  color: var(--colour-navy);
  font-weight: var(--w-bold);
}

/* ---------- CTA. Teal only.
   --colour-purple-2 is decorative under v2026-07-31f and must never
   fill a button or any container that holds a control. ---------- */
.ev-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 var(--sp-4);
  margin-left: var(--sp-2);
  border-radius: var(--radius-full);
  background: var(--colour-teal);
  color: var(--colour-text-white);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--w-bold);
  line-height: 1;
  text-decoration: none;
  transition: background-color 150ms ease;
}

.ev-cta:hover {
  background: var(--teal-700);
}

.ev-cta--block {
  width: 100%;
  height: 52px;
  margin: 0;
}

/* ---------- Focus ---------- */
.ev-header a:focus-visible,
.ev-header button:focus-visible,
.ev-panel a:focus-visible,
.ev-panel button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ---------- Menu button (mobile) ---------- */
.ev-menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--colour-border-medium);
  border-radius: var(--radius-full);
  background: var(--colour-purple);
  cursor: pointer;
}

.ev-menu-btn:hover {
  background: var(--navy-700); /* fallback if color-mix unsupported */
  background: color-mix(in srgb, var(--colour-purple) 82%, var(--colour-white));
}

.ev-menu-btn__bars,
.ev-menu-btn__bars::before,
.ev-menu-btn__bars::after {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--colour-text-white);
  content: "";
}

.ev-menu-btn__bars {
  position: relative;
}

.ev-menu-btn__bars::before {
  position: absolute;
  top: -5px;
}

.ev-menu-btn__bars::after {
  position: absolute;
  top: 5px;
}

.ev-menu-btn__x {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
}

.ev-menu-btn__x::before,
.ev-menu-btn__x::after {
  position: absolute;
  top: 7px;
  left: 0;
  width: 16px;
  height: 2px;
  background: var(--colour-text-white);
  content: "";
}

.ev-menu-btn__x::before { transform: rotate(45deg); }
.ev-menu-btn__x::after  { transform: rotate(-45deg); }

/* ---------- Hero surface. The capsule must never sit on white ---------- */
.ev-hero {
  position: relative;
  min-height: 640px;
  background: var(--colour-bg-dark);
  overflow: hidden;
}

.ev-hero__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ev-hero__scrim {
  position: absolute;
  inset: 0;
  /* fallback: --navy-950 at 66% fading out to clear across the frame */
  background: linear-gradient(
    100deg,
    rgba(10, 19, 48, 0.66) 0%,
    rgba(10, 19, 48, 0.4) 34%,
    rgba(10, 19, 48, 0.08) 62%,
    rgba(10, 19, 48, 0) 88%
  );
  background: linear-gradient(
    100deg,
    color-mix(in srgb, var(--navy-950) 66%, transparent) 0%,
    color-mix(in srgb, var(--navy-950) 40%, transparent) 34%,
    color-mix(in srgb, var(--navy-950) 8%, transparent) 62%,
    transparent 88%
  );
}

@media (max-width: 900px) {
  .ev-hero__scrim {
    background: linear-gradient(
      180deg,
      rgba(10, 19, 48, 0.42) 0%,
      rgba(10, 19, 48, 0.5) 55%,
      rgba(10, 19, 48, 0.62) 100%
    );
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--navy-950) 42%, transparent) 0%,
      color-mix(in srgb, var(--navy-950) 50%, transparent) 55%,
      color-mix(in srgb, var(--navy-950) 62%, transparent) 100%
    );
  }
}

.ev-hero__body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  max-width: 760px;
  padding: calc(var(--sp-9) + var(--sp-7)) var(--sp-6) var(--sp-8);
}

.ev-hero__eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: var(--w-semibold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal-300);
}

.ev-hero__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--fs-hero);
  font-weight: var(--w-black);
  line-height: 1.1;
  color: var(--colour-text-white);
  text-wrap: pretty;
}

/* One highlighted word per screenful. Never a phrase. */
.ev-highlight {
  font-family: var(--font-highlight);
  font-weight: var(--fw-normal);
  color: var(--colour-highlight);
}

.ev-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding-top: var(--sp-2);
}

.ev-hero__actions .ev-cta {
  height: 50px;
  margin-left: 0;
}

.ev-btn-ghost {
  display: inline-flex;
  align-items: center;
  height: 50px;
  padding: 0 var(--sp-5);
  border: 1px solid rgba(255, 255, 255, 0.4); /* fallback: --colour-white at 40% */
  border: 1px solid color-mix(in srgb, var(--colour-white) 40%, transparent);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--w-semibold);
  color: var(--colour-text-white);
  text-decoration: none;
  transition: background-color 150ms ease;
}

.ev-btn-ghost:hover {
  background: var(--colour-border-medium);
}

/* Inner pages with no hero image */
.ev-hero--flat {
  min-height: 220px;
  background: var(--gradient-hero);
}

/* ---------- Mobile panel ---------- */
.ev-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  padding: var(--sp-5);
  background: rgba(32, 9, 57, 0.6); /* fallback: --colour-purple at 60% */
  background: color-mix(in srgb, var(--colour-purple) 60%, transparent);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  overflow-y: auto;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ev-panel {
    background: rgba(32, 9, 57, 0.97); /* fallback: --colour-purple at 97% */
    background: color-mix(in srgb, var(--colour-purple) 97%, transparent);
  }
}

.ev-panel[hidden] {
  display: none;
}

.ev-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ev-panel__head img {
  height: 34px;
  width: auto;
}

.ev-panel__nav {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  padding-top: var(--sp-4);
}

.ev-panel__nav a {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: var(--w-bold);
  color: var(--colour-text-white);
  text-decoration: none;
}

.ev-panel__nav a:hover {
  color: var(--teal-200);
}

.ev-btn-group {
  display: flex;
  align-items: center;
  border-radius: var(--radius-full);
}

.ev-top-btn { display: none; }

@media (max-width: 1240px) {
  .ev-nav { display: none; }
  .ev-menu-btn { display: inline-flex; }

  /* Once pinned, the purple circle stretches left into a pill holding Top */
  .ev-header[data-state="stuck"] .ev-btn-group {
    background: var(--colour-purple);
    border: 1px solid var(--colour-border-medium);
  }

  .ev-header[data-state="stuck"] .ev-btn-group .ev-menu-btn {
    border-color: transparent;
  }

  .ev-header[data-state="stuck"] .ev-top-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 var(--sp-2) 0 var(--sp-4);
    border: 0;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--colour-text-white);
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: var(--w-bold);
    cursor: pointer;
  }
  .ev-capsule { padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4); }
  .ev-hero__body { padding: calc(var(--sp-8) + var(--sp-7)) var(--sp-5) var(--sp-7); }
}

body.ev-scroll-locked {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .ev-capsule,
  .ev-logo img,
  .ev-nav__list a,
  .ev-cta,
  .ev-btn-ghost {
    transition: none;
  }
}
