/* ============================================================
   HabitLife — custom styles (complements Tailwind CDN)
   ============================================================ */

html { scroll-behavior: smooth; }
body { overflow-x: hidden; }

/* --- Background decoration --- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(to right, rgba(139, 92, 246, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(139, 92, 246, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}
.bg-orb {
  position: fixed;
  z-index: -1;
  border-radius: 9999px;
  filter: blur(110px);
  opacity: 0.35;
  pointer-events: none;
}
.bg-orb--1 { top: -120px; left: -80px;  width: 380px; height: 380px; background: #8b5cf6; }
.bg-orb--2 { top: 280px;  right: -120px; width: 420px; height: 420px; background: #22d3ee; opacity: 0.22; }

/* --- Section headings --- */
.section-title {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.1;
  color: #fff;
  text-align: center;
}
.section-sub {
  margin-top: 0.85rem;
  color: #94a3b8;
  font-size: 1.05rem;
}

/* --- Language buttons --- */
.lang-btn { color: #94a3b8; }
.lang-btn.is-active {
  background: #8b5cf6;
  color: #fff;
}

/* --- XP bars --- */
.xp-track {
  height: 8px;
  border-radius: 9999px;
  background: #2a2640;
  overflow: hidden;
}
.xp-fill {
  height: 100%;
  width: 0;
  border-radius: 9999px;
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.6);
  animation: fillBar 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.xp-fill--cyan { background: linear-gradient(90deg, #06b6d4, #22d3ee); box-shadow: 0 0 12px rgba(34, 211, 238, 0.6); }
.xp-fill--gold { background: linear-gradient(90deg, #f59e0b, #fbbf24); box-shadow: 0 0 12px rgba(251, 191, 36, 0.6); }
@keyframes fillBar { to { width: var(--w); } }

/* --- Hero character card --- */
.char-card { animation: floatY 6s ease-in-out infinite; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.floating-quest {
  position: absolute;
  bottom: -14px;
  left: -18px;
  background: #1c1930;
  border: 1px solid #34d399;
  color: #34d399;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: 9999px;
  box-shadow: 0 0 24px -6px rgba(52, 211, 153, 0.5);
  animation: floatY 5s ease-in-out infinite 0.6s;
}

/* --- Steps --- */
.step-card {
  position: relative;
  border: 1px solid #2a2640;
  background: rgba(28, 25, 48, 0.55);
  border-radius: 1rem;
  padding: 2rem 1.5rem 1.5rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.step-card:hover { transform: translateY(-4px); border-color: #8b5cf6; }
.step-num {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #8b5cf6, #22d3ee);
  color: #0b0a14;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}
.step-title { font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: 1.15rem; color: #fff; }
.step-text { margin-top: 0.5rem; color: #94a3b8; font-size: 0.95rem; line-height: 1.55; }

/* --- Features --- */
.feat-card {
  border: 1px solid #2a2640;
  background: rgba(21, 19, 31, 0.5);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.feat-card:hover { transform: translateY(-4px); border-color: #22d3ee; box-shadow: 0 0 40px -12px rgba(34, 211, 238, 0.45); }
.feat-icon { font-size: 1.75rem; }
.feat-title { margin-top: 0.85rem; font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: 1.05rem; color: #fff; }
.feat-text { margin-top: 0.4rem; color: #94a3b8; font-size: 0.9rem; line-height: 1.5; }

/* --- Concept diagram --- */
.concept-diagram { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.cd-box {
  width: 100%;
  max-width: 280px;
  text-align: center;
  padding: 0.9rem 1rem;
  border-radius: 0.85rem;
  font-weight: 600;
  border: 1px solid #2a2640;
}
.cd-action { background: rgba(139, 92, 246, 0.12); border-color: #8b5cf6; color: #c4b5fd; }
.cd-skill  { background: rgba(34, 211, 238, 0.12); border-color: #22d3ee; color: #a5f3fc; }
.cd-arch   { background: rgba(251, 191, 36, 0.12); border-color: #fbbf24; color: #fde68a; }
.cd-arrow  { color: #64748b; font-size: 0.85rem; font-weight: 500; }

/* --- FAQ --- */
.faq-item {
  border: 1px solid #2a2640;
  background: rgba(21, 19, 31, 0.5);
  border-radius: 0.85rem;
  padding: 0 1.25rem;
  transition: border-color 0.2s ease;
}
.faq-item[open] { border-color: #8b5cf6; }
.faq-q {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 0;
  font-weight: 600;
  color: #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after { content: "+"; color: #8b5cf6; font-size: 1.3rem; transition: transform 0.2s ease; }
.faq-item[open] .faq-q::after { transform: rotate(45deg); }
.faq-a { padding: 0 0 1.1rem; color: #94a3b8; font-size: 0.95rem; line-height: 1.6; }

/* --- Scroll reveal --- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .xp-fill { width: var(--w); }
  .reveal { opacity: 1; transform: none; }
}
