/* Texture and scroll animation layer for the landing page.
   Loaded after the compiled styles; its markers (data-fx*) are added by site-fx.js.
   Only a few selected sections get graphic textures; the rest of the page stays clean. */

/* ---------- Dark textured bands ---------- */
[data-fx-band="dark"] {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color-scheme: dark;
}
[data-fx-band="dark"] .astryx-section {
  background: transparent !important;
}
[data-fx-band="dark"]::before {
  content: "";
  position: absolute;
  inset: -14% 0;
  z-index: -1;
  background:
    linear-gradient(100deg, rgba(5, 4, 13, 0.4) 0%, rgba(5, 4, 13, 0.12) 55%, rgba(5, 4, 13, 0) 100%),
    var(--fx-tex, url(/fx/band-dark-1.webp)) center / cover no-repeat;
  transform: translate3d(0, var(--fx-py, 0px), 0);
}
[data-fx-tex="1"] { --fx-tex: url(/fx/band-dark-1.webp); }
[data-fx-tex="2"] { --fx-tex: url(/fx/band-dark-2.webp); }
[data-fx-tex="3"] { --fx-tex: url(/fx/band-dark-3.webp); }
[data-fx-tex="4"] { --fx-tex: url(/fx/band-dark-4.webp); }

/* The gradient-coloured first words of the page headings use the normal heading colour (white in dark mode). */
main h1 > span {
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  -webkit-text-fill-color: currentColor !important;
  color: inherit !important;
}

/* ---------- Header ---------- */
header {
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}
header[data-fx-scrolled] {
  box-shadow: 0 1px 0 var(--color-border), 0 10px 30px rgba(30, 16, 90, 0.08);
}

/* ---------- Hover ---------- */
main [data-variant="default"][data-elevation][data-astryx-pressable] {
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease;
}
main [data-variant="default"][data-elevation][data-astryx-pressable]:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(60, 36, 160, 0.18);
}

/* ---------- Scroll reveal ---------- */
html[data-fx] [data-fx="reveal"] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) var(--fx-delay, 0ms),
    transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) var(--fx-delay, 0ms);
  will-change: opacity, transform;
}
html[data-fx] [data-fx="reveal"][data-fx-img] {
  transform: translate3d(0, 36px, 0) scale(0.96);
}
html[data-fx] [data-fx="reveal"][data-fx-in] {
  opacity: 1;
  transform: none;
}

/* Hide the hero content until the script has prepared it, so it does not flash. If the script
   never runs, the failsafe animation shows it after a moment. */
html[data-fx]:not([data-fx-ready]) main > div:first-child > div:not([aria-hidden]) {
  opacity: 0;
  animation: fx-failsafe 0s 1.5s forwards;
}
@keyframes fx-failsafe {
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  main > div:first-child::before { animation: none; }
  html[data-fx] [data-fx="reveal"] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
