/* codea arcade — the game's tokens on the web: white ground, light panels at the 20px radius,
   primary yellow pills, Nunito in the heavy weights, lower-case labels like the app */
:root {
  --white: #ffffff;
  --light: #f5f5f5;
  --border: #e0e0e0;
  --grey: #a0a0a0;
  --fade: #3e3e3e;
  --material: #1e1e1e;
  --dark: #101010;
  --black: #000000;
  --primary: #ecae00;
  --secondary: #ffecb3;
  --red: #d44235;
  --green: #0f9855;
  --blue: #4081ec;
  --gold: #f7be14;

  --ground: var(--white);
  --panel: var(--light);
  --inner: var(--white);
  --text: var(--black);
  --muted: var(--grey);
  --line: var(--border);
  --radius: 20px;
  --nav: 70px;
  /* motion: the app's pace — one curve for the ui, a bouncy one for the game's people, three durations */
  --ease: cubic-bezier(.2, 0, 0, 1);
  --bounce: cubic-bezier(.34, 1.56, .64, 1);
  --quick: .16s;
  --standard: .32s;
  --slow: .6s;
}
/* the app reads its hex colours as display p3 (lib/main/colors.dart p3()), so a wide-gamut screen gets the same coordinates here; sRGB hex above stands in elsewhere */
@supports (color: color(display-p3 0 0 0)) { :root { --primary: color(display-p3 0.9255 0.6824 0.0000); --secondary: color(display-p3 1.0000 0.9255 0.7020); --red: color(display-p3 0.8314 0.2588 0.2078); --green: color(display-p3 0.0588 0.5961 0.3333); --blue: color(display-p3 0.2510 0.5059 0.9255); --gold: color(display-p3 0.9686 0.7451 0.0784); } }

/* light or dark follows the device, like the app's "system" setting; no toggle */
@media (prefers-color-scheme: dark) {
  :root { --ground: var(--dark); --panel: var(--material); --inner: var(--fade); --text: var(--white); --muted: var(--grey); --line: var(--fade); }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--text); font-family: "Nunito", "SF Pro Rounded", system-ui, sans-serif; font-weight: 700; line-height: 1.5; font-size: 16px; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: clamp(36px, 7vw, 64px); font-weight: 900; line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 900; line-height: 1.1; letter-spacing: -0.01em; }
h3 { font-size: 18px; font-weight: 800; }
.muted { color: var(--muted); }
.lead { font-size: 18px; color: var(--muted); font-weight: 700; }
.wrap { width: min(1100px, 100% - 32px); margin: 0 auto; }
.wrap > *, .grid > *, .hero .copy > *, .talk > * { min-width: 0; }
body { overflow-x: hidden; }
section { padding: 60px 0; }
.center { text-align: center; }
.stack { display: grid; gap: 12px; align-content: start; }

/* nav */
.nav { position: sticky; top: 0; z-index: 10; height: var(--nav); background: color-mix(in srgb, var(--ground) 85%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.nav .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark { height: 26px; width: 104px; }
.brand .plus { font-weight: 900; font-size: 22px; color: var(--primary); }
.links { display: flex; gap: 6px; align-items: center; }
.links a { padding: 8px 14px; border-radius: 999px; font-weight: 800; color: var(--muted); transition: color var(--quick) var(--ease), background-color var(--quick) var(--ease), transform var(--quick) var(--ease); }
.links a:active { transform: scale(.96); }
.links a:hover, .links a[aria-current="page"] { color: var(--text); background: var(--panel); }
.links .cta { color: var(--white); background: var(--primary); }
.links .cta:hover { color: var(--white); background: var(--primary); filter: brightness(1.05); }
@media (max-width: 640px) { .links a:not(.cta) { display: none; } }

/* icons: every svg is a mask so it takes currentColor like the app's svg assets */
.icon { display: inline-block; width: 24px; height: 24px; background: currentColor; -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat; flex: none; }
.disc { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: var(--white); background: var(--primary); flex: none; transition: transform var(--standard) var(--bounce); }
.card:hover .disc { transform: rotate(-6deg) scale(1.06); }
.disc .icon { width: 32px; height: 32px; }
.disc.red { background: var(--red); } .disc.green { background: var(--green); } .disc.blue { background: var(--blue); } .disc.black { background: var(--text); color: var(--ground); } .disc.gold { background: var(--gold); }

/* buttons: the app's pills, white on primary, or quiet on the panel ground */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px; padding: 0 24px; border-radius: 999px; background: var(--primary); color: var(--white); font: inherit; font-weight: 900; font-size: 16px; border: 0; cursor: pointer; transition: transform var(--standard) var(--bounce), filter var(--quick) var(--ease), box-shadow var(--standard) var(--ease); white-space: nowrap; }
.btn:hover { filter: brightness(1.05); transform: translateY(-2px); box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--primary) 70%, transparent); }
.btn.quiet:hover, .btn.dark:hover { box-shadow: 0 10px 22px -12px rgba(0,0,0,.35); }
.btn:active { transform: scale(.96); transition-duration: var(--quick); }
.btn.quiet { background: var(--panel); color: var(--text); }
.btn.dark { background: var(--text); color: var(--ground); }
.btn.small { height: 40px; padding: 0 18px; font-size: 14px; }
.btn .icon { width: 20px; height: 20px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* panels and cards */
.panel { background: var(--panel); border-radius: var(--radius); padding: 24px; }
.card { background: var(--inner); border-radius: var(--radius); padding: 22px; border: 1px solid var(--line); display: grid; gap: 12px; align-content: start; transition: transform var(--standard) var(--ease), box-shadow var(--standard) var(--ease), border-color var(--standard) var(--ease); }
.card:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -18px rgba(0,0,0,.35); }
a.card:active { transform: translateY(-1px) scale(.99); }
.card.primary { border: 3px solid var(--primary); }
.card p { color: var(--muted); font-size: 15px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.pill { width: fit-content; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--panel); color: var(--muted); font-size: 12px; font-weight: 900; }
.pill.primary { background: var(--primary); color: var(--white); }
.pill .icon { width: 14px; height: 14px; }
.strip { width: fit-content; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--secondary); color: var(--black); font-size: 12px; font-weight: 900; }

/* hero */
.hero { padding: 70px 0 40px; }
.hero .wrap { display: grid; gap: 40px; grid-template-columns: 1.1fr .9fr; align-items: center; }
.hero .copy { display: grid; gap: 22px; }
@media (max-width: 820px) { .hero .wrap { grid-template-columns: 1fr; } .hero .copy { text-align: center; justify-items: center; } }

/* avatars: the app's tile with one flattened png per tile (tools/avatars.py), drawn a quarter larger
   and bottom-true as a background so there is nothing to drag, long-press or "save image as" */
.avatar { position: relative; width: var(--size, 120px); height: var(--size, 120px); border-radius: calc(var(--size, 120px) * .28); background: var(--panel); flex: none; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-user-drag: none; max-width: none; }
.avatar .figure { position: absolute; left: 50%; bottom: 0; width: calc(var(--size, 120px) * .96); height: calc(var(--size, 120px) * .96); transform: translateX(-50%); pointer-events: none; -webkit-user-drag: none; max-width: none; }
.avatar.primary { background: var(--primary); } .avatar.red { background: var(--red); } .avatar.green { background: var(--green); } .avatar.blue { background: var(--blue); } .avatar.secondary { background: var(--secondary); }
.avatar.tap { cursor: pointer; transition: transform var(--standard) var(--bounce); }
.avatar.tap:hover { transform: translateY(-4px) rotate(-2deg); }
.avatar.tap:active { transform: scale(.94); transition-duration: var(--quick); }
.avatar .figure { transition: transform var(--standard) var(--bounce); }
.avatar.tap:hover .figure { transform: translateX(-50%) scale(1.04); }
@keyframes hop { 0% { transform: translateX(-50%) scale(1); } 35% { transform: translateX(-50%) scale(1.12, .9); } 70% { transform: translateX(-50%) translateY(-6px) scale(.96, 1.06); } 100% { transform: translateX(-50%) scale(1); } }
.avatar.hop .figure { animation: hop .45s var(--ease); }
@keyframes pop { 0% { opacity: 0; transform: translateY(6px) scale(.96); } 100% { opacity: 1; transform: none; } }
.bubble.pop > * { animation: pop var(--standard) var(--ease); }

/* a talking avatar: the tile beside a bubble with the little tail, the line is random per visit
   and shuffles on tap (the person stays) — the website's way of letting the game's people do the explaining */
.talk { display: flex; align-items: flex-end; gap: 14px; }
.talk.flip { flex-direction: row-reverse; }
.bubble { position: relative; transition: background-color var(--standard) var(--ease); background: var(--panel); border-radius: var(--radius); padding: 14px 18px; font-weight: 800; max-width: 340px; min-width: 0; flex: 0 1 auto; line-height: 1.35; }
.bubble::after { content: ""; position: absolute; bottom: 16px; left: -8px; width: 16px; height: 16px; background: var(--panel); border-radius: 4px; transform: rotate(45deg); }
.talk.flip .bubble::after { left: auto; right: -8px; }
.bubble.primary { background: var(--primary); color: var(--white); } .bubble.primary::after { background: var(--primary); }
.bubble .name { display: block; font-size: 12px; color: var(--muted); font-weight: 900; margin-bottom: 2px; }
.bubble.primary .name { color: rgba(255,255,255,.75); }
.crowd { display: grid; gap: 22px; }
.crowd .talk:nth-child(even) { justify-self: end; }

/* phone shots: the screenshot inside the real iPhone shell (a transparent png from Trick Shot/archive/web-screens.py);
   an empty .phone is still the dashed placeholder */
.phones { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.phone { width: 220px; aspect-ratio: 1350 / 2760; border-radius: 32px; background: var(--panel); border: 2px dashed var(--line); display: grid; place-items: center; text-align: center; padding: 16px; position: relative; overflow: hidden; }
.phone img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.phone img:not([src]), .phone img[src=""] { display: none; }
.phone .slot { color: var(--muted); font-size: 13px; font-weight: 800; display: grid; gap: 6px; justify-items: center; }
.phone .slot code { font-size: 11px; color: var(--muted); background: var(--inner); padding: 2px 8px; border-radius: 999px; }
.phone.big { width: 280px; }
.phone.shot { border: none; padding: 0; background: none; border-radius: 0; overflow: visible; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .25)); }
.phone.shot img { position: static; object-fit: contain; max-width: none; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.phone.shot { animation: float 6s ease-in-out infinite; }
.phones .phone.shot:nth-child(2) { animation-delay: -2s; } .phones .phone.shot:nth-child(3) { animation-delay: -4s; } .phones .phone.shot:nth-child(4) { animation-delay: -1s; } .phones .phone.shot:nth-child(5) { animation-delay: -3s; } .phones .phone.shot:nth-child(6) { animation-delay: -5s; }
.phone.shot:hover { animation-play-state: paused; }

/* store badges: placeholders until the real App Store / Google Play artwork drops in */
.badges { display: flex; gap: 12px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px; border-radius: 14px; background: var(--text); color: var(--ground); font-weight: 900; transition: transform var(--standard) var(--bounce), box-shadow var(--standard) var(--ease); }
.badge:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -14px rgba(0,0,0,.4); }
.badge:active { transform: scale(.96); transition-duration: var(--quick); }
.badge .icon { width: 26px; height: 26px; background-color: currentColor; }
.badge small { display: block; font-size: 10px; font-weight: 800; opacity: .7; line-height: 1; }
.badge span { line-height: 1.1; }
.badge.soon { background: var(--panel); color: var(--muted); border: 2px dashed var(--line); }

/* arcade + hero card: the app's sheet hero, price large on primary with the mark at the right */
.arcade-hero { background: var(--primary); color: var(--white); border-radius: var(--radius); padding: 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; overflow: hidden; position: relative; }
.arcade-hero .price { font-size: 48px; font-weight: 900; line-height: 1; }
.arcade-hero .terms { font-weight: 800; opacity: .85; }
.arcade-hero .mark { width: 70px; height: 100px; opacity: .25; flex: none; }
.perk { display: flex; gap: 14px; align-items: flex-start; }
.perk .disc { width: 44px; height: 44px; border-radius: 14px; }
.perk .disc .icon { width: 26px; height: 26px; }

/* legal pages */
.doc { max-width: 760px; margin: 0 auto; display: grid; gap: 18px; }
.doc h2 { font-size: 22px; margin-top: 18px; }
.doc p, .doc li { color: var(--fade); }
@media (prefers-color-scheme: dark) { .doc p, .doc li { color: #d0d0d0; } }
.doc ul { padding-left: 20px; margin: 0; display: grid; gap: 6px; }
.doc .date { color: var(--muted); font-size: 14px; }
.todo { background: var(--secondary); color: var(--black); padding: 0 6px; border-radius: 6px; font-weight: 900; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; }

/* faq */
details { background: var(--panel); border-radius: var(--radius); padding: 0 20px; }
details summary { cursor: pointer; list-style: none; padding: 16px 0; font-weight: 900; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; color: var(--muted); font-size: 22px; font-weight: 900; transition: transform var(--standard) var(--bounce); }
details[open] summary::after { transform: rotate(45deg); }
details p { padding: 0 0 16px; color: var(--muted); }
details[open] p { animation: pop var(--standard) var(--ease); }
details { transition: background-color var(--standard) var(--ease); }
details:hover { background: color-mix(in srgb, var(--panel) 80%, var(--inner)); }

/* footer */
footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
footer .links a { padding: 6px 10px; }

/* entrance: the app's rise, once, on scroll */
.rise { opacity: 0; transform: translateY(18px); transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease); }
.rise.in { opacity: 1; transform: none; }
/* children follow their parent one step behind: cards, tiles and phones */
.rise .grid > *, .rise .crowd > *, .rise .phones > *, .rise .row > .avatar, .hero .copy > * { opacity: 0; transform: translateY(16px); transition: opacity var(--slow) var(--ease), transform var(--slow) var(--bounce); }
.rise.in .grid > *, .rise.in .crowd > *, .rise.in .phones > *, .rise.in .row > .avatar, .hero .copy.in > * { opacity: 1; transform: none; }
.rise .grid > :nth-child(1), .rise .crowd > :nth-child(1), .rise .phones > :nth-child(1), .rise .row > .avatar:nth-child(1), .hero .copy > :nth-child(1) { transition-delay: .06s; }
.rise .grid > :nth-child(2), .rise .crowd > :nth-child(2), .rise .phones > :nth-child(2), .rise .row > .avatar:nth-child(2), .hero .copy > :nth-child(2) { transition-delay: .14s; }
.rise .grid > :nth-child(3), .rise .crowd > :nth-child(3), .rise .phones > :nth-child(3), .rise .row > .avatar:nth-child(3), .hero .copy > :nth-child(3) { transition-delay: .22s; }
.rise .grid > :nth-child(4), .rise .phones > :nth-child(4), .rise .row > .avatar:nth-child(4), .hero .copy > :nth-child(4) { transition-delay: .30s; }
.rise .grid > :nth-child(5), .rise .phones > :nth-child(5), .rise .row > .avatar:nth-child(5), .hero .copy > :nth-child(5) { transition-delay: .38s; }
.rise .phones > :nth-child(6) { transition-delay: .46s; }
.hero .phones, .hero .crowd { opacity: 0; transform: translateY(24px) scale(.98); transition: opacity var(--slow) var(--ease) .2s, transform .8s var(--ease) .2s; }
.hero .phones.in, .hero .crowd.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rise, .rise *, .hero .copy > *, .hero .phones, .hero .crowd { opacity: 1 !important; transform: none !important; transition: none !important; animation: none !important; }
  .phone.shot { animation: none; }
}
