/* =============================================
   Mood Bubs — Shared Styles
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --purple:  #8E55E8;
  --yellow:  #FFC247;
  --bg:      #EAF1FA;
  --text:    #233044;
  --green:   #50C878;
  --red:     #EF4E5D;
  --pink:    #FF5EA8;
  --radius:  22px;
  --glass-bg:     rgba(255,255,255,0.18);
  --glass-border: rgba(255,255,255,0.35);
  --shadow:  0 8px 32px rgba(0,0,0,0.12);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- NAV ---- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: rgba(255,255,255,0.22);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.3);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.nav-logo svg {
  flex-shrink: 0;
}

.nav-logo span {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  opacity: 0.75;
  transition: opacity 0.2s;
}

.nav-links a:hover { opacity: 1; }

/* ---- HERO ---- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #86E89A, #3FC45E, #1E8F44);
  animation: moodCycle 18s ease-in-out infinite;
  z-index: 0;
}

@keyframes moodCycle {
  0%    { background: linear-gradient(135deg, #86E89A, #3FC45E, #1E8F44); }
  16%   { background: linear-gradient(135deg, #FFD862, #FFA92E, #D17A00); }
  33%   { background: linear-gradient(135deg, #FF9AD0, #FF5BAB, #D62E86); }
  50%   { background: linear-gradient(135deg, #7FD4FF, #3BA0F0, #1F77C9); }
  66%   { background: linear-gradient(135deg, #FF7B7B, #EB3B3B, #C92626); }
  83%   { background: linear-gradient(135deg, #B07FFF, #8E55E8, #4A20A8); }
  100%  { background: linear-gradient(135deg, #86E89A, #3FC45E, #1E8F44); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -1px;
  text-shadow: 0 4px 24px rgba(0,0,0,0.18);
  margin-bottom: 20px;
}

.hero p {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: rgba(255,255,255,0.9);
  margin-bottom: 40px;
  font-weight: 600;
}

.cta-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 100px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: transform 0.18s, box-shadow 0.18s;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,0.2); }

.btn-ghost {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255,255,255,0.5);
  color: #fff;
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-ghost:hover { transform: none; box-shadow: none; }

/* ---- GRID DEMO ---- */
#demo-container {
  position: relative;
  z-index: 1;
  margin-top: 8px;
}

#puzzle-demo {
  display: grid;
  grid-template-columns: repeat(5, 54px);
  grid-template-rows: repeat(5, 54px);
  gap: 6px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
}

.demo-label {
  text-align: center;
  color: rgba(255,255,255,0.75);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 12px;
}

/* ---- SECTIONS ---- */
section {
  padding: 96px 24px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 12px;
}

.section-title {
  text-align: center;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.section-sub {
  text-align: center;
  font-size: 1.05rem;
  color: #6b7a93;
  max-width: 560px;
  margin: 0 auto 56px;
  font-weight: 600;
}

/* ---- FEATURES CARDS ---- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 28px;
  transition: transform 0.22s, box-shadow 0.22s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.16);
}

.card-icon {
  font-size: 2.8rem;
  margin-bottom: 18px;
  display: block;
}

.card h3 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text);
}

.card p {
  font-size: 0.97rem;
  color: #6b7a93;
  font-weight: 600;
  line-height: 1.65;
}

/* ---- HOW TO PLAY ---- */
.how-bg {
  background: linear-gradient(160deg, #f0e8ff 0%, #e8f4ff 100%);
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  position: relative;
}

.step {
  text-align: center;
  padding: 40px 28px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}

.step-num {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 6px 20px rgba(142,85,232,0.4);
}

.step h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.step p {
  font-size: 0.95rem;
  color: #6b7a93;
  font-weight: 600;
}

.step-icon {
  font-size: 2.4rem;
  margin-bottom: 16px;
  display: block;
}

/* ---- MOOD SECTION ---- */
.mood-bg {
  background: var(--text);
}

.mood-bg .section-label { color: var(--yellow); }
.mood-bg .section-title { color: #fff; }
.mood-bg .section-sub   { color: rgba(255,255,255,0.6); }

.mood-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
}

.mood-card {
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
  cursor: default;
  transition: transform 0.22s, box-shadow 0.22s;
}

.mood-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 20px 48px rgba(0,0,0,0.3);
}

.mood-emoji { font-size: 2.4rem; display: block; margin-bottom: 12px; }
.mood-name  { font-size: 1.05rem; font-weight: 800; margin-bottom: 6px; }
.mood-desc  { font-size: 0.82rem; opacity: 0.85; font-weight: 600; line-height: 1.45; }

.mood-calm   { background: linear-gradient(145deg, #86E89A, #3FC45E, #1E8F44); }
.mood-happy  { background: linear-gradient(145deg, #FFD862, #FFA92E, #D17A00); }
.mood-love   { background: linear-gradient(145deg, #FF9AD0, #FF5BAB, #D62E86); }
.mood-cool   { background: linear-gradient(145deg, #7FD4FF, #3BA0F0, #1F77C9); }
.mood-angry  { background: linear-gradient(145deg, #FF7B7B, #EB3B3B, #C92626); }
.mood-mystic { background: linear-gradient(145deg, #B07FFF, #8E55E8, #4A20A8); }

/* ---- FEATURE LIST ---- */
.feat-bg {
  background: linear-gradient(160deg, #e8f4ff 0%, #f0e8ff 100%);
}

.feat-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.feat-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 22px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  font-weight: 700;
  font-size: 0.97rem;
  color: var(--text);
  transition: transform 0.18s;
}

.feat-item:hover { transform: translateX(4px); }

.feat-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(80,200,120,0.4);
}

/* ---- FOOTER ---- */
footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
  padding: 60px 24px 40px;
  text-align: center;
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.footer-logo span {
  font-size: 1.3rem;
  font-weight: 900;
  color: #fff;
}

.footer-tagline {
  font-size: 0.95rem;
  margin-bottom: 28px;
  font-weight: 600;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 28px;
  list-style: none;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  text-decoration: none;
  color: rgba(255,255,255,0.65);
  font-weight: 700;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-links a:hover { color: #fff; }

.footer-bottom {
  font-size: 0.82rem;
  opacity: 0.5;
  margin-top: 16px;
  line-height: 1.8;
}

/* ---- LEGAL PAGES ---- */
.legal-hero {
  padding: 140px 24px 60px;
  text-align: center;
  background: linear-gradient(135deg, #B07FFF, #8E55E8, #4A20A8);
}

.legal-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  color: #fff;
  margin-bottom: 12px;
}

.legal-hero p {
  color: rgba(255,255,255,0.8);
  font-size: 1rem;
  font-weight: 600;
}

.legal-body {
  max-width: 780px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}

.legal-body h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  margin: 48px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e8ecf2;
}

.legal-body h2:first-of-type { margin-top: 0; }

.legal-body h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--purple);
  margin: 28px 0 10px;
}

.legal-body p {
  color: #4a5568;
  font-size: 0.97rem;
  font-weight: 600;
  line-height: 1.8;
  margin-bottom: 16px;
}

.legal-body ul {
  margin: 0 0 16px 20px;
  color: #4a5568;
  font-size: 0.97rem;
  font-weight: 600;
  line-height: 1.8;
}

.legal-body a {
  color: var(--purple);
  font-weight: 700;
  text-decoration: none;
}

.legal-body a:hover { text-decoration: underline; }

.legal-callout {
  background: rgba(142,85,232,0.08);
  border-left: 4px solid var(--purple);
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 700;
}

/* ---- ENTRANCE ANIMATIONS ---- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
  nav { padding: 12px 20px; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 0.85rem; }

  section { padding: 72px 20px; }

  #puzzle-demo {
    grid-template-columns: repeat(5, 44px);
    grid-template-rows: repeat(5, 44px);
  }

  .mood-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cta-group { flex-direction: column; align-items: center; }
}

@media (max-width: 380px) {
  #puzzle-demo {
    grid-template-columns: repeat(5, 38px);
    grid-template-rows: repeat(5, 38px);
  }
}
