/* ============================================================
   SKY QUEST — animations.css
   Purely additive motion layer. Does NOT alter layout, colors,
   spacing or structure. All motion uses transform/opacity only,
   so nothing reflows. Safe to remove this file at any time.
   ============================================================ */

:root {
  --sq-ease: cubic-bezier(0.16, 1, 0.3, 1);   /* smooth "out-expo" feel */
  --sq-ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
  --sq-dur: 0.7s;
  --sq-dur-fast: 0.3s;
}

/* ---------- 6. Smooth scrolling ---------- */
html {
  scroll-behavior: smooth;
}

/* ============================================================
   1 & 4. SCROLL REVEAL
   Hidden state is applied ONLY to elements JS tags with
   `.sq-reveal`. If JS never runs, content stays visible.
   ============================================================ */
.sq-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity var(--sq-dur) var(--sq-ease),
    transform var(--sq-dur) var(--sq-ease);
  transition-delay: calc(var(--sq-i, 0) * 90ms);
  will-change: opacity, transform;
}
.sq-reveal.sq-left   { transform: translateX(-40px); }
.sq-reveal.sq-right  { transform: translateX(40px); }
.sq-reveal.sq-scale  { transform: scale(0.92); }
.sq-reveal.sq-fade   { transform: none; }

/* Visible state — JS adds .sq-in when element scrolls into view */
.sq-reveal.sq-in {
  opacity: 1;
  transform: none;
}

/* ============================================================
   2. HERO ENTRANCE + ANIMATED TEXT
   ============================================================ */
@keyframes sq-rise {
  from { opacity: 0; transform: translateY(34px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes sq-gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes sq-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

/* Hero text rises in with a gentle stagger on page load */
.text-container > * {
  animation: sq-rise 0.9s var(--sq-ease) both;
}
.text-container > *:nth-child(1) { animation-delay: 0.15s; }
.text-container > *:nth-child(2) { animation-delay: 0.32s; }
.text-container > *:nth-child(3) { animation-delay: 0.49s; }
.text-container > *:nth-child(4) { animation-delay: 0.66s; }

/* Animated gradient headline (first line of the hero only,
   so existing body copy keeps its original color) */
.text-container > p:first-child {
  background: linear-gradient(
    100deg,
    #ffffff 0%,
    #8fd3ff 25%,
    #4aa8ff 50%,
    #8fd3ff 75%,
    #ffffff 100%
  );
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: sq-rise 0.9s var(--sq-ease) both,
             sq-gradient-shift 7s ease-in-out 0.9s infinite;
}

/* The hero video breathes very subtly for a "live" feel */
.top-content-video {
  transition: transform 1.2s var(--sq-ease), filter 1.2s var(--sq-ease);
}
.top-content:hover .top-content-video {
  transform: scale(1.03);
  filter: saturate(1.08);
}

/* ============================================================
   7. SOFT FLOATING BACKGROUND GLOW (injected by JS)
   Sits behind everything, never intercepts clicks.
   ============================================================ */
.sq-bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.sq-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.35;
  animation: sq-float 12s ease-in-out infinite;
}
.sq-glow-1 {
  width: 460px; height: 460px;
  top: -120px; left: -100px;
  background: radial-gradient(circle, #4aa8ff 0%, transparent 70%);
}
.sq-glow-2 {
  width: 520px; height: 520px;
  bottom: -160px; right: -120px;
  background: radial-gradient(circle, #00d8c0 0%, transparent 70%);
  animation-duration: 16s;
  animation-delay: -4s;
}
.sq-glow-3 {
  width: 380px; height: 380px;
  top: 40%; left: 55%;
  background: radial-gradient(circle, #7b8cff 0%, transparent 70%);
  opacity: 0.22;
  animation-duration: 20s;
  animation-delay: -8s;
}

/* ============================================================
   6. NAVBAR — subtle background blur + shadow when scrolling
   (.scrolled is toggled by animations.js). Transition only,
   no layout change.
   ============================================================ */
.header-container {
  transition: background-color var(--sq-dur-fast) var(--sq-ease),
              box-shadow var(--sq-dur-fast) var(--sq-ease),
              backdrop-filter var(--sq-dur-fast) var(--sq-ease);
}
.header-container.scrolled {
  background-color: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 24px -10px rgba(20, 40, 80, 0.25);
}

/* ============================================================
   3 & 5. HOVER + TRANSITION EFFECTS
   ============================================================ */

/* --- Navbar links: animated underline + hover lift --- */
.menu-main-item a,
.menu-sub-item a,
.ss-menu-item a {
  position: relative;
  transition: color var(--sq-dur-fast) var(--sq-ease),
              transform var(--sq-dur-fast) var(--sq-ease);
}
.menu-main-item a::after,
.ss-menu-item > a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #4aa8ff, #00d8c0);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--sq-dur-fast) var(--sq-ease);
}
.menu-item:hover .menu-main-item a::after,
.ss-menu-item:hover > a::after {
  transform: scaleX(1);
}
.menu-main-item:hover a,
.ss-menu-item:hover > a {
  color: #4aa8ff;
}

/* Nav icons gently scale on hover */
.menu-main-item svg {
  transition: transform var(--sq-dur-fast) var(--sq-ease),
              fill var(--sq-dur-fast) var(--sq-ease);
}
.menu-item:hover .menu-main-item svg {
  transform: translateY(-2px) scale(1.12);
}

/* --- Hamburger / button: scale + glow --- */
.ss-dropbtn {
  transition: transform var(--sq-dur-fast) var(--sq-ease),
              box-shadow var(--sq-dur-fast) var(--sq-ease),
              color var(--sq-dur-fast) var(--sq-ease);
}
.ss-dropbtn:hover {
  transform: scale(1.12);
  color: #4aa8ff;
  text-shadow: 0 0 12px rgba(74, 168, 255, 0.7);
}

/* --- Logo subtle interaction --- */
.logo img {
  transition: transform var(--sq-dur) var(--sq-ease),
              filter var(--sq-dur) var(--sq-ease);
}
.logo:hover img {
  transform: scale(1.04);
  filter: drop-shadow(0 4px 14px rgba(74, 168, 255, 0.35));
}

/* --- Links (footer + generic content links) animated underline --- */
.footer-links-container a {
  position: relative;
  display: inline-block;
  transition: color var(--sq-dur-fast) var(--sq-ease),
              transform var(--sq-dur-fast) var(--sq-ease);
}
.footer-links-container a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--sq-dur-fast) var(--sq-ease);
}
.footer-links-container a:hover::after {
  transform: scaleX(1);
}

/* Footer buttons jump on hover */
@keyframes sq-btn-jump {
  0%, 100% { transform: translateY(0); }
  40%      { transform: translateY(-9px); }
}
.footer-links-container a:hover {
  animation: sq-btn-jump 0.55s ease-in-out infinite;
}

/* Keep footer text/links always clearly visible (defeat any dimming) */
.footer-links-container a span,
.copyright {
  opacity: 1 !important;
}

/* Footer logo: drop-shadow so the white mark stays visible on any background */
.footer-logo img {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55));
  transition: transform var(--sq-dur) var(--sq-ease), filter var(--sq-dur) var(--sq-ease);
}
.footer-logo:hover img {
  transform: scale(1.06);
  filter: drop-shadow(0 4px 12px rgba(46, 163, 242, 0.6));
}

@media (prefers-reduced-motion: reduce) {
  .footer-links-container a:hover { animation: none !important; }
}

/* --- Images: smooth zoom + brightness on hover --- */
.bottom-content-three-image img,
.bottom-content-two img,
.bottom-content-four img,
.svs-bottom-content-three-image img,
.svs-bottom-content-five-image img,
.svs-bottom-content-seven-image img,
.svs-bottom-content-nine-image img,
.contain {
  transition: transform var(--sq-dur) var(--sq-ease),
              filter var(--sq-dur) var(--sq-ease);
  will-change: transform;
}
.bottom-content-three-image:hover img,
.bottom-content-two:hover img,
.bottom-content-four:hover img,
.svs-bottom-content-three-image:hover img,
.svs-bottom-content-five-image:hover img,
.svs-bottom-content-seven-image:hover img,
.svs-bottom-content-nine-image:hover img,
.contain:hover {
  transform: scale(1.05);
  filter: brightness(1.06) saturate(1.05);
}

/* --- Cards: lift + shadow on hover --- */
.bottom-content-three,
.bottom-content-two,
.bottom-content-four,
.message,
.event-column,
.month-column,
.year-column,
.svs-bottom-content-three,
.svs-bottom-content-five,
.svs-bottom-content-seven,
.svs-bottom-content-nine,
.nc-container-1,
.nc-container-2,
.recruit-container-1 {
  transition: transform var(--sq-dur) var(--sq-ease),
              box-shadow var(--sq-dur) var(--sq-ease);
}
.bottom-content-three:hover,
.bottom-content-two:hover,
.bottom-content-four:hover,
.message:hover,
.event-column:hover,
.svs-bottom-content-three:hover,
.svs-bottom-content-five:hover,
.svs-bottom-content-seven:hover,
.svs-bottom-content-nine:hover,
.nc-container-1:hover,
.nc-container-2:hover,
.recruit-container-1:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px -16px rgba(20, 40, 80, 0.28);
}

/* ============================================================
   4. OPTIONAL MARQUEE UTILITY
   Add class="sq-marquee" to any wide strip to scroll it.
   Not auto-applied, so it can't disturb existing layout.
   ============================================================ */
.sq-marquee {
  overflow: hidden;
  white-space: nowrap;
}
.sq-marquee > * {
  display: inline-block;
  padding-left: 100%;
  animation: sq-marquee-move 22s linear infinite;
}
@keyframes sq-marquee-move {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* ============================================================
   8. MOBILE — lighten heavy effects on small screens
   ============================================================ */
@media (max-width: 768px) {
  .sq-glow { filter: blur(50px); opacity: 0.25; }
  .sq-glow-3 { display: none; }            /* fewer blurred layers = smoother */
  .sq-reveal { transform: translateY(20px); }
  .sq-reveal.sq-left,
  .sq-reveal.sq-right { transform: translateY(20px); } /* avoid horizontal shift on phones */
}

/* ============================================================
   9. ACCESSIBILITY — honor reduced-motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
  .sq-reveal { opacity: 1 !important; transform: none !important; }
  .sq-glow { animation: none !important; }
  .text-container > * { animation: none !important; opacity: 1 !important; }
  .text-container > p:first-child {
    /* keep gradient look but stop the motion */
    animation: none !important;
  }
}
