/* ==========================================================================
   Modular Floating SVG Decorations & Mascot Badges
   GPU-composited animations (transform only) — safe across Home, About, Program
   ========================================================================== */

.has-float-decor {
  position: relative;
}

.programs.has-float-decor,
.about-content.has-float-decor {
  overflow-x: clip;
}

/* Base floating decoration element */
.float-decor {
  position: absolute;
  pointer-events: none;
  user-select: none;
  z-index: 2;
  will-change: transform;
  animation: floatGentle 4.2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.float-decor img {
  display: block;
  width: 100%;
  height: auto;
}

.float-decor--slow {
  animation-name: floatSlow;
  animation-duration: 5.2s;
}

.float-decor--delay-1 {
  animation-delay: -1.4s;
}

.float-decor--delay-2 {
  animation-delay: -2.8s;
}

.float-decor--delay-3 {
  animation-delay: -4.1s;
}

.float-decor--static {
  animation: none;
}

@keyframes floatGentle {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(4px, -20px, 0) rotate(2.8deg);
  }
}

@keyframes floatSlow {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(-4px, -16px, 0) rotate(-2.4deg);
  }
}

/* ---------- Peeking Mascot (Kura-kura Nongol di Pojok Card) ---------- */
.program-card.has-turtle-peek {
  overflow: visible !important;
}

.card-turtle-peek {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 86px;
  height: auto;
  pointer-events: none;
  user-select: none;
  z-index: 4;
  filter: drop-shadow(0 4px 10px rgba(45, 75, 15, 0.12));
  will-change: transform;
  animation: floatPeek 4.2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.program-card.has-turtle-peek .program-link {
  position: relative;
  z-index: 5;
  margin-left: 62px;
}

.card-turtle-peek img {
  display: block;
  width: 100%;
  height: auto;
}

@keyframes floatPeek {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(1px, -5px, 0);
  }
}

/* ---------- Home: #programs ---------- */
.fd-home-cloud-pink {
  top: 38px;
  left: max(2%, calc(50% - 560px));
  width: 132px;
}

.fd-home-tree-top {
  top: 34px;
  right: max(2%, calc(50% - 550px));
  width: 78px;
}

.fd-home-mountain-left {
  top: 255px;
  left: max(1%, calc(50% - 590px));
  width: 130px;
  z-index: 3;
}

.fd-home-mountain-right {
  top: 255px;
  right: max(1%, calc(50% - 590px));
  width: 130px;
  z-index: 3;
}

.fd-home-turtle-programs {
  bottom: 14px;
  left: max(1%, calc(50% - 595px));
  width: 112px;
  z-index: 3;
}

/* ---------- Home: #gallery ---------- */
.fd-gallery-cloud-blue {
  top: 32px;
  left: max(2%, calc(50% - 520px));
  width: 136px;
}

.fd-gallery-turtle {
  top: 18px;
  right: max(2%, calc(50% - 510px));
  width: 112px;
}

/* ---------- Home: #schedule ---------- */
.fd-schedule-tree {
  right: -28px;
  bottom: -14px;
  width: 88px;
  z-index: 3;
}

/* ---------- Program Page: Header & Finder ---------- */
.fd-program-cloud-pink {
  top: 20px;
  right: -130px;
  width: 126px;
}

.fd-finder-cloud-blue {
  top: 26px;
  right: -36px;
  width: 120px;
  z-index: 3;
}

.fd-finder-tree {
  left: -34px;
  bottom: -14px;
  width: 84px;
  z-index: 3;
}

/* ---------- Program Page: 5 Class Card Mascot Badges ---------- */
.matrix-cards-grid.has-card-mascots {
  margin-top: 52px;
  row-gap: 64px;
}

.matrix-class-card.has-card-mascot {
  padding-top: 58px;
}

.card-mascot-badge {
  position: absolute;
  top: -42px;
  left: 50%;
  width: 84px;
  height: 84px;
  margin-left: -42px;
  pointer-events: none;
  user-select: none;
  z-index: 4;
  will-change: transform;
  filter: drop-shadow(0 6px 14px rgba(38, 61, 135, 0.14));
  animation: floatBadge 3.8s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.card-mascot-badge img {
  display: block;
  width: 100%;
  height: 100%;
}

@keyframes floatBadge {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(0, -12px, 0) rotate(2deg);
  }
}

/* ---------- About Page ---------- */
.fd-about-mountain {
  top: -54px;
  left: 16px;
  width: 118px;
  z-index: 3;
}

.fd-about-turtle {
  right: -24px;
  bottom: -34px;
  width: 96px;
  z-index: 3;
}

.fd-start-cloud-blue {
  top: -8px;
  left: 4%;
  width: 122px;
}

.fd-start-tree {
  top: -16px;
  right: 4%;
  width: 76px;
}

/* ---------- Responsive Safety (Tablet & Mobile) ---------- */
@media (max-width: 1024px) {
  .fd-home-cloud-pink,
  .fd-home-tree-top,
  .fd-home-mountain-left,
  .fd-home-mountain-right,
  .fd-home-turtle-programs,
  .fd-program-cloud-pink,
  .fd-finder-cloud-blue,
  .fd-finder-tree {
    opacity: 0.9;
    transform: scale(0.85);
  }
}

@media (max-width: 768px) {
  .float-decor--hide-mobile {
    display: none;
  }

  .fd-gallery-cloud-blue {
    width: 92px;
    top: 18px;
    left: 10px;
  }

  .fd-gallery-turtle {
    width: 80px;
    top: 14px;
    right: 10px;
  }

  .fd-about-mountain {
    width: 84px;
    top: -38px;
    left: 10px;
  }

  .fd-about-turtle {
    width: 74px;
    right: -8px;
    bottom: -24px;
  }

  .card-turtle-peek {
    width: 76px;
    bottom: 0;
    left: 0;
  }

  .program-card.has-turtle-peek .program-link {
    margin-left: 54px;
  }

  .card-mascot-badge {
    width: 74px;
    height: 74px;
    top: -37px;
    margin-left: -37px;
  }

  .matrix-class-card.has-card-mascot {
    padding-top: 50px;
  }
}

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  .float-decor,
  .card-turtle-peek,
  .card-mascot-badge {
    animation: none !important;
  }
}
