/* The same stage sits behind the navigation and first section of every page. */
:root {
  --site-paper: #FCFEFF;
  --site-gutter: clamp(14px, 1.4vw, 24px);
  --site-radius: clamp(24px, 2.8vw, 46px);
  --site-nav-padding: 20px;
  --site-header-slot: calc(113px + var(--site-nav-padding));
  --site-shell-content-width: min(1440px, 90%, calc(100% - 40px));
  --site-photo-width: min(75%, 1080px);
  --site-photo-height: clamp(530px, 52vw, 690px);
  --site-photo-opacity: 1;
  --site-footer-ink: #04060a;
  --site-paper-fade: var(--site-paper), #dbe5f1 25%, #677b96 59%, #18263b 83%, var(--site-footer-ink);
  scrollbar-gutter: stable;
}

body {
  background: var(--site-paper);
}

body .site-header {
  height: var(--site-header-slot);
  min-height: var(--site-header-slot);
  border-bottom-color: transparent;
  box-shadow: none;
}

body .site-header:not(.is-pinned) {
  padding-block-start: var(--site-nav-padding);
  background: transparent;
  backdrop-filter: none;
}

body .site-header::before {
  opacity: 0;
}

body .site-header .wrap.nav-row,
body .site-footer.compact-footer :is(.footer-brand-row, .footer-line, .footer-legal).wrap {
  width: var(--site-shell-content-width);
  max-width: none;
}

body .site-header .nav :is(.nav-group > a, .nav-services > a, .nav-contact > a:first-child) {
  border: 1px solid transparent;
}

body .site-header .nav :is(.nav-group > a, .nav-services > a, .nav-contact > a:first-child)[aria-current="page"] {
  color: #fff;
  border-color: #5da9f9;
  background: linear-gradient(145deg, #4975c8, #2c50b1);
  box-shadow: 0 0 15px #1978df66, inset 0 1px #94c7ff66;
}

body main .button:not(.secondary) {
  color: #FCFEFF;
  background: #2C5CC5;
  border-color: #79b7ff;
  box-shadow: 0 0 22px #0a84ff40, inset 0 1px #ffffff33;
}

body main .button:not(.secondary):hover {
  background: #254FAD;
  box-shadow: 0 0 30px #149eff66, inset 0 1px #ffffff33;
}

body > .site-footer.compact-footer {
  border-top: 0;
  background: var(--site-footer-ink);
}

body > .site-footer.compact-footer::before {
  content: "";
  display: block;
  height: clamp(44px, 6vw, 96px);
  background: linear-gradient(to bottom, var(--site-paper-fade));
}

/* Full-width calls to action already have a dark surface above the footer. */
body:has(> main > :is(.reference-cta, .reference-cta-backdrop):last-child) > .site-footer.compact-footer::before {
  height: clamp(16px, 3vw, 38px);
  background: linear-gradient(to bottom, #0b1425, var(--site-footer-ink));
}

.reference-cta-backdrop {
  --cta-fade-depth: clamp(44px, 6vw, 86px);
  padding-top: var(--cta-fade-depth);
  background: linear-gradient(
    to bottom,
    var(--site-paper),
    #dbe5f1 calc(var(--cta-fade-depth) * .26),
    #677b96 calc(var(--cta-fade-depth) * .62),
    #0b1425 var(--cta-fade-depth)
  );
}

/* The inset form-page banner sits inside the fade, rather than above it. */
body > main > .ref-cta-section:last-child {
  background: linear-gradient(to bottom, var(--site-paper-fade));
}

body:has(> main > .ref-cta-section:last-child) > .site-footer.compact-footer::before {
  content: none;
}

body .site-hero,
body .site-hero.glass-contact.ref-hero {
  position: relative;
  isolation: isolate;
  width: calc(100% - 2 * var(--site-gutter));
  max-width: none;
  margin: 0 auto;
  overflow: visible;
  border: 0;
  background: none;
}

body .site-hero::before,
body .site-hero::after {
  content: none;
}

.site-hero-backdrop {
  position: absolute;
  z-index: -1;
  inset: calc(14px - var(--site-header-slot)) 0 var(--site-stage-bottom, 0px);
  overflow: hidden;
  border: 1px solid #5b8ac43d;
  border-radius: var(--site-radius);
  background:
    radial-gradient(ellipse at 76% 6%, #18538f38, transparent 64%),
    linear-gradient(154deg, #0a182e, #060e1e 62%, #040a15);
  box-shadow: 0 23px 42px -31px #244c7970;
  pointer-events: none;
}

.site-hero-backdrop > img {
  position: absolute;
  top: 0;
  right: max(0px, calc((100% - 1440px) / 2));
  width: var(--site-photo-width);
  height: var(--site-photo-height);
  object-fit: cover;
  object-position: 53% 50%;
  opacity: var(--site-photo-opacity);
  filter: saturate(1.1) contrast(1.05) brightness(.85);
  mask-image:
    linear-gradient(to right, transparent, #0009 29%, black 51% 89%, transparent),
    linear-gradient(to bottom, transparent, #0006 13%, black 34% 78%, #000b 90%, transparent);
  mask-composite: intersect;
}

main > .site-hero.page-intro {
  display: flex;
  min-height: calc(var(--site-photo-height) + 14px - var(--site-header-slot));
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

main > .site-hero.page-intro h1 {
  text-shadow: 0 2px 12px #030917d9;
}

@media (max-width: 980px) {
  :root {
    --site-nav-padding: 16px;
    --site-header-slot: calc(91px + var(--site-nav-padding));
  }
}

@media (max-width: 760px) {
  :root {
    --site-photo-width: 100%;
    --site-photo-height: clamp(470px, 78vw, 550px);
    --site-photo-opacity: .58;
  }

  .site-hero-backdrop > img {
    mask-image:
      linear-gradient(to right, #0006, black 65%),
      linear-gradient(to bottom, transparent, #0008 18%, black 42% 73%, transparent);
  }

  main > .site-hero.page-intro {
    min-height: auto;
  }
}

@media screen and (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  /* Dissolve the old page over the live page while its hero fades in. */
  ::view-transition-group(root) {
    animation: none;
  }

  ::view-transition-old(root) {
    z-index: 1;
    mix-blend-mode: normal;
    animation: cpt-page-out 210ms cubic-bezier(.4, 0, .2, 1) both;
  }

  ::view-transition-new(root) {
    mix-blend-mode: normal;
    animation: none;
  }

  .site-hero :is(h1, .lead, .lede, .hero-note, .careers-lead, .ref-hero-copy > p):not(.cpt-reveal, .cpt-entered, .cpt-reveal *, .cpt-entered *) {
    animation: cpt-copy-in 860ms var(--cpt-entrance-ease) 125ms backwards;
  }

  main > .split.detail > :not(.about-profile, .cpt-reveal, .cpt-entered, :has(:target)) {
    animation: cpt-copy-in 860ms var(--cpt-entrance-ease) 190ms backwards;
  }

  /* Keep the filtered surface in the same compositing layer throughout entry. */
  :is(.site-hero .glass-form, .site-hero .careers-glass, .split.detail > .about-profile):not(:target, :has(:target))
    > :not(.cpt-reveal, .cpt-entered, [hidden], [aria-live], [role="status"], [role="alert"]) {
    animation: cpt-glass-content-in 920ms var(--cpt-entrance-ease) 160ms backwards;
  }

  :is(.glass-form, .careers-glass, .about-profile):focus-within > *,
  main > .split.detail > :focus-within {
    opacity: 1 !important;
    translate: none !important;
  }

  .site-hero-backdrop > img {
    animation: cpt-rack-in 820ms var(--cpt-entrance-ease);
  }

  @keyframes cpt-page-out {
    to { opacity: 0; }
  }

  @keyframes cpt-copy-in {
    from {
      opacity: 0;
      translate: var(--cpt-copy-slide-x, 0px) var(--cpt-rise);
    }
  }

  @keyframes cpt-glass-content-in {
    from {
      opacity: .58;
      translate: 0 12px;
    }
  }

  @keyframes cpt-rack-in {
    from { opacity: calc(var(--site-photo-opacity) * .32); }
  }
}

@media (min-width: 981px) {
  .site-hero {
    --cpt-copy-slide-x: -18px;
  }
}
