/* Teddy Arcade: the maze at night.
   The game's own colors (midnight navy, maze-wall indigo, teal for play, gold for
   math scrolls, zombie lime) staged like a game's title screen: the maze rises out of
   the dark, the bears arrive, and then everything quietly idles. Fredoka only.
   No scripts: all motion is CSS, and every element is fully visible without it. */

:root {
  --night: #0d1333;       /* page background, a touch bluer than the game's #0B1026 */
  --night-2: #151d4d;
  --wall: #2b3990;        /* maze walls */
  --wall-top: #5b6cf0;
  --teal: #2ee6d6;        /* play color */
  --teal-deep: #0f9f93;
  --gold: #ffd23f;        /* math scrolls */
  --lime: #c8ff6a;        /* zombie glow */
  --honey: #e0913f;
  --text: #f4f5ff;
  --muted: #b9c1ec;
  --line: rgba(124, 140, 255, 0.22);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--text);
  background: radial-gradient(90% 420px at 50% -120px, #1d2766, transparent), var(--night);
  background-repeat: no-repeat;
  min-height: 100vh;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; border-radius: 8px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 20;
  padding: 0.6rem 1rem; border-radius: 12px; background: var(--gold); color: var(--night);
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 1rem; }

main, .top, .bottom { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }

/* ---------------------------------------------------------------- header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.5rem 0 0;
  position: relative; z-index: 5;
}
.home .top { position: absolute; left: 0; right: 0; }
.logo {
  display: inline-flex; align-items: center; gap: 0.65rem;
  text-decoration: none; font-weight: 700; font-size: 1.4rem; letter-spacing: 0.005em;
}
.logo img { width: 40px; height: 40px; }
.top-link {
  font-weight: 500; font-size: 1rem; color: var(--muted);
  text-decoration: none; padding: 0.4rem 0.2rem;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.top-link:hover { color: var(--text); border-color: var(--teal); }

/* ---------------------------------------------------------------- hero */
.home main { width: auto; }
.hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(660px, 100svh, 1040px);
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(5.5rem, 13vh, 8.5rem) 1.25rem 0;
  overflow: clip;
  background:
    radial-gradient(70% 55% at 50% 100%, rgba(46, 230, 214, 0.16), transparent 70%),
    radial-gradient(60% 50% at 50% 0%, #1d2766, transparent 75%),
    var(--night);
}

/* the bottom of the stage melts into the page */
.hero::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  height: 16%;
  background: linear-gradient(180deg, rgba(13, 19, 51, 0), var(--night));
  pointer-events: none;
}

/* sky: two star fields twinkling out of step, and a soft moon */
.sky { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.stars { position: absolute; inset: 0; }
.stars-a {
  background-image:
    radial-gradient(1.6px 1.6px at 12% 18%, #fff 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 27% 8%, #fff 50%, transparent 52%),
    radial-gradient(2px 2px at 41% 26%, #fff7d1 50%, transparent 52%),
    radial-gradient(1.3px 1.3px at 63% 12%, #fff 50%, transparent 52%),
    radial-gradient(1.8px 1.8px at 77% 30%, #d9fffb 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 91% 9%, #fff 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 6% 44%, #fff 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 96% 46%, #fff 50%, transparent 52%);
}
.stars-b {
  background-image:
    radial-gradient(1.2px 1.2px at 19% 33%, #fff 50%, transparent 52%),
    radial-gradient(1.8px 1.8px at 34% 15%, #d9fffb 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 55% 5%, #fff 50%, transparent 52%),
    radial-gradient(1.6px 1.6px at 70% 21%, #fff7d1 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 85% 38%, #fff 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 3% 25%, #fff 50%, transparent 52%);
}
.moon { /* a storybook crescent */
  position: absolute; top: 12%; right: 24%;
  width: clamp(40px, 4.2vw, 60px); aspect-ratio: 1; border-radius: 50%;
  box-shadow: inset -0.36em 0.2em 0 0.04em #ffe7a0;
  font-size: clamp(40px, 4.2vw, 60px);
  transform: rotate(-18deg);
  filter: drop-shadow(0 0 14px rgba(255, 222, 130, 0.45));
}

.hero-copy {
  position: relative; z-index: 3;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  max-width: 44rem;
}
.hero-copy::before {
  content: '';
  position: absolute; z-index: -1;
  inset: 6% -16% -22%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(13, 19, 51, 0.95), rgba(13, 19, 51, 0.8) 55%, transparent);
}

/* the title: chunky toy letters with an indigo extrusion, like maze walls */
.title {
  margin: 0;
  font-weight: 700;
  font-size: clamp(3.3rem, min(10.4vw, 13.2vh), 8rem);
  line-height: 0.9;
  letter-spacing: -0.015em;
  color: #fffaf0;
}
.word { display: inline-block; white-space: nowrap; margin: 0 0.12em; }
.word-3 { display: block; }
@media (min-width: 761px) { .word { display: block; } }
.word span {
  display: inline-block;
  text-shadow:
    0 0.012em 0 #8e9bff, 0 0.03em 0 #4f5fe0, 0 0.045em 0 #4757d4, 0 0.06em 0 #3f4ec6,
    0 0.075em 0 #3846b8, 0 0.09em 0 #313fa8, 0 0.105em 0 #2b3990,
    0 0.16em 0.12em rgba(4, 7, 28, 0.55);
}
.lede {
  margin: 1.6rem 0 0;
  max-width: 33rem;
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.5;
  color: var(--muted);
}
.cta { margin-top: 2rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.cta-note { margin: 0; font-size: 0.98rem; color: var(--muted); max-width: 30rem; }

/* the Play button: an arcade key that sits on its own teal base */
.play {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 15rem;
  padding: 1.05rem 2.8rem 1.1rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #6ff5ea, var(--teal) 55%, #22d3c4);
  color: #071a33;
  font-weight: 700;
  font-size: clamp(1.4rem, 2.2vw, 1.7rem);
  line-height: 1;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    0 8px 0 var(--teal-deep),
    0 22px 44px -12px rgba(46, 230, 214, 0.75);
  transition: transform 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out);
}
.play span { position: relative; z-index: 1; }
/* a slow light ring that breathes outward */
.play::after {
  content: '';
  position: absolute; inset: -2px;
  border-radius: inherit;
  border: 3px solid rgba(46, 230, 214, 0.7);
  opacity: 0;
  pointer-events: none;
}
/* the shine that sweeps across the key now and then */
.play::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.75) 50%, transparent 65%) no-repeat;
  background-size: 250% 100%;
  background-position: 150% 0;
  pointer-events: none;
}
.play:hover {
  transform: translateY(-3px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55), 0 11px 0 var(--teal-deep), 0 28px 50px -12px rgba(46, 230, 214, 0.85);
}
.play:active {
  transform: translateY(6px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), 0 2px 0 var(--teal-deep), 0 10px 24px -12px rgba(46, 230, 214, 0.6);
  transition-duration: 0.05s;
}
.play:focus-visible { outline: 4px solid var(--gold); outline-offset: 7px; border-radius: 999px; }

/* ---------------------------------------------------------------- the stage */
.stage {
  position: absolute; inset: 0;
  z-index: 1;
  pointer-events: none;
}
/* the far side of the maze fades into the night (a mask, so the stars stay visible) */
.floor-wrap {
  position: absolute; inset: 0;
  perspective: 1100px;
  perspective-origin: 50% 20%;
  -webkit-mask-image: linear-gradient(180deg, transparent 38%, #000 78%);
  mask-image: linear-gradient(180deg, transparent 38%, #000 78%);
}
.floor {
  position: absolute;
  left: 50%; bottom: -27%;
  width: max(1500px, 118vw);
  aspect-ratio: 960 / 660;
  margin-left: calc(max(1500px, 118vw) / -2);
  transform-style: preserve-3d;
  transform: rotateX(64deg);
  transform-origin: 50% 100%;
}
.floor::before { /* the ground: a pool of teal light under the bears */
  content: '';
  position: absolute; inset: -10%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(46, 230, 214, 0.22), rgba(91, 108, 240, 0.12) 55%, transparent);
}
.maze { position: absolute; inset: 0; transform-style: preserve-3d; }
.maze-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.l1 { transform: translateZ(0); opacity: 0.85; }
.l2 { transform: translateZ(7px); }
.l3 { transform: translateZ(14px); }
.l4 { transform: translateZ(21px); }
.l5 { transform: translateZ(28px); }
.l6 { transform: translateZ(34px); }

/* bears: outer box = place (and scroll parallax), .pop = entrance, img = idle motion */
.bear { position: absolute; z-index: 2; }
.bear .pop { position: relative; height: 100%; }
.bear img { height: 100%; width: auto; position: relative; z-index: 1; }
.bear .pop::after { /* contact shadow */
  content: '';
  position: absolute; left: 18%; right: 18%; bottom: -3%;
  height: 9%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(3, 6, 25, 0.7), transparent);
}
.bear-teddy { left: max(2vw, calc(50% - 680px)); bottom: 7%; height: clamp(230px, 42vh, 400px); }
.bear-zombie { right: max(2.5vw, calc(50% - 690px)); bottom: 5%; height: clamp(240px, 44vh, 420px); }
.bear-pink { right: max(15vw, calc(50% - 520px)); bottom: 47%; height: clamp(140px, 23vh, 220px); z-index: 1; }
.bear-pink .pop::after { bottom: -34%; left: 26%; right: 26%; opacity: 0.6; }

.aura { /* the zombie's green glow, as in the game */
  position: absolute; inset: -6% -12% 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(200, 255, 106, 0.5), rgba(141, 255, 63, 0.16) 55%, transparent);
  filter: blur(6px);
  opacity: 0.8;
}

/* math scrolls: gold paper with rolled ends */
.scroll {
  position: absolute; z-index: 2;
  font-size: clamp(0.9rem, 1.35vw, 1.2rem);
}
.scroll span {
  position: relative;
  display: block;
  padding: 0.5em 1.1em;
  border-radius: 0.3em;
  background: linear-gradient(180deg, #fff1b8, var(--gold) 45%, #f2b81f);
  color: #5a3a06;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 0 0 2px rgba(255, 244, 200, 0.4), 0 12px 30px -6px rgba(255, 210, 63, 0.55);
}
.scroll span::before, .scroll span::after {
  content: '';
  position: absolute; top: -0.22em; bottom: -0.22em; width: 0.6em;
  border-radius: 0.3em;
  background: linear-gradient(90deg, #d8961a, #ffe38a 45%, #c98612);
}
.scroll span::before { left: -0.35em; }
.scroll span::after { right: -0.35em; }
.s1 { left: max(8vw, calc(50% - 560px)); top: 30%; transform: rotate(-9deg); }
.s2 { right: max(6vw, calc(50% - 600px)); top: 17%; transform: rotate(8deg); }
.s3 { right: max(25vw, calc(50% - 390px)); bottom: 11%; transform: rotate(-5deg); }

/* ---------------------------------------------------------------- coming soon */
.soon {
  width: min(1120px, 100% - 2.5rem);
  margin: clamp(1.5rem, 4vw, 3rem) auto 0;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 4.5rem);
}
.soon-art {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 380px;
  width: 100%;
  justify-self: center;
  border-radius: 50%;
  background: radial-gradient(closest-side at 50% 88%, rgba(46, 230, 214, 0.2), rgba(46, 230, 214, 0.04) 70%, transparent);
}
.spot { /* a spotlight cone from above */
  position: absolute; left: 22%; right: 22%; top: -14%; bottom: 6%;
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgba(127, 245, 234, 0), rgba(127, 245, 234, 0.16) 60%, rgba(127, 245, 234, 0.26));
  filter: blur(3px);
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent);
  mask-image: linear-gradient(180deg, #000 70%, transparent);
}
.soon-art img {
  position: absolute; left: 0; right: 0; bottom: 9%;
  height: 78%; width: auto;
  margin-inline: auto;
  filter: brightness(0) drop-shadow(0 0 1.5px #7ff5ea) drop-shadow(0 0 18px rgba(127, 245, 234, 0.45));
}
.soon-art::after { /* floor ring under the bear */
  content: '';
  position: absolute; left: 26%; right: 26%; bottom: 6%; height: 7%;
  border-radius: 50%;
  border: 2px solid rgba(127, 245, 234, 0.35);
  background: radial-gradient(closest-side, rgba(127, 245, 234, 0.25), transparent);
}
.soon h2 {
  margin: 0 0 0.6rem;
  font-weight: 700;
  font-size: clamp(2rem, 4.4vw, 3.3rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.soon p { margin: 0; max-width: 30rem; font-size: 1.2rem; color: var(--muted); }

/* ---------------------------------------------------------------- grown-ups */
.grownups {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
  margin-top: clamp(3.5rem, 7vw, 5.5rem);
  padding-top: 2.4rem;
  border-top: 1px solid var(--line);
}
.grownups h2 { margin: 0 0 1.6rem; font-size: 1.6rem; font-weight: 600; }
.grownups dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.6rem 2.6rem;
}
.grownups dt { font-weight: 600; margin-bottom: 0.3rem; }
.grownups dd { margin: 0; color: var(--muted); font-size: 1.05rem; }
.grownups a, .lost p a { color: var(--teal); text-underline-offset: 3px; }

/* ---------------------------------------------------------------- footer */
.bottom { padding: 4rem 0 2.75rem; font-size: 0.95rem; color: var(--muted); }
.bottom p { margin: 0; }
.legal-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin-bottom: 0.9rem; }
.legal-links a { color: var(--text); text-underline-offset: 3px; }
.legal-links a:hover { color: var(--teal); }
.legal-links a[aria-current="page"] { text-decoration: none; color: var(--teal); }
.bottom .notice { max-width: 46rem; margin: 0 0 0.6rem; font-size: 0.9rem; }

/* ---------------------------------------------------------------- 404 */
.lost {
  min-height: 62vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 3rem 0 0;
}
.lost img { height: clamp(170px, 28vh, 240px); width: auto; filter: drop-shadow(0 18px 18px rgba(3, 6, 25, 0.6)); }
.lost h1 { margin: 1.4rem 0 0.5rem; font-weight: 700; font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.05; }
.lost .play { font-size: 1.3rem; padding-inline: 2rem; }
.lost p { margin: 0 0 2.2rem; max-width: 30rem; color: var(--muted); }

/* ---------------------------------------------------------------- legal pages */
.legal { max-width: 46rem; padding: 2.5rem 0 1rem; font-size: 1.05rem; }
.legal h1 { margin: 0 0 0.9rem; font-weight: 700; font-size: clamp(2.1rem, 4.6vw, 3rem); line-height: 1.05; }
.legal .effective { margin: 0 0 1.5rem; color: var(--muted); }
.legal .lede { font-size: 1.2rem; padding: 1.1rem 1.3rem; border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 14px; background: var(--night-2); }
.legal h2 { margin: 2.2rem 0 0.6rem; font-size: 1.35rem; font-weight: 600; }
.legal p, .legal li { max-width: 44rem; }
.legal ul { padding-left: 1.3rem; }
.legal li { margin: 0.35rem 0; }
.legal a { color: var(--teal); text-underline-offset: 3px; }
.legal .caps { font-size: 0.95rem; letter-spacing: 0.01em; }
.legal table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.98rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--line); }
.legal th { font-weight: 600; }
.legal code { font-family: ui-monospace, Consolas, monospace; font-size: 0.92em; }
@media (max-width: 640px) {
  .legal table, .legal thead, .legal tbody, .legal tr, .legal th, .legal td { display: block; }
  .legal thead { display: none; }
  .legal td { border: 0; padding: 0.15rem 0; }
  .legal tr { padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
  .legal td:first-child { font-weight: 600; }
}

/* ---------------------------------------------------------------- smaller screens */
@media (max-width: 1100px) {
  .bear-pink { right: 6vw; bottom: 50%; }
  .s1 { left: 5vw; top: 24%; }
  .s2 { right: 6vw; top: 22%; }
}
@media (max-width: 860px) {
  .grownups dl { grid-template-columns: 1fr; max-width: 38rem; }
}
/* phones and small tablets: the bears step out from beside the title and line up below it */
@media (max-width: 760px) {
  .top-link { font-size: 0.95rem; }
  .logo { font-size: 1.2rem; }
  .logo img { width: 34px; height: 34px; }
  .hero { min-height: 0; padding-top: 6rem; }
  .stage {
    position: relative; inset: auto;
    width: calc(100% + 2.5rem);
    height: clamp(260px, 78vw, 380px);
    margin-top: 1.5rem;
  }
  .floor-wrap { -webkit-mask-image: linear-gradient(180deg, transparent 5%, #000 45%); mask-image: linear-gradient(180deg, transparent 5%, #000 45%); }
  .floor { width: 900px; margin-left: -450px; bottom: -40%; }
  .bear-teddy { left: 4%; bottom: 8%; height: 62%; }
  .bear-zombie { right: 1%; bottom: 6%; height: 66%; }
  .bear-pink { left: auto; right: 40%; bottom: 44%; height: 36%; }
  .s1 { left: 6%; top: 6%; }
  .s2 { right: 8%; top: 4%; }
  .s3 { right: 41%; bottom: 9%; }
  .soon { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .soon-art { width: min(270px, 72vw); }
  .moon { display: none; }
  .hero::after { height: 7%; }
  .soon p { margin-inline: auto; }
}
@media (max-width: 380px) {
  .top-link { display: none; }
  .play { min-width: 0; width: 100%; padding-inline: 1.5rem; }
  .cta { width: 100%; }
}

/* ================================================================ motion
   One orchestrated entrance, then gentle idling. Every keyframe animates FROM a
   hidden state TO the element's normal look, so without animation support (or
   with reduced motion) the page simply shows its finished state. */
@media (prefers-reduced-motion: no-preference) {
  .sky { animation: fade-in 1.4s var(--ease-out) both; }
  .stars-a { animation: twinkle 4.5s ease-in-out 1.5s infinite alternate; }
  .stars-b { animation: twinkle 3.2s ease-in-out 0.4s infinite alternate-reverse; }
  .moon { animation: moon-rise 2s var(--ease-out) 0.1s both; }

  /* the camera swoops down as the maze grows out of the floor */
  .floor { animation: swoop 1.6s var(--ease-out) both; }
  .l2 { animation: grow-2 0.9s var(--ease-pop) 0.35s both; }
  .l3 { animation: grow-3 0.9s var(--ease-pop) 0.42s both; }
  .l4 { animation: grow-4 0.9s var(--ease-pop) 0.49s both; }
  .l5 { animation: grow-4 0.9s var(--ease-pop) 0.56s both; }
  .l6 { animation: grow-top 0.9s var(--ease-pop) 0.63s both; }

  /* title letters drop in one by one and land with a squash */
  .word span { animation: drop 0.75s var(--ease-out) both; transform-origin: 50% 100%; }
  .word-1 span:nth-child(1) { animation-delay: 0.25s; }
  .word-1 span:nth-child(2) { animation-delay: 0.3s; }
  .word-1 span:nth-child(3) { animation-delay: 0.35s; }
  .word-1 span:nth-child(4) { animation-delay: 0.4s; }
  .word-2 span:nth-child(1) { animation-delay: 0.47s; }
  .word-2 span:nth-child(2) { animation-delay: 0.52s; }
  .word-2 span:nth-child(3) { animation-delay: 0.57s; }
  .word-2 span:nth-child(4) { animation-delay: 0.62s; }
  .word-3 span:nth-child(1) { animation-delay: 0.7s; }
  .word-3 span:nth-child(2) { animation-delay: 0.75s; }
  .word-3 span:nth-child(3) { animation-delay: 0.8s; }
  .word-3 span:nth-child(4) { animation-delay: 0.85s; }
  .word-3 span:nth-child(5) { animation-delay: 0.9s; }

  .lede { animation: rise 0.8s var(--ease-out) 1.05s both; }
  .play { animation: key-pop 0.7s var(--ease-pop) 1.25s both; }
  .play::before { animation: sheen 6s ease-in-out 2.1s infinite; }
  .play::after { animation: ring 3.2s var(--ease-out) 2.4s infinite; }
  .cta-note { animation: rise 0.8s var(--ease-out) 1.45s both; }

  /* the bears arrive: teddy hops in, the zombie climbs out of the maze, pink lands from a Super Jump */
  .bear-teddy .pop { animation: hop-in 0.9s var(--ease-pop) 0.95s both; }
  .bear-zombie .pop { animation: rise-up 1.1s var(--ease-out) 1.15s both; }
  .bear-pink .pop { animation: land 1s var(--ease-out) 1.35s both; }
  .bear-teddy img { animation: bob 2.6s ease-in-out 2s infinite; }
  .bear-pink img { animation: hover 3.4s ease-in-out 2.4s infinite; }
  .bear-zombie img { animation: shamble 3.8s ease-in-out 2.3s infinite; transform-origin: 50% 100%; }
  .aura { animation: aura-in 1.4s ease-out 1.3s both, pulse 2.6s ease-in-out 2.7s infinite; }
  .bear-teddy .pop::after { animation: shadow-bob 2.6s ease-in-out 2s infinite; }

  .scroll span { animation: scroll-pop 0.7s var(--ease-pop) both, float 4s ease-in-out infinite; }
  .s1 span { animation-delay: 1.6s, 2.3s; }
  .s2 span { animation-delay: 1.75s, 2.9s; }
  .s3 span { animation-delay: 1.9s, 2.6s; }

  .lost img { animation: land 1s var(--ease-out) 0.1s both, hover 3.4s ease-in-out 1.2s infinite; }

  /* the coming-soon bear steps into the spotlight */
  .soon-art img { animation: bob 4s ease-in-out infinite; }
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes twinkle { to { opacity: 0.35; } }
@keyframes moon-rise { from { opacity: 0; transform: translateY(40px) scale(0.8); } }
@keyframes swoop { from { transform: rotateX(80deg) translateY(12%); opacity: 0; } 40% { opacity: 1; } }
@keyframes grow-2 { from { transform: translateZ(0); } }
@keyframes grow-3 { from { transform: translateZ(0); } }
@keyframes grow-4 { from { transform: translateZ(0); } }
@keyframes grow-top { from { transform: translateZ(0); opacity: 0; } 30% { opacity: 1; } }
@keyframes drop {
  0% { opacity: 0; transform: translateY(-0.9em) rotate(-10deg) scale(0.7); }
  45% { opacity: 1; transform: translateY(0.04em) rotate(0) scale(1.06, 0.86); }
  70% { transform: translateY(-0.08em) scale(0.97, 1.04); }
  100% { transform: none; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes key-pop {
  0% { opacity: 0; transform: translateY(18px) scale(0.6); }
  60% { opacity: 1; }
}
@keyframes sheen { 0% { background-position: 150% 0; } 22%, 100% { background-position: -60% 0; } }
@keyframes ring {
  0% { opacity: 0.8; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(1.18, 1.45); }
}
@keyframes hop-in {
  0% { opacity: 0; transform: translateY(45%) scale(0.5); }
  50% { opacity: 1; transform: translateY(-12%) scale(1.04); }
  75% { transform: translateY(2%) scale(1.03, 0.95); }
  100% { transform: none; }
}
@keyframes rise-up {
  0% { opacity: 0; transform: translateY(35%) scale(0.92, 0.7); filter: brightness(2.2) saturate(0.4); }
  60% { opacity: 1; transform: translateY(-3%) scale(1); }
  100% { transform: none; filter: none; }
}
@keyframes land {
  0% { opacity: 0; transform: translateY(-160%) rotate(-14deg); }
  55% { opacity: 1; transform: translateY(6%) rotate(3deg) scale(1.06, 0.9); }
  78% { transform: translateY(-4%) rotate(-1deg); }
  100% { transform: none; }
}
@keyframes bob { 50% { transform: translateY(-4%); } }
@keyframes shadow-bob { 50% { transform: scale(0.82); opacity: 0.7; } }
@keyframes hover { 50% { transform: translateY(-7%) rotate(2deg); } }
@keyframes shamble { 25% { transform: rotate(-2.5deg); } 75% { transform: rotate(2deg) translateY(-1%); } }
@keyframes aura-in { from { opacity: 0; transform: scale(0.4); } }
@keyframes pulse { 50% { opacity: 0.45; transform: scale(0.92); } }
@keyframes scroll-pop { from { opacity: 0; transform: translateY(30px) rotate(-30deg) scale(0.3); } }
@keyframes float { 50% { transform: translateY(-10px) rotate(4deg); } }

/* scroll-linked depth, where the browser supports it: as the hero scrolls away the
   near bears slide faster than the far ones, and the mystery bear rises into its light */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .bear, .scroll {
      animation: parallax linear both;
      animation-timeline: scroll(root);
      animation-range: 0 100vh;
    }
    .bear-teddy { --depth: -22%; }
    .bear-zombie { --depth: -30%; }
    .bear-pink { --depth: -55%; }
    .scroll { --depth: -140%; }
    .hero-copy { animation: drift linear both; animation-timeline: scroll(root); animation-range: 0 90vh; }

    /* fill "forwards" only: before the section reaches the screen it keeps its normal look,
       so nothing can be left hidden (full-page captures, print, odd timelines) */
    .soon-art { animation: spot-in linear forwards; animation-timeline: view(); animation-range: entry 0% cover 45%; }
    .spot { animation: spot-open linear forwards; animation-timeline: view(); animation-range: entry 0% cover 50%; }
    .soon-copy { animation: copy-in linear forwards; animation-timeline: view(); animation-range: entry 0% cover 40%; }
  }
}
@keyframes parallax { to { translate: 0 var(--depth); } }
@keyframes drift { to { translate: 0 -12vh; opacity: 0.2; } }
@keyframes spot-in { from { translate: 0 18%; scale: 0.9; } }
@keyframes spot-open { from { opacity: 0; scale: 0.4 1; } }
@keyframes copy-in { from { opacity: 0; translate: 0 2rem; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.nowrap { white-space: nowrap; }
