:root {
  --pink: #ff6fb5;
  --pink-soft: #ffd6ec;
  --blue: #5bb8ff;
  --blue-soft: #d5ecff;
  --purple: #9b6bff;
  --yellow: #ffd23f;
  --mint: #7ee0c3;
  --ink: #3b2a5a;
  --card: rgba(255, 255, 255, 0.85);
  --shadow: 0 10px 0 rgba(59, 42, 90, 0.12), 0 18px 40px rgba(155, 107, 255, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Fredoka", "Comic Sans MS", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #ffd6ec 0%, #e6dcff 45%, #d5ecff 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ---------- Sky decorations ---------- */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.sky > * { position: absolute; user-select: none; }

.sun {
  position: absolute; z-index: 2;
  top: 18px; right: 18px;
  font-size: 64px; line-height: 1;
  background: none; border: 0; padding: 0; cursor: pointer;
  animation: spin 20s linear infinite;
  -webkit-tap-highlight-color: transparent;
}
.sun.party { animation: spin 0.6s linear 3; }

.cloud { font-size: 70px; opacity: 0.9; animation: drift linear infinite; }
.c1 { top: 12%; animation-duration: 38s; }
.c2 { top: 42%; font-size: 52px; animation-duration: 52s; animation-delay: -20s; }
.c3 { top: 72%; font-size: 86px; animation-duration: 64s; animation-delay: -40s; }

.twinkle { font-size: 22px; animation: twinkle 2.4s ease-in-out infinite; }
.t1 { top: 20%; left: 8%; }
.t2 { top: 34%; right: 12%; animation-delay: 0.6s; }
.t3 { top: 64%; left: 14%; animation-delay: 1.2s; }
.t4 { top: 84%; right: 8%; animation-delay: 1.8s; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { from { left: -120px; } to { left: 110%; } }
@keyframes twinkle {
  0%, 100% { transform: scale(0.7) rotate(0deg); opacity: 0.5; }
  50% { transform: scale(1.2) rotate(20deg); opacity: 1; }
}

/* ---------- Layout ---------- */
main {
  position: relative; z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.hero { text-align: center; padding: 48px 0 24px; }
.hello { font-size: 1.25rem; margin: 0 0 8px; font-weight: 600; }

h1 {
  font-size: clamp(2.2rem, 8vw, 4rem);
  line-height: 1.15;
  margin: 0 0 12px;
  font-weight: 700;
}
h1 .letter {
  display: inline-block;
  cursor: pointer;
  text-shadow: 3px 3px 0 #fff, 6px 6px 0 rgba(59, 42, 90, 0.15);
  animation: bob 2.6s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}
h1 .word { display: inline-block; white-space: nowrap; }
h1 .letter.jump { animation: jump 0.6s ease-out; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes jump {
  0% { transform: translateY(0) rotate(0) scale(1); }
  40% { transform: translateY(-28px) rotate(-12deg) scale(1.3); }
  100% { transform: translateY(0) rotate(0) scale(1); }
}

.tagline { font-size: 1.15rem; margin: 0 0 20px; }
.hint { opacity: 0.6; font-size: 0.95rem; white-space: nowrap; }

.jump { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.pill {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  box-shadow: 0 5px 0 rgba(59, 42, 90, 0.2);
  transition: transform 0.15s;
}
.pill:hover, .pill:focus-visible { transform: translateY(-3px) rotate(-2deg); }
.pill:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(59, 42, 90, 0.2); }
.pill.pink { background: var(--pink); }
.pill.blue { background: var(--blue); }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  backdrop-filter: blur(6px);
  border: 4px solid #fff;
  border-radius: 32px;
  box-shadow: var(--shadow);
  padding: 24px;
  margin: 28px 0;
  scroll-margin-top: 16px;
}
.card h2 { margin: 0 0 8px; font-size: 1.9rem; text-align: center; }

/* ---------- Game ---------- */
.how { text-align: center; margin: 0 0 14px; line-height: 1.5; }
.only-mouse { display: none; }
@media (hover: hover) and (pointer: fine) {
  .only-touch { display: none; }
  .only-mouse { display: inline; }
}

.hud {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--blue-soft);
  border-radius: 18px;
  padding: 8px 14px;
  margin-bottom: 10px;
  font-size: 1.05rem;
}
.hud b { font-size: 1.3rem; color: var(--purple); }
#lives { letter-spacing: 2px; }
.mute {
  background: #fff; border: 0; border-radius: 50%;
  width: 40px; height: 40px; font-size: 1.2rem; cursor: pointer;
  box-shadow: 0 3px 0 rgba(59, 42, 90, 0.15);
}

.stage {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(180deg, #2b1f5c 0%, #6b4fd1 60%, #ff9ccf 100%);
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
canvas { display: block; width: 100%; touch-action: none; }

.overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(43, 31, 92, 0.45);
  padding: 16px;
}
.overlay.hidden { display: none; }
.overlay-box {
  background: #fff;
  border-radius: 24px;
  padding: 20px 24px;
  text-align: center;
  max-width: 320px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.15);
  animation: pop 0.35s ease-out;
}
.overlay-box p { margin: 0 0 12px; }
.overlay-box .big { font-size: 1.8rem; font-weight: 700; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.play {
  font: inherit; font-size: 1.4rem; font-weight: 700;
  color: #fff;
  background: var(--pink);
  border: 0; border-radius: 999px;
  padding: 12px 32px;
  cursor: pointer;
  box-shadow: 0 6px 0 #d94a92;
  animation: wiggle 1.6s ease-in-out infinite;
}
.play:active { transform: translateY(4px); box-shadow: 0 2px 0 #d94a92; }
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

/* ---------- Projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.project {
  background: #fff;
  border-radius: 24px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 5px 0 rgba(59, 42, 90, 0.1);
}
.project h3 { margin: 8px 0; }
.project p { margin: 0; line-height: 1.5; }
.project-emoji { font-size: 56px; animation: bob 2s ease-in-out infinite; }
.coming-soon {
  border: 4px dashed var(--mint);
  background: repeating-linear-gradient(45deg, #fff, #fff 14px, #f2fffb 14px, #f2fffb 28px);
}

footer {
  position: relative; z-index: 1;
  text-align: center;
  padding: 16px 16px 32px;
  font-size: 1rem;
  opacity: 0.8;
}

/* ---------- Confetti (sun easter egg) ---------- */
.confetti {
  position: fixed; z-index: 10; pointer-events: none;
  font-size: 24px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(720deg); }
}

@media (max-width: 520px) {
  .hero { padding-top: 64px; }
  .card { padding: 18px 12px; border-radius: 26px; }
  .sun { font-size: 48px; }
  .hud { font-size: 0.95rem; padding: 6px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}
