/* =============================
   Onboarding Overlay
   ============================= */

#ob-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.45s cubic-bezier(.22,.68,0,1.2), transform 0.45s cubic-bezier(.22,.68,0,1.2);
}
#ob-overlay.ob-visible {
  opacity: 1;
  transform: scale(1);
}

.ob-skip {
  position: absolute;
  top: max(18px, env(safe-area-inset-top, 18px));
  right: 20px;
  z-index: 10;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  border-radius: 20px;
  color: rgba(255,255,255,0.88);
  font-size: 14px;
  font-weight: 600;
  padding: 7px 16px;
  cursor: pointer;
  letter-spacing: .3px;
}

.ob-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.42s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}

/* ---- Slide base ---- */
.ob-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 40px 28px 100px;
  text-align: center;
  box-sizing: border-box;
}

/* ---- Slide gradient backgrounds ---- */
.ob-s1 { background: linear-gradient(145deg, #6366f1 0%, #a855f7 55%, #ec4899 100%); }
.ob-s2 { background: linear-gradient(145deg, #0ea5e9 0%, #6366f1 60%, #8b5cf6 100%); }
.ob-s3 { background: linear-gradient(145deg, #f59e0b 0%, #ef4444 55%, #a855f7 100%); }
.ob-s4 { background: linear-gradient(145deg, #10b981 0%, #0ea5e9 55%, #6366f1 100%); }
.ob-s5 { background: linear-gradient(145deg, #8b5cf6 0%, #6366f1 40%, #3b82f6 100%); }

/* ---- Typography ---- */
.ob-title {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 12px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.18);
  animation: ob-slide-up 0.55s cubic-bezier(.22,.68,0,1.2) both;
  animation-delay: 0.1s;
  letter-spacing: -.5px;
}
.ob-subtitle {
  font-size: 17px;
  color: rgba(255,255,255,0.88);
  margin: 0;
  line-height: 1.55;
  animation: ob-slide-up 0.55s cubic-bezier(.22,.68,0,1.2) both;
  animation-delay: 0.2s;
}

/* ---- Hero / slide icons ---- */
.ob-hero-icon {
  font-size: 88px;
  margin-bottom: 16px;
  display: block;
  animation: ob-bounce-in 0.7s cubic-bezier(.22,.68,0,1.4) both;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.22));
}
.ob-slide-icon {
  font-size: 72px;
  margin-bottom: 16px;
  display: block;
  animation: ob-bounce-in 0.7s cubic-bezier(.22,.68,0,1.4) both;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.22));
}

/* ---- Floating bg cards (slide 1, 2) ---- */
.ob-bg-card {
  position: absolute;
  border-radius: 16px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  backdrop-filter: blur(2px);
}
.ob-bg-card-1 {
  width: 140px; height: 90px;
  top: 10%; left: -30px;
  transform: rotate(-14deg);
  animation: ob-float 4.8s ease-in-out infinite;
}
.ob-bg-card-2 {
  width: 110px; height: 75px;
  top: 18%; right: -20px;
  transform: rotate(10deg);
  animation: ob-float 5.6s ease-in-out infinite reverse;
  animation-delay: .8s;
}
.ob-bg-card-3 {
  width: 90px; height: 60px;
  bottom: 22%; right: 15px;
  transform: rotate(-7deg);
  animation: ob-float 6s ease-in-out infinite;
  animation-delay: 1.4s;
}

/* ---- Sparkles ---- */
.ob-sparkle {
  position: absolute;
  font-size: 22px;
  opacity: .75;
  pointer-events: none;
  animation: ob-sparkle 2.4s ease-in-out infinite;
}
.ob-sp1 { top: 12%; left: 14%; animation-delay: 0s; }
.ob-sp2 { top: 8%;  right: 18%; animation-delay: .7s; }
.ob-sp3 { bottom: 28%; left: 10%; animation-delay: 1.1s; }
.ob-sp4 { bottom: 20%; right: 12%; animation-delay: 1.7s; }

/* ---- Folders demo (slide 2) ---- */
.ob-folders-demo {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  justify-content: center;
  animation: ob-pop 0.55s cubic-bezier(.22,.68,0,1.4) both;
  animation-delay: 0.05s;
}
.ob-folder-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.18);
  border: 1.5px solid rgba(255,255,255,0.35);
  border-radius: 24px;
  padding: 10px 20px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* ---- Quiz demo (slide 3) ---- */
.ob-quiz-demo {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 300px;
  margin-bottom: 22px;
  animation: ob-pop 0.55s cubic-bezier(.22,.68,0,1.4) both;
  animation-delay: 0.05s;
}
.ob-flip-demo {
  background: rgba(255,255,255,0.2);
  border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: 16px;
  padding: 16px 20px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.ob-mc-demo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ob-mc-btn {
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 12px;
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  text-align: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ob-mc-btn.ob-mc-ok {
  background: rgba(34,197,94,0.38);
  border-color: rgba(34,197,94,0.6);
  color: #fff;
  animation: ob-pulse 1.8s ease-in-out infinite;
}

/* ---- Gesture list (slide 4) ---- */
.ob-gesture-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 300px;
  margin-bottom: 22px;
  animation: ob-pop 0.55s cubic-bezier(.22,.68,0,1.4) both;
  animation-delay: 0.05s;
}
.ob-gesture-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255,255,255,0.16);
  border: 1.5px solid rgba(255,255,255,0.28);
  border-radius: 16px;
  padding: 14px 18px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ob-gi {
  font-size: 28px;
  flex-shrink: 0;
  display: block;
}
.ob-gi-edge  { animation: ob-gi-edge  1.6s ease-in-out infinite; }
.ob-gi-sheet { animation: ob-gi-sheet 1.6s ease-in-out infinite 0.4s; }
.ob-gi-card  { animation: ob-gi-card  1.6s ease-in-out infinite 0.8s; }
.ob-gtext {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  text-align: left;
  line-height: 1.35;
}

/* ---- Features list (slide 5) ---- */
.ob-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 290px;
  margin-bottom: 20px;
  animation: ob-slide-up 0.55s cubic-bezier(.22,.68,0,1.2) both;
  animation-delay: 0.05s;
}
.ob-feat {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.14);
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}
.ob-feat > span:first-child { font-size: 20px; }

/* ---- Footer ---- */
.ob-footer {
  position: absolute;
  bottom: max(28px, env(safe-area-inset-bottom, 28px));
  left: 0; right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  z-index: 10;
  padding: 0 24px;
}
.ob-dots {
  display: flex;
  gap: 8px;
}
.ob-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: width 0.3s ease, background 0.3s ease;
  cursor: pointer;
}
.ob-dot.active {
  width: 24px;
  border-radius: 4px;
  background: #fff;
}
.ob-btn-next {
  width: 100%;
  max-width: 280px;
  padding: 16px;
  border-radius: 18px;
  border: none;
  background: rgba(255,255,255,0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .2px;
  cursor: pointer;
  border: 1.5px solid rgba(255,255,255,0.4);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.3);
  transition: transform 0.12s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.ob-btn-next:active {
  transform: scale(0.96);
  background: rgba(255,255,255,0.32);
}

/* ---- Keyframes ---- */
@keyframes ob-bounce-in {
  0%   { opacity: 0; transform: scale(0.3) translateY(20px); }
  60%  { opacity: 1; transform: scale(1.1) translateY(-6px); }
  80%  { transform: scale(0.95) translateY(2px); }
  100% { transform: scale(1) translateY(0); }
}
@keyframes ob-slide-up {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ob-float {
  0%, 100% { transform: translateY(0) rotate(var(--rot, -14deg)); }
  50%       { transform: translateY(-16px) rotate(var(--rot, -14deg)); }
}
@keyframes ob-pop {
  0%   { opacity: 0; transform: scale(0.75); }
  70%  { transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes ob-sparkle {
  0%, 100% { opacity: .55; transform: scale(1) rotate(0deg); }
  50%       { opacity: 1;   transform: scale(1.35) rotate(20deg); }
}
@keyframes ob-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.55); }
  50%       { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
}
@keyframes ob-gi-edge {
  0%, 100% { transform: translateX(0); }
  40%       { transform: translateX(-10px); }
  60%       { transform: translateX(4px); }
}
@keyframes ob-gi-sheet {
  0%, 100% { transform: translateY(0); }
  40%       { transform: translateY(10px); }
  60%       { transform: translateY(-3px); }
}
@keyframes ob-gi-card {
  0%, 100% { transform: translateX(0); }
  40%       { transform: translateX(10px); }
  60%       { transform: translateX(-3px); }
}
