/* Roo Labs: a goofy, bubbly cartoon lab. Thick navy outlines, hard offset shadows, saturated colours. */

@font-face {
  font-family: 'Luckiest Guy';
  src: url('/assets/fonts/luckiest-guy-latin-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Fredoka';
  src: url('/assets/fonts/fredoka-latin-wght.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #14213d;
  --yellow: #ffd93b;
  --aqua: #3fd0e0;
  --ocean: #1e7fd8;
  --pink: #ff6f91;
  --lime: #8be04e;
  --orange: #ff9a3c;
  --cream: #fff6da;
  --sand: #f6d58e;
  --display: 'Luckiest Guy', 'Comic Sans MS', 'Chalkboard SE', system-ui, sans-serif;
  --body: 'Fredoka', 'Comic Sans MS', 'Chalkboard SE', system-ui, sans-serif;
  --outline: 5px solid var(--ink);
  --shadow: 8px 8px 0 var(--ink);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ocean);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.45;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.35) 0 60px, transparent 61px),
    radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.22) 0 90px, transparent 91px),
    linear-gradient(180deg, #8ef0f5 0%, var(--aqua) 32%, #27a8de 70%, var(--ocean) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

/* --- Rising bubbles (decorative) ----------------------------------------------------- */

.bubbles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.bubbles span {
  position: absolute;
  bottom: -80px;
  width: var(--s, 28px);
  height: var(--s, 28px);
  left: var(--x, 50%);
  border-radius: 50%;
  border: 3px solid rgba(20, 33, 61, 0.55);
  background: radial-gradient(circle at 32% 30%, #fff 0 18%, rgba(255, 255, 255, 0.35) 19% 40%, rgba(255, 255, 255, 0.12) 41%);
  animation: rise var(--t, 14s) linear var(--d, 0s) infinite;
  opacity: 0.85;
}

.bubbles span:nth-child(1) { --x: 4%; --s: 34px; --t: 16s; --d: -2s; }
.bubbles span:nth-child(2) { --x: 12%; --s: 18px; --t: 11s; --d: -7s; }
.bubbles span:nth-child(3) { --x: 21%; --s: 46px; --t: 19s; --d: -12s; }
.bubbles span:nth-child(4) { --x: 30%; --s: 22px; --t: 13s; --d: -4s; }
.bubbles span:nth-child(5) { --x: 39%; --s: 30px; --t: 17s; --d: -9s; }
.bubbles span:nth-child(6) { --x: 48%; --s: 16px; --t: 10s; --d: -1s; }
.bubbles span:nth-child(7) { --x: 57%; --s: 40px; --t: 20s; --d: -15s; }
.bubbles span:nth-child(8) { --x: 65%; --s: 20px; --t: 12s; --d: -6s; }
.bubbles span:nth-child(9) { --x: 73%; --s: 52px; --t: 22s; --d: -3s; }
.bubbles span:nth-child(10) { --x: 81%; --s: 24px; --t: 14s; --d: -10s; }
.bubbles span:nth-child(11) { --x: 88%; --s: 36px; --t: 18s; --d: -13s; }
.bubbles span:nth-child(12) { --x: 95%; --s: 14px; --t: 9s; --d: -5s; }
.bubbles span:nth-child(13) { --x: 52%; --s: 26px; --t: 15s; --d: -11s; }
.bubbles span:nth-child(14) { --x: 17%; --s: 28px; --t: 21s; --d: -17s; }

@keyframes rise {
  0% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(14px, -28vh);
  }
  50% {
    transform: translate(-10px, -56vh);
  }
  75% {
    transform: translate(12px, -84vh);
  }
  100% {
    transform: translate(0, -115vh);
  }
}

/* --- Hero ----------------------------------------------------------------------------- */

.hero,
main,
.seabed {
  position: relative;
  z-index: 1;
}

.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 48px) 20px 10px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
}

.logo {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(64px, 10vw, 128px);
  line-height: 0.92;
  letter-spacing: 0.02em;
  transform: rotate(-4deg);
}

.logo span {
  display: inline-block;
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  text-shadow: 6px 7px 0 var(--ink);
}

.logo-roo {
  color: var(--yellow);
  animation: bob 2.6s ease-in-out infinite;
}

.logo-labs {
  color: var(--pink);
  animation: bob 2.6s ease-in-out -1.3s infinite;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(-8px) rotate(2deg);
  }
}

.tagline {
  position: relative;
  margin: 28px 0 14px;
  padding: 16px 20px;
  background: var(--cream);
  border: var(--outline);
  border-radius: 28px;
  box-shadow: var(--shadow);
  font-size: clamp(19px, 2vw, 23px);
  font-weight: 600;
  transform: rotate(1deg);
}

/* Speech-bubble tail. */
.tagline::after {
  content: '';
  position: absolute;
  right: 22%;
  bottom: -22px;
  width: 30px;
  height: 30px;
  background: var(--cream);
  border-right: var(--outline);
  border-bottom: var(--outline);
  transform: skewX(30deg) rotate(45deg);
}

.hint {
  margin: 26px 0 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.hint b {
  font-family: var(--display);
  font-weight: 400;
  color: var(--yellow);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  font-size: 1.25em;
  letter-spacing: 0.03em;
}

.hero-art {
  margin: 0;
  border: 6px solid var(--ink);
  border-radius: 38px;
  overflow: hidden;
  box-shadow: 10px 10px 0 var(--ink);
  transform: rotate(1.5deg);
  background: var(--aqua);
}

.hero-art img {
  display: block;
  width: 100%;
  height: auto;
}

/* --- Shelf of cards ----------------------------------------------------------------- */

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 20px 40px;
}

.plank {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 30px;
  padding: 12px 26px 8px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: 0.03em;
  color: var(--cream);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 4px 4px 0 var(--ink);
  background:
    repeating-linear-gradient(180deg, transparent 0 18px, rgba(20, 33, 61, 0.25) 18px 21px),
    linear-gradient(180deg, #d98b3a, #b8692a);
  border: var(--outline);
  border-radius: 14px 22px 16px 26px;
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
}

.count {
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  height: 48px;
  padding: 0 8px;
  border-radius: 50%;
  background: var(--yellow);
  border: 4px solid var(--ink);
  color: var(--ink);
  -webkit-text-stroke: 0;
  text-shadow: none;
  font-size: 28px;
  line-height: 1;
  padding-top: 6px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(22px, 3vw, 40px);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--cream);
  border: var(--outline);
  border-radius: 34px;
  box-shadow: var(--shadow);
  transition:
    transform 0.18s cubic-bezier(0.3, 1.6, 0.5, 1),
    box-shadow 0.18s;
}

.card:nth-child(odd) {
  transform: rotate(-1deg);
}

.card:nth-child(even) {
  transform: rotate(1deg);
}

.card:hover,
.card:focus-visible {
  transform: translateY(-6px) rotate(-2deg) scale(1.015);
  box-shadow: 12px 14px 0 var(--ink);
}

.card:nth-child(even):hover,
.card:nth-child(even):focus-visible {
  transform: translateY(-6px) rotate(2deg) scale(1.015);
}

.card:active {
  transform: translateY(2px) scale(0.99);
  box-shadow: 4px 4px 0 var(--ink);
}

.card:focus-visible {
  outline: 5px dashed var(--yellow);
  outline-offset: 6px;
}

.card-art {
  display: block;
  margin: 12px 12px 0;
  border: 4px solid var(--ink);
  border-radius: 24px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--tone);
}

/* Keep the critter dropping in from the top in view. */
.tone-pink .card-art img {
  object-position: center 30%;
}

.card-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.card:hover .card-art img {
  transform: scale(1.06) rotate(-1deg);
}

.tone-blue {
  --tone: var(--ocean);
}
.tone-yellow {
  --tone: var(--yellow);
}
.tone-pink {
  --tone: var(--pink);
}
.tone-lime {
  --tone: var(--lime);
}

.card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px 22px 24px;
  flex: 1;
}

.kind {
  padding: 3px 12px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--tone);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tone-blue .kind {
  color: #fff;
}

.card-title {
  font-family: var(--display);
  font-size: clamp(30px, 3.2vw, 40px);
  line-height: 1;
  letter-spacing: 0.02em;
  margin-top: 4px;
}

.card-text {
  font-size: 18px;
  font-weight: 500;
  flex: 1;
}

.play {
  margin-top: 8px;
  padding: 10px 30px 6px;
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: 0.04em;
  color: #fff;
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  background: var(--pink);
  border: 4px solid var(--ink);
  border-radius: 999px;
  box-shadow: 5px 5px 0 var(--ink);
}

.card:hover .play {
  background: var(--orange);
  animation: wiggle 0.5s ease-in-out;
}

@keyframes wiggle {
  0%,
  100% {
    transform: rotate(0);
  }
  25% {
    transform: rotate(-5deg);
  }
  75% {
    transform: rotate(5deg);
  }
}

/* "New!" starburst, drawn as a star outline behind a star fill. */
.burst {
  position: absolute;
  top: -22px;
  right: -18px;
  z-index: 2;
  width: 104px;
  height: 104px;
  background: var(--ink);
  clip-path: polygon(50% 0%, 61% 14%, 79% 9%, 81% 27%, 98% 35%, 88% 50%, 98% 65%, 81% 73%, 79% 91%, 61% 86%, 50% 100%, 39% 86%, 21% 91%, 19% 73%, 2% 65%, 12% 50%, 2% 35%, 19% 27%, 21% 9%, 39% 14%);
  transform: rotate(12deg);
  animation: pulse 1.4s ease-in-out infinite;
}

.burst span {
  position: absolute;
  inset: 6px;
  display: grid;
  place-items: center;
  background: var(--yellow);
  clip-path: inherit;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.04em;
  padding-top: 4px;
}

@keyframes pulse {
  0%,
  100% {
    transform: rotate(12deg) scale(1);
  }
  50% {
    transform: rotate(4deg) scale(1.08);
  }
}

/* --- Seabed footer ------------------------------------------------------------------- */

.seabed {
  margin-top: 30px;
  padding: 70px 20px calc(40px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-weight: 600;
  background:
    radial-gradient(ellipse 60px 34px at 10% 0, var(--ocean) 98%, transparent 100%),
    radial-gradient(ellipse 80px 40px at 36% 0, var(--ocean) 98%, transparent 100%),
    radial-gradient(ellipse 70px 36px at 63% 0, var(--ocean) 98%, transparent 100%),
    radial-gradient(ellipse 90px 42px at 90% 0, var(--ocean) 98%, transparent 100%),
    radial-gradient(circle at 20% 70%, rgba(20, 33, 61, 0.12) 0 8px, transparent 9px),
    radial-gradient(circle at 70% 55%, rgba(20, 33, 61, 0.12) 0 6px, transparent 7px),
    radial-gradient(circle at 46% 85%, rgba(20, 33, 61, 0.1) 0 10px, transparent 11px),
    var(--sand);
  border-top: var(--outline);
}

.seabed p {
  margin: 0 0 6px;
}

.seabed .small {
  font-size: 15px;
}

/* --- Small screens and motion ------------------------------------------------------------ */

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .tagline {
    margin-left: auto;
    margin-right: auto;
    max-width: 520px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  main {
    text-align: center;
  }
  .card {
    text-align: left;
  }
}

@media (max-width: 420px) {
  body {
    font-size: 17px;
  }
  .logo span {
    -webkit-text-stroke: 3px var(--ink);
    text-shadow: 4px 5px 0 var(--ink);
  }
  .plank {
    font-size: 27px;
    padding: 10px 18px 6px;
  }
  .count {
    min-width: 40px;
    height: 40px;
    font-size: 22px;
  }
  .burst {
    width: 84px;
    height: 84px;
    right: -8px;
  }
  .burst span {
    font-size: 18px;
  }
  .card-body {
    padding: 14px 16px 20px;
  }
}

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