@font-face {
  font-family: "Fredoka";
  src: url("assets/fonts/Fredoka.ttf") format("truetype");
  font-weight: 300 700;
  font-stretch: 75% 125%;
  font-display: swap;
}

:root {
  /* Midnight colorway, from Figma "08 D icon colors" */
  --ink: #4a4170;
  --ink-dark: #2a2444;
  --lilac: #bdb4da;
  --card: #e9e5f4;
  --bg: #ffffff;
  --font: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
}

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

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

main { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* ───── hero ───── */
.hero {
  min-height: 92vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 48px 0 32px;
}

.mark-wrap {
  background: none; border: 0; padding: 0; cursor: pointer;
  width: min(360px, 74vw);
  -webkit-tap-highlight-color: transparent;
}
.mark-wrap:focus-visible { outline: 3px solid var(--lilac); outline-offset: 8px; border-radius: 24px; }
.mark { width: 100%; height: auto; display: block; overflow: visible; }
.mark g, .mark path { transform-box: fill-box; }

.wordmark {
  margin-top: 28px;
  display: flex; flex-direction: column; align-items: center;
  font-weight: 700;
  line-height: 1;
}
.w-main { font-size: clamp(3rem, 10vw, 5.25rem); letter-spacing: .005em; }
.w-sub {
  font-size: clamp(1rem, 2.6vw, 1.35rem);
  font-weight: 600;
  letter-spacing: .55em;
  padding-left: .55em; /* balance trailing tracking */
  margin-top: .7em;
}

.slogan {
  margin-top: 28px;
  font-size: clamp(1.1rem, 2.8vw, 1.4rem);
  font-weight: 400;
  color: var(--ink);
  opacity: .85;
}

/* ───── sections ───── */
.label {
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink);
  opacity: .7;
  margin-bottom: 28px;
}

.games { padding: 56px 0 24px; }
.game-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

.game {
  display: flex; flex-direction: column;
  background: var(--card);
  border-radius: 32px;
  overflow: hidden;
  text-decoration: none;
  transition: transform .25s var(--ease-pop), box-shadow .25s;
}
.game:hover, .game:focus-visible { transform: translateY(-4px); box-shadow: 0 14px 0 -6px var(--lilac); }
.game:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.game-art { aspect-ratio: 2 / 1; overflow: hidden; }
.game-art img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.game:hover .game-art img { transform: scale(1.03); }
.game-body { padding: 22px 28px 26px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.game h3 { font-size: 1.6rem; font-weight: 700; line-height: 1.15; }
.game p { font-size: 1rem; color: var(--ink-dark); opacity: .8; flex: 1; }
.go { margin-top: 10px; font-weight: 600; font-size: .95rem; }

.links { padding: 72px 0 40px; text-align: center; }
.pill-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.pill-row + .pill-row { margin-top: 12px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: background .2s, transform .2s var(--ease-pop);
}
.pill:hover, .pill:focus-visible { background: var(--ink-dark); transform: translateY(-2px); }
.pill:focus-visible { outline: 3px solid var(--lilac); outline-offset: 3px; }
.pill.ghost { background: var(--card); color: var(--ink); }
.pill.ghost:hover, .pill.ghost:focus-visible { background: var(--lilac); }

.foot { text-align: center; padding: 32px 24px 40px; font-size: .85rem; opacity: .6; }

/* ───── intro animation ───── */
.intro .m-d { animation: d-in .7s var(--ease-pop) both; transform-origin: 50% 60%; }
.intro .m-ears, .intro .m-ears-inner, .intro .m-brow-line, .intro .m-head, .intro .m-eyes {
  animation: peek .55s cubic-bezier(.2, .8, .3, 1) .45s both;
}
.intro .m-paws { animation: plop .45s var(--ease-pop) .85s both; }
.intro .wordmark .w-main { animation: rise .6s cubic-bezier(.2, .8, .3, 1) 1.05s both; }
.intro .wordmark .w-sub { animation: rise .6s cubic-bezier(.2, .8, .3, 1) 1.2s both; }
.intro .slogan { animation: rise .6s cubic-bezier(.2, .8, .3, 1) 1.4s both; }
.intro .games, .intro .links, .intro .foot { animation: fade .8s ease 1.7s both; }

@keyframes d-in { from { opacity: 0; transform: scale(.55) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes peek { from { opacity: 0; transform: translateY(34px); } to { opacity: 1; transform: none; } }
@keyframes plop { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* idle: Zs drift up and fade, on a loop */
.m-z-small, .m-z-big { opacity: 0; animation: z-float 3.2s ease-in-out infinite; }
.m-z-small { animation-delay: 1.3s; }
.m-z-big { animation-delay: 1.9s; }
@keyframes z-float {
  0% { opacity: 0; transform: translate(6px, 8px) scale(.8); }
  25% { opacity: 1; transform: none; }
  70% { opacity: 1; transform: translate(-4px, -10px); }
  100% { opacity: 0; transform: translate(-8px, -18px) scale(.9); }
}

/* poke: the dormouse jolts awake for a moment */
.poked .m-ears, .poked .m-ears-inner, .poked .m-brow-line, .poked .m-head, .poked .m-eyes, .poked .m-paws {
  animation: jolt .5s var(--ease-pop) both;
}
.poked .m-z-small, .poked .m-z-big { animation: none; opacity: 0; }
.poked .m-eyelid, .poked .m-eyelid-2 { opacity: 0; transition: opacity .1s; }
@keyframes jolt { 0% { transform: none; } 35% { transform: translateY(-16px); } 100% { transform: none; } }

@media (max-width: 720px) {
  .game-grid { grid-template-columns: 1fr; }
  .hero { min-height: 86vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .m-z-small, .m-z-big { opacity: 1; }
}
