/* A headline flown in (hero-flight.js), on TESORIN's home and Apricity's:
   a small plane, a real photograph, tows it in on a white cloth banner
   through the sky itself, behind what stands in it. The banner lets go at
   the headline's place, stills, and is wiped away, leaving its words as
   the headline. */
/* Its sky, in the sky's own layer: over the sky (also -1, and earlier on
   the page), under what stands in it. Clipped to its width, so the flight
   in from off the screen never widens the page. */
.flight-sky { position: absolute; left: 0; top: 0; width: 100%; z-index: -1; overflow: hidden; overflow: clip; pointer-events: none; }
.flight { position: absolute; will-change: transform; }
.flight__banner { position: absolute; inset: 0; }
/* The cloth, cut into upright slices that each ride the wave. Each holds
   the whole banner, shifted, so the words run on unbroken. */
.flight__slice { position: absolute; top: 0; height: 100%; overflow: hidden; will-change: transform; }
.flight__cloth { position: absolute; top: 0; height: 100%; }
/* Lit as the sky lights it: warmer where the sun catches its top, a
   little of the sky's blue thrown up under it, and its hems. */
.flight__cloth::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(24, 34, 64, 0) 4px, rgba(24, 34, 64, .1) 4px 5px, rgba(24, 34, 64, 0) 5px calc(100% - 5px), rgba(24, 34, 64, .1) calc(100% - 5px) calc(100% - 4px), rgba(24, 34, 64, 0) calc(100% - 4px)),
    linear-gradient(180deg, rgba(255, 246, 226, .55) 0%, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0) 62%, rgba(122, 170, 236, .2) 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(232, 238, 248, .5) 100%),
    #F7F5EF;
}
/* Each fold's shade as the wave passes under it. */
.flight__shade { position: absolute; inset: 0; background: #1A2646; opacity: 0; }
.flight__words { position: absolute; margin: 0; color: #182442; }
.flight__words em { font-style: normal; color: inherit; }
/* Landed: the whole banner takes the flat slices' place and is wiped away
   from the pole back, a soft edge sweeping along it, uncovering the words
   in white beneath: the headline. */
.flight__white { display: none; color: #FFFFFF; text-shadow: var(--sky-shadow); }
.flight__whole {
  display: none; position: absolute; inset: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 44%, #000 56%); mask-image: linear-gradient(90deg, transparent 44%, #000 56%);
  -webkit-mask-size: 260% 100%; mask-size: 260% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.flight__banner.is-landing .flight__slice { visibility: hidden; }
.flight__banner.is-landing :is(.flight__white, .flight__whole) { display: block; }
.flight__banner.is-landing .flight__whole { animation: flight-wipe .62s cubic-bezier(.45, 0, .3, 1) both; }
.flight__banner.is-landing .flight__pole { animation: flight-wipe-pole .2s ease both; }
@keyframes flight-wipe { from { -webkit-mask-position: 100% 0; mask-position: 100% 0; } to { -webkit-mask-position: 0 0; mask-position: 0 0; } }
@keyframes flight-wipe-pole { to { opacity: 0; } }
.flight__lines { position: absolute; overflow: visible; }
/* The pole along its leading edge. */
.flight__pole { position: absolute; left: -2px; top: -6px; bottom: -6px; width: 3px; border-radius: 2px; background: #3A3935; }
.flight__line { fill: none; stroke: rgba(28, 28, 32, .55); stroke-width: 1.2; }
.flight__ride { position: absolute; left: 0; top: 0; will-change: transform; }
.flight__craft { position: absolute; transform-origin: 50% 55%; will-change: transform; }
.flight__plane { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; filter: contrast(.94) saturate(.9); }
/* A breath of the air between it and us, in the sky's own blue. */
.flight__haze {
  position: absolute; inset: 0; background: #9CC0F2; opacity: .14;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
/* Its propeller, a blur turning at the nose. */
.flight__prop {
  position: absolute; width: 6px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(52, 54, 62, .42), rgba(52, 54, 62, .16) 60%, rgba(52, 54, 62, 0));
  filter: blur(.5px);
  animation: flight-prop 90ms steps(3) infinite;
}
@keyframes flight-prop {
  0% { opacity: .9; transform: scaleY(1); }
  33% { opacity: .55; transform: scaleY(.82); }
  66% { opacity: .75; transform: scaleY(.94); }
  100% { opacity: .9; transform: scaleY(1); }
}
/* By night, the plane and its banner in the dusk. */
html[data-theme="dark"] .flight__plane { filter: brightness(.58) saturate(.7) contrast(.92); }
html[data-theme="dark"] .flight__haze { background: #1C2D57; opacity: .3; }
html[data-theme="dark"] .flight__cloth::before {
  background:
    linear-gradient(180deg, rgba(10, 14, 30, 0) 4px, rgba(10, 14, 30, .14) 4px 5px, rgba(10, 14, 30, 0) 5px calc(100% - 5px), rgba(10, 14, 30, .14) calc(100% - 5px) calc(100% - 4px), rgba(10, 14, 30, 0) calc(100% - 4px)),
    linear-gradient(180deg, rgba(176, 196, 255, .16) 0%, rgba(255, 255, 255, 0) 45%, rgba(20, 36, 87, .22) 100%),
    #CFCBC3;
}
html[data-theme="dark"] .flight__shade { background: #050A1C; }
html[data-theme="dark"] .flight__pole { background: #2A2A2E; }
html[data-theme="dark"] .flight__line { stroke: rgba(10, 10, 14, .7); }
html[data-theme="dark"] .flight__prop { background: radial-gradient(closest-side, rgba(20, 22, 30, .5), rgba(20, 22, 30, .18) 60%, rgba(20, 22, 30, 0)); }
