@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/baloo-2-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/atkinson-hyperlegible-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/atkinson-hyperlegible-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --door: #f6f3ec;
  --print: #fffdf8;
  --ink: #3a2e25;
  --ink-soft: #6b5a4c;
  --red: #e2392f;
  --blue: #1f6fd1;
  --yellow: #f4b81e;
  --green: #2e9b4e;
  --orange: #f2762e;
  --purple: #7b4fc9;
  --plastic-shadow: 0 3px 5px rgb(92 58 30 / 0.25);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
  caret-color: var(--red);
  accent-color: var(--blue);
  scrollbar-color: var(--orange) var(--door);
}

::selection {
  background: var(--yellow);
  color: var(--ink);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(100deg, var(--door) 15%, #fbf9f4 42%, var(--door) 70%) var(--door);
  -webkit-tap-highlight-color: transparent;
}

main,
.note {
  max-width: calc(1180px + 2 * var(--pad));
  margin-inline: auto;
  padding-inline: var(--pad);
  --pad: clamp(1.25rem, 4vw, 2.5rem);
}

/* Title: one alphabet magnet per letter. */
.title {
  margin: 0;
  padding-block: clamp(1.25rem, 3.5vw, 2.25rem) clamp(1.5rem, 3.5vw, 2.5rem);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 0.4em;
  font-family: "Baloo 2", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(3rem, 9vw, 6rem);
  line-height: 1;
}

.word {
  display: flex;
  gap: 0.06em;
}

/* Below 768px the words stack (ARDG / ARCADE); at 768px and up they share one line. */
@media (max-width: 767.98px) {
  .word {
    flex-basis: 100%;
    justify-content: center;
  }
}

.letter {
  display: inline-block;
  color: var(--lc);
  rotate: var(--lr);
  translate: 0 var(--ly);
  text-shadow:
    0 -1px 0 rgb(255 255 255 / 0.55),
    var(--plastic-shadow);
  cursor: default;
  user-select: none;
}

.word:first-child .letter:nth-child(1) { --lc: var(--red); --lr: -6deg; --ly: 2px; }
.word:first-child .letter:nth-child(2) { --lc: var(--blue); --lr: 4deg; --ly: -3px; }
.word:first-child .letter:nth-child(3) { --lc: var(--yellow); --lr: -3deg; --ly: 3px; }
.word:first-child .letter:nth-child(4) { --lc: var(--green); --lr: 6deg; --ly: -1px; }
.word:last-child .letter:nth-child(1) { --lc: var(--orange); --lr: 5deg; --ly: -2px; }
.word:last-child .letter:nth-child(2) { --lc: var(--purple); --lr: -4deg; --ly: 3px; }
.word:last-child .letter:nth-child(3) { --lc: var(--red); --lr: 7deg; --ly: 0px; }
.word:last-child .letter:nth-child(4) { --lc: var(--blue); --lr: -5deg; --ly: -3px; }
.word:last-child .letter:nth-child(5) { --lc: var(--green); --lr: 3deg; --ly: 2px; }
.word:last-child .letter:nth-child(6) { --lc: var(--yellow); --lr: -7deg; --ly: -1px; }

.letter.wobble {
  animation: wobble 700ms var(--ease-out);
}

@keyframes wobble {
  0% { transform: rotate(0); }
  18% { transform: rotate(14deg); }
  38% { transform: rotate(-9deg); }
  58% { transform: rotate(5deg); }
  78% { transform: rotate(-2deg); }
  100% { transform: rotate(0); }
}

/* Shaped magnets: flat toy plastic, same highlight and shadow as the letters. */
.magnet {
  display: block;
  width: 3rem;
  height: 3rem;
  color: var(--c);
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linejoin: round;
  filter: drop-shadow(var(--plastic-shadow));
}

.magnet .hl {
  fill: none;
  stroke: #fff;
  stroke-opacity: 0.55;
  stroke-width: 3;
  stroke-linecap: round;
}

/* Prints: one per game. Each game class sets its colour (--c) and fixed tilt (--r). */
.print--stackadia { --c: var(--blue); --r: -2deg; }
.print--thewindshrine { --c: var(--green); --r: 1.5deg; }
.print--mochimamu { --c: var(--red); --r: -1deg; }
.print--click3 { --c: var(--orange); --r: 2deg; }
.print--star5 { --c: var(--yellow); --r: -1.5deg; }
.print--twinkle { --c: var(--purple); --r: 1deg; }

.prints {
  list-style: none;
  margin: 0;
  padding: 1.5rem 0 0;
  display: grid;
  grid-template-columns: minmax(0, 420px);
  justify-content: center;
  gap: 3.5rem clamp(1.5rem, 3.5vw, 2.75rem);
}

@media (min-width: 560px) {
  .prints {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .prints {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.print a {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 10px 10px 0;
  min-height: 3rem;
  background: var(--print);
  color: var(--ink);
  text-decoration: none;
  text-align: center;
  rotate: var(--r);
  box-shadow:
    0 1px 2px rgb(70 45 25 / 0.14),
    0 4px 10px rgb(70 45 25 / 0.1);
  transition:
    rotate 220ms var(--ease-out),
    translate 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out);
}

.print a:focus-visible {
  outline: 4px solid color-mix(in srgb, var(--c) 55%, #3a2e25);
  outline-offset: 6px;
}

.print a:focus-visible,
.print a:hover {
  rotate: 0deg;
  translate: 0 -4px;
  box-shadow:
    0 3px 6px rgb(70 45 25 / 0.12),
    0 16px 30px rgb(70 45 25 / 0.18);
}

.print a:active {
  translate: 0 0;
  box-shadow: 0 1px 2px rgb(70 45 25 / 0.2);
}

.print .magnet {
  position: absolute;
  top: -1.6rem;
  left: 50%;
  translate: -50% 0;
  z-index: 1;
}

.print img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e9e3d8;
}

.name,
.line {
  display: block;
  padding-inline: 0.25rem;
}

.name {
  padding-top: 0.45rem;
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.15;
}

.line {
  min-height: calc(3.5rem - 0.45rem - 1.35rem * 1.15);
  padding-bottom: 0.6rem;
  font-size: 1rem;
  line-height: 1.25;
  color: var(--ink-soft);
}

/* Footer: one lined-paper note under a round magnet. */
.note {
  display: flex;
  justify-content: center;
  padding-block: 4.5rem 3.5rem;
}

.note p {
  position: relative;
  margin: 0;
  padding: 1.75rem 1.5rem;
  rotate: -1.5deg;
  font-size: 1rem;
  line-height: 1.75rem;
  color: var(--ink);
  background:
    repeating-linear-gradient(transparent 0 calc(1.75rem - 1px), rgb(31 111 209 / 0.22) calc(1.75rem - 1px) 1.75rem),
    var(--print);
  box-shadow:
    0 1px 2px rgb(70 45 25 / 0.14),
    0 4px 10px rgb(70 45 25 / 0.1);
}

.note .magnet {
  --c: var(--red);
  position: absolute;
  width: 2.25rem;
  height: 2.25rem;
  margin-top: -1.1rem;
  z-index: 1;
}

/* iPad landscape and up: a door handle and a rubber gasket around the edges. */
@media (min-width: 1024px) {
  main,
  .note {
    --pad: 4.5rem;
  }

  body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    box-shadow:
      inset 0 0 0 3px #e2dbcd,
      inset 0 0 0 4px rgb(255 255 255 / 0.7);
  }

  body::after {
    content: "";
    position: fixed;
    top: 50%;
    right: 1.25rem;
    width: 1.25rem;
    height: min(46vh, 26rem);
    translate: 0 -50%;
    border-radius: 0.625rem;
    pointer-events: none;
    background: linear-gradient(90deg, #ebe6dc, #fdfcf9 40%, #e9e3d7 75%, #ddd6c8);
    box-shadow:
      -3px 5px 10px rgb(70 45 25 / 0.16),
      -1px 1px 2px rgb(70 45 25 / 0.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  .print a {
    transition: none;
  }

  .letter.wobble {
    animation: none;
  }
}
