/* ─────────────────────────────────────────────────────────────
   פיצוחים — landing page
   The app's `paper` palette (app/src/theme/palettes.ts) and its
   game tiles (tokens.ts GAME), copied by hand. Nothing links them:
   a palette change in the app is mirrored here by hand.
   Each token is written once as light-dark(light, dark); which face
   shows is decided by `color-scheme` below.
   ───────────────────────────────────────────────────────────── */

:root {
  color-scheme: light;

  --page: light-dark(#f4f8fc, #0d141b);
  --ink: light-dark(#14202b, #e8eef4);
  --muted: light-dark(#5e7288, #8b9dad);
  --card: light-dark(#ffffff, #16202a);
  --line: light-dark(#dce8f3, #24313d);
  --fill: light-dark(#eaf1f9, #1c2731);
  --accent: light-dark(#2f6fb0, #5aa3ee);

  /* the deep brown every painting is outlined in, and the cream inside it */
  --grout: #3a2418;
  --cream: #f6ecd4;

  /* the app's own icon, each face (app/assets/icon.png and icon-dark.png at 384, as WebP) */
  --app-icon: url("assets/icon.webp");
  --app-icon-dark: url("assets/icon-dark.webp");

  --g-wordle: light-dark(#6fb47a, #5a9a65);           --t-wordle: light-dark(#e0f0e2, #1d2e21);
  --g-bee: light-dark(#f5d547, #d9b93a);              --t-bee: light-dark(#fcf3cc, #2f2a14);
  --g-strands: light-dark(#c3e2d6, #9fc7b8);          --t-strands: light-dark(#e6f3ee, #1e2d28);
  --g-arrowword: light-dark(#9cc3ec, #7ea7d4);        --t-arrowword: light-dark(#e2eefb, #1b2837);
  --g-cryptic: light-dark(#b8a4e8, #9d88d0);          --t-cryptic: light-dark(#ece6fa, #251f36);
  --g-connections: light-dark(#f2b8c6, #d79aab);      --t-connections: light-dark(#fbe9ee, #33222a);
  --g-squares: light-dark(#f0a868, #d1945f);          --t-squares: light-dark(#fdeadb, #32241a);

  --shadow-1: light-dark(rgba(20, 32, 43, .04), rgba(0, 0, 0, .3));
  --shadow-2: light-dark(rgba(20, 32, 43, .18), rgba(0, 0, 0, .6));
  --shadow-3: light-dark(rgba(20, 32, 43, .05), rgba(0, 0, 0, .35));
  --shadow-4: light-dark(rgba(20, 32, 43, .28), rgba(0, 0, 0, .7));
  --shadow: 0 1px 2px var(--shadow-1), 0 12px 32px -12px var(--shadow-2);
  --shadow-lift: 0 2px 4px var(--shadow-3), 0 28px 48px -18px var(--shadow-4);

  --r-s: 6px; --r-m: 13px; --r-l: 20px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}
/* The face: the system's unless the toggle has chosen one. The app icon
   follows it, as it does on a phone's home screen. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; --app-icon: var(--app-icon-dark); }
}
:root[data-theme="dark"] { color-scheme: dark; --app-icon: var(--app-icon-dark); }

/* A background, not an <img>: an <img> cannot change its picture from CSS,
   and every use of the icon here is decoration beside the name. Printed
   too, which browsers skip for backgrounds unless told. */
.app-icon {
  display: block; flex: none;
  background: var(--app-icon) center / cover;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: 'Assistant', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-s); }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* a faint paper grain under the content, so the flat page ground sits with the paintings */
.grain {
  position: fixed; inset: -50%; z-index: 0; pointer-events: none;
  opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .25 0 0 0 0 .2 0 0 0 .18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
/* opacity and blend mode are not colours, so these two cannot use light-dark() */
:root[data-theme="dark"] .grain { opacity: .18; mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .grain { opacity: .18; mix-blend-mode: screen; }
}
main, header, footer { position: relative; z-index: 1; }

/* ── Type ─────────────────────────────────────────────────── */
.display {
  font-weight: 800;
  font-size: clamp(44px, 8vw, 88px);
  line-height: 1.02;
  letter-spacing: -.015em;
}
.h2 {
  font-weight: 800;
  font-size: clamp(30px, 4.6vw, 52px);
  line-height: 1.08;
  letter-spacing: -.01em;
}
.sub {
  color: var(--muted);
  font-size: clamp(17px, 1.6vw, 21px);
  margin-top: 12px;
}
.eyebrow {
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .02em;
  margin-bottom: 18px;
}
.lead {
  color: var(--muted);
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.45;
  max-width: 30ch;
  margin-top: 22px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; cursor: pointer;
  border: 0; border-radius: 999px;
  padding: 12px 22px;
  transition: transform .22s var(--ease-spring), background .18s, box-shadow .22s;
}
.btn:active { transform: scale(.97); transition-duration: .09s; }
.btn-ink { background: var(--ink); color: var(--page); }
.btn-ink:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-sm { padding: 9px 18px; font-size: 15px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  cursor: pointer; transition: transform .22s var(--ease-spring), background .18s;
}
.icon-btn:hover { transform: rotate(-12deg); }
.icon-btn > svg { grid-area: 1 / 1; transition: opacity .25s, transform .4s var(--ease-spring); }
.icon-btn .moon { opacity: 0; transform: scale(.6) rotate(40deg); }
/* which glyph shows is not a colour either, so the face is repeated here once more */
:root[data-theme="dark"] .icon-btn .moon { opacity: 1; transform: none; }
:root[data-theme="dark"] .icon-btn .sun { opacity: 0; transform: scale(.6) rotate(-40deg); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .moon { opacity: 1; transform: none; }
  :root:not([data-theme="light"]) .icon-btn .sun { opacity: 0; transform: scale(.6) rotate(-40deg); }
}

.store-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.store-btn {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--page);
  border-radius: 14px; padding: 10px 20px 10px 18px;
  min-width: 190px;
  box-shadow: var(--shadow);
  transition: transform .25s var(--ease-spring), box-shadow .25s;
}
.store-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.store-btn:active { transform: translateY(0) scale(.98); transition-duration: .09s; }
.store-btn svg { flex: none; }
.store-text { display: flex; flex-direction: column; line-height: 1.15; text-align: start; }
.store-text small { font-size: 12px; font-weight: 600; opacity: .8; }
.store-text strong { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.store-btn-light { background: var(--cream); color: var(--grout); }

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  padding: 14px 0;
  transition: background .3s, box-shadow .3s, padding .3s;
}
.site-header.scrolled {
  padding: 8px 0;
  background: color-mix(in srgb, var(--page) 78%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; }
.brand-icon { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 0 0 1px rgba(58, 36, 24, .18); }
.header-actions { display: flex; align-items: center; gap: 10px; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero { padding: clamp(28px, 6vw, 72px) 0 clamp(48px, 8vw, 96px); overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: clamp(24px, 5vw, 64px);
}
.hero-note { color: var(--muted); font-size: 15px; margin-top: 16px; }

/* headline lines rise out of a clip on load */
.line-wrap { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.line { display: block; }
.hero-in {
  opacity: 0;
  transform: translateY(28px);
  animation: hero-in .9s var(--ease-out) forwards;
  animation-delay: calc(80ms + var(--d, 0) * 110ms);
}
.line.hero-in { transform: translateY(110%); }
@keyframes hero-in { to { opacity: 1; transform: none; } }

/* the painted mosaic: seven game icons on their own tiles, floating */
.mosaic {
  position: relative;
  width: min(100%, 520px);
  aspect-ratio: 1;
  margin-inline: auto;
}
.tile {
  position: absolute;
  left: var(--x); top: var(--y);
  width: var(--s); aspect-ratio: 1;
  border-radius: 22%;
  display: grid; place-items: center;
  box-shadow:
    inset 0 0 0 2px rgba(58, 36, 24, .16),
    0 2px 3px rgba(58, 36, 24, .08),
    0 22px 40px -16px rgba(20, 32, 43, .35);
  will-change: transform;
  transform: translate(var(--px, 0), var(--py, 0)) rotate(var(--r));
}
.tile::after {
  /* a soft brushed highlight, so the flat tile reads as a painted one */
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(145deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 45%, rgba(58, 36, 24, .06));
  pointer-events: none;
}
/* sized against the tile, not padded: a percentage padding here would resolve
   against the whole mosaic's width and shrink the icon to a dot */
.tile img {
  width: 74%; height: 74%; object-fit: contain;
  filter: drop-shadow(0 3px 3px rgba(58, 36, 24, .18));
  animation: bob var(--f, 8s) ease-in-out infinite alternate;
}
@keyframes bob { from { transform: translateY(-3%) } to { transform: translateY(3%) } }

.t-wordle { background: var(--g-wordle); }
.t-bee { background: var(--g-bee); }
.t-strands { background: var(--g-strands); }
.t-arrowword { background: var(--g-arrowword); }
.t-cryptic { background: var(--g-cryptic); }
.t-connections { background: var(--g-connections); }
.t-squares { background: var(--g-squares); }

/* ── Sections ─────────────────────────────────────────────── */
.section { padding: clamp(56px, 9vw, 120px) 0; }
.section-tint { background: var(--fill); }
/* grey on the tinted band fell under 4.5:1; the band's secondary text is ink, softened toward the band */
.section-tint { --muted: color-mix(in srgb, var(--ink) 72%, var(--fill)); }
.section .h2, .section .sub { text-align: center; }
.section .sub { margin-inline: auto; max-width: 40ch; }

/* scroll reveals, staggered by --i; main.js adds `js` as its first act, so they are
   hidden only once the script that shows them again is actually running */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.js .reveal.in { opacity: 1; transform: none; }

/* ── Games ────────────────────────────────────────────────── */
.games {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 18px;
  margin-top: clamp(32px, 5vw, 56px);
}
.game {
  --tile: var(--line); --tint: var(--card);
  flex: 0 1 250px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 18px 18px 22px;
  text-align: center;
  box-shadow: var(--shadow);
  /* the hover lift uses translate/rotate so it never touches the reveal's transform */
  transition: translate .35s var(--ease-out), rotate .35s var(--ease-out), box-shadow .35s var(--ease-out);
}
.game:hover { translate: 0 -6px; rotate: -.6deg; box-shadow: var(--shadow-lift); }
.game-art {
  display: grid; place-items: center;
  aspect-ratio: 1.45;
  border-radius: var(--r-m);
  background: var(--tint);
  margin-bottom: 16px;
  overflow: hidden;
  position: relative;
}
.game-art::before {
  content: ""; position: absolute; inset: 14% 24%;
  border-radius: 22%; background: var(--tile);
  box-shadow: inset 0 0 0 2px rgba(58, 36, 24, .14);
  transition: transform .45s var(--ease-spring);
}
.game-art img {
  position: relative; width: 44%;
  filter: drop-shadow(0 3px 3px rgba(58, 36, 24, .18));
  transition: transform .45s var(--ease-spring);
}
.game:hover .game-art img { transform: scale(1.1) rotate(-4deg); }
.game:hover .game-art::before { transform: scale(1.05) rotate(3deg); }
.game h3 { font-size: 22px; font-weight: 800; }
.game p { color: var(--muted); font-size: 15px; margin-top: 4px; line-height: 1.4; }

.g-wordle { --tile: var(--g-wordle); --tint: var(--t-wordle); }
.g-bee { --tile: var(--g-bee); --tint: var(--t-bee); }
.g-strands { --tile: var(--g-strands); --tint: var(--t-strands); }
.g-arrowword { --tile: var(--g-arrowword); --tint: var(--t-arrowword); }
.g-cryptic { --tile: var(--g-cryptic); --tint: var(--t-cryptic); }
.g-connections { --tile: var(--g-connections); --tint: var(--t-connections); }
.g-squares { --tile: var(--g-squares); --tint: var(--t-squares); }

/* ── Screens ──────────────────────────────────────────────── */
/* a row that scrolls sideways and snaps; its sides line up with .wrap, and it runs to the screen's edges */
.screens {
  --edge: max(16px, (100% - 1120px) / 2);
  display: flex; gap: clamp(14px, 2vw, 24px);
  margin-top: clamp(32px, 5vw, 56px);
  padding: 8px var(--edge) 28px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--edge);
}
/* the scrollbar gives way to the arrows, which need main.js; without it a mouse still has the bar */
.js .screens { scrollbar-width: none; }
.js .screens::-webkit-scrollbar { display: none; }
.screens:focus-visible { outline-offset: -2px; border-radius: 0; }
/* store/build.py writes the row, and its `sizes` repeats this width: change them together */
.screens li { flex: 0 0 clamp(210px, 23vw, 270px); scroll-snap-align: start; }
.screens picture { display: block; }
.screens img {
  width: 100%; height: auto;
  border-radius: var(--r-l);
  background: var(--fill);
  box-shadow: var(--shadow);
  transition: translate .35s var(--ease-out), box-shadow .35s var(--ease-out);
}
.screens li:hover img { translate: 0 -6px; box-shadow: var(--shadow-lift); }
/* the arrows need main.js; without it the row still scrolls by touch, trackpad or its scrollbar */
.screens-nav { display: none; }
.js .screens-nav { display: flex; justify-content: center; gap: 10px; margin-top: 4px; }
.screens-nav .icon-btn:hover { transform: none; background: var(--fill); }
.screens-nav .icon-btn[aria-disabled="true"] { opacity: .35; cursor: default; background: var(--card); }

/* ── Why ──────────────────────────────────────────────────── */
.why {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px 24px;
  margin-top: clamp(36px, 5vw, 64px);
}
.why-item { text-align: center; }
.why-item img {
  width: clamp(112px, 12vw, 150px);
  margin: 0 auto 16px;
  filter: drop-shadow(0 6px 8px rgba(58, 36, 24, .16));
  transition: transform .5s var(--ease-spring);
}
.why-item:hover img { transform: translateY(-6px) rotate(-3deg) scale(1.04); }
.why-item h3 { font-size: clamp(21px, 2vw, 25px); font-weight: 800; line-height: 1.15; }
.why-item p { color: var(--muted); margin-top: 8px; font-size: 16px; }

/* ── Themes marquee ───────────────────────────────────────── */
.marquee {
  margin-top: clamp(32px, 5vw, 56px);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
}
.marquee-track {
  --gap: 16px;
  display: flex; gap: var(--gap); width: max-content;
  /* the list is laid out twice; the trailing gap makes each half exactly one
     list long, so the loop's seam lands on a gap and never jumps */
  padding-inline-end: var(--gap);
  animation: marquee 48s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(50%); } }
.theme-card {
  flex: 0 0 auto;
  width: 168px;
  border-radius: var(--r-m);
  background: var(--tc-page);
  color: var(--tc-ink);
  border: 1px solid var(--tc-line);
  box-shadow: var(--shadow);
  padding: 14px 14px 12px;
  transition: transform .3s var(--ease-spring);
}
.theme-card:hover { transform: translateY(-4px) rotate(-1deg); }
.theme-card .tc-bar { height: 8px; width: 60%; border-radius: 4px; background: var(--tc-ink); opacity: .9; }
.theme-card .tc-lines { display: grid; gap: 6px; margin-top: 10px; }
.theme-card .tc-lines i { display: block; height: 6px; border-radius: 3px; background: var(--tc-line); }
.theme-card .tc-lines i:nth-child(2) { width: 70%; }
.theme-card .tc-lines i:nth-child(3) { width: 45%; }
.theme-card .tc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.theme-card .tc-name { font-weight: 800; font-size: 15px; }
.theme-card .tc-dot { width: 22px; height: 22px; border-radius: 999px; background: var(--tc-accent); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35); }

/* ── CTA ──────────────────────────────────────────────────── */
.cta {
  background: var(--grout);
  color: var(--cream);
  padding: clamp(64px, 10vw, 128px) 0;
  position: relative; overflow: hidden;
}
.cta::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 80% at 15% 20%, rgba(245, 213, 71, .16), transparent 60%),
    radial-gradient(50% 70% at 85% 80%, rgba(156, 195, 236, .16), transparent 60%),
    radial-gradient(40% 50% at 70% 10%, rgba(242, 184, 198, .12), transparent 60%);
  pointer-events: none;
}
.cta-inner { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; }
.cta-icon {
  width: 112px; height: 112px;
  border-radius: 26px;
  box-shadow: 0 0 0 3px rgba(246, 236, 212, .18), 0 30px 60px -20px rgba(0, 0, 0, .6);
  animation: cta-float 7s ease-in-out infinite alternate;
}
/* translate/rotate, not transform, so the reveal's rise still plays underneath */
@keyframes cta-float { from { translate: 0 -4px; rotate: -2deg } to { translate: 0 4px; rotate: 2deg } }
.cta-title { margin-top: 28px; }
.cta-sub { color: rgba(246, 236, 212, .72); font-size: 20px; margin-top: 10px; }
.cta .store-row { justify-content: center; margin-top: 34px; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer { padding: 28px 0; color: var(--muted); font-size: 14px; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); }
.footer-icon { width: 22px; height: 22px; border-radius: 6px; }

.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover, .footer-links a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ── Legal and support pages ──────────────────────────────── */
.doc { padding: 36px 0 72px; }
.doc-body { width: min(760px, 100% - 32px); margin-inline: auto; }
.doc-title { font-weight: 800; font-size: clamp(34px, 5vw, 52px); line-height: 1.1; letter-spacing: -.01em; }
.doc-meta { color: var(--muted); font-size: 15px; margin-top: 10px; }
.doc-summary {
  margin-top: 28px; padding: 20px 22px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l);
  box-shadow: var(--shadow);
}
.doc-body .doc-summary h2 { font-size: 19px; margin: 0 0 8px; }
.doc-toc { margin-top: 28px; }
.doc-toc ol { margin: 8px 0 0; padding-inline-start: 22px; columns: 2 220px; column-gap: 32px; }
.doc-toc li { margin: 3px 0; break-inside: avoid; }
.doc-toc a { color: var(--accent); }
.doc-body h2 { font-weight: 800; font-size: clamp(22px, 2.6vw, 27px); line-height: 1.2; margin: 44px 0 12px; scroll-margin-top: 90px; }
.doc-body h3 { font-weight: 700; font-size: 19px; margin: 24px 0 8px; }
.doc-body p { margin: 0 0 12px; }
.doc-body ul, .doc-body ol.steps { list-style: disc; margin: 0 0 14px; padding-inline-start: 24px; }
.doc-body ol.steps { list-style: decimal; }
.doc-body li { margin: 5px 0; }
.doc-body p a, .doc-body li a, .doc-body td a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.doc-body strong { font-weight: 700; }
.doc-table-wrap { overflow-x: auto; margin: 6px 0 16px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--card); }
.doc-body table { width: 100%; border-collapse: collapse; font-size: 15px; }
.doc-body th, .doc-body td { text-align: start; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.doc-body tr:last-child td { border-bottom: 0; }
.doc-body th { background: var(--fill); font-weight: 700; }
.doc-contact {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 4px;
  font-weight: 700; color: var(--page); background: var(--ink);
  padding: 11px 20px; border-radius: 999px;
}
.doc-body a.doc-contact { color: var(--page); text-decoration: none; }
.doc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 28px; }
.doc-card {
  display: block; padding: 18px 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l);
  box-shadow: var(--shadow); transition: transform .22s var(--ease-spring);
}
.doc-card:hover { transform: translateY(-2px); }
.doc-card strong { display: block; font-size: 18px; }
.doc-card span { color: var(--muted); font-size: 15px; }
.doc-body details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.doc-body summary { cursor: pointer; font-weight: 700; }
.doc-body details p { margin: 10px 0 0; }
[dir="ltr"], .ltr { direction: ltr; unicode-bidi: isolate; }

/* ── Download page ────────────────────────────────────────── */
/* one centred column that fills the screen between header and footer */
.dl-page { display: grid; grid-template-rows: auto 1fr auto; min-height: 100svh; }
.dl { display: grid; place-items: center; padding: 12px 0 40px; }
.dl-inner { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.dl-inner::before {
  /* a soft glow behind the icon, in the tiles' own colours */
  content: ""; position: absolute; z-index: -1;
  /* centred on the column and never wider than the screen, or a phone scrolls sideways */
  width: min(560px, 100vw); aspect-ratio: 1; top: -120px; left: 50%; translate: -50% 0;
  background:
    radial-gradient(closest-side at 38% 40%, color-mix(in srgb, var(--g-arrowword) 45%, transparent), transparent),
    radial-gradient(closest-side at 64% 52%, color-mix(in srgb, var(--g-connections) 40%, transparent), transparent),
    radial-gradient(closest-side at 50% 30%, color-mix(in srgb, var(--g-bee) 30%, transparent), transparent);
  filter: blur(30px); opacity: .55; pointer-events: none;
}
.dl-icon {
  width: 128px; height: 128px; border-radius: 29px;
  box-shadow: 0 0 0 1px rgba(58, 36, 24, .14), var(--shadow-lift);
}
/* the float rides on translate/rotate so the entrance's transform still plays underneath */
.dl-icon.hero-in { animation: hero-in .9s var(--ease-out) forwards, cta-float 7s ease-in-out 1s infinite alternate; }
.dl-title { margin-top: 26px; font-size: clamp(48px, 9vw, 76px); }
.dl-sub { margin-top: 6px; }

/* seven tiles and their gaps shrink with the screen, so the row fits a 320px phone */
.dl-games { display: flex; justify-content: center; gap: clamp(4px, 1.6vw, 8px); margin-top: 26px; }
.dl-games li {
  width: clamp(32px, 10.5vw, 42px); aspect-ratio: 1; border-radius: 22%;
  display: grid; place-items: center;
  rotate: var(--r);
  box-shadow: inset 0 0 0 1.5px rgba(58, 36, 24, .16), 0 10px 18px -10px rgba(20, 32, 43, .4);
  transition: rotate .3s var(--ease-spring), translate .3s var(--ease-spring);
}
.dl-games li:hover { rotate: 0deg; translate: 0 -3px; }
.dl-games img { width: 76%; height: 76%; object-fit: contain; }

.dl-stores { justify-content: center; margin-top: 30px; }
/* a phone sees only its own store's button (download.js marks which, before first paint) */
[data-os="apple"] .dl-stores [data-store="google"],
[data-os="google"] .dl-stores [data-store="apple"] { display: none; }
[data-os] .dl-stores .store-btn { min-width: 240px; justify-content: center; padding-block: 13px; }

.dl-status { color: var(--muted); font-size: 16px; margin-top: 18px; min-height: 1.5em; max-width: min(42ch, 100%); }
/* while the page is on its way to the store, three dots keep time */
[data-going] .dl-status::after {
  content: "…"; display: inline-block; width: 1em; text-align: start;
  animation: dl-dots 1s steps(4, jump-none) infinite;
  /* revealed from the right: in Hebrew the dots grow leftward, away from the words */
  clip-path: inset(0 0 0 100%);
}
@keyframes dl-dots { to { clip-path: inset(0 0 0 0); } }
/* on the way to the store the page has under a second, so its entrance runs quicker
   (the icon keeps its own: it is first anyway, and its float is chained to it) */
[data-going] .dl-inner > .hero-in:not(.dl-icon) { animation-duration: .5s; animation-delay: calc(var(--d, 0) * 50ms); }

.dl-other { margin-top: 6px; font-size: 15px; }
.dl-other a { display: none; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
[data-os="apple"] .dl-other [data-other-for="apple"],
[data-os="google"] .dl-other [data-other-for="google"] { display: inline; }

/* ── Toast ────────────────────────────────────────────────── */
.toast {
  position: fixed; inset-inline: 0; bottom: 24px; z-index: 30;
  width: max-content; max-width: calc(100% - 32px); margin-inline: auto;
  background: var(--ink); color: var(--page);
  padding: 12px 20px; border-radius: 999px;
  font-weight: 700; box-shadow: var(--shadow-lift);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-out);
}
.toast.show { opacity: 1; transform: none; }

/* ── Phone ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .why { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .hero { padding-top: 12px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-copy { text-align: center; }
  .lead { margin-inline: auto; }
  .store-row { justify-content: center; }
  .store-btn { flex: 1 1 100%; justify-content: center; }
  .mosaic { width: min(100%, 360px); }
  .game { flex-basis: calc(50% - 9px); padding: 14px 12px 18px; }
  .game h3 { font-size: 19px; }
  .game p { font-size: 14px; }
  .why { gap: 32px 16px; }
  .footer-row { justify-content: center; text-align: center; }
}

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* `.line.hero-in` and `.dl-icon.hero-in` are named so the two-class rules above cannot outrank this */
  .hero-in, .line.hero-in, .dl-icon.hero-in { animation: none; opacity: 1; transform: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .tile img, .cta-icon, .marquee-track, [data-going] .dl-status::after { animation: none; }
  [data-going] .dl-status::after { clip-path: none; }
  .tile { transform: rotate(var(--r)); }
  .game, .store-btn, .why-item img, .theme-card, .icon-btn, .dl-games li, .screens img { transition: none; }
}
