/* SMOOTH TRANSIT GLOBAL — motion layer
   Load after css/style.css on every page.
   The core site styles remain in style.css. */

/* ---------------------------------------------------------------
   PAGE TRANSITION COVER
   The .pt cover is real markup on every page (heading + caption for
   THAT page), so on arrival the browser paints the exact same panel the
   previous page ended on: no flash, no text popping in, no colour jump.
   --------------------------------------------------------------- */
html.stg-arriving,
html.stg-intro-pending {
  background: #071b43;
}

/* Hide the page itself until the cover (or loader) is in charge. */
html.stg-arriving body > :not(.pt),
html.stg-intro-pending body > :not(#stg-loader) {
  visibility: hidden !important;
}

html.stg-intro-pending {
  overflow: hidden;
}

.pt {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  overflow: hidden;
  pointer-events: none;
  isolation: isolate;
}

html.stg-arriving .pt,
.pt.is-active {
  display: block;
}

.pt > .p {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  color: #fff;
  background: #071b43;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  will-change: transform;
}

.pt .p b {
  color: #fff;
  font:
    500 clamp(2.3rem, 6.5vw, 6.5rem)/1.05 "Instrument Serif",
    Georgia,
    serif;
  text-align: center;
  letter-spacing: -0.025em;
  -webkit-text-stroke: 0;
}

.pt .p span {
  display: block;
  margin-top: 1.3rem;
  font:
    500 clamp(0.66rem, 1.1vw, 0.85rem)/1.6 "JetBrains Mono",
    monospace;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-align: center;
  color: #9db7e2;
}

/* Above-the-fold animated bits stay hidden until JS has set their start
   state, so they never flash visible and then jump to hidden. */
html.js:not(.stg-ready) [data-pop],
html.js:not(.stg-ready) .hero-cap,
html.js:not(.stg-ready) .pass {
  visibility: hidden;
}

/* Lenis: on touch devices native scrolling ignores lenis.stop(), so lock
   it with CSS. Desktop is excluded to avoid a scrollbar-width layout jump. */
@media (hover: none) and (pointer: coarse) {
  html.lenis-stopped,
  html.lenis-stopped body {
    overflow: hidden;
  }
}

/* First-visit home loader */
#stg-loader {
  display: none;
}

html.stg-intro-pending #stg-loader,
html.stg-intro-active #stg-loader {
  display: flex;
}

.stg-loader {
  position: fixed;
  inset: 0;
  z-index: 10001;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  box-sizing: border-box;
  background: #07162e;
  color: #f3f6ff;
  padding: clamp(22px, 4vw, 65px);
  font-family: Inter, Arial, sans-serif;
  isolation: isolate;
}

.stg-loader::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.45;
  background:
    radial-gradient(
      ellipse at 50% 49%,
      rgba(34, 74, 143, 0.33),
      transparent 55%
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc(25% - 1px),
      rgba(140, 164, 204, 0.12) 25%
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent calc(25% - 1px),
      rgba(140, 164, 204, 0.1) 25%
    );
}

.stg-loader__top,
.stg-loader__bottom,
.stg-loader__status {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stg-loader__top {
  position: relative;
  z-index: 1;
}

.stg-loader__brand {
  font-size: clamp(1.25rem, 2vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.09em;
}

.stg-loader__slash {
  color: #ec4544;
  margin-inline: 0.12em;
}

.stg-loader__flight,
.stg-loader__kicker,
.stg-loader__status,
.stg-loader__runway-id {
  font:
    500 clamp(0.6rem, 0.92vw, 0.78rem)/1.6 "JetBrains Mono",
    monospace;
  letter-spacing: 0.12em;
}

.stg-loader__flight {
  color: #9cadc7;
}

.stg-loader__flight b {
  margin-left: 14px;
  color: #fff;
}

.stg-loader__scene {
  position: absolute;
  z-index: 0;
  top: 17%;
  bottom: 31%;
  left: 50%;
  width: min(470px, 62vw);
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
}

.stg-loader__runway {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(167, 194, 236, 0.1) 0 20px,
    rgba(190, 209, 245, 0.55) 20px 40px,
    transparent 40px 68px
  );
}

.stg-loader__runway::before,
.stg-loader__runway::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(163, 186, 223, 0.14);
}

.stg-loader__runway::before {
  left: -80px;
}
.stg-loader__runway::after {
  right: -80px;
}

.stg-loader__aircraft {
  position: relative;
  width: clamp(52px, 8.8vw, 105px);
  height: auto;
  color: #fff;
  filter: drop-shadow(0 0 28px rgba(144, 182, 255, 0.35));
  transform: translate3d(0, 60px, 0);
  opacity: 0;
  will-change: transform, opacity;
}

.stg-loader__runway-id {
  position: absolute;
  right: -12%;
  top: 50%;
  writing-mode: vertical-rl;
  color: #7c93b6;
  font-size: 0.64rem;
}

.stg-loader__bottom {
  position: relative;
  z-index: 1;
  align-items: flex-end;
  margin-top: auto;
  margin-bottom: 34px;
}

.stg-loader__kicker {
  color: #a5b9df;
}

.stg-loader__titleblock h2 {
  margin: 15px 0 0;
  font:
    400 clamp(3rem, 6.5vw, 7rem)/0.98 "Instrument Serif",
    Georgia,
    serif;
  letter-spacing: -0.045em;
}

.stg-loader__titleblock h2 em {
  color: #a3bce2;
  font-weight: 400;
}

.stg-loader__number {
  font:
    400 clamp(3rem, 8vw, 8rem)/0.9 "Instrument Serif",
    Georgia,
    serif;
  letter-spacing: -0.06em;
}

.stg-loader__number small {
  font:
    500 clamp(0.75rem, 1.2vw, 1rem) "JetBrains Mono",
    monospace;
  margin-left: 0.3em;
  color: #a4b7d5;
}

.stg-loader__track {
  height: 2px;
  width: 100%;
  background: rgba(165, 185, 217, 0.2);
  overflow: hidden;
}

.stg-loader__fill {
  display: block;
  width: 100%;
  height: 100%;
  background: #f3f6ff;
  transform: scaleX(0);
  transform-origin: left;
}

.stg-loader__status {
  margin-top: 17px;
  gap: 12px;
  color: #8ea3c8;
}

@media (max-width: 600px) {
  .stg-loader__scene {
    top: 12%;
    bottom: 33%;
  }

  .stg-loader__runway-id {
    display: none;
  }
  .stg-loader__flight {
    font-size: 0.57rem;
  }
  .stg-loader__flight b {
    margin-left: 5px;
  }

  .stg-loader__bottom {
    gap: 12px;
    margin-bottom: 24px;
  }

  .stg-loader__titleblock h2 {
    font-size: clamp(2.65rem, 11vw, 4.2rem);
  }

  .stg-loader__number {
    font-size: clamp(3.4rem, 12vw, 5rem);
  }

  .stg-loader__status {
    font-size: 0.54rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.stg-arriving body > :not(.pt),
  html.stg-intro-pending body > :not(#stg-loader) {
    visibility: visible !important;
  }

  #stg-loader {
    display: none !important;
  }
}

/* ---------------------------------------------------------------
   FOOTER HOVER
   Only on devices that can actually hover, so touch screens never
   get stuck in a hover state after a tap.
   --------------------------------------------------------------- */
.f li a,
.f .lg2 a {
  position: relative;
  display: inline-block;
  transition:
    color 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Underline that draws in from the left */
.f li a::after,
.f .lg2 a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.f img.lg {
  transition:
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.f h4 {
  transition:
    opacity 0.35s,
    color 0.35s;
}

@media (hover: hover) and (pointer: fine) {
  .f li a:hover,
  .f li a:focus-visible,
  .f .lg2 a:hover {
    color: #6aa8ff;
    transform: translateX(6px);
  }

  .f li a:hover::after,
  .f li a:focus-visible::after,
  .f .lg2 a:hover::after {
    transform: scaleX(1);
    transform-origin: left center;
  }

  /* Contact links pick up the brand red instead */
  .f .fg > div:last-child li a:hover {
    color: #ff5a5a;
  }

  .f img.lg:hover {
    transform: translateY(-4px) rotate(-1.5deg);
    box-shadow: 0 14px 30px -12px rgba(106, 168, 255, 0.55);
  }

  /* Hovering a column lights up its heading */
  .fg > div:hover > h4 {
    opacity: 1;
    color: #6aa8ff;
  }
}

@media (prefers-reduced-motion: reduce) {
  .f li a,
  .f li a::after,
  .f img.lg {
    transition: none !important;
    transform: none !important;
  }
}
