/* Landing page (launch plan 4.9). One small script (landing.js, the robot game), no cookies, no analytics,
   no outside fonts: Nunito comes from fonts/ (SIL Open Font License). */
@font-face { font-family: Nunito; src: url("fonts/Nunito-400.ttf") format("truetype"); font-weight: 400; }
@font-face { font-family: Nunito; src: url("fonts/Nunito-800.ttf") format("truetype"); font-weight: 800; }

:root {
  --teal: #3bceac;
  --ink: #1f2a44;
  --blue: #3d63f2;
  --yellow: #ffd23f;
  --paper: #fff7ea;
  --orange: #f47c20;
  --purple: #8b5cf6;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 18px/1.55 Nunito, system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--blue); }
img { display: block; max-width: 100%; height: auto; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* Top bar */
.top { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }
.top img { width: 132px; }
.top a { font-weight: 800; text-decoration: none; }

/* Hero */
.hero { background: var(--teal); }
.hero .wrap { padding-top: 8px; padding-bottom: 56px; text-align: center; }
.hero .icon { width: 112px; margin: 8px auto 12px; border-radius: 26px; box-shadow: 0 10px 24px rgba(31, 42, 68, .18); }
.hero .name { font-weight: 800; font-size: 20px; margin: 0 0 18px; }
.hero h1 { font-weight: 800; font-size: clamp(32px, 6vw, 54px); line-height: 1.12; margin: 0 auto; max-width: 15em; text-wrap: balance; }
.hero h1 span { display: block; margin-top: 10px; }
.hero .store {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 28px;
  background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 22px;
  font-weight: 800; font-size: 17px;
}

/* The mystery to play: three beats, then the room and a panel like the app's */
.play { padding: 48px 20px 40px; }
.beats { list-style: none; margin: 0 auto 24px; padding: 0; display: grid; gap: 10px; max-width: 760px; }
.beats li { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 21px; line-height: 1.25; transition: opacity .3s; }
.js .beats li { opacity: .4; }
.js .beats li.now, .js .beats li.done { opacity: 1; }
.beats .num {
  flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  color: #fff; font-size: 19px; background: var(--ink);
}
.beats li:nth-child(1) .num { background: var(--purple); }
.beats li:nth-child(2) .num { background: var(--blue); }
.beats li:nth-child(3) .num { background: var(--orange); }
.beats li:nth-child(4) .num { background: #1e8fc4; }
.js .beats li.done .num { background: #2e9e5b; }
.nw { white-space: nowrap; }

.game {
  max-width: 760px; margin: 0 auto; background: #fff; border-radius: 28px; overflow: hidden;
  border: 3px solid var(--ink); box-shadow: 0 18px 40px rgba(31, 42, 68, .14);
}
.scene svg { display: block; width: 100%; height: auto; }
.panel { padding: 18px 20px 22px; min-height: 210px; }
.panel p { margin: 0 0 10px; }
.line { font-size: 18px; }
.q { font-weight: 800; font-size: 19px; }
.result { font-weight: 800; font-size: 22px; }
.good { color: #2e9e5b; }
.bad { color: #e5484d; }

.opts { display: grid; gap: 10px; margin-top: 6px; }
.opt, .btn, .part {
  font: inherit; font-weight: 800; cursor: pointer; border-radius: 16px; text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.opt { background: #fff; color: var(--ink); border: 3px solid #c9b8f5; padding: 12px 16px; font-size: 17px; }
.opt:hover:not(:disabled) { border-color: var(--purple); }
.opt.picked { border-color: var(--purple); background: #f3efff; }
.opt.right { border-color: #2e9e5b; background: #e8f7ee; }
.opt.wrong { border-color: #e5484d; background: #fdecec; }
.opt:disabled { cursor: default; }
.btn {
  display: block; width: 100%; margin-top: 14px; border: 0; color: #fff; padding: 14px 18px;
  font-size: 18px; text-align: center; border-radius: 999px;
}
.btn.purple { background: var(--purple); }
.btn.orange { background: var(--orange); }
.btn.blue { background: var(--blue); }
.btn:disabled { opacity: .5; cursor: default; }

.decided { background: var(--ink); color: #fff; border-radius: 18px; padding: 14px 16px; margin-top: 4px; }
.d-title { font-weight: 800; font-size: 15px; opacity: .85; }
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 6px; text-align: center; }
.flow small { display: block; font-size: 12px; opacity: .75; }
.flow b { display: block; color: var(--yellow); font-size: 15px; line-height: 1.2; }
.flow b.bot { color: #8fb0ff; letter-spacing: 2px; }
.flow i { font-style: normal; color: #4ade80; font-weight: 800; }

.part {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; width: 100%;
  background: #fff4ea; border: 3px dashed var(--orange); padding: 12px 14px; color: var(--ink);
  touch-action: none; user-select: none;
}
.part b { font-size: 17px; }
.part small { grid-column: 2; font-weight: 400; font-size: 15px; }
.part-ico, .ghost { width: 34px; height: 34px; border-radius: 9px; background: var(--blue); border: 3px solid var(--ink); position: relative; grid-row: span 2; }
.part-ico::after, .ghost::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #fff; }
.ghost { position: fixed; z-index: 10; transform: translate(-50%, -50%) scale(1.3); pointer-events: none; }

#robot, #cat .cat-in, .robot-in { transform-box: fill-box; }
.robot-in { transform-origin: center bottom; transition: transform .25s; }
#robot.target .robot-in { transform: scale(1.25); }
#robot.pop .robot-in { transform: scale(1.15); }
#burst, #meow, #sensor, #ray { transition: opacity .2s; }
#cat.jump .cat-in { animation: jump .5s ease-out; transform-origin: center bottom; }
@keyframes jump { 40% { transform: translateY(-14px); } }
.burst-t { font: 800 10px Nunito, sans-serif; fill: #e5484d; }
.bubble { font: 800 16px Nunito, sans-serif; fill: var(--ink); }
.ray-t { font: 800 13px Nunito, sans-serif; fill: var(--blue); }
.pic-q { font: 800 40px Nunito, sans-serif; fill: #4d7cfe; }
#pic-q, #pic-normal, #pic-heat { transition: opacity .35s; }

.vac { display: none; }
.sock-t { font: 800 13px Nunito, sans-serif; fill: #fff; }
#vac.go { animation: around 3.2s ease-in-out forwards; }
@keyframes around {
  0% { transform: translate(0, 0); }
  25% { transform: translate(40px, 0); }
  45% { transform: translate(100px, -34px); }
  70% { transform: translate(190px, -34px); }
  100% { transform: translate(250px, 0); }
}
@media (prefers-reduced-motion: reduce) { #vac.go { animation-duration: .4s; } }
.rw-out { font-weight: 800; margin-top: 12px !important; }

/* The featuring story's "Aha!" line, above the safe line */
.aha { text-align: center; font-size: 20px; line-height: 1.45; margin: 0 auto; padding-top: 28px; max-width: 30em; text-wrap: balance; }

/* Safe to hand over */
.safe { background: #fff; border-top: 2px solid #efe5d3; border-bottom: 2px solid #efe5d3; }
.safe-line { text-align: center; font-weight: 800; font-size: 19px; margin: 0 auto; padding: 14px 20px 28px; }

/* Footer */
footer .wrap { padding: 32px 20px 48px; display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; justify-content: center; font-size: 16px; }

/* Wide screens: room and panel side by side */
@media (min-width: 840px) {
  .game { max-width: 980px; display: grid; grid-template-columns: 1.35fr 1fr; }
  .scene { display: flex; align-items: center; padding: 16px 0 16px 16px; }
  .scene svg { border-radius: 18px; }
  .beats { max-width: 980px; grid-template-columns: repeat(4, auto); justify-content: space-between; }
  .beats li { font-size: 17px; }
}

/* Sound on/off, top left of the scene */
.game { position: relative; }
.sound {
  position: absolute; top: 10px; left: 10px; z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--ink); background: #fff; color: var(--ink); display: grid; place-items: center; cursor: pointer; padding: 0;
}
.sound svg { width: 24px; height: 24px; }
.sound .slash { display: none; }
.sound.off .waves { display: none; }
.sound.off .slash { display: inline; }
.sound.off { opacity: .8; }
.sound[hidden] { display: none; }

/* End of the game, under the card: more mysteries in the app (the App Store
   badge replaces the pill at launch) */
.more { margin: 22px auto 0; text-align: center; }
.more.in { animation: more-in .5s ease-out; }
@keyframes more-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.more p { font-weight: 800; font-size: 19px; margin: 0 0 12px; text-wrap: balance; }
.more .cta { display: inline-block; background: var(--ink); color: #fff; border-radius: 14px; padding: 10px 18px; font-size: 16px; }

/* Phones: get the game into the first screen. The four steps become a bar of
   numbered dots; only the step being played shows its words. */
@media (max-width: 599px) {
  .top { padding: 10px 0; }
  .top img { width: 112px; }
  .hero .wrap { padding-bottom: 28px; }
  .hero .icon { display: inline-block; vertical-align: middle; width: 44px; border-radius: 12px; margin: 0 8px 0 0; box-shadow: none; }
  .hero .name { display: inline-block; vertical-align: middle; font-size: 16px; margin: 0; }
  .hero h1 { margin-top: 14px; font-size: clamp(25px, 7.4vw, 30px); }
  .hero h1 span { margin-top: 4px; }
    .hero .store { margin-top: 16px; padding: 9px 16px; font-size: 15px; }
  .play { padding-top: 24px; }
    /* The dots stay put in one row (1 2 3 4); the current step's words always sit
     to their right. The li boxes step aside (display: contents) so the dots and
     the words line up as one row. */
  .js .beats { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; min-height: 44px; }
  .js .beats li { display: contents; font-size: 18px; }
  .js .beats li > span:not(.num) { display: none; }
  .js .beats li.now > span:not(.num) { display: block; order: 1; flex: 1; margin-left: 6px; font-weight: 800; font-size: 18px; line-height: 1.25; }
  .js .beats .num { width: 32px; height: 32px; font-size: 16px; transition: opacity .3s; }
  .js .beats li:not(.now):not(.done) .num { opacity: .4; }
  .js .beats li.now .num { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
  .aha { font-size: 18px; padding-top: 22px; }
  .safe-line { font-size: 17px; padding-bottom: 22px; }
}
