/* Landing page: everything fits in one screen (100dvh), no scrolling. */

body.landing { overflow: hidden; }

/* ---------- Floating colour backdrop ---------- */
.backdrop { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .32; animation: float 18s ease-in-out infinite alternate; }
.b1 { width: 42vmax; height: 42vmax; background: var(--primary); top: -18vmax; right: -10vmax; }
.b2 { width: 30vmax; height: 30vmax; background: var(--red); bottom: -14vmax; right: 18vw; animation-delay: -6s; opacity: .18; }
.b3 { width: 26vmax; height: 26vmax; background: var(--yellow); top: 30vh; left: -12vmax; animation-delay: -11s; opacity: .2; }
.b4 { width: 20vmax; height: 20vmax; background: var(--green); bottom: -8vmax; left: 22vw; animation-delay: -3s; opacity: .14; }
@keyframes float { to { transform: translate3d(4vmax, 3vmax, 0) scale(1.08); } }

/* ---------- Page frame ---------- */
.page {
  position: relative; z-index: 1; height: 100vh; height: 100dvh;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 8px;
  padding: max(18px, env(safe-area-inset-top)) clamp(20px, 4.5vw, 64px) max(16px, env(safe-area-inset-bottom));
  max-width: 1440px; margin: 0 auto;
}
.topbar { display: flex; align-items: center; justify-content: space-between; }
.top-link { color: var(--muted); font-weight: 800; }

.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: clamp(16px, 3vw, 48px); min-height: 0; }

/* ---------- Copy ---------- */
.copy { position: relative; z-index: 2; max-width: 700px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; padding: 8px 16px; border-radius: 999px;
  background: var(--surface); box-shadow: 0 6px 20px rgba(28, 31, 59, .07); font-weight: 800; font-size: 14px; color: var(--muted); }
.pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(34, 165, 91, .5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(34, 165, 91, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 165, 91, 0); } }
.copy h1 { margin: 0; font-weight: 900; letter-spacing: -.035em; line-height: 1.02; font-size: clamp(36px, min(5vw, 8.4vh), 80px); }
.copy h1 .line { white-space: nowrap; }
.gradient { background: linear-gradient(100deg, var(--red) 0%, var(--orange) 22%, var(--yellow) 40%, var(--green) 60%, var(--blue) 80%, var(--purple) 100%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 8s ease-in-out infinite alternate; }
@keyframes shimmer { to { background-position: 100% 0; } }
.lede { margin: clamp(14px, 2.4vh, 24px) 0 0; font-size: clamp(16px, min(1.5vw, 2.3vh), 20px); line-height: 1.55; color: var(--muted); font-weight: 600; max-width: 520px; }
.cta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 20px; margin-top: clamp(18px, 3.4vh, 34px); }
.store-badge { display: inline-block; border-radius: 14px; transition: transform .15s ease, box-shadow .15s ease; box-shadow: 0 10px 26px rgba(0, 0, 0, .18); }
.store-badge:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(0, 0, 0, .22); text-decoration: none; }
.store-badge img { display: block; height: clamp(48px, 7vh, 60px); width: auto; }
.store-badge.soon { cursor: default; }
.cta-note { font-weight: 800; color: var(--muted); font-size: 15px; }
.highlights { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: clamp(16px, 3vh, 30px) 0 0; }
.highlights li { padding: 9px 16px; border-radius: 999px; background: rgba(255, 255, 255, .75); font-weight: 700; color: var(--muted); font-size: 15px;
  box-shadow: 0 4px 14px rgba(28, 31, 59, .05); }
.highlights b { color: var(--ink); font-weight: 900; }

/* ---------- Phone stage ---------- */
.stage { position: relative; height: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; container-type: size; }
.stage::before { /* soft glow behind the phone */
  content: ""; position: absolute; width: 70cqmin; height: 70cqmin; border-radius: 50%;
  background: radial-gradient(circle, rgba(75, 87, 224, .35), rgba(75, 87, 224, 0) 70%); filter: blur(10px);
}
.phone {
  --h: min(97cqh, 780px, calc(97cqw / .49));
  --rx: 0deg; --ry: -8deg;
  position: relative; height: var(--h); width: calc(var(--h) * .49); flex: none;
  padding: calc(var(--h) * .014); border-radius: calc(var(--h) * .078);
  background: linear-gradient(150deg, #3a3e5c, #11131f 45%, #2a2d44);
  box-shadow: inset 0 0 0 calc(var(--h) * .0025) #5d6184, 0 calc(var(--h) * .05) calc(var(--h) * .1) rgba(28, 31, 59, .28),
    0 calc(var(--h) * .012) calc(var(--h) * .02) rgba(28, 31, 59, .2);
  transform: perspective(1800px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
  /* fades the bottom of the phone into the page */
  -webkit-mask-image: linear-gradient(to bottom, #000 82%, rgba(0, 0, 0, .15) 100%);
  mask-image: linear-gradient(to bottom, #000 82%, rgba(0, 0, 0, .15) 100%);
}
.phone-button { position: absolute; width: calc(var(--h) * .006); background: #2a2d44; border-radius: 2px; }
.phone-button.left { left: calc(var(--h) * -.005); }
.phone-button.left.one { top: 22%; height: 6%; }
.phone-button.left.two { top: 30%; height: 6%; }
.phone-button.right { right: calc(var(--h) * -.005); top: 26%; height: 10%; }

.screen { --u: calc(100cqw / 390); position: relative; width: 100%; height: 100%; overflow: hidden; container-type: size;
  border-radius: calc(var(--h) * .066); background: var(--bg); user-select: none; -webkit-user-select: none; }
.island { position: absolute; z-index: 3; top: calc(var(--u) * 11); left: 50%; transform: translateX(-50%);
  width: calc(var(--u) * 124); height: calc(var(--u) * 36); border-radius: 999px; background: #000; }
.statusbar { position: absolute; z-index: 2; top: 0; left: 0; right: 0; height: calc(var(--u) * 54); display: flex; align-items: center;
  justify-content: space-between; padding: calc(var(--u) * 6) calc(var(--u) * 34) 0 calc(var(--u) * 40);
  font-size: calc(var(--u) * 17); font-weight: 700; font-family: -apple-system, "SF Pro Text", system-ui, sans-serif; }
.status-icons { display: flex; align-items: center; gap: calc(var(--u) * 6); }
.status-icons i { display: block; background: var(--ink); border-radius: calc(var(--u) * 2); }
.sig { width: calc(var(--u) * 17); height: calc(var(--u) * 11); clip-path: polygon(0 100%, 100% 0, 100% 100%); }
.wifi { width: calc(var(--u) * 15); height: calc(var(--u) * 11); border-radius: 50% 50% 0 0 / 100% 100% 0 0 !important; clip-path: polygon(50% 100%, 0 25%, 100% 25%); }
.bat { width: calc(var(--u) * 25); height: calc(var(--u) * 12); border-radius: calc(var(--u) * 3.5) !important; }

/* ---------- App UI inside the phone (sizes in app points via --u) ---------- */
.app { position: absolute; inset: calc(var(--u) * 58) calc(var(--u) * 24) calc(var(--u) * 26); display: flex; flex-direction: column; gap: calc(var(--u) * 18); }
.app-header { display: flex; align-items: center; justify-content: space-between; }
.icon-btn { width: calc(var(--u) * 52); height: calc(var(--u) * 52); border-radius: calc(var(--u) * 18); background: var(--surface);
  display: grid; place-items: center; box-shadow: 0 calc(var(--u) * 4) calc(var(--u) * 10) rgba(28, 31, 59, .06); }
.icon-btn svg, .toolbar svg { width: calc(var(--u) * 22); height: calc(var(--u) * 22); fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.app-title { text-align: center; display: grid; gap: calc(var(--u) * 2); }
.app-title b { font-size: calc(var(--u) * 28); font-weight: 900; }
.app-title span { font-size: calc(var(--u) * 16); font-weight: 700; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(var(--u) * 12); }
.stats div { background: var(--surface); border-radius: calc(var(--u) * 22); padding: calc(var(--u) * 13) 0; text-align: center; display: grid; gap: calc(var(--u) * 3);
  box-shadow: 0 calc(var(--u) * 4) calc(var(--u) * 12) rgba(28, 31, 59, .06); }
.stats small { font-size: calc(var(--u) * 12.5); font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stats b { font-size: calc(var(--u) * 28); font-weight: 900; font-variant-numeric: tabular-nums; }
.board-card { background: var(--surface); border-radius: calc(var(--u) * 28); padding: calc(var(--u) * 14);
  box-shadow: 0 calc(var(--u) * 6) calc(var(--u) * 16) rgba(28, 31, 59, .06); }
#board { display: block; width: 100%; height: auto; touch-action: none; cursor: pointer; }
.pair-row { display: flex; justify-content: center; gap: calc(var(--u) * 10); }
.pair-row i { width: calc(var(--u) * 32); height: calc(var(--u) * 32); border-radius: 50%; border: calc(var(--u) * 3) solid; display: grid; place-items: center;
  color: #fff; font-style: normal; font-weight: 900; font-size: calc(var(--u) * 15); transition: transform .25s; }
.pair-row i.done { transform: scale(1.06); }
.toolbar { margin-top: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(var(--u) * 14); }
.toolbar button { all: unset; cursor: pointer; display: grid; justify-items: center; gap: calc(var(--u) * 6); padding: calc(var(--u) * 15) 0;
  border-radius: calc(var(--u) * 20); background: var(--surface); font-size: calc(var(--u) * 18); font-weight: 900; color: var(--ink);
  box-shadow: 0 calc(var(--u) * 5) 0 var(--track); transition: transform .1s, box-shadow .1s; }
.toolbar button:active { transform: translateY(calc(var(--u) * 4)) scale(.97); box-shadow: 0 calc(var(--u) * 1) 0 var(--track); }
.toolbar button.hint { background: var(--hint); box-shadow: 0 calc(var(--u) * 5) 0 #E3B21F; }
.toolbar svg { width: calc(var(--u) * 24); height: calc(var(--u) * 24); }

/* Win sheet */
.win { position: absolute; inset: 0; z-index: 4; display: flex; align-items: flex-end; padding: calc(var(--u) * 24);
  background: linear-gradient(to bottom, rgba(244, 245, 251, 0) 30%, rgba(244, 245, 251, .7)); animation: fade .3s ease; }
.win[hidden] { display: none; }
.win-card { width: 100%; background: var(--surface); border-radius: calc(var(--u) * 32); padding: calc(var(--u) * 26) calc(var(--u) * 24) calc(var(--u) * 30);
  display: grid; justify-items: center; gap: calc(var(--u) * 8); box-shadow: 0 calc(var(--u) * 18) calc(var(--u) * 40) rgba(28, 31, 59, .18);
  animation: rise .45s cubic-bezier(.2, .9, .3, 1.2); }
.stars { display: flex; align-items: flex-end; gap: calc(var(--u) * 14); color: var(--star); font-style: normal; }
.stars i { font-style: normal; font-size: calc(var(--u) * 44); line-height: 1; animation: pop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.stars i.big { font-size: calc(var(--u) * 60); transform: translateY(calc(var(--u) * -14)); animation-delay: .15s; }
.stars i:last-child { animation-delay: .3s; }
.win-card b { font-size: calc(var(--u) * 40); font-weight: 900; }
.win-card span { font-size: calc(var(--u) * 16); font-weight: 700; color: var(--muted); }
.win-card .next { margin-top: calc(var(--u) * 10); background: var(--primary); color: #fff; padding: calc(var(--u) * 14) calc(var(--u) * 34);
  border-radius: calc(var(--u) * 20); font-size: calc(var(--u) * 20); font-weight: 900; box-shadow: 0 calc(var(--u) * 5) 0 var(--primary-step); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40%); opacity: 0; } }
@keyframes pop { from { transform: scale(.2); opacity: 0; } }

.try-me { position: absolute; z-index: 3; bottom: 9%; left: 50%; transform: translateX(-50%); margin: 0; white-space: nowrap;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px;
  box-shadow: 0 10px 30px rgba(28, 31, 59, .3); transition: opacity .4s, transform .4s; animation: bob 2.4s ease-in-out infinite;
  pointer-events: none; /* a label only — never blocks the board or toolbar underneath */ }
.try-me span { color: var(--hint); font-weight: 900; margin-right: 4px; }
.try-me.gone { opacity: 0; pointer-events: none; transform: translate(-50%, 10px); animation: none; }
@keyframes bob { 50% { transform: translate(-50%, -6px); } }

.site-footer { position: relative; z-index: 2; }

/* ---------- Narrow screens: phone sits behind the copy and fades out ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 0; text-align: center; }
  .copy { margin: 0 auto; }
  .eyebrow { margin-bottom: 12px; }
  .lede { margin-left: auto; margin-right: auto; font-size: 16px; }
  .cta { justify-content: center; flex-direction: column; gap: 10px; }
  .cta-note { font-size: 13px; }
  .highlights { display: none; }
  /* The phone peeks up from the bottom and fades out, clipped to its own area. */
  .stage { overflow: hidden; align-items: flex-start; margin-top: 14px; }
  .stage::before { top: 10%; }
  .phone { --h: min(118cqh, 760px, calc(86cqw / .49)); --ry: 0deg;
    -webkit-mask-image: linear-gradient(to bottom, #000 62%, rgba(0, 0, 0, 0) 92%);
    mask-image: linear-gradient(to bottom, #000 62%, rgba(0, 0, 0, 0) 92%); }
  .try-me { bottom: 6%; font-size: 13px; padding: 8px 14px; }
  .site-footer { justify-content: center; text-align: center; font-size: 13px; }
}
@media (max-width: 860px) and (max-height: 700px) { .lede { display: none; } }
@media (max-height: 560px) and (min-width: 861px) { .highlights { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .blob, .gradient, .pulse-dot, .try-me, .win, .win-card, .stars i { animation: none !important; }
  .phone { transition: none; }
}
