/* Mimolino – mimolino.app
   Layout: two painted panoramas frame the page – morning meadow on top, night
   hill at the bottom. In between: calm paper, left-aligned text, the games as
   the only dense element. Desktop overlays text on the painted sky; tablet and
   phone stack text above the painting. */

@font-face { font-family: "Grandstander"; src: url("../fonts/grandstander.woff2?v=b55dfe28") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Andika"; src: url("../fonts/andika-400.woff2?v=d3b664e8") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Andika"; src: url("../fonts/andika-400i.woff2?v=ae001eb9") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Andika"; src: url("../fonts/andika-700.woff2?v=86ae6250") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --paper: #fcf7ea;        /* watercolor paper */
  --ink: #4a3426;          /* brown pencil */
  --ink-soft: #77604e;
  --line: #e2d4b6;
  --leaf: #3f6b1f;         /* buttons, links */
  --leaf-ink: #fffbea;
  --spike: #b85c10;        /* orange accent, 4.3:1 on paper */
  --chip-line: #9c8662;    /* 3.3:1 */
  --focus: #3f6b1f;
  /* painted bands keep their own colors in both themes */
  --sky-top: #d4e5ee;      /* top of the morning painting */
  --sky-low: #f6ecdf;
  --sky-ink: #4a3426;
  --night: #1c2f5c;        /* top of the night painting */
  --night-ink: #f6edd6;
  --night-soft: #c3c6dc;

  --f-display: "Grandstander", "Chalkboard SE", ui-rounded, system-ui, sans-serif;
  --f-body: "Andika", "Avenir Next", "Segoe UI", system-ui, sans-serif;

  --t-xs: .875rem;
  --t-s: 1rem;
  --t-m: 1.125rem;
  --t-l: 1.375rem;
  --t-xl: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
  --t-hero: clamp(2.6rem, 1.6rem + 3.6vw, 4.75rem);

  --gut: max(20px, env(safe-area-inset-left, 0px));
  --gut-r: max(20px, env(safe-area-inset-right, 0px));
  --wash-display: block;
  --wrap: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1f2540; --ink: #f2e8d0; --ink-soft: #bdb3a0; --line: #3b4368;
    --leaf: #b2dc69; --leaf-ink: #1c2a0f; --spike: #f4a05a; --chip-line: #6b74a3; --focus: #f4a05a;
    --wash-display: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1f2540; --ink: #f2e8d0; --ink-soft: #bdb3a0; --line: #3b4368;
  --leaf: #b2dc69; --leaf-ink: #1c2a0f; --spike: #f4a05a; --chip-line: #6b74a3; --focus: #f4a05a;
  --wash-display: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background-color: var(--paper); background-image: url("../img/grain.png?v=243db7d8"); background-size: 256px 256px; color: var(--ink); font: 400 var(--t-m)/1.6 var(--f-body); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 800; line-height: 1.08; margin: 0; text-wrap: balance; }
p { margin: 0; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-left: var(--gut); padding-right: var(--gut-r); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--leaf); color: var(--leaf-ink); padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; cursor: pointer;
  font: 700 var(--t-s)/1 var(--f-body); padding: 15px 24px; border-radius: 999px; border: 0;
  background: var(--leaf); color: var(--leaf-ink);
  transition: transform .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--small { padding: 10px 16px; font-size: var(--t-xs); }
/* on the painted bands the button colors are fixed */
.hero .btn, .top .btn { background: #3f6b1f; color: #fffbea; }
.night .btn { background: #f7e7a8; color: #3a2a1c; }

/* ---------- header (sits on the painted sky) ---------- */
.top { position: absolute; inset: 0 0 auto; z-index: 10; padding-top: env(safe-area-inset-top, 0px); color: var(--sky-ink); }
.top__bar { display: flex; align-items: center; gap: 28px; padding-block: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 1.5rem/1 var(--f-display); }
.brand img { width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 2px 6px rgba(74, 52, 38, .25); }
.nav { display: flex; gap: 24px; margin-left: auto; font-size: var(--t-s); }
.nav a { text-decoration: none; padding-block: 6px; }
.nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
@media (max-width: 720px) { .nav { display: none; } .top__bar .btn { margin-left: auto; } }

/* ---------- hero ---------- */
.hero { position: relative; display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; background: var(--sky-low); color: var(--sky-ink); }
.hero__text { padding-block: calc(96px + env(safe-area-inset-top, 0px)) 8px; background: linear-gradient(var(--sky-top), var(--sky-low)); max-width: none; padding-left: max(20px, env(safe-area-inset-left, 0px), calc((100% - var(--wrap)) / 2 + 20px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.hero h1 { font-size: var(--t-hero); letter-spacing: -0.02em; line-height: 1; }
.hero__lead { margin-top: 18px; max-width: 30em; font-size: clamp(1.0625rem, 1rem + .3vw, 1.25rem); color: #5e4837; }
.hero__cta { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.hero__note { flex-basis: 100%; font-size: var(--t-xs); color: #4a3426; }
@media (min-width: 1024px) { .hero__note { flex-basis: auto; margin-right: auto; padding: 6px 12px; border-radius: 12px; background: rgba(246, 236, 223, .88); } }
.hero__art { position: relative; order: 2; flex: 1 1 auto; min-height: 38svh; }
.hero__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 78% 100%; }
.hero__art::before { /* melt the band into the painting */
  content: ""; position: absolute; inset: 0 0 auto; height: 30%; z-index: 1;
  background: linear-gradient(var(--sky-low), transparent);
}
@media (min-width: 640px) {
  .hero__art img { object-position: 70% 100%; }
}
/* desktop: text sits on the painted sky */
@media (min-width: 1024px) {
  .hero { display: block; background: var(--sky-low); }
  .hero__text { background: none; }
  .hero__art { position: absolute; inset: 0; }
  .hero__art::before { display: block; inset: 0; height: auto; background: linear-gradient(90deg, rgba(246, 236, 223, .72) 0%, rgba(246, 236, 223, .35) 38%, transparent 60%); }
  .hero__art img { object-position: 70% 100%; }
  .hero__text { position: relative; z-index: 2; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-block: calc(110px + env(safe-area-inset-top, 0px)) 120px; }
  .hero__lead { max-width: 24em; }
}

/* ---------- sections ---------- */
.section { padding-block: clamp(48px, 7vw, 96px); border-top: 2px dotted var(--line); }
.head { max-width: 38rem; display: grid; gap: 12px; margin-bottom: clamp(28px, 4vw, 44px); }
.head h2 { font-size: var(--t-xl); }
.head p { color: var(--ink-soft); }

/* ---------- games ---------- */
.areas { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
.chip {
  flex: none; font: 700 var(--t-xs)/1 var(--f-body); padding: 10px 15px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--ink); border: 2px solid var(--chip-line);
  transition: background-color .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--ink-soft); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
@media (max-width: 640px) {
  /* one swipeable row on phones */
  .areas { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: calc(-1 * var(--gut)); margin-right: calc(-1 * var(--gut-r)); padding-left: var(--gut); padding-right: var(--gut-r); padding-bottom: 4px; }
  .areas::-webkit-scrollbar { display: none; }
}
.games { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 36px 24px; }
.game { display: grid; justify-items: center; align-content: start; text-align: center; gap: 6px; transition: opacity .25s, filter .25s; }
.game img { width: min(112px, 100%); aspect-ratio: 1; border-radius: 50%; margin-bottom: 4px; }
.game h3 { font-size: var(--t-m); font-weight: 700; }
.game p { font-size: var(--t-xs); line-height: 1.4; color: var(--ink-soft); max-width: 16em; }
.game[hidden] { display: none; }
.game.is-in { animation: game-in .3s ease-out; }
@keyframes game-in { from { opacity: 0; transform: scale(.92); } }
.games__count { margin-top: 28px; min-height: 1.6em; font-size: var(--t-s); color: var(--ink-soft); }
@media (max-width: 1000px) { .games { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  /* phones: one swipeable row instead of ten rows */
  .games { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
    margin-left: calc(-1 * var(--gut)); margin-right: calc(-1 * var(--gut-r)); padding: 4px var(--gut-r) 12px var(--gut); scroll-padding-inline: var(--gut); }
  .games::-webkit-scrollbar { display: none; }
  .game { flex: 0 0 40%; scroll-snap-align: start; }
  .game img { width: 96px; }
  .games__hint { display: block; }
}

/* ---------- prices ---------- */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.plan { position: relative; display: grid; gap: 6px; padding: 26px 26px 24px; border-radius: 24px; border: 2px solid var(--line); }
.plan--best { border: 3px solid var(--leaf); }
.plan h3 { font-size: var(--t-l); }
.plan__price { font: 800 2.25rem/1.1 var(--f-display); font-variant-numeric: tabular-nums; }
.plan__price small { font: 400 var(--t-s)/1 var(--f-body); color: var(--ink-soft); }
.plan__sub { font-size: var(--t-s); color: var(--ink-soft); }
.plan__flag { position: absolute; top: -14px; left: 22px; background: var(--leaf); color: var(--leaf-ink); font: 700 .8125rem/1 var(--f-body); padding: 7px 12px; border-radius: 999px; }
.small { margin-top: 24px; max-width: 46rem; font-size: var(--t-xs); line-height: 1.55; color: var(--ink-soft); }
@media (max-width: 640px) { .plans { grid-template-columns: minmax(0, 1fr); gap: 26px; } }

/* ---------- FAQ ---------- */
.faq { max-width: 46rem; }
.faq details { border-top: 2px dotted var(--line); }
.faq details:last-child { border-bottom: 2px dotted var(--line); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 18px; font: 700 var(--t-m)/1.3 var(--f-display); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font: 600 1.6rem/1 var(--f-display); color: var(--spike); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding-bottom: 20px; max-width: 38em; color: var(--ink-soft); font-size: var(--t-s); }
.faq a { color: var(--leaf); }

/* ---------- night footer ---------- */
.night { position: relative; background: var(--night); color: var(--night-ink); margin-top: clamp(32px, 5vw, 64px); }
.night__text { padding-block: clamp(40px, 7vw, 64px) clamp(48px, 8vw, 72px); }
.night h2 { font-size: var(--t-xl); }
.night__text p { margin-top: 12px; max-width: 26em; color: var(--night-soft); }
.night__text .btn { margin-top: 24px; }
.night__art { position: relative; }
.night__art img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 80% 100%; }
.night__art::before { content: ""; position: absolute; inset: 0 0 auto; height: 35%; background: linear-gradient(var(--night), transparent); }
@media (min-width: 640px) { .night__art img { aspect-ratio: 16 / 8; object-position: 70% 100%; } }
@media (min-width: 1024px) {
  .night__art { position: absolute; inset: 0; }
  .night__art::before { display: none; }
  .night__art img { height: 100%; aspect-ratio: auto; }
  .night__text { position: relative; z-index: 1; min-height: clamp(520px, 46vw, 760px); padding-block: clamp(80px, 9vw, 140px) 120px; }
}

/* ---------- legal pages ---------- */
.page-top { position: static; color: var(--ink); border-bottom: 2px dotted var(--line); }
.page-top .brand img { box-shadow: none; }
.doc { max-width: 44rem; padding-block: clamp(32px, 6vw, 64px); }
.doc h1 { font-size: var(--t-xl); margin-bottom: 12px; }
.doc h2 { font-size: var(--t-l); margin-top: 40px; margin-bottom: 10px; }
.doc p, .doc ul { margin-bottom: 14px; }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: 6px; }
.doc .meta { color: var(--ink-soft); font-size: var(--t-s); margin-bottom: 24px; }
.doc .summary { font: 600 var(--t-l)/1.35 var(--f-display); margin-bottom: 24px; }
.doc .todo { background: #f7e7a8; color: #4a3426; padding: 0 6px; border-radius: 4px; }
.doc a { color: var(--leaf); text-underline-offset: 3px; }
.lost__mimo { width: 200px; }
.lost__cta { margin-top: 24px; }

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

/* ---------- painted companions next to headings ---------- */
.head-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; margin-bottom: clamp(28px, 4vw, 44px); }
.head-row .head { margin-bottom: 0; }
.head-row__art { width: clamp(120px, 18vw, 230px); }
.games__hint { display: none; margin-top: 4px; font-size: var(--t-xs); color: var(--ink-soft); }
.pass { display: grid; grid-template-columns: minmax(0, 1fr) clamp(180px, 24vw, 280px); gap: clamp(24px, 4vw, 56px); align-items: center; }
.pass__art { justify-self: center; }
@media (max-width: 760px) {
  .pass { grid-template-columns: minmax(0, 1fr); }
  .pass__art { order: -1; width: 170px; margin-bottom: 8px; }
  .plans { grid-template-columns: minmax(0, 1fr); gap: 26px; }
}
@media (max-width: 480px) { .head-row__art { width: 110px; } }
@media (max-width: 640px) { .games__hint { display: block; } }

/* ---------- watercolor washes behind sections ---------- */
.has-wash { position: relative; overflow-x: clip; }
.has-wash > .wrap { position: relative; z-index: 1; }
.wash { position: absolute; z-index: 0; pointer-events: none; mix-blend-mode: multiply; display: var(--wash-display); max-width: none;  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); }
.wash--games { width: min(980px, 130vw); top: -40px; right: max(-260px, calc(50% - 760px)); }
.wash--pass { width: min(900px, 140vw); top: 10%; right: max(-200px, calc(50% - 720px)); }
@media (max-width: 640px) {
  .wash--games { top: 20px; right: -45vw; }
  .wash--pass { top: 0; right: -40vw; }
}

/* =========================================================
   Mimos Tag – scroll story (pinned stage, Apple-style)
   Scroll position drives everything; see js/site.js.
   ========================================================= */
.story { position: relative; background: var(--sky-low); }
.story { height: 620vh; }
.story__stage { position: relative; height: 100vh; height: 100svh; overflow: hidden; }
.story__stage { position: sticky; top: 0; }
.story__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; opacity: 0; }
.story__bg.is-on { opacity: 1; }
.story.is-live .story__bg { opacity: 0; }

/* Mimo, built from the app's layers (positions from Resources/mimo_layers.json) */
.actor { position: absolute; left: 58%; bottom: 4%; height: min(64%, 660px); aspect-ratio: .8056; transform: translateX(-50%); font-size: min(6.4vh, 66px); }
.actor img { position: absolute; max-width: none; }
.actor__body { position: absolute; inset: 0; transform-origin: 50% 100%; animation: mimo-breathe 3.2s ease-in-out infinite; animation-play-state: paused; }
@keyframes mimo-breathe {
  0%, 100% { transform: rotate(-1deg) scale(1, 1); }
  50% { transform: rotate(1deg) scale(.992, 1.012); }
}
.pose { inset: 0; width: 100%; height: 100%; opacity: 0; }
.pose.is-on { opacity: 1; }
.story.is-live .pose { opacity: 0; }
.eyes { left: 33.842%; top: 21.453%; width: 46.325%; height: 18.994%; opacity: 0; }
.actor.is-blink[data-pose="idle"] .eyes[data-eyes="idle"],
.actor.is-blink[data-pose="happy"] .eyes[data-eyes="happy"],
.actor.is-blink[data-pose="thinking"] .eyes[data-eyes="thinking"] { opacity: 1; }
.outfit, .flyer { opacity: 0; }
.flyer { object-fit: contain; will-change: transform, opacity; }
/* the mask must be fitted exactly like the image (object-fit: contain), or JPEG background shows */
.flyer.mk { -webkit-mask-size: contain; mask-size: contain; -webkit-mask-position: center; mask-position: center; }
.outfit--shorts { left: 19.972%; top: 65.698%; width: 65.187%; height: 25.698%; }
.outfit--tshirt { left: 19.972%; top: 46.927%; width: 64.632%; height: 34.19%; }
.outfit--cap { left: 29.958%; top: -0.223%; width: 44.938%; height: 21.006%; }

.prop { opacity: 0; will-change: transform, opacity; }

/* things beside Mimo live in a box to his left */
.props { position: absolute; left: 92%; bottom: 0; width: 64%; height: 100%; }
.prop--plate { left: 4%; bottom: 20%; width: 92%; }
.prop--berry { width: 27%; }
.prop--b1 { left: 18%; bottom: 31%; }
.prop--b2 { left: 39%; bottom: 35%; }
.prop--b3 { left: 59%; bottom: 30%; }
.count {
  position: absolute; left: 30%; bottom: 62%; width: 1.6em; height: 1.6em; margin: 0; display: grid; place-items: center;
  font: 800 1em/1 var(--f-display); color: #4a3426; background: #fffaf0; border-radius: 50%;
  box-shadow: 0 0 0 .07em #4a3426, 0 .12em .3em rgba(74, 52, 38, .25); opacity: 0;
}
.prop--basket { left: 6%; bottom: 4%; width: 88%; }
.prop--buy { bottom: 32%; }
.prop--apple { left: 20%; width: 27%; }
.prop--banana { left: 38%; width: 32%; bottom: 36%; }
.prop--milk { left: 62%; width: 20%; }

/* Mimo talks: three bars like a voice meter */
.bubble {
  position: absolute; left: 80%; top: -4%; width: 1.9em; height: 1.4em; padding: .3em .35em; display: flex; align-items: center; justify-content: space-between;
  background: #fffaf0; border-radius: .6em .6em .6em .15em; box-shadow: 0 0 0 .06em #4a3426; opacity: 0;
}
.bubble span { width: .2em; height: 30%; border-radius: .1em; background: #3f6b1f; animation: talk .9s ease-in-out infinite; animation-play-state: paused; }
.bubble span:nth-child(2) { animation-delay: .15s; }
.bubble span:nth-child(3) { animation-delay: .3s; }
@keyframes talk { 50% { height: 90%; } }
.zzz { position: absolute; left: 70%; top: -6%; margin: 0; font: 800 .9em/1 var(--f-display); color: #fff3cf; opacity: 0; text-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.zzz span { display: inline-block; animation: zzz 2.4s ease-in-out infinite; animation-play-state: paused; }
.zzz span:nth-child(2) { font-size: .8em; animation-delay: .4s; }
.zzz span:nth-child(3) { font-size: .64em; animation-delay: .8s; }
@keyframes zzz { 0%, 100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(-.5em); opacity: 1; } }
.night-veil { position: absolute; inset: 0; background: radial-gradient(ellipse at 66% 80%, transparent 30%, rgba(14, 22, 52, .55)); opacity: 0; pointer-events: none; }

/* captions */
.captions {
  position: absolute; z-index: 2; top: 50%; transform: translateY(-50%);
  left: max(20px, env(safe-area-inset-left, 0px), calc((100% - var(--wrap)) / 2 + 20px)); width: min(440px, 40vw);
  display: grid; padding: 32px 34px 30px; border-radius: 28px; max-height: calc(100% - 32px); overflow-y: auto; overscroll-behavior: contain;
  background: rgba(252, 247, 234, .93); color: #4a3426; box-shadow: 0 18px 40px -18px rgba(74, 52, 38, .45);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.caption { grid-area: 1 / 1; opacity: 0; }
.caption.is-on { opacity: 1; }
.story.is-live .caption { opacity: 0; }
.caption__when { font: 700 var(--t-s)/1.2 var(--f-display); color: #a34f0c; margin-bottom: 8px; }
.caption h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem); margin-bottom: 12px; }
.caption p:last-child { color: #6a5240; font-size: var(--t-m); }
.dots { position: absolute; z-index: 2; right: max(20px, env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.dots li { width: 10px; height: 10px; border-radius: 50%; background: rgba(252, 247, 234, .7); box-shadow: 0 0 0 2px rgba(74, 52, 38, .5); transition: transform .2s, background-color .2s; }
.dots li.is-on { background: #3f6b1f; transform: scale(1.35); }

/* portrait (phones, iPad upright): caption on top, Mimo below */
@media (max-aspect-ratio: 1/1), (max-width: 700px) {
  .story { height: 560vh; }
  .actor { left: 64%; height: 46%; bottom: 3%; font-size: 4.4vh; }
  .props { left: auto; right: 88%; width: 48%; }
  .bubble { left: 56%; top: -12%; }
  .captions { top: calc(16px + env(safe-area-inset-top, 0px)); transform: none; left: 16px; right: 16px; width: auto; max-height: 48%; padding: 20px 22px 18px; border-radius: 22px; }
  .caption h2 { font-size: clamp(1.4rem, 1rem + 2.4vw, 2rem); margin-bottom: 8px; }
  .caption p:last-child { font-size: var(--t-s); }
  .dots { top: auto; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); right: auto; left: 20px; transform: none; display: flex; }
}
.btn--quiet { background: rgba(255, 251, 234, .7) !important; color: #4a3426 !important; box-shadow: inset 0 0 0 2px rgba(74, 52, 38, .35); }

@media (prefers-reduced-motion: reduce) {
  .actor__body, .bubble span, .zzz span { animation: none; }
}

/* teeth: a round magnifier shows Mimo's mouth, monsters sit on the teeth
   (spot coordinates from Games/Teeth/TeethGame.swift) */
.zoom {
  position: absolute; left: 0; bottom: 46%; width: 112%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; opacity: 0;
  background: #fffaf0; box-shadow: 0 0 0 .07em #4a3426, 0 .2em .5em rgba(74, 52, 38, .3); transform-origin: 0% 100%;
}
.zoom__mouth { left: 2%; top: 17%; width: 96%; }
.zoom__monster { width: 20%; transform-origin: 50% 60%; }
/* mouth box: left 2%, top 17%, 96% x 63.4%; spot (x, y) -> left = 2 + 96x - 10, top = 17 + 63.4y - 9 */
.zoom__m1 { left: 30.4%; top: 27%; }
.zoom__m2 { left: 53.4%; top: 27.7%; }
.zoom__m3 { left: 45.8%; top: 57.5%; }
.zoom__brush { left: 40%; top: 12%; width: 22%; transform-origin: 50% 50%; z-index: 2; }

/* the wardrobe cap has its brim on the left, the worn cap on the right: mirror the flying one */
.flyer.outfit--cap { scale: -1 1; }

/* animations play only while the visitor scrolls (class set by js/site.js) */
.story.is-moving .actor__body, .story.is-moving .bubble span, .story.is-moving .zzz span { animation-play-state: running; }
/* the phone games row scrolls sideways: keyboard users can focus and arrow through it */
.games:focus-visible { outline-offset: 6px; }

/* =========================================================
   Footer – design by Nano Banana (art/web/footer_idea_2.png):
   the night tears open into light watercolor paper, little
   meadow animals in the corners, App Store button on a leaf.
   Fixed colours: it is a painted scene in both themes.
   ========================================================= */
.night :focus-visible { outline-color: #f7e7a8; }
.night { margin-bottom: 0; }
.night-strip { height: clamp(90px, 12vw, 150px); margin-top: 64px; background: #1c2f5c url("../img/night-1200.jpg?v=48794d47") 70% 85% / cover no-repeat; }
.foot {
  --foot-paper: #fcf5e6;
  position: relative; isolation: isolate; color: #4a3426;
  background: var(--foot-paper) url("../img/grain.png?v=243db7d8") 0 0 / 256px 256px;
  padding-block: clamp(56px, 7vw, 90px) 0; overflow-x: clip;
}
/* torn, misty paper edge overlapping the night scene */
.foot::before { content: ""; position: absolute; left: -2%; right: -2%; pointer-events: none; z-index: -1; }
.foot::before {
  top: -58px; height: 84px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 84' preserveAspectRatio='none'%3E%3Cpath d='M0 84 L0.0 52.6 L6.4 57.6 L12.2 56.1 L18.7 54.5 L24.7 57.0 L32.5 52.3 L37.3 51.2 L45.2 53.3 L48.4 54.6 L57.2 51.6 L63.9 48.5 L67.0 51.2 L70.4 49.4 L74.8 49.0 L80.6 52.5 L88.7 53.8 L95.5 53.7 L102.5 52.6 L107.1 55.2 L116.1 51.8 L123.4 46.6 L127.7 45.5 L131.2 48.0 L136.6 48.1 L141.9 49.0 L150.0 44.2 L154.2 51.1 L160.0 53.2 L165.4 48.9 L172.2 55.0 L176.8 51.3 L181.8 57.3 L189.4 51.8 L193.8 51.3 L197.2 55.3 L201.3 53.3 L207.0 50.3 L214.3 49.5 L221.2 49.8 L226.7 51.2 L231.4 57.0 L239.2 54.7 L247.5 56.0 L252.8 60.9 L259.7 56.3 L268.6 55.8 L273.2 58.2 L278.2 53.6 L281.6 51.0 L288.1 49.6 L294.7 48.3 L300.4 50.6 L306.3 47.2 L314.5 44.2 L318.4 48.7 L326.4 44.5 L330.5 47.5 L339.1 43.0 L347.8 45.2 L354.5 39.8 L358.1 35.9 L366.9 33.5 L374.1 31.1 L382.0 31.6 L386.8 28.5 L394.1 28.2 L398.5 31.9 L406.6 33.8 L411.3 36.7 L415.5 31.7 L420.1 35.1 L423.5 33.6 L428.7 36.3 L432.5 34.8 L440.8 38.0 L447.8 35.4 L454.3 31.5 L457.5 30.7 L465.9 35.9 L474.7 33.8 L481.5 39.2 L488.9 40.9 L497.9 42.2 L504.2 47.7 L512.6 48.2 L519.8 47.9 L528.3 43.8 L535.4 46.2 L543.6 42.3 L551.4 45.4 L557.8 44.7 L563.1 45.3 L569.8 43.4 L576.6 50.3 L584.9 49.0 L590.2 48.7 L596.7 45.8 L604.7 41.5 L612.2 39.2 L618.8 40.6 L623.2 41.5 L629.2 40.7 L637.7 39.4 L640.8 40.3 L647.9 41.6 L651.9 47.3 L658.8 46.2 L667.2 47.2 L674.2 47.0 L679.8 50.9 L688.3 51.0 L693.6 48.8 L698.5 45.9 L704.4 50.7 L712.5 51.3 L721.2 51.2 L725.3 53.8 L729.9 54.2 L735.4 59.0 L741.4 59.0 L749.4 65.0 L755.1 59.6 L758.3 64.7 L761.5 63.4 L768.0 60.0 L775.7 56.6 L779.5 58.7 L782.7 60.5 L787.1 55.5 L790.4 58.4 L796.1 58.2 L803.0 59.7 L811.7 59.7 L815.9 58.7 L820.0 55.9 L825.8 60.3 L829.9 57.0 L835.0 58.7 L841.1 56.2 L848.7 51.8 L856.4 51.6 L859.9 50.2 L867.3 42.4 L873.0 44.1 L881.4 41.5 L887.9 44.7 L895.6 45.6 L901.4 44.1 L905.6 44.7 L913.6 44.0 L920.9 40.2 L929.3 43.3 L938.1 38.2 L945.9 35.5 L954.3 38.5 L959.4 34.0 L965.1 38.0 L972.7 39.6 L975.8 42.6 L979.2 43.6 L983.3 41.7 L991.0 42.1 L994.9 45.0 L1002.2 47.1 L1009.4 47.0 L1015.3 46.0 L1018.8 40.7 L1025.0 40.0 L1032.4 41.4 L1038.5 42.6 L1044.9 39.6 L1050.2 43.8 L1058.6 41.1 L1066.7 47.0 L1072.8 44.7 L1077.0 44.2 L1083.0 43.7 L1086.2 45.3 L1092.3 39.8 L1100.1 38.2 L1106.0 37.1 L1109.4 35.2 L1114.9 36.8 L1123.5 31.8 L1129.3 31.3 L1134.9 36.5 L1143.3 35.9 L1148.2 34.9 L1154.9 40.5 L1158.7 39.8 L1161.8 36.1 L1166.2 39.1 L1171.1 36.6 L1177.9 34.2 L1185.2 33.6 L1191.3 34.2 L1195.5 36.3 L1200 84 Z' fill='%23fcf5e6'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
}
.foot__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) auto; gap: 32px 48px; align-items: center; }
.foot__brand { position: relative; display: grid; gap: 14px; justify-items: start; padding-block: 18px; }
.foot__cloud { position: absolute; z-index: -1; left: -7%; top: -18%; width: min(500px, 115%); max-width: none; mix-blend-mode: multiply; opacity: .95; }
.foot__logo { display: inline-flex; align-items: center; gap: 16px; text-decoration: none; color: #4a3426; font: 800 clamp(2rem, 1.4rem + 2vw, 3rem)/1 var(--f-display); letter-spacing: -0.01em; }
.foot__logo img { width: clamp(52px, 5vw, 72px); height: auto; border-radius: 18px; box-shadow: 0 0 0 3px #fffaf0, 0 4px 10px rgba(74, 52, 38, .22); }
.foot__claim { font: 600 var(--t-l)/1.3 var(--f-body); color: #4a3426; }
.foot__links { display: grid; grid-template-columns: repeat(2, max-content); gap: 10px 36px; font-size: var(--t-m); }
.foot__links a { color: #4a3426; text-decoration: none; padding-block: 6px; }
.foot__links a:hover { text-decoration: underline; text-decoration-color: #b85c10; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.foot__links a[href^="mailto"] { grid-column: 1 / -1; }
.leafbtn { position: relative; display: grid; place-items: center; width: clamp(200px, 18vw, 240px); aspect-ratio: 480 / 279; text-decoration: none; color: #3a2a1c; transform: rotate(-4deg); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.leafbtn:hover { transform: rotate(0deg) scale(1.04); }
.leafbtn__leaf { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 6px 6px rgba(74, 52, 38, .18)); }
.leafbtn__label { position: relative; display: inline-flex; align-items: center; gap: 8px; margin-left: 14%; font: 800 1.125rem/1 var(--f-display); text-align: left; }
.leafbtn__label small { display: block; font: 600 .75rem/1.2 var(--f-body); }
.leafbtn__label svg { width: 20px; height: 20px; flex: none; }
.leafbtn:focus-visible { outline: 3px solid #3f6b1f; outline-offset: 2px; border-radius: 50%; }
.foot__copy { position: relative; text-align: center; font-size: var(--t-xs); color: #5e4837; padding-block: clamp(36px, 5vw, 64px) max(28px, env(safe-area-inset-bottom, 0px)); }
.foot :focus-visible { outline-color: #3f6b1f; }

.foot__deco { position: absolute; inset: 0; pointer-events: none; }
.deco { position: absolute; max-width: none; height: auto; }
.deco--grass-l { left: -30px; bottom: -10px; width: clamp(150px, 20vw, 290px); }
.deco--grass-r { right: -30px; bottom: -10px; width: clamp(150px, 20vw, 290px); transform: scaleX(-1); }
.deco--snail { left: clamp(10px, 3vw, 60px); bottom: clamp(18px, 2.4vw, 36px); width: clamp(64px, 7.5vw, 110px); }
.deco--snail2 { right: clamp(110px, 12vw, 200px); bottom: clamp(16px, 2vw, 30px); width: clamp(44px, 4.8vw, 70px); }
.deco--hedgehog { right: clamp(14px, 3vw, 56px); bottom: clamp(26px, 3vw, 44px); width: clamp(86px, 9vw, 136px); }
.deco--bee1 { left: 3%; top: 46%; width: 50px; transform: rotate(-8deg); }
.deco--bee2 { right: 8%; top: 22%; width: 44px; transform: scaleX(-1) rotate(-6deg); }
.deco--bee3 { left: 64%; bottom: 14%; width: 40px; transform: rotate(10deg); }
.deco--star1 { left: 41%; top: 26%; width: 28px; }
.deco--star2 { right: 4%; top: 52%; width: 24px; transform: rotate(14deg); }
.deco--star3 { left: 27%; bottom: 13%; width: 22px; transform: rotate(-12deg); }

@media (max-width: 960px) {
  .foot__grid { grid-template-columns: minmax(0, 1fr) auto; }
  .foot__brand { grid-column: 1 / -1; }
  .deco--star1 { left: 70%; top: 12%; }
}
@media (max-width: 640px) {
  .foot { padding-top: 40px; text-align: center; }
  .foot__grid { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 22px; }
  .foot__brand { justify-items: center; gap: 8px; padding-block: 12px; }
  .foot__cloud { left: 50%; top: -14%; width: 360px; transform: translateX(-50%); }
  .foot__claim { font-size: var(--t-m); }
  .foot__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 22px; font-size: var(--t-s); }
  .foot__links a[href^="mailto"] { flex-basis: 100%; }
  .leafbtn { width: 190px; }
  .foot__copy { padding-block: 22px max(104px, env(safe-area-inset-bottom, 0px)); }
  .deco--bee1, .deco--bee3, .deco--star3, .deco--star1 { display: none; }
  .deco--bee2 { top: 7%; right: 6%; }
  .deco--star2 { top: auto; bottom: 34%; right: 8%; }
}
@media (prefers-reduced-motion: reduce) { .leafbtn:hover { transform: rotate(-4deg); } }
