:root {
  --bg: #F5F3EB;
  --bg-top: #E8EDE3;
  --card: #FFFEFA;
  --text: #26352B;
  --muted: #66736A;
  --stroke: rgba(38, 53, 43, 0.09);
  --emerald: #78977A;
  --emerald-deep: #5E7E61;
  --accent-text: #56775A;
  --btn: #1B231D;
  --btn-text: #FFFFFF;
  --bubble: #FFFEFA;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121813;
    --bg-top: #1A231C;
    --card: #1C251E;
    --text: #E9EEE6;
    --muted: #A3B0A5;
    --stroke: rgba(233, 238, 230, 0.10);
    --accent-text: #A9C2A9;
    --btn: #F5F3EB;
    --btn-text: #1B231D;
    --bubble: #232D25;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 42%) fixed, var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap {
  max-width: 440px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}

/* First screen: exactly one viewport tall (small-viewport units so mobile
   browser bars never hide the buttons). Scoop's stage takes the leftover. */
.fold {
  display: flex; flex-direction: column;
  height: calc(100vh - max(14px, env(safe-area-inset-top)) - 12px);
  height: calc(100svh - max(14px, env(safe-area-inset-top)) - 12px);
  min-height: 330px;
  max-height: 900px;
}
.fold > * { flex: none; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.brand img { border-radius: 9px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.brand b { color: var(--emerald-deep); }
@media (prefers-color-scheme: dark) { .brand b { color: var(--accent-text); } }

.hero { text-align: center; }
.fold > .stage { flex: 1 1 auto; position: relative; min-height: 0; max-height: 380px; margin: 2px 0 0; }
#scoop {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  display: block; /* width/height set by scoop.js to fit the stage */ cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.bubble {
  position: absolute; left: 50%; top: 2%; transform: translateX(-50%);
  margin: 0; padding: 7px 13px; white-space: nowrap;
  background: var(--bubble); border: 1px solid var(--stroke); border-radius: 999px;
  font-size: 14px; font-weight: 700; color: var(--accent-text);
  box-shadow: 0 6px 18px rgba(38,53,43,.10);
}
.sound {
  position: absolute; right: 0; bottom: 8%; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; padding: 0; cursor: pointer;
  display: grid; place-items: center;
  background: var(--bubble); color: var(--muted); border: 1px solid var(--stroke);
  box-shadow: 0 4px 14px rgba(38,53,43,.10); -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, color .2s ease;
}
.sound svg { width: 21px; height: 21px; }
.sound .i-on, .sound.on .i-off { display: none; }
.sound.on .i-on { display: block; }
.sound.on { color: var(--emerald-deep); }
.sound:active { transform: scale(.92); }
.sound:focus-visible { outline: 3px solid var(--emerald); outline-offset: 2px; }
@media (prefers-color-scheme: dark) { .sound.on { color: var(--accent-text); } }
.bubble.pop { animation: pop .35s cubic-bezier(.3,1.6,.5,1); }
@keyframes pop { from { transform: translateX(-50%) scale(.82); opacity: .2; } to { transform: translateX(-50%) scale(1); opacity: 1; } }

h1 { font-size: clamp(25px, min(8.4vw, 4.4svh), 38px); line-height: 1.08; letter-spacing: -0.025em; margin: 4px 0 8px; font-weight: 850; }
.lede { color: var(--muted); margin: 0 auto; max-width: 34ch; font-size: clamp(14.5px, 2.1svh, 16.5px); }

.ctas { display: flex; flex-direction: column; gap: 10px; margin: clamp(12px, 2.6svh, 24px) 0 0; }
.ctas.android-first { flex-direction: column-reverse; }
.store {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 60px; padding: 10px 18px; border-radius: 16px;
  background: var(--btn); color: var(--btn-text); text-decoration: none;
  font-weight: 700; font-size: 20px; letter-spacing: -0.01em;
  transition: transform .12s ease, box-shadow .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.store svg { width: 28px; height: 28px; flex: none; }
.store span { display: flex; flex-direction: column; line-height: 1.1; text-align: left; min-width: 128px; }
.store small { font-size: 11.5px; font-weight: 500; opacity: .8; letter-spacing: .01em; }
.store:active { transform: scale(.97); }
.store.primary { background: var(--emerald-deep); color: #fff; box-shadow: 0 10px 24px rgba(94,126,97,.35); }
.store:focus-visible { outline: 3px solid var(--emerald); outline-offset: 3px; }

.stats { margin: 30px 0 0; background: var(--card); border: 1px solid var(--stroke); border-radius: 20px; padding: 16px; }
.stats-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.stats-head h2 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.stats-head a { color: var(--accent-text); font-weight: 650; font-size: 14px; text-decoration: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3FB45A; box-shadow: 0 0 0 0 rgba(63,180,90,.6); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(63,180,90,0); } 100% { box-shadow: 0 0 0 0 rgba(63,180,90,0); } }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--bg); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.tile b { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 13px; }

/* Short screens (small phones, landscape, browser chrome eating height). */
@media (max-height: 640px) {
  .store { min-height: 52px; font-size: 18px; }
  .store small { font-size: 10.5px; }
  .brand { font-size: 17px; }
  .brand img { width: 30px; height: 30px; }
  .bubble { font-size: 12.5px; padding: 5px 11px; }
}
@media (max-height: 560px) {
  .lede { display: none; }
}
/* Landscape phones: Scoop beside the text so the buttons still show. */
@media (orientation: landscape) and (max-height: 500px) {
  .wrap { max-width: 820px; }
  .fold {
    display: grid; grid-template-columns: 1fr 1.25fr; grid-template-rows: auto 1fr auto auto;
    column-gap: 20px; min-height: 0;
  }
  .brand { grid-column: 1 / -1; }
  .fold > .stage { grid-column: 1; grid-row: 2 / 5; max-height: none; }
  .hero, .ctas { grid-column: 2; text-align: left; }
  .hero { grid-row: 2; align-self: end; }
  .ctas { grid-row: 3; flex-direction: row; }
  .ctas.android-first { flex-direction: row-reverse; }
  .store { flex: 1; min-height: 50px; }
  .store span { min-width: 0; white-space: nowrap; }
  .store { font-size: 16px; gap: 9px; padding: 8px 12px; }
  h1 { font-size: clamp(22px, 7svh, 30px); }
}

footer { text-align: center; color: var(--muted); font-size: 13px; margin: 28px 0 6px; }

@media (prefers-reduced-motion: reduce) {
  .bubble.pop, .dot { animation: none; }
}
