:root {
  --cream: #FFF6F0;
  --cream-2: #FFEFE4;
  --plum: #3D2436;
  --plum-soft: #6B4A5C;
  --rose: #E8567C;
  --rose-deep: #C93B62;
  --peach: #FFB88C;
  --sky: #5AC8E8;
  --sky-deep: #3FAECF;
  --yellow: #FFD966;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --shadow-soft: 0 12px 32px rgba(232, 86, 124, 0.14);
  --font-display: 'Fredoka', sans-serif;
  --font-body: 'Nunito', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--plum);
  overflow-x: hidden;
  line-height: 1.5;
}

#bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 184, 140, 0.25), transparent 40%),
    radial-gradient(circle at 85% 10%, rgba(90, 200, 232, 0.16), transparent 35%),
    radial-gradient(circle at 75% 80%, rgba(232, 86, 124, 0.14), transparent 45%);
  pointer-events: none;
}

.section {
  position: relative;
  padding: 100px 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rose-deep);
  margin: 0 0 10px;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 600;
  margin: 0 0 20px;
  color: var(--plum);
}

.lead {
  font-size: 1.1rem;
  color: var(--plum-soft);
  max-width: 640px;
  margin: 0 0 14px;
}

/* ============ HERO ============ */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 40px 24px;
  overflow: hidden;
}

.hero-inner {
  text-align: center;
  z-index: 2;
  max-width: 720px;
}

.chip {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  background: rgba(232, 86, 124, 0.1);
  color: var(--rose-deep);
  padding: 8px 20px;
  border-radius: 999px;
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 8vw, 5rem);
  font-weight: 700;
  line-height: 1.08;
  margin: 0 0 24px;
  color: var(--plum);
}

.highlight {
  color: var(--rose);
  position: relative;
  display: inline-block;
}

.highlight::after {
  content: '';
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: 6px;
  height: 0.3em;
  background: var(--yellow);
  z-index: -1;
  opacity: 0.55;
  border-radius: 4px;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--plum-soft);
  margin: 0 0 44px;
}

#msg-counter {
  font-weight: 800;
  color: var(--rose-deep);
  font-variant-numeric: tabular-nums;
}

.scroll-cue {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  color: white;
  background: var(--rose);
  border: none;
  padding: 16px 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.scroll-cue svg {
  animation: bounceDown 1.6s ease-in-out infinite;
}

@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

.scroll-cue:hover {
  transform: translateY(-3px);
  background: var(--rose-deep);
  box-shadow: 0 16px 36px rgba(201, 59, 98, 0.28);
}

.hero-bubbles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.float-bubble {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.95rem;
  opacity: 0.85;
  animation: floatUpDown 6s ease-in-out infinite;
  white-space: nowrap;
}

.b1 { top: 14%; left: 8%; background: var(--peach); color: var(--plum); animation-delay: 0s; }
.b2 { top: 22%; right: 10%; background: var(--sky); color: white; animation-delay: 1.2s; }
.b3 { bottom: 28%; left: 12%; background: var(--rose); color: white; animation-delay: 2.1s; }
.b4 { bottom: 18%; right: 14%; background: var(--yellow); color: var(--plum); animation-delay: 0.6s; }
.b5 { top: 48%; left: 4%; background: var(--rose-deep); color: white; animation-delay: 3s; font-size: 0.85rem; }
.b6 { top: 60%; right: 6%; background: var(--plum); color: white; animation-delay: 1.8s; font-size: 0.85rem; }

@keyframes floatUpDown {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-18px) rotate(2deg); }
}

@media (max-width: 720px) {
  .float-bubble { display: none; }
}

/* ============ INTRO ============ */
.intro-section { text-align: center; }
.intro-inner { max-width: 680px; margin: 0 auto; }
.intro-section .lead { margin-left: auto; margin-right: auto; }

/* ============ TIMELINE / CHAT ============ */
.timeline-section { }
.timeline-header { text-align: center; margin-bottom: 50px; }
.timeline-header .lead { margin-left: auto; margin-right: auto; }

.chat-window {
  background: white;
  border-radius: var(--radius-lg);
  padding: 40px clamp(16px, 5vw, 48px);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(232, 86, 124, 0.08);
}

.chat-block { margin-bottom: 56px; }
.chat-block:last-child { margin-bottom: 0; }

.chat-date-divider {
  text-align: center;
  margin: 0 0 6px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.chat-date-divider.revealed { opacity: 1; transform: translateY(0); }

.chat-date-divider span {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--plum-soft);
  background: var(--cream-2);
  padding: 6px 16px;
  border-radius: 999px;
}

.chat-block-label {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--rose-deep);
  margin: 14px 0 24px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease 0.05s, transform 0.6s ease 0.05s;
}
.chat-block-label.revealed { opacity: 1; transform: translateY(0); }

.bubble-row {
  display: flex;
  margin-bottom: 10px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.bubble-row.revealed { opacity: 1; transform: translateY(0); }

.row-her { justify-content: flex-start; }
.row-me { justify-content: flex-end; }

.bubble {
  max-width: min(78%, 480px);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.98rem;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.bubble-her {
  background: var(--cream-2);
  color: var(--plum);
  border-bottom-left-radius: 6px;
}

.bubble-me {
  background: var(--sky);
  color: white;
  border-bottom-right-radius: 6px;
}

.bubble-text { flex: 1; }

.bubble-time {
  font-size: 0.72rem;
  opacity: 0.65;
  white-space: nowrap;
}

.chat-note {
  margin-top: 20px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--plum-soft);
  font-style: italic;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.chat-note.revealed { opacity: 1; transform: translateY(0); }
.chat-note span { font-style: italic; }

/* ============ STATS ============ */
.stats-section { text-align: center; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 44px;
}

.stat-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 32px 20px;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.stat-card.revealed { opacity: 1; transform: translateY(0) scale(1); }

.stat-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--rose);
  margin-bottom: 6px;
}

.stat-label {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  color: var(--plum);
  margin-bottom: 6px;
}

.stat-sub {
  font-size: 0.85rem;
  color: var(--plum-soft);
}

/* ============ QUIZ ============ */
.quiz-section { text-align: center; }
.quiz-header .lead { margin-left: auto; margin-right: auto; }

.quiz-card {
  max-width: 600px;
  margin: 40px auto 0;
  background: white;
  border-radius: var(--radius-lg);
  padding: clamp(24px, 5vw, 44px);
  box-shadow: var(--shadow-soft);
  text-align: left;
  min-height: 320px;
}

.quiz-progress {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--rose-deep);
  margin-bottom: 12px;
}

.quiz-question {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  margin-bottom: 24px;
  color: var(--plum);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-option {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--cream-2);
  background: var(--cream);
  color: var(--plum);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease, background 0.2s ease;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--peach);
  transform: translateX(4px);
}

.quiz-option:disabled { cursor: default; }

.quiz-option.correct {
  border-color: var(--rose);
  background: rgba(232, 86, 124, 0.12);
  color: var(--rose-deep);
}

.quiz-option.wrong {
  border-color: #d9a3a3;
  background: rgba(217, 163, 163, 0.15);
  opacity: 0.7;
}

.quiz-feedback {
  margin-top: 20px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.4s ease;
}
.quiz-feedback.show { opacity: 1; max-height: 300px; }

.feedback-box {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.feedback-correct { background: rgba(232, 86, 124, 0.1); color: var(--rose-deep); }
.feedback-wrong { background: rgba(90, 200, 232, 0.12); color: var(--sky-deep); }

.quiz-next, .quiz-restart {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: white;
  background: var(--rose);
  border: none;
  padding: 12px 26px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.quiz-next:hover, .quiz-restart:hover {
  background: var(--rose-deep);
  transform: translateY(-2px);
}

.quiz-result { text-align: center; padding: 20px 0; }
.quiz-result-emoji { font-size: 3rem; margin-bottom: 12px; }
.quiz-result-score {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--rose);
  margin-bottom: 14px;
}
.quiz-result-verdict {
  font-size: 1.05rem;
  color: var(--plum-soft);
  margin-bottom: 26px;
}

/* ============ FINALE ============ */
.finale-section {
  text-align: center;
  padding-bottom: 140px;
  position: relative;
  overflow: hidden;
}

.finale-emoji {
  font-size: 3.5rem;
  margin-bottom: 20px;
  animation: pulseHeart 1.8s ease-in-out infinite;
}

@keyframes pulseHeart {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.finale-inner h2 {
  font-size: clamp(2rem, 5vw, 3rem);
}

.finale-text {
  max-width: 560px;
  margin: 0 auto 30px;
  font-size: 1.15rem;
  color: var(--plum-soft);
}

.finale-sign {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--rose-deep);
}

.confetti-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 14px;
  opacity: 0.85;
  animation-name: fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 0.9; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0.3; }
}

@media (max-width: 600px) {
  .section { padding: 70px 18px; }
  .chat-window { padding: 28px 16px; }
  .bubble { max-width: 88%; }
}
