/* Joyblip Games
 * Layout: a night stage up top where every tap drops a blip, one full-width band per game in that game's own world,
 * then quiet paper sections, and the night stage again as the footer.
 */
@font-face { font-family: 'Fredoka'; font-weight: 600; font-display: swap; src: url('/fonts/fredoka-600.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 700; font-display: swap; src: url('/fonts/fredoka-700.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-weight: 400; font-display: swap; src: url('/fonts/figtree-400.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-weight: 500; font-display: swap; src: url('/fonts/figtree-500.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-weight: 600; font-display: swap; src: url('/fonts/figtree-600.woff2') format('woff2'); }
@font-face { font-family: 'Bungee'; font-display: swap; src: url('/fonts/bungee.woff2') format('woff2'); }
@font-face { font-family: 'Baloo 2'; font-display: swap; src: url('/fonts/baloo-2-800.woff2') format('woff2'); }
@font-face { font-family: 'Sniglet'; font-display: swap; src: url('/fonts/sniglet-800.woff2') format('woff2'); }
@font-face { font-family: 'Titan One'; font-display: swap; src: url('/fonts/titan-one-400.woff2') format('woff2'); }
@font-face { font-family: 'Rammetto One'; font-display: swap; src: url('/fonts/rammetto-one-400.woff2') format('woff2'); }
@font-face { font-family: 'Shrikhand'; font-display: swap; src: url('/fonts/shrikhand.woff2') format('woff2'); }
@font-face { font-family: 'Lilita One'; font-display: swap; src: url('/fonts/lilita-one.woff2') format('woff2'); }

:root {
  --stage: #170F38;          /* the night stage: hero and footer */
  --stage-2: #2B1C6B;
  --stage-ink: #FFFFFF;
  --stage-mute: #B8AEE6;
  --paper: #FBFAFF;          /* quiet sections */
  --ink: #1A1033;
  --mute: #5D5878;
  --line: #E5E1F2;
  --gold: #FFC42E;           /* the two blips of the wordmark */
  --gold-deep: #C98A00;
  --coral: #FF5A6E;
  --sky: #3D9BFF;
  --mint: #3EDC81;
  --stacky-a: #261463; --stacky-b: #6A2A8E; --stacky-c: #E2647A;
  --pop-a: #1561D6; --pop-b: #3D9BFF; --pop-c: #9AD6FF;
  --font-display: 'Fredoka', 'Arial Rounded MT Bold', ui-rounded, system-ui, sans-serif;
  --font-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --wrap: 1120px;
  --side-l: max(20px, env(safe-area-inset-left, 0px));
  --side-r: max(20px, env(safe-area-inset-right, 0px));
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #100A22; --ink: #F2EFFF; --mute: #ABA5C8; --line: #2A2350; color-scheme: dark; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--font-body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { width: 100%; max-width: calc(var(--wrap) + 40px); margin: 0 auto; padding-left: var(--side-l); padding-right: var(--side-r); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--gold); color: #2A1700; padding: 10px 14px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.skip:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }

/* ------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 24px; border-radius: 16px; font: 600 17px/1 var(--font-display); letter-spacing: 0.01em; text-decoration: none; border: 0; cursor: pointer; transition: transform 120ms ease, box-shadow 120ms ease; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: translateY(3px); }
.btn-gold { background: var(--gold); color: #2A1700; box-shadow: 0 5px 0 var(--gold-deep); }
.btn-gold:active { box-shadow: 0 2px 0 var(--gold-deep); }
.btn-sky { background: var(--sky); color: #fff; box-shadow: 0 5px 0 #1F6CC4; }
.btn-sky:active { box-shadow: 0 2px 0 #1F6CC4; }
.btn-light { background: #fff; color: var(--band-ink, #1A1033); box-shadow: 0 5px 0 rgba(10, 4, 40, 0.28); }
.btn-light:active { box-shadow: 0 2px 0 rgba(10, 4, 40, 0.28); }
.btn-store { background: rgba(10, 4, 40, 0.34); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.45); font-family: var(--font-body); font-weight: 600; font-size: 15px; }
.btn-store small { display: block; font-weight: 500; font-size: 11.5px; opacity: 0.85; margin-bottom: 2px; }
.btn-store span { text-align: left; line-height: 1.15; }
.btn .play { width: 0; height: 0; border-left: 11px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }

/* ------------------------------------------------------------ hero */
.hero { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 50% 0%, var(--stage-2) 0%, var(--stage) 62%); color: var(--stage-ink); padding-top: env(safe-area-inset-top, 0px); touch-action: manipulation; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.hero a, .hero button { cursor: pointer; }
.topbar { position: relative; z-index: 2; display: flex; justify-content: flex-end; padding-top: 20px; }
.topbar ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; padding: 0; }
.topbar a { color: var(--stage-mute); text-decoration: none; font-weight: 600; font-size: 15px; }
.topbar a:hover { color: #fff; }
.hero-body { position: relative; z-index: 1; padding-top: 56px; padding-bottom: 200px; pointer-events: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 48px; align-items: center; }
.hero-copy { min-width: 0; }
.hero-body a, .hero-body button { pointer-events: auto; }
.hero-logo { width: min(620px, 86%); color: #fff; }
.hero-logo svg { width: 100%; height: auto; overflow: visible; display: block; }
.hero-line { margin-top: 30px; font: 600 clamp(28px, 4.4vw, 46px)/1.08 var(--font-display); max-width: 15em; text-wrap: balance; }
.hero-sub { margin-top: 16px; max-width: 33em; color: var(--stage-mute); font-size: 18px; }
.hero-cta { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 14px; }
.hero-hint { margin-top: 26px; color: var(--stage-mute); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.hero-hint::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 14px 0 0 var(--coral); margin-right: 16px; flex: none; }

/* live demo: the real game in a phone, desktop only */
.hero-demo { pointer-events: auto; cursor: default; display: flex; flex-direction: column; align-items: center; }
.demo-phone { position: relative; width: 300px; aspect-ratio: 390 / 844; border-radius: 42px; border: 9px solid #0B0720; background: #0B0720; overflow: hidden; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.14), 0 40px 80px rgba(5, 2, 24, 0.6); }
.demo-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.demo-screen { position: absolute; inset: 0; overflow: hidden; }
.demo-screen iframe { position: absolute; left: 0; top: 0; width: 390px; height: 844px; border: 0; transform-origin: 0 0; background: transparent; opacity: 0; transition: opacity 300ms ease; }
.demo-screen iframe.ready { opacity: 1; }
.demo-tabs { margin-top: 20px; display: flex; gap: 6px; padding: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }
.demo-tab { border: 0; border-radius: 999px; padding: 8px 16px; font: 600 14px/1 var(--font-display); color: var(--stage-mute); background: transparent; cursor: pointer; }
.demo-tab[aria-pressed="true"] { background: #fff; color: var(--stage); }
.demo-note { margin-top: 12px; font-size: 13px; color: var(--stage-mute); }

/* the two blips of the wordmark land once, on load */
.hero-logo .blip { transform-box: fill-box; transform-origin: 50% 0%; animation: blip-drop 1000ms cubic-bezier(0.3, 0, 0.3, 1) both; }
.hero-logo .blip-2 { animation-delay: 140ms; }
@keyframes blip-drop {
  /* the wordmark's group is flipped, so a positive y is up */
  0% { transform: translateY(1400px); }
  55% { transform: translateY(0) scale(1.18, 0.82); }
  70% { transform: translateY(160px) scale(0.94, 1.06); }
  84% { transform: translateY(0) scale(1.06, 0.94); }
  92% { transform: translateY(36px); }
  100% { transform: translateY(0); }
}

/* ------------------------------------------------------------ game bands */
.game { position: relative; color: #fff; padding-block: 88px; overflow: hidden; }
.game--stacky { --band-ink: #2A145F; background: linear-gradient(170deg, var(--stacky-a) 0%, var(--stacky-b) 58%, var(--stacky-c) 100%); }
.game--pop { --band-ink: #0E3B86; background: linear-gradient(170deg, var(--pop-a) 0%, var(--pop-b) 55%, var(--pop-c) 100%); }
.game--blocks { --band-ink: #24145c; background: linear-gradient(170deg, #221456 0%, #4a2c9a 56%, #8a5ae0 100%); }
.game--blocks .game-title { font-family: 'Baloo 2', var(--font-display); letter-spacing: 0; }
.game--sort { --band-ink: #7a2456; background: linear-gradient(170deg, #d8447f 0%, #ff7ab8 56%, #ffb58a 100%); }
.game--sort .game-title { font-family: 'Sniglet', var(--font-display); letter-spacing: 0; }
.game--drop { --band-ink: #24145c; background: linear-gradient(170deg, #1c1250 0%, #3a279a 56%, #6a4ad8 100%); }
.game--drop .game-title { font-family: 'Titan One', var(--font-display); letter-spacing: 0; }
.game--lot { --band-ink: #141c30; background: linear-gradient(170deg, #1c2740 0%, #3c4f72 56%, #6a86b8 100%); }
.game--lot .game-title { font-family: 'Rammetto One', var(--font-display); letter-spacing: 0; }
.game--bolt { --band-ink: #0e1626; background: linear-gradient(170deg, #16203a 0%, #31476e 56%, #5878b0 100%); }
.game--bolt .game-title { font-family: 'Bungee', var(--font-display); letter-spacing: 0; }
.game--flip .game-copy { order: 2; }
.game-points li:nth-child(2n) { --dot: var(--coral); }
/* the row of game icons in the hero */
.hero-games { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; list-style: none; padding: 0; }
.hero-games a { display: block; border-radius: 22%; transition: transform 160ms ease; }
.hero-games a:hover { transform: translateY(-3px); }
.hero-games a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.hero-games img { display: block; width: 56px; height: 56px; border-radius: 22%; box-shadow: 0 6px 16px rgba(8, 4, 36, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.18); }
.game--road { --band-ink: #5a1a3a; background: linear-gradient(170deg, #2a1a5a 0%, #b0507a 52%, #ff9a6a 100%); }
.game--road .game-title { font-family: 'Shrikhand', var(--font-display); font-weight: 400; letter-spacing: 0; }
.game-badge { display: inline-block; margin-bottom: 14px; padding: 5px 12px; border-radius: 10px; background: var(--gold); color: #3a2000; font: 600 14px/1.2 var(--font-display); }
.game-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.game--pop .game-copy { order: 2; }
.game-copy { min-width: 0; }
.game-head { display: flex; align-items: center; gap: 18px; }
.game-icon { width: 92px; height: 92px; border-radius: 22%; box-shadow: 0 10px 26px rgba(8, 4, 36, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.18); flex: none; }
.game-title { font-weight: 400; font-size: clamp(34px, 4.6vw, 52px); line-height: 1; }
.game--stacky .game-title { font-family: 'Bungee', var(--font-display); letter-spacing: 0; }
.game--pop .game-title { font-family: 'Lilita One', var(--font-display); letter-spacing: 0.01em; }
.game-tag { margin-top: 8px; font: 600 19px/1.3 var(--font-display); color: rgba(255, 255, 255, 0.9); }
.game-how { margin-top: 26px; font-size: 18px; max-width: 32em; color: rgba(255, 255, 255, 0.92); }
.game-points { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.game-points li { position: relative; padding-left: 26px; font-weight: 500; }
.game-points li::before { content: ''; position: absolute; left: 2px; top: 0.55em; width: 11px; height: 11px; border-radius: 50%; background: var(--dot, var(--gold)); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.16); }
.game--pop .game-points li { --dot: var(--gold); }
.game--pop .game-points li:nth-child(2n) { --dot: var(--coral); }
.game--stacky .game-points li:nth-child(2n) { --dot: var(--coral); }
.game-cta { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 16px; }
.store-note { font-size: 15px; font-weight: 500; color: rgba(255, 255, 255, 0.86); }
.store-note strong { color: #fff; font-weight: 600; }

/* three phones, fanned */
.game-shots { position: relative; width: 100%; max-width: 520px; aspect-ratio: 1.06; margin: 0 auto; }
.phone { position: absolute; margin: 0; border-radius: 13% / 6%; overflow: hidden; background: #0B0720; border: 5px solid #0B0720; box-shadow: 0 24px 50px rgba(8, 4, 36, 0.42); }
.phone img { width: 100%; height: auto; aspect-ratio: 540 / 1170; object-fit: cover; }
.phone--mid { left: 30%; top: 0; width: 40%; z-index: 2; }
.phone--l { left: 1%; top: 9%; width: 34%; transform: rotate(-7deg); z-index: 1; }
.phone--r { right: 1%; top: 9%; width: 34%; transform: rotate(7deg); z-index: 1; }

/* ------------------------------------------------------------ about */
.about { padding-block: 96px 88px; }
.about-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: start; }
.about h2 { font-size: clamp(32px, 4vw, 44px); }
.about .lead { margin-top: 18px; font-size: 20px; color: var(--mute); max-width: 26em; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 40px; }
.facts div { min-width: 0; }
.facts dt { font: 600 21px/1.2 var(--font-display); display: flex; align-items: center; gap: 10px; }
.facts dt::before { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--dot, var(--gold)); flex: none; }
.facts div:nth-child(2) { --dot: var(--coral); }
.facts div:nth-child(3) { --dot: var(--sky); }
.facts div:nth-child(4) { --dot: var(--mint); }
.facts dd { margin: 8px 0 0; color: var(--mute); }

/* ------------------------------------------------------------ contact */
.contact { border-top: 1px solid var(--line); padding-block: 72px 84px; }
.contact-inner { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 22px 40px; }
.contact h2 { font-size: clamp(30px, 3.6vw, 40px); }
.contact p { margin-top: 12px; color: var(--mute); max-width: 30em; }
.contact-mail { font: 600 clamp(24px, 3.4vw, 36px)/1.1 var(--font-display); text-decoration: none; background-image: linear-gradient(var(--gold), var(--gold)); background-size: 100% 0.18em; background-position: 0 92%; background-repeat: no-repeat; padding-bottom: 4px; overflow-wrap: anywhere; }
.contact-mail:hover { background-size: 100% 0.5em; }

/* ------------------------------------------------------------ footer */
.foot { background: var(--stage); color: var(--stage-mute); padding-block: 56px calc(40px + env(safe-area-inset-bottom, 0px)); }
.foot-inner { display: grid; grid-template-columns: auto 1fr auto; gap: 28px 48px; align-items: center; }
.foot-mark { width: 150px; color: #fff; display: block; }
.foot-mark svg { width: 100%; height: auto; display: block; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 26px; justify-content: center; }
.foot nav a { color: var(--stage-mute); text-decoration: none; font-weight: 600; font-size: 15px; }
.foot nav a:hover { color: #fff; }
.legal { font-size: 14px; text-align: right; line-height: 1.5; }

/* ------------------------------------------------------------ document pages: privacy, support */
.pagehead { background: var(--stage); color: #fff; padding-top: env(safe-area-inset-top, 0px); }
.pagehead-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 22px; }
.pagehead .foot-mark { width: 128px; }
.pagehead nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.pagehead nav a { color: var(--stage-mute); text-decoration: none; font-weight: 600; font-size: 15px; }
.pagehead nav a:hover, .pagehead nav a[aria-current] { color: #fff; }
.doc { max-width: calc(720px + 40px); padding-block: 56px 80px; }
.doc h1 { font-size: clamp(34px, 5vw, 48px); }
.doc .date { margin-top: 10px; color: var(--mute); font-size: 15px; }
.doc h2 { font-size: 24px; margin-top: 44px; }
.doc p, .doc ul { margin-top: 12px; }
.doc ul { padding-left: 22px; }
.doc li + li { margin-top: 6px; }
.doc a { color: inherit; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.doc .summary { margin-top: 28px; padding: 18px 20px; border-radius: var(--radius); background: color-mix(in srgb, var(--gold) 14%, var(--paper)); border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--paper)); }
.doc .summary strong { font-family: var(--font-display); font-weight: 600; }
.qa { margin-top: 28px; border-top: 1px solid var(--line); }
.qa details { border-bottom: 1px solid var(--line); }
.qa summary { cursor: pointer; list-style: none; padding: 18px 36px 18px 0; position: relative; font: 600 19px/1.3 var(--font-display); }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: ''; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -7px; border-right: 2.5px solid var(--mute); border-bottom: 2.5px solid var(--mute); transform: rotate(45deg); transition: transform 160ms ease; }
.qa details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.qa details p { margin: 0 0 18px; color: var(--mute); }

/* ------------------------------------------------------------ not found */
.lost, .lost body { background: var(--stage); }
.lost main { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; text-align: center; background: var(--stage); color: #fff; padding: 80px var(--side-r) 80px var(--side-l); }
.lost h1 { font-size: clamp(34px, 6vw, 56px); }
.lost p { margin-top: 14px; color: var(--stage-mute); }
.lost .btn { margin-top: 28px; }
.lost .dots { display: flex; justify-content: center; gap: 14px; margin-bottom: 30px; }
.lost .dots span { width: 26px; height: 26px; border-radius: 50%; background: var(--gold); }
.lost .dots span + span { background: var(--coral); opacity: 0.35; }

/* ------------------------------------------------------------ narrow screens */
@media (max-width: 1023px) {
  .hero-body { grid-template-columns: minmax(0, 1fr); }
  .hero-demo { display: none; }
}
@media (max-width: 860px) {
  .game { padding-block: 64px 72px; }
  .game-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .game--pop .game-copy { order: 0; }
  .game--flip .game-copy { order: 0; }
  .hero-games img { width: 48px; height: 48px; }
  .about-grid { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .foot-inner { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .foot nav { justify-content: flex-start; }
  .legal { text-align: left; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .topbar { justify-content: flex-start; padding-top: 16px; }
  .topbar ul { gap: 4px 18px; }
  .hero-body { padding-top: 40px; padding-bottom: 170px; }
  .hero-logo { width: 94%; margin-left: 4px; }
  .hero-sub { font-size: 16.5px; }
  .hero-cta .btn { flex: 1 1 100%; }
  .game-icon { width: 72px; height: 72px; }
  .game-how { font-size: 16.5px; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .pagehead-inner { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-logo .blip { animation: none; }
  .btn { transition: none; }
}
