/* ==========================================================================
   Yorùbá Learning with Ṣèfúnmí — v2
   A bright, animated, kid-first design.
   Display: Fredoka · Body: Nunito
   ========================================================================== */

:root {
  --sky: #7ec8f2;
  --sky-deep: #4fa8e8;
  --sun: #ffc93c;
  --coral: #ff7b54;
  --leaf: #3fae74;
  --grape: #9b6fde;
  --indigo: #2d3e8b;
  /* heritage tie to the portfolio */
  --paper: #fff8ea;
  --ink: #2b2b3a;
  --white: #ffffff;
  --shadow: 0 6px 0 rgba(45, 62, 139, 0.18);

  --font-display: "Fredoka", "Nunito", sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
  --radius: 24px;
  --maxw: 1080px;
  --pad: clamp(1rem, 4vw, 2.2rem);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.97rem + 0.2vw, 1.1rem);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--indigo);
}

:focus-visible {
  outline: 4px solid var(--sun);
  outline-offset: 3px;
  border-radius: 8px;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--pad);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes bob {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-12px);
  }
}

@keyframes bobBig {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-22px);
  }
}

@keyframes drift {
  from {
    transform: translateX(-12vw);
  }

  to {
    transform: translateX(112vw);
  }
}

@keyframes spinSlow {
  to {
    transform: rotate(360deg);
  }
}

@keyframes wiggle {

  0%,
  100% {
    transform: rotate(-2.5deg);
  }

  50% {
    transform: rotate(2.5deg);
  }
}

@keyframes popIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  70% {
    transform: scale(1.12);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes bounceIn {
  0% {
    transform: translateY(30px);
    opacity: 0;
  }

  60% {
    transform: translateY(-8px);
    opacity: 1;
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes rainbowShift {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 200% 50%;
  }
}

@keyframes starPop {
  0% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.6) rotate(18deg);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes floaty {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-16px) rotate(6deg);
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-7px);
  }

  75% {
    transform: translateX(7px);
  }
}

.anim-pop {
  animation: popIn 500ms cubic-bezier(.5, 1.6, .5, 1) both;
}

.anim-bounce {
  animation: bounceIn 650ms cubic-bezier(.4, 1.4, .5, 1) both;
}

.stagger>* {
  animation: bounceIn 650ms cubic-bezier(.4, 1.4, .5, 1) both;
}

.stagger>*:nth-child(1) {
  animation-delay: 60ms;
}

.stagger>*:nth-child(2) {
  animation-delay: 160ms;
}

.stagger>*:nth-child(3) {
  animation-delay: 260ms;
}

.stagger>*:nth-child(4) {
  animation-delay: 360ms;
}

.stagger>*:nth-child(5) {
  animation-delay: 460ms;
}

.shake {
  animation: shake 320ms ease;
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  background: var(--indigo);
  position: sticky;
  top: 0;
  z-index: 60;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
}

.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding-block: 0.65rem;
}

.brand {
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  color: var(--white);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.brand .logo-sun {
  width: 34px;
  height: 34px;
  flex: none;
  animation: spinSlow 24s linear infinite;
}

.star-chip {
  font-family: var(--font-display);
  background: var(--sun);
  color: var(--indigo);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15);
}

.star-chip.earn {
  animation: starPop 600ms ease;
}

.site-nav ul {
  display: flex;
  gap: clamp(0.15rem, 1.4vw, 0.7rem);
  list-style: none;
}

.site-nav a {
  font-family: var(--font-display);
  color: var(--white);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  display: inline-block;
  white-space: nowrap;
  transition: background 150ms ease, transform 150ms ease;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px) rotate(-1.5deg);
}

.site-nav a[aria-current="page"] {
  background: var(--coral);
}

.nav-toggle {
  display: none;
  background: var(--coral);
  border: none;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
}

@media (max-width: 990px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--indigo);
    display: none;
    padding: 0.5rem var(--pad) 1rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
  }

  .site-nav.open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
  }

  .site-nav a {
    display: block;
  }
}

/* ==========================================================================
   Sky hero
   ========================================================================== */
.hero {
  position: relative;
  background: linear-gradient(180deg, var(--sky-deep) 0%, var(--sky) 55%, #bfe6fb 100%);
  color: var(--white);
  overflow: hidden;
  padding-block: clamp(3.2rem, 9vw, 6rem) clamp(4.5rem, 10vw, 7rem);
  text-align: center;
}

.hero .wrap {
  position: relative;
  z-index: 3;
}

.hero h1 {
  font-size: clamp(2.2rem, 6.5vw, 4.2rem);
  text-shadow: 0 4px 0 rgba(45, 62, 139, 0.28);
}

.hero h1 .bouncy {
  display: inline-block;
  animation: bob 2.6s ease-in-out infinite;
}

.hero h1 .bouncy:nth-child(2n) {
  animation-delay: 0.25s;
}

.hero h1 .bouncy:nth-child(3n) {
  animation-delay: 0.5s;
}

.hero .sub {
  margin: 1rem auto 0;
  max-width: 46ch;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 2px 0 rgba(45, 62, 139, 0.2);
}

.hero .cta-row {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.mascot {
  width: clamp(110px, 18vw, 170px);
  margin: 0 auto 1.2rem;
  border-radius: 50%;
  border: 6px solid var(--white);
  box-shadow: 0 8px 0 rgba(45, 62, 139, 0.25);
  animation: bobBig 3.2s ease-in-out infinite;
}

.sun-el {
  position: absolute;
  top: 34px;
  right: 7%;
  width: clamp(70px, 10vw, 120px);
  z-index: 1;
  animation: spinSlow 30s linear infinite;
}

.cloud {
  position: absolute;
  z-index: 1;
  opacity: 0.9;
  animation: drift linear infinite;
}

.floaties span {
  position: absolute;
  z-index: 2;
  font-size: clamp(1.2rem, 3vw, 2rem);
  animation: floaty 4s ease-in-out infinite;
  user-select: none;
}

.hero .wave {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  z-index: 2;
  display: block;
  width: 100%;
}

/* Buttons — chunky, pushable */
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  display: inline-block;
  text-decoration: none;
  padding: 0.8rem 1.8rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  color: var(--white);
  box-shadow: var(--shadow);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.btn:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 rgba(45, 62, 139, 0.18);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:hover:active {
  transform: translateY(5px);
}

.btn-coral {
  background: var(--coral);
}

.btn-leaf {
  background: var(--leaf);
}

.btn-grape {
  background: var(--grape);
}

.btn-indigo {
  background: var(--indigo);
}

.btn-sun {
  background: var(--sun);
  color: var(--indigo);
}

.btn.small {
  font-size: 0.95rem;
  padding: 0.55rem 1.2rem;
}

/* ==========================================================================
   Sections & cards
   ========================================================================== */
.section {
  padding-block: clamp(2.6rem, 7vw, 4.5rem);
}

.section h2 {
  font-size: clamp(1.7rem, 4.5vw, 2.6rem);
  text-align: center;
  color: var(--indigo);
}

.section .section-sub {
  text-align: center;
  max-width: 56ch;
  margin: 0.6rem auto 2rem;
  font-weight: 600;
  color: #56597a;
}

.big-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.4rem;
}

.big-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.7rem 1.4rem 1.6rem;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 8px 0 rgba(45, 62, 139, 0.12);
  border: 4px solid transparent;
  transition: transform 160ms ease, border-color 160ms ease;
}

.big-card:hover {
  transform: translateY(-6px) rotate(-1deg);
  animation: wiggle 400ms ease;
}

.big-card .emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.6rem;
}

.big-card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.35rem;
}

.big-card p {
  font-size: 0.98rem;
  color: #56597a;
  font-weight: 600;
}

.big-card.c-coral:hover {
  border-color: var(--coral);
}

.big-card.c-leaf:hover {
  border-color: var(--leaf);
}

.big-card.c-grape:hover {
  border-color: var(--grape);
}

.big-card.c-sun:hover {
  border-color: var(--sun);
}

.big-card .yo {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--coral);
  letter-spacing: 0.03em;
}

/* Page hero (inner pages) */
.page-hero {
  background: linear-gradient(180deg, var(--sky-deep), var(--sky));
  color: var(--white);
  text-align: center;
  padding-block: clamp(2.2rem, 6vw, 3.6rem);
  position: relative;
  overflow: hidden;
}

.page-hero h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  text-shadow: 0 3px 0 rgba(45, 62, 139, 0.28);
  position: relative;
  z-index: 2;
}

.page-hero p {
  font-weight: 700;
  margin-top: 0.5rem;
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 0 rgba(45, 62, 139, 0.2);
}

/* ==========================================================================
   Flashcards (lessons)
   ========================================================================== */
.deck-zone {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.progress-track {
  background: #e8e2cf;
  border-radius: 999px;
  height: 18px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.4rem;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(45deg, var(--leaf) 0 14px, #55c98b 14px 28px);
  border-radius: 999px;
  transition: width 400ms cubic-bezier(.5, 1.4, .5, 1);
}

.flashcard {
  perspective: 1200px;
  height: 300px;
  cursor: pointer;
  margin-bottom: 1.3rem;
  -webkit-tap-highlight-color: transparent;
}

.flashcard .inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 550ms cubic-bezier(.4, 1.3, .5, 1);
}

.flashcard.flipped .inner {
  transform: rotateY(180deg);
}

.flashcard .face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.4rem;
  box-shadow: 0 10px 0 rgba(45, 62, 139, 0.15);
}

.flashcard .front {
  background: var(--white);
  border: 5px solid var(--sky-deep);
}

.flashcard .back {
  background: var(--indigo);
  color: var(--white);
  transform: rotateY(180deg);
  border: 5px solid var(--sun);
}

.flashcard .word {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 600;
}

.flashcard .hint {
  font-weight: 700;
  font-size: 0.9rem;
  color: #8a8fae;
}

.flashcard .back .hint {
  color: rgba(255, 255, 255, 0.7);
}

.deck-actions {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.deck-done {
  padding: 2rem 0;
}

.deck-done .big-emoji {
  font-size: 4rem;
  animation: bobBig 1.6s ease-in-out infinite;
}

/* ==========================================================================
   Games
   ========================================================================== */
.game-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.game-zone {
  display: none;
}

.game-zone.active {
  display: block;
}

.scoreboard {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
  font-family: var(--font-display);
}

.score-pill {
  background: var(--white);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-size: 1rem;
  color: var(--indigo);
  box-shadow: 0 4px 0 rgba(45, 62, 139, 0.12);
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  max-width: 640px;
  margin: 0 auto;
}

@media (max-width: 560px) {
  .memory-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
  }
}

.mem-card {
  aspect-ratio: 3 / 3.4;
  perspective: 900px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.mem-card .inner {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 400ms cubic-bezier(.4, 1.3, .5, 1);
}

.mem-card.flipped .inner,
.mem-card.matched .inner {
  transform: rotateY(180deg);
}

.mem-card .face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(0.8rem, 2.4vw, 1.05rem);
  padding: 0.4rem;
  text-align: center;
  line-height: 1.2;
  box-shadow: 0 5px 0 rgba(45, 62, 139, 0.14);
}

.mem-card .face-down {
  background: linear-gradient(135deg, var(--grape), var(--indigo));
  color: var(--white);
  font-size: 1.6rem;
}

.mem-card .face-up {
  background: var(--white);
  color: var(--indigo);
  transform: rotateY(180deg);
  border: 3px solid var(--sky-deep);
}

.mem-card .face-up.yo-side {
  background: var(--sun);
  border-color: var(--coral);
}

.mem-card.matched .face-up {
  background: var(--leaf);
  color: var(--white);
  border-color: var(--leaf);
  animation: starPop 500ms ease;
}

.mem-card.matched {
  cursor: default;
}

.quiz-box {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

.quiz-word {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3rem);
  color: var(--indigo);
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.6rem 1rem;
  box-shadow: 0 8px 0 rgba(45, 62, 139, 0.13);
  margin-bottom: 1.4rem;
}

.quiz-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

@media (max-width: 480px) {
  .quiz-opts {
    grid-template-columns: 1fr;
  }
}

.quiz-opt {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  background: var(--white);
  color: var(--ink);
  border: 4px solid var(--sky-deep);
  border-radius: 18px;
  padding: 0.9rem 0.8rem;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(45, 62, 139, 0.14);
  transition: transform 130ms ease;
}

.quiz-opt:hover {
  transform: translateY(-3px) rotate(-0.5deg);
}

.quiz-opt.right {
  background: var(--leaf);
  border-color: var(--leaf);
  color: var(--white);
  animation: starPop 500ms ease;
}

.quiz-opt.wrong {
  background: var(--coral);
  border-color: var(--coral);
  color: var(--white);
  animation: shake 320ms ease;
}

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

.win-banner {
  text-align: center;
  padding: 1.6rem 0 0.4rem;
}

.win-banner .big-emoji {
  font-size: 4.2rem;
  display: inline-block;
  animation: bobBig 1.4s ease-in-out infinite;
}

.win-banner h3 {
  font-size: 1.8rem;
  color: var(--indigo);
  margin-top: 0.4rem;
}

.win-banner p {
  font-weight: 700;
  color: #56597a;
}

/* ==========================================================================
   Songs
   ========================================================================== */
.song-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
}

@media (max-width: 760px) {
  .song-grid {
    grid-template-columns: 1fr;
  }
}

.song-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 0 rgba(45, 62, 139, 0.13);
  transition: transform 160ms ease;
}

.song-card:hover {
  transform: translateY(-5px) rotate(-0.6deg);
}

.yt-lite {
  position: relative;
  aspect-ratio: 16 / 9;
  cursor: pointer;
  background: #000 center / cover no-repeat;
  border: none;
  width: 100%;
  padding: 0;
}

.yt-lite .play-bubble {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--coral);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.28);
  animation: bob 2.2s ease-in-out infinite;
  pointer-events: none;
}

.yt-lite iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.song-card .body {
  padding: 1.1rem 1.3rem 1.3rem;
}

.song-card h3 {
  color: var(--indigo);
  font-size: 1.35rem;
}

.song-card .yo-title {
  color: var(--coral);
  font-family: var(--font-display);
  font-size: 1rem;
}

.song-card p {
  font-weight: 600;
  color: #56597a;
  font-size: 0.97rem;
  margin-top: 0.3rem;
}

/* ==========================================================================
   Stories
   ========================================================================== */
.story-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 0 rgba(45, 62, 139, 0.13);
  overflow: hidden;
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: 300px 1fr;
}

@media (max-width: 760px) {
  .story-card {
    grid-template-columns: 1fr;
  }
}

.story-card .pic {
  background: var(--sky);
  min-height: 220px;
}

.story-card .pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-card .body {
  padding: 1.5rem 1.6rem 1.6rem;
}

.story-card h3 {
  color: var(--indigo);
  font-size: 1.45rem;
  margin-bottom: 0.6rem;
}

.story-card .yo-text {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.75;
}

.story-card .yo-text strong {
  color: var(--coral);
}

.translation {
  margin-top: 1rem;
  background: var(--paper);
  border: 3px dashed var(--sun);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  font-weight: 600;
  display: none;
}

.translation.show {
  display: block;
  animation: bounceIn 450ms ease both;
}

.translation strong {
  color: var(--leaf);
}

.story-card .btn {
  margin-top: 1rem;
}

/* ==========================================================================
   About + misc
   ========================================================================== */
.about-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 0 rgba(45, 62, 139, 0.13);
  padding: clamp(1.4rem, 4vw, 2.4rem);
  max-width: 780px;
  margin: 0 auto;
}

.about-card p+p {
  margin-top: 1rem;
}

.credit-note {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: #8a8fae;
  margin-top: 1.6rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--indigo);
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  padding: 2rem var(--pad) 2.4rem;
  font-weight: 600;
  font-size: 0.92rem;
  margin-top: 2rem;
}

.site-footer .foot-sun {
  width: 40px;
  margin: 0 auto 0.7rem;
  animation: spinSlow 26s linear infinite;
}

.site-footer a {
  color: var(--sun);
}

/* ==========================================================================
   Sefunmi AI chat
   ========================================================================== */
#chat-launcher {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 90;
  background: var(--coral);
  color: var(--white);
  border: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: bob 3s ease-in-out infinite;
}

#chat-launcher img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--white);
}

#chatbot {
  position: fixed;
  right: 1rem;
  bottom: 4.6rem;
  z-index: 95;
  width: min(330px, calc(100vw - 2rem));
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 14px 34px rgba(45, 62, 139, 0.35);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 4px solid var(--indigo);
}

#chatbot.open {
  display: flex;
  animation: bounceIn 400ms ease both;
}

#chatbot header {
  background: var(--indigo);
  color: var(--white);
  padding: 0.6rem 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 600;
}

#chatbot header button {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
}

#chat-body {
  height: 250px;
  overflow-y: auto;
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--paper);
}

.chat-msg {
  max-width: 86%;
  padding: 0.5rem 0.75rem;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.45;
}

.chat-msg.bot {
  background: var(--white);
  border: 2px solid var(--sky);
  align-self: flex-start;
}

.chat-msg.user {
  background: var(--leaf);
  color: var(--white);
  align-self: flex-end;
}

#chat-form {
  display: flex;
  border-top: 3px solid var(--paper);
}

#chat-input {
  flex: 1;
  border: none;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  font-family: var(--font-body);
  font-weight: 600;
}

#chat-input:focus {
  outline: none;
}

#chat-form button {
  border: none;
  background: var(--coral);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 600;
  padding: 0 1.1rem;
  cursor: pointer;
}

/* Confetti canvas */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
}
