/* ---------- Sloppy Games — pulled straight from the logo ---------- */
:root {
  --purple: #9333ea;
  --purple-dark: #7e22ce;
  --lime: #84cc16;
  --lime-dark: #65a30d;
  --ink: #1a1a1a;
  --cream: #ffffff;
  --paper: #fffdf6;
  --shadow: rgba(26, 26, 26, 0.18);
  --outline: 3px solid var(--ink);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Fredoka', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 500;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.5;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: 'Baloo 2', 'Fredoka', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

a { color: var(--purple-dark); }

/* ---------- Background blobs (subtle sloppy splats) ---------- */
.bg-blobs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.blob {
  position: absolute;
  display: block;
  width: 380px;
  height: 380px;
  border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
  filter: blur(2px);
  opacity: 0.22;
}
.blob--purple { background: var(--purple); top: -100px; left: -120px; }
.blob--lime   { background: var(--lime);   bottom: -120px; right: -100px; width: 460px; height: 460px; }
.blob--small  { width: 220px; height: 220px; top: 40%; right: 8%; opacity: 0.12; }

/* ---------- Header ---------- */
.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.logo-link { display: inline-flex; }
.logo-img {
  height: 64px;
  width: auto;
  display: block;
  filter: drop-shadow(0 4px 0 var(--shadow));
  transition: transform 0.2s ease;
}
.logo-link:hover .logo-img { transform: rotate(-3deg) scale(1.05); }

.site-nav {
  display: flex;
  gap: 0.5rem;
}
.site-nav a {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--ink);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
.site-nav a:hover { background: var(--ink); color: var(--cream); }

/* ---------- Hero ---------- */
main { position: relative; z-index: 1; }
.hero {
  max-width: 900px;
  margin: 2rem auto 4rem;
  padding: 2rem 1.5rem 0;
  text-align: center;
}
.hero-logo {
  width: min(360px, 70vw);
  height: auto;
  filter: drop-shadow(0 8px 0 var(--shadow));
  animation: wiggle 5s ease-in-out infinite;
}
@keyframes wiggle {
  0%, 100% { transform: rotate(-2deg); }
  50%      { transform: rotate(2deg); }
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  margin-top: 1.5rem;
  line-height: 1.15;
}
.hero-title .accent {
  background: var(--lime);
  color: var(--ink);
  padding: 0 0.4rem;
  border-radius: 12px;
  box-shadow: 4px 4px 0 var(--ink);
  display: inline-block;
  transform: rotate(-1deg);
}
.hero-sub {
  max-width: 580px;
  margin: 0.5rem auto 2rem;
  font-size: 1.15rem;
  color: #3a3a3a;
}
.hero-cta {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: var(--outline);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  cursor: pointer;
}
.btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--ink);
}
.btn--primary {
  background: var(--lime);
  color: var(--ink);
}
.btn--primary:hover { background: var(--lime-dark); color: var(--cream); }
.btn--ghost {
  background: var(--paper);
  color: var(--ink);
}
.btn--ghost:hover { background: var(--purple); color: var(--cream); }

/* ---------- Sections ---------- */
section {
  scroll-margin-top: 1rem;
}
.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  text-align: center;
}
.section-sub {
  text-align: center;
  margin: -0.25rem auto 2rem;
  max-width: 560px;
  color: #4a4a4a;
}

/* ---------- Games grid ---------- */
.games {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.game-card {
  background: var(--paper);
  border: var(--outline);
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.game-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--ink);
}
.game-card h3 {
  font-size: 1.4rem;
  margin: 0.5rem 0 0;
}
.game-card p {
  margin: 0;
  color: #444;
}
.game-thumb {
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  border: var(--outline);
  display: grid;
  place-items: center;
  font-size: 3.5rem;
}
.game-thumb--1 { background: linear-gradient(135deg, var(--purple), #c084fc); }
.game-thumb--2 { background: linear-gradient(135deg, var(--lime), #bef264); }
.game-thumb--3 { background: linear-gradient(135deg, var(--purple), var(--lime)); }
.thumb-emoji { filter: drop-shadow(0 3px 0 rgba(0,0,0,0.25)); }

/* Live game card — clickable link, no underline */
a.game-card { text-decoration: none; color: inherit; }
a.game-card:hover h3 { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }

/* Memory game thumbnail — mini 2×2 board */
.game-thumb--memory {
  background: #fff;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  place-items: stretch;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.memory-pad {
  display: block;
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  animation: memoryBlink 3.6s infinite ease-in-out;
}
.memory-pad--purple { background: #d8b4fe; border-radius: 50% 14px 14px 14px; animation-delay: 0s; }
.memory-pad--lime   { background: #d9f99d; border-radius: 14px 50% 14px 14px; animation-delay: 0.9s; }
.memory-pad--pink   { background: #fbcfe8; border-radius: 14px 14px 14px 50%; animation-delay: 2.7s; }
.memory-pad--cyan   { background: #a5f3fc; border-radius: 14px 14px 50% 14px; animation-delay: 1.8s; }
@keyframes memoryBlink {
  0%, 90%, 100% { filter: brightness(0.78) saturate(0.7); }
  5%, 12%       { filter: brightness(1.1) saturate(1.3); }
}

.badge--play {
  background: var(--lime);
  color: var(--ink);
}

/* Whack-a-Splat thumbnail — grass field with holes and a popping splat */
.game-thumb--whack {
  background: linear-gradient(180deg, #d9f99d 0%, #bef264 45%, #84cc16 100%);
  position: relative;
  overflow: hidden;
}
.whack-hole {
  position: absolute;
  width: 28%;
  height: 22%;
  bottom: 18%;
  background: radial-gradient(ellipse 60% 80% at 50% 100%, #3a230f 0%, #5b3a1f 60%, transparent 62%);
  border-radius: 50%;
}
.whack-hole::before {
  content: '';
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 14%;
  height: 50%;
  background: radial-gradient(ellipse at center, #0a0a0a 0%, #1a1a1a 60%, transparent 75%);
  border-radius: 50%;
}
.whack-hole--1 { left: 8%; }
.whack-hole--2 { left: 36%; }
.whack-hole--3 { left: 64%; }

.whack-splat {
  position: absolute;
  width: 26%;
  height: auto;
  left: 37%;
  bottom: 30%;
  filter: drop-shadow(0 4px 0 rgba(0,0,0,0.25));
  animation: whackBob 1.4s ease-in-out infinite;
}
.whack-splat svg { width: 100%; height: 100%; display: block; }
@keyframes whackBob {
  0%, 100% { transform: translateY(8%); }
  40%, 60% { transform: translateY(-10%); }
}

/* Sloppy Snake thumbnail — head + body chasing a splat */
.game-thumb--snake {
  background: linear-gradient(180deg, #d9f99d 0%, #bef264 60%, #84cc16 100%);
  position: relative;
  overflow: hidden;
}
.snake-body {
  position: absolute;
  width: 16%;
  aspect-ratio: 1;
  background: #9333ea;
  border: 3px solid var(--ink);
  border-radius: 25%;
  box-shadow: 0 3px 0 var(--ink);
  bottom: 38%;
}
.snake-body--1 { left: 14%; }
.snake-body--2 { left: 32%; }
.snake-body--3 { left: 50%; }
.snake-head {
  position: absolute;
  width: 19%;
  aspect-ratio: 1;
  bottom: 36%;
  left: 67%;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,0.2));
  animation: snakeWobble 1.6s ease-in-out infinite;
}
.snake-head svg { width: 100%; height: 100%; display: block; }
@keyframes snakeWobble {
  0%, 100% { transform: translateY(0) rotate(0); }
  50%      { transform: translateY(-6%) rotate(3deg); }
}
.snake-food {
  position: absolute;
  width: 17%;
  bottom: 18%;
  right: 8%;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,0.2));
  animation: snakeFood 1.6s ease-in-out infinite;
}
.snake-food svg { width: 100%; height: 100%; display: block; }
@keyframes snakeFood {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.1); }
}

/* Splat Flap thumbnail — splat between two slime towers */
.game-thumb--flap {
  background: linear-gradient(180deg, #93c5fd 0%, #bfdbfe 60%, #dbeafe 100%);
  position: relative;
  overflow: hidden;
}
.flap-tower {
  position: absolute;
  width: 22%;
  background: linear-gradient(90deg, #7e22ce 0%, #a855f7 50%, #7e22ce 100%);
  border: 3px solid var(--ink);
  right: 16%;
}
.flap-tower--top {
  top: -4%;
  height: 38%;
  border-radius: 0 0 14px 14px;
  box-shadow: 0 4px 0 var(--ink);
}
.flap-tower--bottom {
  bottom: -4%;
  height: 38%;
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -2px 0 var(--ink);
}
.flap-splat {
  position: absolute;
  width: 22%;
  left: 22%;
  top: 38%;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,0.25));
  animation: flapBob 1.4s ease-in-out infinite;
}
.flap-splat svg { width: 100%; height: 100%; display: block; }
@keyframes flapBob {
  0%, 100% { transform: translateY(0) rotate(8deg); }
  50%      { transform: translateY(-18%) rotate(-12deg); }
}

/* Maths Sprint thumbnail — question above two racing splats with finish flag */
.game-thumb--maths {
  background: linear-gradient(180deg, #93c5fd 0%, #bfdbfe 50%, #a3e635 78%, #65a30d 100%);
  position: relative;
  overflow: hidden;
}
.maths-question {
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--ink);
  background: rgba(255,255,255,0.9);
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 0.2rem 0.7rem;
  box-shadow: 3px 3px 0 var(--ink);
}
.maths-splat {
  position: absolute;
  width: 22%;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,0.25));
}
.maths-splat svg { width: 100%; height: 100%; display: block; }
.maths-splat--player {
  left: 18%;
  bottom: 12%;
  animation: mathsHop 0.6s ease-in-out infinite;
}
.maths-splat--bot {
  left: 38%;
  bottom: 14%;
  animation: mathsHop 0.6s ease-in-out infinite 0.3s;
}
@keyframes mathsHop {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50%      { transform: translateY(-12%) scaleY(1.08); }
}
.maths-flag {
  position: absolute;
  right: 12%;
  bottom: 8%;
  width: 4px;
  height: 38%;
  background: var(--ink);
}
/* Sloppy Paint thumbnail — a paint canvas with brush strokes and stamps */
.game-thumb--paint {
  background: #fff;
  position: relative;
  overflow: hidden;
}
.paint-canvas {
  position: absolute;
  inset: 8px;
  background: #fff;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  overflow: hidden;
}
.paint-stroke {
  position: absolute;
  border-radius: 999px;
  transform-origin: left center;
}
.paint-stroke--1 {
  background: #84cc16;
  width: 70%;
  height: 12%;
  top: 22%;
  left: 8%;
  transform: rotate(-8deg);
  box-shadow: 1px 2px 0 var(--ink);
}
.paint-stroke--2 {
  background: #06b6d4;
  width: 60%;
  height: 10%;
  top: 48%;
  left: 28%;
  transform: rotate(6deg);
  box-shadow: 1px 2px 0 var(--ink);
}
.paint-stamp {
  position: absolute;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.15));
}
.paint-stamp svg { width: 100%; height: 100%; display: block; }
.paint-stamp--star  { width: 22%; top: 8%;  right: 8%; }
.paint-stamp--heart { width: 22%; bottom: 10%; left: 12%; }
.paint-stamp--splat { width: 30%; bottom: 6%; right: 6%; }

.maths-flag::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 0;
  width: 28px;
  height: 18px;
  background:
    repeating-conic-gradient(#1a1a1a 0 25%, #ffffff 0 50%) 50% 50% / 14px 9px;
  border: 2px solid var(--ink);
}

.badge {
  align-self: flex-start;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--ink);
  color: var(--cream);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-top: 0.5rem;
}

/* ---------- About ---------- */
.about {
  padding: 3rem 1.5rem 4rem;
  max-width: 800px;
  margin: 0 auto;
}
.about-card {
  background: var(--paper);
  border: var(--outline);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 8px 8px 0 var(--ink);
}
.about-card p { font-size: 1.1rem; }
.about-signoff {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  text-align: right;
  margin-top: 1.5rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--cream);
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 2rem;
  position: relative;
  z-index: 2;
}
.footer-logo {
  height: 56px;
  width: auto;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.4));
}
.site-footer p { margin: 0; font-size: 0.95rem; opacity: 0.85; }

/* ---------- Small screens ---------- */
@media (max-width: 540px) {
  .logo-img { height: 48px; }
  .site-nav a { padding: 0.4rem 0.7rem; font-size: 0.95rem; }
  .game-card { box-shadow: 4px 4px 0 var(--ink); }
  .about-card { padding: 1.5rem; box-shadow: 5px 5px 0 var(--ink); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-logo { animation: none; }
  * { transition: none !important; }
}
