:root {
  --ink: #1f1547;
  --line: #1a123d;
  --yellow: #f2ea63;
  --pink: #f8addb;
  --mint: #80e4a9;
  --cream: #fff7e4;
  --lilac: #b4a8ff;
  --hot: #ff4db1;
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  font-family: "Nunito", sans-serif;
  background: var(--yellow);
  color: var(--ink);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--yellow);
  border-bottom: 3px solid var(--line);
  padding: 0.55rem 1rem;
}

.brand {
  margin: 0;
  font-family: "Baloo 2", cursive;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.top-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.top-actions a {
  text-decoration: none;
  color: var(--ink);
  font-family: "Gaegu", cursive;
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0.3rem 0.75rem;
  box-shadow: 3px 3px 0 #000;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.top-actions a.add { background: #9cf6b5; }

.top-actions a:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 #000;
}

.top-actions a:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #000;
}

main {
  width: min(1050px, 96vw);
  margin: 0 auto;
}

.block {
  border: 3px solid var(--line);
  margin-top: 0.85rem;
  padding: 1rem;
  box-shadow: 7px 8px 0 rgba(26, 18, 61, 0.2);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 450ms ease, transform 450ms ease;
}

.block.in-view,
.footer.in-view {
  opacity: 1;
  transform: translateY(0);
}

.block-yellow { background: var(--yellow); }
.block-pink { background: var(--pink); }
.block-mint { background: var(--mint); }
.block-cream { background: var(--cream); }
.block-lilac { background: var(--lilac); }

.pill {
  display: inline-block;
  margin: 0 0 0.5rem;
  padding: 0.2rem 0.9rem;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: #ff4db1;
  color: #fff;
  font-family: "Baloo 2", cursive;
  font-size: 1.2rem;
  letter-spacing: 0.03em;
}

h1, h2, h3 { margin: 0; }

h2 {
  position: relative;
  display: inline-block;
  padding-bottom: 0.25rem;
}

h2::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: color-mix(in oklab, var(--hot), white 10%);
  border-radius: 6px;
  transform: rotate(-1deg);
}

h1 {
  font-family: "Baloo 2", cursive;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 0.95;
  text-transform: uppercase;
  position: relative;
  z-index: 2;
}

.lead {
  max-width: 90%;
  font-family: "Gaegu", cursive;
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  background: #fff;
  border: 3px solid var(--line);
  box-shadow: 6px 6px 0 #000;
  padding: 0.9rem 1rem;
  margin: 1rem 0 1.2rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-btn {
  text-decoration: none;
  color: #000;
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 999px;
  padding: 0.85rem 1.45rem;
  font-family: "Nunito", sans-serif;
  text-transform: uppercase;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 5px 5px 0 #000;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hero-btn.primary {
  background: #fff;
}

.hero-btn.secondary {
  background: #ff90e8;
}

.hero-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 #000;
}

.hero-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

.hero {
  background-color: #ffde59;
  background-image: radial-gradient(#000 1.4px, transparent 1.4px);
  background-size: 20px 20px;
  padding: 2.2rem 1.4rem;
  border-bottom: 4px solid #000;
  overflow: hidden;
  min-height: 64vh;
}

.hero-container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.hero-copy {
  max-width: 760px;
}

.badge-pill {
  display: inline-block;
  background: #000;
  color: #fff;
  font-family: "Nunito", sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  margin-bottom: 0.7rem;
  transform: rotate(-3deg);
}

.hero h1 {
  text-shadow: 3px 3px 0 #fff, 5px 5px 0 #000;
  transform: rotate(-1.4deg);
  margin-bottom: 0.5rem;
}

.hero-visual {
  position: relative;
  height: 390px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.character-placeholder {
  width: 240px;
  height: 240px;
  border: 4px solid #000;
  border-radius: 50%;
  background: #fff;
  box-shadow: 10px 10px 0 #000;
  display: grid;
  place-items: center;
  z-index: 2;
  animation: float 6s ease-in-out infinite;
}

.flowly-face {
  width: 130px;
  height: 130px;
  border: 4px solid var(--line);
  border-radius: 58% 42% 55% 45% / 48% 55% 45% 52%;
  background: radial-gradient(circle at 30% 20%, #eaffea, #96edb0 70%);
  position: relative;
}

.eye {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #111;
  top: 40%;
}

.eye.left { left: 32%; }
.eye.right { right: 28%; }

.mouth {
  position: absolute;
  width: 30px;
  height: 14px;
  border-bottom: 3px solid #111;
  left: 50%;
  top: 56%;
  transform: translateX(-50%);
}

.speech-bubble {
  position: absolute;
  top: 10%;
  right: 8%;
  background: #fff;
  border: 3px solid #000;
  box-shadow: 5px 5px 0 #000;
  border-radius: 20px 20px 20px 0;
  padding: 0.7rem 1rem;
  font-family: "Gaegu", cursive;
  font-size: 1.4rem;
  font-weight: 700;
  transform: rotate(4deg);
  z-index: 3;
}

.floater {
  position: absolute;
  font-size: 2rem;
  animation: wiggle 3s ease-in-out infinite;
}

.floater-1 { top: 20%; left: 10%; transform: rotate(-15deg); }
.floater-2 { bottom: 14%; right: 20%; font-size: 2.4rem; }
.floater-3 { bottom: 31%; left: 0%; transform: rotate(15deg); }

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
  100% { transform: translateY(0); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(10deg); }
}

.steps-grid,
.examples-grid,
.mosaic,
.comic-strip {
  display: grid;
  gap: 0.7rem;
}

.steps-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.steps-grid article {
  border: 3px solid var(--line);
  background: #fff;
  padding: 0.7rem;
}

.steps-grid article:nth-child(1) { transform: rotate(-0.6deg); }
.steps-grid article:nth-child(2) { transform: rotate(0.45deg); }
.steps-grid article:nth-child(3) { transform: rotate(-0.35deg); }

.steps-grid h2 {
  font-family: "Baloo 2", cursive;
  font-size: 2.2rem;
}

.steps-grid h3 {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

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

.mosaic article {
  border: 3px solid var(--line);
  background: #fff;
  min-height: 108px;
  padding: 0.8rem;
  font-size: clamp(1rem, 2vw, 1.4rem);
  font-weight: 800;
  display: grid;
  align-content: center;
}

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

.ticket {
  border: 3px solid var(--line);
  background: #fff;
  padding: 0.8rem;
  transition: transform 140ms ease;
}

.ticket.solved { background: #deffd6; }
.ticket.human { background: #dce8ff; }

.ticket h3 {
  font-family: "Baloo 2", cursive;
  font-size: 1.35rem;
  margin-bottom: 0.4rem;
}

.ticket p {
  margin: 0;
}

.ticket p + p {
  margin-top: 0.36rem;
}

.ticket span {
  display: inline-block;
  margin-top: 0.65rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}

.big-copy {
  max-width: 72ch;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
}

.comic-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.frame {
  border: 3px solid var(--line);
  background: #fff;
  min-height: 90px;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 0.45rem;
  font-family: "Patrick Hand", cursive;
  font-size: 1.12rem;
}

.footer {
  width: min(1050px, 96vw);
  margin: 0.9rem auto 1.2rem;
  border: 3px solid var(--line);
  background: #fff;
  padding: 0.9rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 450ms ease, transform 450ms ease;
}

.footer p {
  margin: 0;
}

.footer a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  margin-right: 0.8rem;
}

.sleepy {
  margin-top: 0.3rem;
  font-family: "Patrick Hand", cursive;
  font-size: 1.12rem;
}

.sparkle {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--line);
  pointer-events: none;
  animation: pop 650ms ease forwards;
}

@keyframes pop {
  0% { opacity: 1; transform: scale(0.5); }
  100% { opacity: 0; transform: translateY(-18px) scale(1.4); }
}

@media (max-width: 900px) {
  .steps-grid,
  .mosaic,
  .examples-grid,
  .comic-strip { grid-template-columns: 1fr; }

  .top-actions a:nth-child(1),
  .top-actions a:nth-child(3) { display: none; }

  .hero {
    min-height: auto;
    padding: 1.4rem 1rem;
  }

  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-copy {
    margin: 0 auto;
  }

  .lead {
    max-width: 100%;
  }

  .hero-cta {
    justify-content: center;
  }

  .hero-visual {
    height: 280px;
  }

  .speech-bubble {
    right: 50%;
    transform: translateX(50%) rotate(2deg);
    top: 4%;
    font-size: 1.2rem;
  }
}
