/* =============================================================================
   ANIMATIONS - things that move when you scroll or hover
   Add one of these classes to an element in the HTML to use it:

     fade-in        fades in when it scrolls into view
     float-in       fades in while sliding up a little
     slide-in       slides in from the left
     spin-in        fades in while turning and growing (home page icons)
     glide-in       slides in from further away
     glide-in-left  slides in from the left (Fleet page icons)
     glide-in-right slides in from the right edge of the screen (yellow arrows)
     turn-in        fades in while turning into place
     breathe        floats gently up and down, all the time (no scrolling needed)

     hover-drop        slides down 10px when the mouse is over it (cards, tiles)
     hover-grow        grows 5% when the mouse is over it (logos on photos)
     hover-grow-small  grows 2% (Experience page industries)
     hover-grow-big    grows 25% (Experience page icons)

   The "scroll into view" part is done by js/animations.js: it adds the class
   "is-visible" when the element appears on screen.
   ============================================================================= */


/* ---------- Appear when scrolled into view --------------------------------- */

/* hidden until js/animations.js marks them "is-visible" (only when JavaScript runs) */
.js .fade-in:not(.is-visible),
.js .float-in:not(.is-visible),
.js .slide-in:not(.is-visible),
.js .spin-in:not(.is-visible),
.js .glide-in:not(.is-visible),
.js .glide-in-left:not(.is-visible),
.js .glide-in-right:not(.is-visible),
.js .turn-in:not(.is-visible) {
  opacity: 0;
}

.fade-in.is-visible  { animation: fade-in 1.2s cubic-bezier(0.445, 0.05, 0.55, 0.95) both; }
.float-in.is-visible { animation: float-in 1.5s cubic-bezier(0.445, 0.05, 0.55, 0.95) both; }
.slide-in.is-visible { animation: slide-in 1.2s cubic-bezier(0.165, 0.84, 0.44, 1) both; }
.glide-in.is-visible { animation: glide-in 1.2s cubic-bezier(0.165, 0.84, 0.44, 1) both; }
.spin-in.is-visible {
  animation:
    fade-in 0.72s cubic-bezier(0.55, 0.055, 0.675, 0.19) both,
    spin-in 1.2s cubic-bezier(0.645, 0.045, 0.355, 1) both;
}

/* glides in from the left edge of its own box / from the right edge of the screen */
.glide-in-left.is-visible  { animation: glide-in-left 1.2s cubic-bezier(0.645, 0.045, 0.355, 1) both; }
.glide-in-right.is-visible { animation: glide-in-right 1.5s cubic-bezier(0.645, 0.045, 0.355, 1) both; }

/* fades in while turning into place */
.turn-in.is-visible {
  transform-origin: left bottom;
  animation:
    fade-in 0.9s cubic-bezier(0.47, 0, 0.745, 0.715) both,
    turn-in 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

/* "breathe": floats gently up and down, forever */
.breathe { animation: breathe 10s linear infinite; }

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes float-in {
  from { opacity: 0; transform: translateY(60px); }
  to   { opacity: 1; transform: none; }
}
@keyframes slide-in {
  from { transform: translateX(-100%); }
  to   { transform: none; }
}
@keyframes glide-in {
  from { opacity: 0; transform: translateX(-120px); }
  to   { opacity: 1; transform: none; }
}
@keyframes spin-in {
  from { transform: rotate(-360deg) scale(0.6); }
  to   { transform: none; }
}
@keyframes glide-in-left {
  from { transform: translateX(-100%); }
  to   { transform: none; }
}
@keyframes glide-in-right {
  from { transform: translateX(100vw); }
  to   { transform: none; }
}
@keyframes turn-in {
  from { transform: rotate(-90deg); }
  to   { transform: none; }
}
@keyframes breathe {
  0%   { transform: translateY(0); animation-timing-function: cubic-bezier(0.39, 0.575, 0.565, 1); }
  25%  { transform: translateY(25px); animation-timing-function: cubic-bezier(0.445, 0.05, 0.55, 0.95); }
  75%  { transform: translateY(-25px); animation-timing-function: cubic-bezier(0.47, 0, 0.745, 0.715); }
  100% { transform: translateY(0); }
}


/* ---------- Hover effects ----------------------------------------------------
   Same timing as the original: 0.3 seconds, starting and ending smoothly. */
.hover-drop,
.hover-grow,
.hover-grow-small,
.hover-grow-big { transition: translate 0.3s ease-in-out, scale 0.3s ease-in-out; }

.hover-drop:hover       { translate: 0 10px; }
.hover-grow:hover       { scale: 1.05; }
.hover-grow-small:hover { scale: 1.02; }
.hover-grow-big:hover   { scale: 1.25; }


/* people who asked their device for less motion get no animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .fade-in, .js .float-in, .js .slide-in, .js .spin-in, .js .glide-in { opacity: 1 !important; }
}
