/* ═══════════════════════════════════════════════
   SEHAGO – Animations & Interactive Effects
   ═══════════════════════════════════════════════ */

/* ── Hero Scene Container ────────────────────── */
.hero {
  grid-template-columns: 1fr 460px !important;
}
.hero-scene {
  width: 460px;
  height: 460px;
  position: relative;
  flex-shrink: 0;
  animation: fadeSlideUp .8s .4s ease both;
}

/* ── Central Orb ─────────────────────────────── */
.orb-wrap {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 160px; height: 160px;
}
.orb-core {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 35% 35%, #fff 0%, var(--primary-container) 50%, var(--primary-c) 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
  box-shadow:
    0 0 0 8px rgba(27,107,55,0.12),
    0 8px 40px rgba(27,107,55,0.25),
    0 20px 60px rgba(27,107,55,0.15);
  animation: orbPulse 3s ease-in-out infinite;
  z-index: 10;
}
.orb-emoji {
  animation: orbSpin 8s linear infinite;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2));
}
@keyframes orbPulse {
  0%,100% { transform: scale(1); box-shadow: 0 0 0 8px rgba(27,107,55,0.12), 0 8px 40px rgba(27,107,55,0.25); }
  50%      { transform: scale(1.06); box-shadow: 0 0 0 16px rgba(27,107,55,0.08), 0 12px 56px rgba(27,107,55,0.3); }
}
@keyframes orbSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Orb Rings ───────────────────────────────── */
.orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--primary);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: ringExpand 3s ease-out infinite;
}
.ring-1 { width: 160px; height: 160px; animation-delay: 0s; }
.ring-2 { width: 160px; height: 160px; animation-delay: 1s; }
.ring-3 { width: 160px; height: 160px; animation-delay: 2s; }
@keyframes ringExpand {
  0%   { width: 160px; height: 160px; opacity: .6; }
  100% { width: 320px; height: 320px; opacity: 0; }
}

/* ── Orbiting Icons ──────────────────────────── */
.orbit {
  position: absolute;
  top: 50%; left: 50%;
  border-radius: 50%;
  border: 1.5px dashed rgba(27,107,55,0.15);
  transform: translate(-50%, -50%);
}
.orbit-1 { width: 260px; height: 260px; animation: orbitSpin 8s linear infinite; }
.orbit-2 { width: 340px; height: 340px; animation: orbitSpin 12s linear infinite reverse; }
.orbit-3 { width: 420px; height: 420px; animation: orbitSpin 16s linear infinite; }
@keyframes orbitSpin {
  from { transform: translate(-50%,-50%) rotate(0deg); }
  to   { transform: translate(-50%,-50%) rotate(360deg); }
}
.orbit-item {
  position: absolute;
  top: -30px; left: 50%;
  transform: translateX(-50%);
  animation: counterSpin var(--dur, 8s) linear infinite;
}
.orbit-1 .orbit-item { --dur: 8s; }
.orbit-2 .orbit-item { --dur: 12s; animation-direction: reverse; }
.orbit-3 .orbit-item { --dur: 16s; }
@keyframes counterSpin {
  from { transform: translateX(-50%) rotate(0deg); }
  to   { transform: translateX(-50%) rotate(-360deg); }
}

/* ── Health Bubbles ──────────────────────────── */
.health-bubble {
  width: var(--sz, 52px);
  height: var(--sz, 52px);
  background: var(--c, #C7EDD5);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--sz, 52px) * 0.5);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transition: transform .2s;
  cursor: default;
}
.health-bubble:hover { transform: scale(1.2); }

/* ── Floating Items (independent) ────────────── */
.float-item {
  position: absolute;
  animation: floatRandom ease-in-out infinite;
}
.fi-1 { top: 5%;  left: 5%;  animation-duration: 5s; animation-delay: 0s; }
.fi-2 { top: 8%;  right: 8%; animation-duration: 6s; animation-delay: -1s; }
.fi-3 { bottom: 10%; left: 8%;  animation-duration: 7s; animation-delay: -2s; }
.fi-4 { bottom: 8%;  right: 5%; animation-duration: 5.5s; animation-delay: -3s; }
.fi-5 { top: 42%; left: 0%;  animation-duration: 6.5s; animation-delay: -1.5s; }
.fi-6 { top: 38%; right: 0%; animation-duration: 7.5s; animation-delay: -2.5s; }
@keyframes floatRandom {
  0%,100% { transform: translateY(0) rotate(0deg); }
  33%      { transform: translateY(-14px) rotate(8deg); }
  66%      { transform: translateY(8px) rotate(-5deg); }
}

/* ── Stat Float Cards ────────────────────────── */
.stat-float {
  position: absolute;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(27,107,55,0.12);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  white-space: nowrap;
  animation: floatUpDown ease-in-out infinite;
  z-index: 20;
}
.sf-1 { top: 8%;   left: -10%; animation-duration: 4s; animation-delay: 0s; }
.sf-2 { bottom: 16%; left: -8%; animation-duration: 5s; animation-delay: -1.5s; }
.sf-3 { top: 20%; right: -5%; animation-duration: 4.5s; animation-delay: -0.8s; }


/* ── Scroll Reveal ───────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity .65s cubic-bezier(.22,1,.36,1), transform .65s cubic-bezier(.22,1,.36,1);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }

/* ── Hero Float ──────────────────────────────── */
.hero__illus {
  animation: floatUpDown 4s ease-in-out infinite;
}
@keyframes floatUpDown {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-18px); }
}

/* Hero content entrance */
.hero__badge  { animation: fadeSlideUp .6s ease both; }
.hero__title  { animation: fadeSlideUp .7s .1s ease both; }
.hero__sub    { animation: fadeSlideUp .7s .2s ease both; }
.hero__actions{ animation: fadeSlideUp .7s .3s ease both; }

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

/* ── Kode Input Glow ─────────────────────────── */
#kode-input:focus {
  box-shadow: 0 0 0 4px rgba(255,255,255,0.5), 0 4px 20px rgba(0,0,0,0.15) !important;
  transform: scale(1.02);
  transition: transform .2s, box-shadow .2s;
}
#btn-verifikasi {
  transition: transform .18s, box-shadow .18s !important;
  position: relative;
  overflow: hidden;
}
#btn-verifikasi::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.4) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: shimmer 2.5s infinite;
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  60%, 100% { transform: translateX(200%); }
}
#btn-verifikasi:hover {
  transform: translateY(-2px) scale(1.04) !important;
  box-shadow: 0 8px 28px rgba(0,0,0,0.22) !important;
}

/* Kode section pulse ring */
#kode-main {
  position: relative;
  overflow: hidden;
}
#kode-main::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  top: -200px; left: -150px;
  animation: pulseBg 6s ease-in-out infinite;
}
#kode-main::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  bottom: -180px; right: -100px;
  animation: pulseBg 6s 2s ease-in-out infinite;
}
@keyframes pulseBg {
  0%,100% { transform: scale(1); opacity: .5; }
  50%      { transform: scale(1.2); opacity: 1; }
}

/* ── Card Flip (Materi Belajar) ──────────────── */
.flip-container {
  perspective: 1200px;
  cursor: pointer;
  border-radius: var(--radius);
}
.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .65s cubic-bezier(.4,0,.2,1);
  border-radius: var(--radius);
}
.flip-container.flipped .flip-inner {
  transform: rotateY(180deg);
}
.flip-front, .flip-back {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius);
  overflow: hidden;
}
.flip-front {
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  box-shadow: var(--shadow-2);
  border: 2px dashed var(--outline-variant);
  padding: 40px 24px;
  text-align: center;
}
.flip-front .lock-icon {
  font-size: 3rem;
  animation: wiggle 3s ease-in-out infinite;
}
.flip-front .flip-hint {
  font-size: 0.875rem;
  color: var(--outline);
  font-weight: 500;
}
.flip-front .flip-num {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem;
  color: #fff;
}

@keyframes wiggle {
  0%,100% { transform: rotate(0deg); }
  20%      { transform: rotate(-12deg); }
  40%      { transform: rotate(12deg); }
  60%      { transform: rotate(-6deg); }
  80%      { transform: rotate(6deg); }
}

.flip-back {
  transform: rotateY(180deg);
  background: var(--white);
  box-shadow: var(--shadow-2);
  display: flex;
  flex-direction: column;
}

/* Locked state overlay for card 2 & 3 */
.flip-container.locked {
  cursor: not-allowed;
  filter: grayscale(0.3);
}
.flip-container.locked .flip-front {
  border-color: var(--outline-variant);
  opacity: 0.75;
}
.flip-container.locked .lock-icon {
  animation: none;
}

/* ── Tips Cards hover ────────────────────────── */
#tips .card {
  transition: transform .25s, box-shadow .25s;
}
#tips .card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-3);
}

/* ── Navbar scroll shadow ────────────────────── */
.navbar-wrap.scrolled {
  box-shadow: 0 4px 24px rgba(0,0,0,0.09);
}

/* ── Particle dots (hero bg) ─────────────────── */
.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--primary-container);
  animation: particleFloat linear infinite;
  pointer-events: none;
  z-index: 0;
}
.hero { position: relative; overflow: hidden; }
.hero__content, .hero__illus { position: relative; z-index: 1; }

@keyframes particleFloat {
  0%   { transform: translateY(0) scale(1); opacity: .7; }
  100% { transform: translateY(-120vh) scale(.4); opacity: 0; }
}

/* ══════════════════════════════════════════
   MULTI-SLIDE LEARNING CARDS
══════════════════════════════════════════ */
.mcard {
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow-2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.05);
  transition: transform .25s, box-shadow .25s;
}
.mcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-3); }

.mcard-inner {
  position: relative;
  overflow: hidden;
  flex: 1;
}

/* Each slide */
.mslide {
  display: none;
  flex-direction: column;
  padding: 28px 24px 20px;
  background: var(--bg, #fff);
  min-height: 340px;
  position: relative;
}
.mslide.ms-active { display: flex; }

/* Cover slide */
.mslide-cover {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}
.mslide-num {
  padding: 6px 16px;
  border-radius: 100px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: .5px;
  margin-bottom: 4px;
}
.mslide-icon { font-size: 4.5rem; animation: floatUpDown 3s ease-in-out infinite; }
.mslide-title { font-size: 1.4rem; font-weight: 800; color: var(--on-surface); }
.mslide-sub { font-size: 0.88rem; color: var(--outline); }
.mslide-tap {
  margin-top: 8px;
  padding: 10px 20px;
  background: var(--accent, var(--primary));
  color: #fff;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 700;
  animation: pulseBg 2s ease-in-out infinite;
}

/* Content slides */
.mslide-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 5px 14px;
  border-radius: 100px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.mslide-emoji { font-size: 3rem; margin-bottom: 8px; }
.mslide-fact-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--on-surface);
  margin-bottom: 14px;
}
.mslide-list {
  padding-left: 18px;
  color: var(--outline);
  font-size: 0.875rem;
  line-height: 1.9;
  flex: 1;
}
.mslide-list li { margin-bottom: 2px; }

/* Steps */
.mslide-steps { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.mstep {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--on-surface);
  background: rgba(255,255,255,0.7);
  border-radius: 10px;
  padding: 8px 12px;
}
.mstep-n {
  width: 24px; height: 24px;
  background: var(--accent, var(--primary));
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* 2-col grid */
.mslide-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex: 1;
}
.mgrid-item {
  background: rgba(255,255,255,0.8);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--on-surface);
  font-weight: 500;
  text-align: center;
}

/* Plate visual */
.mplate {
  display: flex;
  gap: 8px;
  flex: 1;
  align-items: stretch;
}
.mplate-item {
  flex: 1;
  border-radius: 14px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-size: 0.8rem;
}
.mplate-item small { color: var(--outline); font-size: 0.72rem; }

/* Compare good/bad */
.mslide-compare { display: flex; gap: 10px; flex: 1; }
.mcompare-col {
  flex: 1;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mcompare-col.good { background: #f0fdf4; }
.mcompare-col.bad  { background: #fef2f2; }
.mcompare-head { font-weight: 800; font-size: 0.88rem; margin-bottom: 4px; }
.mcompare-item { font-size: 0.8rem; color: var(--on-surface); }

/* Trash bins */
.mslide-bins { display: flex; gap: 8px; flex: 1; align-items: stretch; }
.mbin {
  flex: 1;
  border-radius: 14px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-size: 0.8rem;
}
.mbin small { color: var(--outline); font-size: 0.72rem; }

/* Big fact */
.mslide-bigfact {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(255,255,255,0.6);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
}
.mslide-done {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-container);
  border-radius: 10px;
  padding: 10px;
  margin-top: 8px;
}

/* Progress dots */
.mcard-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0 2px;
}
.mdot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--outline-variant);
  transition: all .3s;
}
.mdot.active {
  width: 24px;
  border-radius: 4px;
  background: var(--primary);
}

/* Nav tap bar */
.mcard-nav {
  text-align: center;
  padding: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-container);
  transition: background .2s;
  user-select: none;
}
.mcard:hover .mcard-nav { background: var(--primary); color: #fff; }

/* Slide transition animation */
@keyframes slideIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: none; }
}
.mslide.ms-active { animation: slideIn .35s cubic-bezier(.22,1,.36,1) both; }
