/*
 * The website's look: the app's quiet chrome, on a page (docs/art-style.md).
 *
 * Painted worlds behind, plain cream panels on top. A panel, a pill, a
 * button, a card, a speech bubble: cream, one soft warm shadow, no outline
 * colour, no stars, no sparkles. The painting carries the colour. Dark brown
 * ink for every word; nothing is white on colour and no word is see-through.
 *
 * The tokens are the app's own (apps/mobile/src/theme.ts): paper is the
 * app's ground, card is its surface, sunk its surfaceSunk, and the ink pair
 * is the same ink. The one thing that moves with the visitor is the buddy
 * they pick: --buddy, --buddy-accent and --buddy-deep are set by site.js, and
 * only the primary button, the chosen chip and small marks wear them.
 *
 * Fredoka for titles, buttons, chips and nav links. Nunito for every
 * sentence.
 */

@font-face { font-family: 'Fredoka'; src: url('/site/Fredoka_700Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('/site/Nunito_600SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('/site/Nunito_800ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }

:root {
  /* theme.ts: palette.ground, surface, surfaceSunk, ink, inkSoft, inkFaint, rule */
  --paper: #f6efe2;
  --card: #fdf8ef;
  --sunk: #f1e5d3;
  --ink: #33190f;
  --ink-soft: #6b4a37;
  --ink-faint: #7d6049;
  --rule: #ebdcc6;
  /* quiet.tsx QUIET_SHADOW: #5a3a1a at 18%, down 6, blur 14 */
  --shadow: 0 6px 14px rgba(90, 58, 26, .18);
  --shadow-soft: 0 2px 10px rgba(90, 58, 26, .1);

  /* Baloo's, until somebody picks (site.js). */
  --buddy: #eed9a8;
  --buddy-accent: #f9efd8;
  --buddy-deep: #7a5a1c;

  /* theme.ts radius: control 16, card 20, sheet 28, pill 999 */
  --r-control: 16px;
  --r-card: 20px;
  --r-sheet: 28px;

  --display: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.3, .8, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 104px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 600 1.125rem/1.6 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.1; margin: 0 0 .4em; text-wrap: balance; }
p { margin: 0 0 1em; }
b, strong { font-weight: 800; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--buddy-deep); outline-offset: 3px; border-radius: 12px; }

.wrap { width: min(1180px, 100% - clamp(32px, 8vw, 80px)); margin-inline: auto; }
.wrap--narrow { width: min(820px, 100% - clamp(32px, 8vw, 80px)); }
.mid { text-align: center; margin-top: 2rem; }
.skip { position: fixed; left: 12px; top: -80px; z-index: 100; background: var(--card); box-shadow: var(--shadow); border-radius: 999px; padding: 10px 18px; font: 700 1rem/1.2 var(--display); }
.skip:focus { top: 12px; }

/* --- Words ---------------------------------------------------------- */

.title { font-size: clamp(1.9rem, 4vw, 3rem); text-align: center; margin-bottom: .5em; }
.title--left { text-align: left; font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.5; max-width: 34em; }
.lede--mid { margin-inline: auto; text-align: center; }
.soft { color: var(--ink-soft); }
.link { font-weight: 800; color: var(--buddy-deep); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.link:hover { text-decoration-thickness: 3px; }

/* A small cream chip with a word on it. `chip--on` is the chosen one, in the buddy's colour. */
.chip {
  display: inline-block; margin: 0 0 1rem; padding: .3em 1em;
  background: var(--card); color: var(--buddy-deep); box-shadow: var(--shadow-soft);
  border-radius: 999px;
  font: 700 .95rem/1.4 var(--display); letter-spacing: .01em;
}
.chip--on { background: var(--buddy); color: var(--ink); box-shadow: none; }
.chip--sunk { background: var(--sunk); box-shadow: none; }

/* --- Buttons -------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: .5em 1.6em;
  background: var(--buddy); color: var(--ink);
  border: 0; border-radius: 999px;
  font: 700 1.15rem/1.1 var(--display); text-decoration: none; text-align: center;
  transition: transform .14s var(--ease), box-shadow .14s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(.97); }
.btn--cream { background: var(--card); color: var(--buddy-deep); box-shadow: var(--shadow); }
.btn--small { min-height: 48px; font-size: 1.02rem; padding: .4em 1.2em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px 16px; align-items: center; margin-top: 1.4rem; }
.cta-row--mid { justify-content: center; }

/* --- Cards ---------------------------------------------------------- */

.card {
  background: var(--card);
  border-radius: var(--r-sheet);
  box-shadow: var(--shadow);
  padding: clamp(22px, 3vw, 36px);
}
.card > :last-child { margin-bottom: 0; }

.ticks { list-style: none; margin: 0 0 1.2rem; padding: 0; display: grid; gap: .7em; }
.ticks li { position: relative; padding-left: 1.9em; }
.ticks li::before {
  content: ''; position: absolute; left: .15em; top: .55em; width: .7em; height: .7em;
  background: var(--buddy-deep); border-radius: 50%;
}

/* --- The bar along the top ------------------------------------------ */

.bar { position: fixed; inset: 0 0 auto; z-index: 50; padding: 12px clamp(10px, 2vw, 24px); pointer-events: none; }
.bar__pill {
  pointer-events: auto;
  display: flex; align-items: center; gap: 8px;
  max-width: 1240px; margin-inline: auto; min-height: 68px; padding: 6px 10px 6px 8px;
  background: var(--card); border-radius: 999px; box-shadow: var(--shadow);
}
.bar__home { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1.2rem/1 var(--display); margin-right: auto; padding-right: 6px; }
.bar__home img { width: 50px; height: 50px; }
.bar__links { display: flex; gap: 2px; }
.bar__link {
  padding: .5em .85em; border-radius: 999px;
  font: 700 1rem/1.2 var(--display); text-decoration: none; white-space: nowrap;
  transition: background .15s ease;
}
.bar__link:hover { background: var(--sunk); }
.bar__link[aria-current] { background: var(--buddy); }
.bar__go { display: flex; align-items: center; gap: 10px; }
.bar__signin { font: 700 1rem/1.2 var(--display); color: var(--buddy-deep); text-decoration: none; padding: .5em .7em; border-radius: 999px; white-space: nowrap; }
.bar__signin:hover { background: var(--sunk); }
.bar__menu {
  display: none; align-items: center; gap: 5px; flex-direction: column; justify-content: center;
  width: 52px; height: 52px; padding: 0; background: var(--sunk); border: 0; border-radius: 50%;
}
.bar__menu span { width: 22px; height: 3px; border-radius: 3px; background: var(--ink); transition: transform .2s ease; }
.bar__menu b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.bar__menu[aria-expanded='true'] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.bar__menu[aria-expanded='true'] span:nth-child(2) { transform: scaleX(0); }
.bar__menu[aria-expanded='true'] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 40; overflow-y: auto;
  padding: 100px clamp(16px, 5vw, 40px) 40px;
  background: var(--paper);
  display: grid; align-content: start; gap: 24px;
}
.menu__links { display: grid; gap: 10px; }
.menu__link {
  display: block; padding: .6em 1.2em; border-radius: 999px; text-decoration: none;
  font: 700 1.35rem/1.2 var(--display);
  background: var(--card); box-shadow: var(--shadow-soft);
}
.menu__link[aria-current] { background: var(--buddy); }
.menu__go { display: grid; gap: 12px; }

@media (max-width: 1120px) {
  .bar__links, .bar__go { display: none; }
  .bar__menu { display: flex; }
}
@media (max-width: 420px) { .bar__home span { display: none; } }

/* --- The front page's top ------------------------------------------- */

.hero {
  position: relative;
  min-height: min(820px, 100svh);
  padding: 120px 0 clamp(30px, 5vw, 60px);
  background: #77ccff var(--hero-art) center top / cover no-repeat;
  display: grid;
}
.hero__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(20px, 4vw, 60px); align-items: end; }
.hero__words { align-self: center; }
.hero__panel { max-width: 560px; }
.hero__title { font-size: clamp(2.2rem, 4.6vw, 3.8rem); margin-bottom: .3em; }
.hero__title em { font-style: normal; color: var(--buddy-deep); }
.hero__panel .lede { margin-bottom: 0; }
.hero__panel .cta-row { margin-top: 1.2rem; }

.hero__stage { display: grid; justify-items: center; align-content: end; }
.bubble {
  position: relative; margin: 0 0 14px; max-width: 340px; padding: .7em 1.1em;
  background: var(--card); border-radius: var(--r-sheet); box-shadow: var(--shadow);
  font: 800 1.1rem/1.35 var(--body); text-align: center;
}
.bubble b { font-weight: 800; color: var(--buddy-deep); }
.bubble::after {
  content: ''; position: absolute; left: 50%; bottom: -12px; margin-left: -12px;
  border-left: 12px solid transparent; border-right: 12px solid transparent; border-top: 14px solid var(--card);
}
.bubble.is-new { animation: settle .35s var(--ease); }
.hero__spot { position: relative; width: min(300px, 64vw); }
.hero__buddy { position: relative; width: 100%; cursor: pointer; }
.hero__buddy.is-hop { animation: hop .6s var(--ease); }
.picker { display: flex; gap: 10px; margin-top: 4px; padding: 8px; background: var(--card); border-radius: 999px; box-shadow: var(--shadow); }
.picker__one {
  display: grid; justify-items: center; gap: 2px; padding: 4px 8px 2px; background: none; border: 0; border-radius: 999px;
  font: 700 .9rem/1.2 var(--display); color: var(--ink-soft);
  transition: background .15s ease;
}
.picker__one img { width: 64px; height: 64px; padding: 2px; border-radius: 50%; background: var(--sunk); }
.picker__one:hover { background: var(--sunk); }
.picker__one[aria-pressed='true'] { background: var(--buddy); color: var(--ink); }
.picker__one[aria-pressed='true'] img { background: var(--card); }
.hero__more { margin: 12px 0 0; font-weight: 800; background: var(--card); border-radius: 999px; padding: .3em 1em; box-shadow: var(--shadow-soft); }
.hero__more a { color: var(--buddy-deep); }

@media (max-width: 1000px) { .hero { min-height: min(720px, 100svh); } }
@media (max-width: 700px) {
  .hero { min-height: 0; padding-top: 104px; background-image: var(--hero-art-small); background-position: center 30%; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__words { text-align: center; }
  .hero__panel { margin-inline: auto; }
  .hero__panel .cta-row { justify-content: center; }
  .hero__spot { width: min(220px, 56vw); }
}

/* --- The top of every other page ------------------------------------ */

.banner {
  padding: 116px 0 clamp(26px, 4vw, 44px);
  background: #77ccff var(--banner-art) center 70% / cover no-repeat;
}
.banner__in { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.banner__panel { max-width: 640px; }
.banner h1 { font-size: clamp(2rem, 4.4vw, 3.3rem); }
.banner .lede { margin: 0; }
.banner__buddy { flex: none; width: clamp(150px, 20vw, 240px); margin-bottom: -8px; }
@media (max-width: 760px) { .banner__buddy { display: none; } .banner { background-image: var(--banner-art-small); } }

/* --- Bands ---------------------------------------------------------- */

.band { position: relative; padding: clamp(44px, 6vw, 80px) 0; }
.band--tight, .band--paper + .band--paper { padding-top: 0; }
.band--paper { background: var(--paper); }
.band--sunk { background: var(--sunk); }

/* --- Two things to do --------------------------------------------- */

.doors { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(18px, 3vw, 36px); margin-top: 1.6rem; max-width: 900px; margin-inline: auto; }
.door { display: grid; grid-template-columns: 112px 1fr; gap: 18px; align-items: center; text-decoration: none; padding: 20px 24px 20px 20px; transition: transform .2s var(--ease); }
.door:hover { transform: translateY(-4px); }
.door__pic { width: 112px; height: 112px; display: grid; place-items: center; background: var(--sunk); border-radius: var(--r-card); }
.door__pic img { width: 92%; height: 92%; object-fit: contain; }
.door h3 { font-size: 1.5rem; margin-bottom: .2em; }
.door p { margin: 0; }
@media (max-width: 760px) { .doors { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .door { grid-template-columns: 1fr; text-align: center; } .door__pic { margin-inline: auto; } }

/* --- A hint, to try -------------------------------------------------- */

.ladder { display: grid; grid-template-columns: minmax(180px, .7fr) 1.3fr; gap: clamp(20px, 4vw, 60px); align-items: center; }
.ladder__buddy img { width: min(320px, 100%); margin-inline: auto; }
.say { display: inline-block; padding: .5em 1.1em; border-radius: 22px 22px 6px 22px; background: var(--sunk); font-weight: 800; font-size: 1.2rem; }
.rungs { list-style: none; counter-reset: rung; margin: 0 0 1rem; padding: 0; display: grid; gap: 10px; }
.rung {
  counter-increment: rung; position: relative; display: grid; gap: 2px;
  padding: .7em 1em .7em 3.4em; background: var(--sunk); border-radius: var(--r-card);
}
.rung::before {
  content: counter(rung); position: absolute; left: .7em; top: 50%; width: 2em; height: 2em; margin-top: -1em;
  display: grid; place-items: center; background: var(--buddy); border-radius: 50%;
  font: 700 1rem/1 var(--display);
}
.rung b { font: 700 1.05rem/1.2 var(--display); color: var(--buddy-deep); }
.js .rung.is-waiting { display: none; }
.rung.is-new { animation: settle .35s var(--ease); }
/* The cookies to count in the hint: your 3, then 4 more, which slide over and join them. */
.cookies { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px 14px; margin: 14px 0 16px; }
.cookies__group { display: grid; justify-items: center; gap: 4px; }
.cookies__group small { font: 700 .9rem/1.4 var(--display); color: var(--buddy-deep); }
.cookies__row { display: flex; gap: 4px; padding: 6px 8px; background: var(--sunk); border-radius: 18px; }
.cookies__plus { align-self: center; margin-top: -1.2em; font: 700 2rem/1 var(--display); color: var(--buddy-deep); }
.cookie { position: relative; display: block; width: clamp(34px, 6vw, 56px); aspect-ratio: 1; }
.cookie img { width: 100%; height: 100%; display: block; }
.cookie__n { position: absolute; inset: 0; z-index: 0; display: grid; place-items: center; font: 700 clamp(.95rem, 2vw, 1.3rem)/1 var(--display); color: var(--ink); }
.cookie__n:empty { display: none; }
.cookie__n::before { content: ''; position: absolute; width: 62%; aspect-ratio: 1; border-radius: 50%; background: var(--card); box-shadow: var(--shadow-soft); z-index: -1; }
.cookie.is-counted .cookie__n { animation: settle .35s var(--ease); }
.cookie.is-last .cookie__n::before { background: var(--buddy); }
.cookies.is-together .cookies__plus, .cookies.is-together .cookies__group--more { display: none; }
.answers { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 1rem; }
.answers .btn { min-width: 88px; font-size: 1.35rem; }
.answers .btn.is-right { background: var(--buddy); color: var(--ink); box-shadow: none; animation: hop .6s var(--ease); }
.answers .btn.is-wrong { animation: shake .4s ease; }
.answers .btn:disabled { opacity: .6; cursor: default; }
.ladder__result { min-height: 1.6em; font-weight: 800; font-size: 1.15rem; margin: 0; }
@media (max-width: 800px) { .ladder { grid-template-columns: 1fr; } .ladder__buddy img { width: 190px; } }

/* --- The shelf of games ---------------------------------------------- */

.shelf { overflow: hidden; padding: 20px 0 30px; }
.shelf__row { display: flex; gap: 18px; width: max-content; animation: slide 70s linear infinite; }
.shelf:hover .shelf__row, .shelf:focus-within .shelf__row { animation-play-state: paused; }
.tile {
  flex: none; width: 176px; display: grid; justify-items: center; gap: 8px; padding: 14px 12px 14px;
  background: var(--card); border-radius: var(--r-sheet); box-shadow: var(--shadow);
  text-decoration: none; text-align: center; font: 700 1.02rem/1.15 var(--display);
  transition: transform .2s var(--ease);
}
.tile img { width: 130px; height: 130px; object-fit: contain; }
.tile:hover { transform: translateY(-5px); }

/* --- Find the pairs -------------------------------------------------- */

.match { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(20px, 4vw, 50px); align-items: center; margin-top: 10px; }
.match__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
/* The cards turn flat, with no 3D: a card squashes to a sliver and opens out showing its other side.
   Safari on an iPhone kept losing the faces of a card turned in 3D. Two quick taps no longer zoom the page. */
.flip { aspect-ratio: 1; padding: 0; background: none; border: 0; border-radius: var(--r-card); touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: transform .2s var(--ease); }
.flip__in { position: relative; display: block; width: 100%; height: 100%; transition: transform .16s ease-in-out; }
.flip.is-turning .flip__in { transform: scaleX(0); }
.flip__back, .flip__front { position: absolute; inset: 0; display: grid; place-items: center; border-radius: var(--r-card); }
.flip__back { background: var(--sunk); box-shadow: var(--shadow-soft); }
.flip__back img { width: 40%; height: 40%; opacity: .9; }
.flip__front { display: none; background: var(--c); }
.flip__front img { width: 76%; height: auto; }
.flip.is-up .flip__front { display: grid; }
.flip.is-up .flip__back { display: none; }
.flip:hover:not(.is-up) { transform: translateY(-3px); }
.flip.is-done { animation: hop .6s var(--ease); }
html:not(.js) .flip__front { display: grid; }
html:not(.js) .flip__back { display: none; }
@media (max-width: 800px) { .match { grid-template-columns: 1fr; } }

/* --- What you earn ---------------------------------------------------- */

.earn { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 60px); align-items: center; }
.xp {
  display: flex; align-items: center; gap: 14px; margin-top: 1.4rem; padding: 12px 20px;
  background: var(--card); border-radius: 999px; box-shadow: var(--shadow);
}
.xp__bar { flex: 1; height: 22px; background: var(--sunk); border-radius: 999px; overflow: hidden; }
.xp__bar i { display: block; height: 100%; width: 12%; background: var(--buddy); border-radius: 999px; }
.xp b { font: 700 1.05rem/1 var(--display); color: var(--buddy-deep); transform: scale(0); }
.xp.in .xp__bar i { animation: fill 1.6s .2s cubic-bezier(.3, .8, .3, 1) forwards; }
.xp.in b { animation: settle .4s 1.8s var(--ease) forwards; }
html:not(.js) .xp b { transform: none; }
.earn__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.earn__one {
  display: grid; grid-template-columns: 88px 1fr; column-gap: 18px; align-items: center;
  padding: 14px 20px; background: var(--card); border-radius: var(--r-sheet); box-shadow: var(--shadow);
}
.earn__one img { grid-row: span 2; width: 88px; height: 88px; object-fit: contain; }
.earn__one b { font: 700 1.25rem/1.1 var(--display); align-self: end; }
.earn__one span { align-self: start; }
@media (max-width: 860px) { .earn { grid-template-columns: 1fr; } }

/* --- Two things side by side ------------------------------------------ */

.trust, .duo { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.trust { align-items: center; }
@media (max-width: 860px) { .trust, .duo { grid-template-columns: 1fr; } }
.plansnip { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.plansnip p { margin: 0; max-width: 40em; }

/* --- One more way in --------------------------------------------------- */

.call {
  position: relative; padding: clamp(50px, 8vw, 96px) 0 190px; text-align: center;
  background: #77ccff var(--call-art) center bottom / cover no-repeat;
}
.call__panel { max-width: 640px; margin-inline: auto; }
.call .lede { margin-inline: auto; }
.call h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
.call__buddies { display: flex; justify-content: center; align-items: end; gap: clamp(0px, 2vw, 24px); margin-bottom: 14px; }
.call__buddies img { width: clamp(84px, 12vw, 130px); }
@media (max-width: 700px) { .call { background-image: var(--call-art-small); } }

/* A buddy out for a walk, along the grass at the bottom of the painting. */
.stroll { position: absolute; left: 0; right: 0; bottom: 0; height: 150px; overflow: hidden; pointer-events: none; }
.stroll__walker {
  position: absolute; left: 0; bottom: 18px; z-index: 1;
  transform: translateX(8vw);
  animation: stroll-across 22s linear infinite;
  pointer-events: auto; cursor: pointer;
}
.stroll__buddy {
  /* One full step: six frames, each shown for a sixth of it. site.js sets the walking speed to match (PACE). */
  --stride: 1.2s;
  width: var(--w); height: var(--h);
  background: var(--sheet) 0 0 / auto 100% no-repeat;
  animation: stroll-legs var(--stride) steps(6) infinite;
}
.stroll__buddy.is-hop { animation: stroll-legs var(--stride) steps(6) infinite, hop .6s var(--ease); }
@keyframes stroll-legs { to { background-position: calc(var(--w) * -6) 0; } }
@keyframes stroll-across { from { transform: translateX(calc(-1 * var(--from, 140px))); } to { transform: translateX(calc(100vw + 20px)); } }

/* --- The footer -------------------------------------------------------- */

.foot { background: var(--sunk); color: var(--ink); padding: clamp(44px, 6vw, 72px) 0 28px; }
.foot__grid { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 30px; }
.foot__brand img { width: 110px; margin-bottom: 10px; }
.foot__brand p { max-width: 18em; color: var(--ink-soft); }
.foot__col { display: grid; gap: 6px; align-content: start; }
.foot__col h2 { font-size: 1.1rem; margin-bottom: .2em; color: var(--buddy-deep); }
.foot__col a { text-decoration: none; font-weight: 800; padding: .15em 0; }
.foot__col a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot__small { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 30px; padding-top: 18px; border-top: 2px solid var(--rule); font-size: .95rem; color: var(--ink-soft); }
.foot__small a { font-weight: 800; }
@media (max-width: 860px) { .foot__grid { grid-template-columns: 1fr 1fr; } .foot__brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .foot__grid { grid-template-columns: 1fr; } }

/* --- The buddies page --------------------------------------------------- */

.faces { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 8px; }
.faces a { display: grid; justify-items: center; gap: 2px; padding: 6px 6px 4px; border-radius: var(--r-control); text-decoration: none; font: 700 .9rem/1.2 var(--display); color: var(--ink-soft); transition: transform .2s var(--ease); }
.faces img { width: 60px; height: 60px; padding: 3px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow-soft); }
.faces a:hover { transform: translateY(-4px); }
.hint-line { margin: 1.2rem 0 2rem; }
.buddies { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(20px, 3vw, 34px); }
.buddy {
  display: grid; grid-template-columns: minmax(130px, 190px) 1fr; gap: 22px; align-items: start;
  padding: clamp(18px, 2.4vw, 28px); background: var(--card);
  border-radius: var(--r-sheet); box-shadow: var(--shadow);
  scroll-margin-top: 110px;
}
.buddy:target { outline: 3px solid var(--buddy-deep); outline-offset: 4px; }
.buddy__face { position: relative; aspect-ratio: 1; padding: 0; background: var(--sunk); border: 0; border-radius: var(--r-card); transition: transform .25s var(--ease); }
.buddy__face img { position: absolute; inset: 4%; width: 92%; height: 92%; object-fit: contain; }
.buddy__happy { visibility: hidden; }
.buddy__face:hover, .buddy__face.is-hi { transform: scale(1.04); }
.buddy__face:hover .buddy__happy, .buddy__face.is-hi .buddy__happy { visibility: visible; }
.buddy__face:hover .buddy__idle, .buddy__face.is-hi .buddy__idle { visibility: hidden; }
.buddy__face.is-hi { animation: hop .6s var(--ease); }
.buddy h2 { font-size: clamp(1.6rem, 2.4vw, 2rem); margin: 0; }
.buddy__when { display: inline-block; margin: 0 0 6px; padding: .2em .9em; background: var(--sunk); border-radius: 999px; font: 700 .9rem/1.4 var(--display); color: var(--buddy-deep); }
.buddy__kind { font-weight: 800; color: var(--ink-soft); margin-bottom: .5em; }
.buddy__good { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: .7em; }
.buddy__good span { padding: .15em .8em; background: var(--sunk); border-radius: 999px; font: 700 .85rem/1.5 var(--display); color: var(--buddy-deep); }
.buddy__says { margin: 0; font-weight: 800; font-size: 1.05rem; }
.buddy__says.is-new { animation: settle .35s var(--ease); }
/* The real pet, when there is a photo of it: beside the drawing, in its own cream frame. */
.buddy__real { grid-column: 1 / -1; display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; margin-top: 4px; padding: 12px; background: var(--sunk); border-radius: var(--r-card); }
.buddy__photo { width: 120px; height: 120px; object-fit: cover; border-radius: var(--r-control); background: var(--card); box-shadow: var(--shadow-soft); }
.buddy__real b { display: block; font: 700 1.05rem/1.2 var(--display); margin-bottom: .2em; }
.buddy__real p { margin: 0; font-size: 1rem; line-height: 1.45; }
@media (max-width: 980px) { .buddies { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .buddy { grid-template-columns: 1fr; text-align: center; }
  .buddy__face { width: 160px; margin-inline: auto; }
  .buddy__good { justify-content: center; }
  .buddy__real { grid-template-columns: 1fr; justify-items: center; }
}

/* --- The games page ------------------------------------------------------ */

.jump { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 2.2rem; }
.jump a { padding: .35em 1.1em; background: var(--card); box-shadow: var(--shadow-soft); border-radius: 999px; font: 700 .95rem/1.5 var(--display); color: var(--buddy-deep); text-decoration: none; transition: background .15s ease; }
.jump a:hover { background: var(--buddy); color: var(--ink); }
.place { margin-bottom: clamp(36px, 5vw, 60px); scroll-margin-top: 110px; }
.place__head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 1rem; }
.place__head h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); margin: 0; }
.place__head p { margin: 0; color: var(--ink-soft); }
/* Four to a row on a computer, three on a tablet, two on a phone. */
.games { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1000px) { .games { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
.game { display: grid; gap: 10px; align-content: start; padding: 16px 16px 18px; background: var(--card); border-radius: var(--r-sheet); box-shadow: var(--shadow); text-align: center; scroll-margin-top: 110px; }
.game:target { outline: 3px solid var(--buddy-deep); outline-offset: 4px; }
.game__art { aspect-ratio: 1; display: grid; place-items: center; background: var(--sunk); border-radius: var(--r-card); }
.game__art img { width: 86%; height: 86%; object-fit: contain; }
.game h3 { font-size: 1.2rem; line-height: 1.1; margin: 0; }
.game__blurb { margin: 0; font-size: .98rem; line-height: 1.4; color: var(--ink-soft); }
@media (max-width: 560px) {
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .game { padding: 12px 12px 14px; }
  .game h3 { font-size: 1.02rem; }
  .game__blurb { font-size: .9rem; }
}
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin-top: 2rem; }
.tool img { width: 100%; border-radius: var(--r-card); margin-bottom: 14px; }
.tool h3 { font-size: 1.5rem; }
.tool ol { margin: 0; padding-left: 1.3em; }

/* --- How it helps --------------------------------------------------------- */

.helps { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 22px; margin-top: 2rem; }
.help img { width: 64px; height: 64px; object-fit: contain; margin-bottom: 10px; }
.help h3 { font-size: 1.35rem; }
.steps { list-style: none; counter-reset: step; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.steps li {
  counter-increment: step; position: relative; display: grid; gap: 4px; align-content: start;
  padding: 22px 20px 22px; background: var(--card); border-radius: var(--r-sheet); box-shadow: var(--shadow);
}
.steps li::before {
  content: counter(step); width: 44px; height: 44px; margin: 0 auto 8px;
  display: grid; place-items: center; background: var(--buddy); border-radius: 50%;
  font: 700 1.3rem/1 var(--display);
}
.steps b { font: 700 1.2rem/1.15 var(--display); text-align: center; }
.steps span { text-align: center; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* --- Plans ------------------------------------------------------------------ */

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; align-items: stretch; max-width: 900px; margin-inline: auto; }
.plan { display: grid; align-content: start; justify-items: start; }
.plan h2 { font-size: 2rem; }
.plan h2 small { font: 800 1rem/1 var(--body); color: var(--ink-soft); }
.plan__for { font-weight: 800; color: var(--ink-soft); }
.plan .btn { margin-top: auto; }
.note { max-width: 40em; margin-inline: auto; color: var(--ink-soft); }

/* --- Questions ---------------------------------------------------------------- */

.find { display: grid; gap: 6px; margin-bottom: 1.4rem; font: 700 1rem/1.4 var(--display); }
.find input {
  width: 100%; min-height: 56px; padding: .4em 1.2em; font: 600 1.1rem var(--body); color: var(--ink);
  background: var(--sunk); border: 0; border-radius: 999px;
}
.find input::placeholder { color: var(--ink-faint); }
.qa { margin-bottom: 2.4rem; scroll-margin-top: 110px; }
.q { background: var(--card); border-radius: var(--r-card); margin-bottom: 12px; box-shadow: var(--shadow-soft); overflow: hidden; }
.q summary { position: relative; padding: .9em 3.4em .9em 1.2em; font: 700 1.15rem/1.25 var(--display); cursor: pointer; list-style: none; }
.q summary::-webkit-details-marker { display: none; }
.q summary::after {
  content: '+'; position: absolute; right: .8em; top: 50%; width: 1.6em; height: 1.6em; margin-top: -.8em;
  display: grid; place-items: center; background: var(--sunk); border-radius: 50%;
  font: 700 1.2rem/1 var(--display); color: var(--buddy-deep);
}
.q[open] summary::after { content: '\2212'; }
.q[open] summary, .q summary:hover { background: var(--buddy-accent); }
.q__a { padding: 1em 1.2em 1.3em; }
.q__a .btn { min-height: 48px; font-size: 1rem; }

/* --- The small print ------------------------------------------------------------ */

.legal h2 { font-size: 1.5rem; margin-top: 2em; scroll-margin-top: 110px; }
.legal h3 { font-size: 1.15rem; margin-top: 1.2em; }
.legal ul { padding-left: 1.3em; margin: 0 0 1em; }
.legal li { margin-bottom: .35em; }
.legal__date { font-weight: 800; }
.draft { padding: .8em 1.2em; background: var(--buddy-accent); border-radius: var(--r-card); }

/* --- Not found ------------------------------------------------------------------ */

.lost { padding: 140px 0 90px; background: var(--paper); text-align: center; }
.lost__in { display: grid; justify-items: center; }
.lost h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }

/* --- Movement: the buddy moves; chrome settles once and stays still ------------- */

.bob { animation: bob 3.4s ease-in-out infinite; }
.bob--2 { animation-delay: -1.1s; }
.bob--3 { animation-delay: -2.2s; }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes hop { 0% { transform: translateY(0) scale(1); } 30% { transform: translateY(-30px) scale(1.04, .97); } 60% { transform: translateY(0) scale(.97, 1.03); } 100% { transform: translateY(0) scale(1); } }
@keyframes settle { from { transform: scale(.94); opacity: .6; } to { transform: scale(1); opacity: 1; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes slide { to { transform: translateX(-50%); } }
@keyframes fill { to { width: 100%; } }

/* --- Small screens and fingers ------------------------------------------ */

/* A phone held sideways is short: the bar scrolls away with the page rather
   than keeping a fifth of the screen. */
@media (max-height: 500px) {
  .bar { position: absolute; }
  .hero { padding-top: 92px; }
  .banner { padding-top: 96px; }
  .bar__pill { min-height: 60px; }
  .bar__home img { width: 44px; height: 44px; }
  .bar__menu { width: 48px; height: 48px; }
}

/* Anything to be tapped is at least as tall as a fingertip. */
@media (pointer: coarse) {
  .foot__col a, .foot__small a { display: flex; align-items: center; min-height: 44px; padding-block: 0; }
  .foot__col { gap: 0; }
  .jump a { display: inline-flex; align-items: center; min-height: 44px; }
  .link { display: inline-block; padding-block: .6em; }
  .legal .link, .q__a p .link, .lede .link, p > .link:not(:only-child) { display: inline; padding-block: 0; }
  .faces a { min-width: 72px; min-height: 44px; }
}

/* A finger does not hover. Without this, the lift a mouse gives a button
   stays stuck on after a tap until something else is touched. */
@media (hover: none) {
  .btn:hover, .door:hover, .tile:hover, .picker__one:hover, .faces a:hover, .flip:hover:not(.is-up) { transform: none; }
  .picker__one:hover { background: none; }
  .picker__one[aria-pressed='true']:hover { background: var(--buddy); }
  .buddy__face:hover { transform: none; }
  .buddy__face:hover .buddy__happy { visibility: hidden; }
  .buddy__face:hover .buddy__idle { visibility: visible; }
  .buddy__face.is-hi .buddy__happy { visibility: visible; }
  .buddy__face.is-hi .buddy__idle { visibility: hidden; }
}

/* In the hand, a slim note about the store app, at the top of the page's first band, below the fixed top bar (site.js adds it). */
.store-note { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; margin: 0 16px 16px; padding: 10px 12px 10px 16px; background: var(--card); box-shadow: var(--shadow); border-radius: var(--r-card); color: var(--ink); font-weight: 800; }
.store-note p { margin: 0; flex: 1; line-height: 1.35; font-size: 1rem; }
.store-note a { color: var(--buddy-deep); }
.store-note button { flex: none; width: 44px; height: 44px; border: 0; border-radius: 999px; background: var(--sunk); color: var(--ink); font: 800 24px/1 var(--display); cursor: pointer; }

/* The Get the app page. */
.get__stores { display: grid; gap: 14px; justify-items: start; margin-top: 1.2rem; }
.get .btn { margin-top: .4rem; }

/* For anybody who has asked their device for less movement: none of it. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .xp__bar i { width: 100%; }
  .xp b { transform: none; }
  .shelf { overflow-x: auto; }
}

/* The website dashboard embeds the authenticated account view on this same origin. */
.dashboard-intro { padding: 136px 0 22px; }
.dashboard-intro h1 { margin: 0 0 12px; font-size: clamp(2rem, 4vw, 3rem); }
.dashboard-intro p { max-width: 780px; margin: 0; }
.dashboard-frame { display: block; width: 100%; height: 1250px; border: 1px solid #d8e2df; border-radius: 24px; background: #f7faf9; }
.dashboard-shell { padding-bottom: 40px; }
.dashboard-links { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 16px; }
@media (max-width: 700px) { .dashboard-intro { padding-top: 100px; } .dashboard-frame { border-radius: 14px; height: 1800px; } }

/* --- Signed in: the bar's Sign out, and the sign-in page ----------------- */

/* site.js shows [data-auth="in"] and hides [data-auth="out"] once Firebase says who is here (src/auth.js). */
button.bar__signin { border: 0; background: none; cursor: pointer; }
button.bar__signin:hover { background: var(--sunk); }
.foot__out { border: 0; background: none; padding: .15em 0; text-align: left; font-weight: 800; cursor: pointer; }
.foot__out:hover { text-decoration: underline; text-underline-offset: 4px; }
.linkbtn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .4em; border: 0; background: none; }

.signin { max-width: 560px; margin-inline: auto; }
.field { display: grid; gap: 6px; margin-bottom: 1rem; font: 700 1rem/1.4 var(--display); }
.field input {
  width: 100%; min-height: 56px; padding: .4em 1.1em; font: 600 1.1rem var(--body); color: var(--ink);
  background: var(--sunk); border: 0; border-radius: var(--r-control);
}
.signin__problem { margin: 0 0 .6rem; font-weight: 800; color: #842d24; } /* theme.ts errorInk */
.signin__note { margin: 0 0 .6rem; font-weight: 800; color: var(--ink-soft); }
.signin__new { margin: 1.4rem 0 0; color: var(--ink-soft); }
.signin__in h2 { margin-bottom: .3em; }
.signin__in p { color: var(--ink-soft); }
.signin .cta-row { margin-top: .8rem; }
@media (pointer: coarse) { .foot__col .foot__out { display: flex; align-items: center; min-height: 44px; padding-block: 0; } }

/* Each buddy's own actions and emotions. */
.buddy__poses { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--rule); }
.buddy__poses figure { margin: 0; min-width: 0; text-align: center; }
.buddy__poses img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.buddy__poses figcaption { font-size: .75rem; color: var(--ink-soft); overflow-wrap: anywhere; }
