/**
 * Fly-through widget.
 *
 * A full-height field of images rushing toward the viewer (drawn on the canvas
 * by assets/js/widgets/flythrough.js) behind a centred heading and pill button.
 * The canvas is transparent and far images fade out, so by default the page's
 * own background (gradients, patterns, light / dark) is the fog colour.
 */

.skyweb-fly {
  --sf-bg: transparent;
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
  background: var(--sf-bg);
}

.skyweb-fly__canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.skyweb-fly__content {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 48px;
  padding: 0 20px;
  text-align: center;
  pointer-events: none;
}

.skyweb-fly__title {
  max-width: 1180px;
  margin: 0;
  color: var(--skyweb-dark-color, #111);
  font-size: clamp(44px, 6vw, 96px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.04em;
  text-align: center;
}

.skyweb-fly__line {
  display: block;
}

/*
 * Entrance: each line drops from -100% with a fade, 0.8s circ.out, 0.1s apart.
 * Hidden only once the script has armed the section and before the field is
 * ready; the 3.5s failsafe shows the title anyway if something stalls.
 */
.skyweb-fly.is-armed:not(.is-ready) .skyweb-fly__title {
  opacity: 0;
  animation: skyweb-fly-failsafe 0s 3.5s forwards;
}

@keyframes skyweb-fly-failsafe {
  to { opacity: 1; }
}

.skyweb-fly.is-ready .skyweb-fly__line {
  animation: skyweb-fly-line .8s cubic-bezier(0, .55, .45, 1) backwards;
}

@keyframes skyweb-fly-line {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
}

/* Same frosted "liquid glass" pill as the Image Galaxy button: dark frost with
   white text in light mode, the site's dark-glass values under html.dark. */
.skyweb-fly__button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 52px;
  padding: 15px 24px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.55);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
          backdrop-filter: blur(16px) saturate(1.6);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .20), inset 0 1px 0 rgba(255, 255, 255, .25);
  text-decoration: none;
  font-size: 15px;
  line-height: 1;
  pointer-events: auto;
  transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
}

.skyweb-fly__button:hover,
.skyweb-fly__button:focus {
  color: #fff;
  text-decoration: none;
}

.skyweb-fly__button:hover {
  transform: translateY(-2px);
  background: rgba(17, 24, 39, 0.66);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .26), inset 0 1px 0 rgba(255, 255, 255, .30);
}

.skyweb-fly.is-ready .skyweb-fly__button {
  animation: skyweb-fly-button .8s .3s cubic-bezier(0, .55, .45, 1) backwards;
}

@keyframes skyweb-fly-button {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

html.dark .skyweb-fly__button {
  background: rgba(255, 255, 255, 0.10) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .40), inset 0 1px 0 rgba(255, 255, 255, .18);
}

html.dark .skyweb-fly__button:hover {
  background: rgba(255, 255, 255, 0.16) !important;
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .skyweb-fly__button { background: #111827; }
  html.dark .skyweb-fly__button { background: rgba(40, 42, 52, 0.92) !important; }
}

/* Editor placeholder (no images yet). */
.skyweb-fly--empty {
  display: grid;
  place-items: center;
  height: 320px;
  min-height: 0;
  color: #777;
  font-size: 16px;
  background: #f5f5f3;
}

@media (max-width: 699px) {
  .skyweb-fly__content {
    gap: 32px;
  }

  .skyweb-fly__title {
    font-size: clamp(40px, 11vw, 56px);
    line-height: 1.02;
    letter-spacing: -.035em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skyweb-fly.is-ready .skyweb-fly__line,
  .skyweb-fly.is-ready .skyweb-fly__button {
    animation: none;
  }
}
