/*
 * Mystical / magical visual layer for the homepage.
 * Loaded after modern-theme.css. Provides keyframes, particle canvas styling,
 * scroll-reveal utilities, glow effects, and illustrated-asset placement.
 */

:root {
  --myst-teal: #5eebc8;
  --myst-purple: #b582de;
  --myst-gold: #f5c56b;
}

/* ============================
   Keyframes
   ============================ */
@keyframes mystic-float-drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25%      { transform: translate(-10px, -16px) rotate(-2deg); }
  50%      { transform: translate(6px, -26px) rotate(1.5deg); }
  75%      { transform: translate(10px, -10px) rotate(2deg); }
}

@keyframes mystic-pulse-glow {
  0%, 100% { opacity: 0.75; filter: drop-shadow(0 0 10px rgba(94, 235, 200, 0.35)); }
  50%      { opacity: 1; filter: drop-shadow(0 0 26px rgba(181, 130, 222, 0.55)); }
}

@keyframes mystic-aurora-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes mystic-twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50%      { opacity: 1; transform: scale(1.15); }
}

@keyframes mystic-scroll-dot {
  0%   { top: 8px; opacity: 1; }
  70%  { opacity: 0.4; }
  100% { top: 26px; opacity: 0; }
}

@keyframes mystic-text-glow {
  0%, 100% { text-shadow: 0 0 10px rgba(94, 235, 200, 0.55), 0 0 26px rgba(181, 130, 222, 0.3); }
  50%      { text-shadow: 0 0 18px rgba(94, 235, 200, 0.8), 0 0 40px rgba(181, 130, 222, 0.5); }
}

/* ============================
   Scroll reveal
   ============================ */
.mystic-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease, transform 0.9s ease;
  transition-delay: var(--reveal-delay, 0s);
}

.mystic-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================
   Particle canvas (fixed, behind all content)
   ============================ */
#mystic-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

/* ============================
   Nav logo glow
   ============================ */
.mystic-logo-glow {
  position: relative;
  display: inline-block;
}

.mystic-logo-glow::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(94, 235, 200, 0.55), rgba(181, 130, 222, 0.25) 55%, transparent 75%);
  filter: blur(6px);
  animation: mystic-pulse-glow 3.2s ease-in-out infinite;
  z-index: -1;
}

/* ============================
   Hero / carousel overlays
   ============================ */
.mystic-hero-wrap {
  position: relative;
  overflow: hidden;
}

.mystic-aurora-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(94, 235, 200, 0.28),
    rgba(181, 130, 222, 0.28),
    rgba(245, 197, 107, 0.22),
    rgba(94, 235, 200, 0.28)
  );
  background-size: 320% 320%;
  animation: mystic-aurora-shift 20s ease infinite;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 2;
}

.mystic-fairy-hero {
  position: absolute;
  top: 8%;
  right: 4%;
  width: 240px;
  max-width: 26vw;
  height: auto;
  opacity: 0.9;
  mix-blend-mode: screen;
  /* Feather the edges so the image's dark backdrop never reads as a box */
  -webkit-mask-image: radial-gradient(ellipse at center, #000 55%, transparent 78%);
  mask-image: radial-gradient(ellipse at center, #000 55%, transparent 78%);
  filter: drop-shadow(0 0 22px rgba(181, 130, 222, 0.45));
  animation: mystic-float-drift 10s ease-in-out infinite;
  pointer-events: none;
  z-index: 3;
}

.mystic-scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 44px;
  border: 2px solid rgba(94, 235, 200, 0.6);
  border-radius: 16px;
  z-index: 4;
  pointer-events: none;
}

.mystic-scroll-cue::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--myst-teal);
  box-shadow: 0 0 8px rgba(94, 235, 200, 0.85);
  animation: mystic-scroll-dot 1.8s ease-in-out infinite;
}

/* ============================
   Quote section
   ============================ */
.mystic-glow-text {
  animation: mystic-text-glow 4.5s ease-in-out infinite;
}

/* Compact the quote so it reads as one tight, elegant statement */
.cid-soFmD6mD4N {
  padding-top: 3.5rem !important;
  padding-bottom: 3.5rem !important;
}

.cid-soFmD6mD4N .display-1 {
  font-size: 2.5rem !important;
  line-height: 1.2 !important;
  margin: 0 auto !important;
  max-width: 20ch;
  color: #e0d9f6 !important;
}

.mystic-quote-attr {
  margin: 1.75rem 0 0 !important;
  font-family: var(--ml-serif, 'Cormorant Garamond', Georgia, serif) !important;
  font-style: italic;
  font-weight: 500;
  font-size: 1.6rem !important;
  letter-spacing: 0.03em;
  text-transform: none;
  color: #ff8fc4 !important;
}

/* Elegant hairline flourish above the signature */
.mystic-quote-attr::before {
  content: "";
  display: block;
  width: 52px;
  height: 1px;
  margin: 0 auto 1rem;
  background: linear-gradient(90deg, transparent, #ff8fc4, transparent);
  opacity: 0.85;
}

/* Static divider PNG (footer): feather the edges so the image's dark
   backdrop never reads as a hard rectangle under screen blend. */
.mystic-divider {
  display: block;
  margin: 1.5rem auto;
  width: 60%;
  max-width: 480px;
  height: auto;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(ellipse 72% 82% at center, #000 52%, transparent 82%);
  mask-image: radial-gradient(ellipse 72% 82% at center, #000 52%, transparent 82%);
  filter: drop-shadow(0 0 16px rgba(94, 235, 200, 0.4));
  animation: mystic-pulse-glow 5s ease-in-out infinite;
}

/* ============================
   Animated blooming lotus (SVG)
   Petals collapse to the center (closed bud) and scale outward on reveal,
   staggered outer -> inner so the flower opens up to a bright core.
   ============================ */
.mystic-lotus {
  display: block;
  width: 190px;
  max-width: 55vw;
  height: auto;
  margin: 0 auto 1.5rem;
  overflow: visible;
  filter: drop-shadow(0 0 18px rgba(94, 235, 200, 0.35));
}

.mystic-lotus .petal {
  transform: scale(0.05);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.mystic-lotus .lotus-core {
  transform: scale(0);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

.mystic-reveal.is-visible .mystic-lotus .petal {
  animation: lotus-bloom 0.9s cubic-bezier(0.18, 0.7, 0.2, 1.15) forwards;
  animation-delay: calc(var(--i) * 0.045s);
}

.mystic-reveal.is-visible .mystic-lotus .lotus-core {
  animation: lotus-core-in 0.8s ease forwards;
  animation-delay: 1.1s;
}

.mystic-reveal.is-visible .mystic-lotus {
  animation: lotus-sway 8s ease-in-out 1.5s infinite;
}

@keyframes lotus-bloom {
  0%   { transform: scale(0.05); opacity: 0; }
  70%  { opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes lotus-core-in {
  0%   { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 0.9; }
}

@keyframes lotus-sway {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50%      { transform: rotate(2deg) scale(1.02); }
}

/* ============================
   Video gallery accents
   ============================ */
.yt-gallery-section {
  position: relative;
  overflow: hidden;
}

.yt-gallery-card:hover {
  box-shadow: 0 0 32px rgba(94, 235, 200, 0.35), 0 0 64px rgba(181, 130, 222, 0.2) !important;
}

.mystic-fairy-accent {
  position: absolute;
  bottom: 4%;
  left: 2%;
  width: 130px;
  max-width: 16vw;
  height: auto;
  opacity: 0.85;
  mix-blend-mode: screen;
  /* Feather the edges so the image's dark backdrop never reads as a box */
  -webkit-mask-image: radial-gradient(ellipse at center, #000 52%, transparent 76%);
  mask-image: radial-gradient(ellipse at center, #000 52%, transparent 76%);
  filter: drop-shadow(0 0 16px rgba(245, 197, 107, 0.4));
  animation: mystic-float-drift 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

/* ============================
   Music / footer section
   ============================ */
.cid-soFqwc8lgT {
  position: relative;
  overflow: hidden;
}

.cid-soFqwc8lgT iframe[src*="spotify"] {
  border-radius: 16px;
  box-shadow: 0 0 30px rgba(94, 235, 200, 0.35), 0 0 60px rgba(181, 130, 222, 0.22);
  border: 1px solid rgba(94, 235, 200, 0.25);
}

.mystic-sparkle-strip {
  position: relative;
  height: 2.5rem;
  margin: 1rem 0;
  background-image:
    radial-gradient(2px 2px at 10% 40%, rgba(94, 235, 200, 0.9), transparent 60%),
    radial-gradient(2px 2px at 25% 65%, rgba(245, 197, 107, 0.9), transparent 60%),
    radial-gradient(2px 2px at 40% 30%, rgba(181, 130, 222, 0.9), transparent 60%),
    radial-gradient(2px 2px at 58% 55%, rgba(94, 235, 200, 0.8), transparent 60%),
    radial-gradient(2px 2px at 72% 35%, rgba(245, 197, 107, 0.8), transparent 60%),
    radial-gradient(2px 2px at 88% 60%, rgba(181, 130, 222, 0.8), transparent 60%);
  animation: mystic-twinkle 3.5s ease-in-out infinite;
  pointer-events: none;
}

.mystic-watermark {
  position: absolute;
  bottom: -6%;
  right: -4%;
  width: 220px;
  max-width: 28vw;
  height: auto;
  opacity: 0.16;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
}

/* ============================
   Accessibility: reduced motion
   ============================ */
@media (prefers-reduced-motion: reduce) {
  .mystic-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .mystic-fairy-hero,
  .mystic-fairy-accent,
  .mystic-divider,
  .mystic-glow-text,
  .mystic-aurora-bg,
  .mystic-scroll-cue::before,
  .mystic-logo-glow::before,
  .mystic-sparkle-strip,
  .mystic-lotus {
    animation: none !important;
  }

  .mystic-lotus .petal,
  .mystic-lotus .lotus-core {
    transform: scale(1) !important;
    opacity: 1 !important;
    animation: none !important;
  }

  #mystic-particles {
    display: none !important;
  }
}

/* ============================
   Small screens: tone down floating art so text stays readable
   ============================ */
@media (max-width: 767px) {
  .mystic-fairy-hero {
    width: 130px;
    max-width: 34vw;
    top: 4%;
    right: 2%;
  }

  .mystic-fairy-accent {
    width: 90px;
    max-width: 22vw;
  }

  .mystic-divider {
    width: 85%;
  }

  .mystic-watermark {
    width: 140px;
  }
}
