/* Kid & Kid marketing site. Static, no script (CSP script-src 'none'): every effect here is CSS,
   and the moving pets are animated WebP pictures baked from the game's own animations
   (scripts/build_site_assets.py). No inline styles either (CSP style-src 'self').
   The look is the game's: its lavender background with soft bubbles, its font (Fredoka), its
   chunky outlined buttons and the four colours of the logo (cyan, yellow, pink, purple).
   Cache-busting: the pages link this file as site.css?v=<date>; bump that in every page after
   an edit (grep "site.css?v=" in site-src/pages/, then scripts/build_site_pages.py).
   LANGUAGES (docs/languages.md): the pages exist once per language (site/<code>/); Persian,
   Arabic and Urdu are right-to-left, so sides are written as start / end (text-align: start,
   margin-inline, inset-inline-end), never left / right, except for pure decoration. */

@font-face { font-family: "Fredoka"; src: url("/fonts/fredoka.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
/* Fredoka only has the letters of some Latin-script languages. Two more fonts of the game
   (scripts/build_site_assets.py; a browser downloads a font only on a page that uses it):
   Nunito for Polish, Turkish, Vietnamese, Russian and Ukrainian, Vazirmatn for Persian, Arabic
   and Urdu. Every other script (Hindi, Bengali, Thai, Chinese, Japanese, Korean) is drawn with
   the device's own font. */
@font-face { font-family: "Nunito"; src: url("/fonts/nunito.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/fonts/vazirmatn.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
    --ink: #2b1a66;          /* the dark indigo outline of the logo: all text */
    --ink-soft: #5b4d8f;
    --lavender: #efe7ff;     /* the game's background */
    --lavender-deep: #dccdff;
    --white: #ffffff;
    --purple: #7c4dff;
    --pink: #ff5c8a;
    --yellow: #ffc93c;
    --cyan: #22c7d6;
    --green: #34c98a;
    --wrap: 1140px;
    --radius: 26px;
    color-scheme: light;
}

* { box-sizing: border-box; }

/* The visit-counter pixel (<img class="px" src="/px/<page>.gif">, first thing in every <body>):
   a 1x1 gif that nginx serves from memory with no-store; its access-log line is the site's
   visit count (deploy/site/default.conf.template). Kept out of the layout and invisible. */
.px { position: absolute; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    font: 400 18px/1.6 "Fredoka", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    /* the game's soft bubbles, in the page background */
    background:
        radial-gradient(circle at 6% 12%, rgba(255, 92, 138, 0.16) 0 70px, transparent 71px),
        radial-gradient(circle at 94% 8%, rgba(34, 199, 214, 0.18) 0 90px, transparent 91px),
        radial-gradient(circle at 88% 46%, rgba(255, 201, 60, 0.20) 0 60px, transparent 61px),
        radial-gradient(circle at 4% 62%, rgba(124, 77, 255, 0.14) 0 80px, transparent 81px),
        radial-gradient(circle at 96% 88%, rgba(52, 201, 138, 0.16) 0 70px, transparent 71px),
        var(--lavender);
    background-attachment: fixed;
}
/* a language whose alphabet Fredoka only half covers gets ONE other font for all its letters */
:lang(pl), :lang(tr), :lang(vi), :lang(ru), :lang(uk) { font-family: "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
:lang(fa), :lang(ar), :lang(ur) { font-family: "Vazirmatn", "Segoe UI", Tahoma, system-ui, sans-serif; }
img { max-width: 100%; height: auto; }
a { color: var(--purple); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 700; }
h2 { font-size: clamp(1.8rem, 4vw, 2.7rem); text-align: center; }
h3 { font-size: 1.3rem; font-weight: 600; }
p { margin: 0 0 1em; }
.wrap { width: min(var(--wrap), 100% - 36px); margin-inline: auto; }
.lead { text-align: center; color: var(--ink-soft); font-size: 1.15rem; max-width: 720px; margin: 0 auto 2.2em; }

/* the logo's colours for single words in a heading */
.c-cyan { color: var(--cyan); }
.c-pink { color: var(--pink); }
.c-purple { color: var(--purple); }
.c-yellow { color: #f0a800; }
.c-green { color: var(--green); }

/* ---------------------------------------------------------------- top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.wordmark { display: inline-flex; align-items: center; }
.wordmark img { width: 150px; height: auto; display: block; }
.top nav { display: flex; align-items: center; gap: 6px 20px; flex-wrap: wrap; font-weight: 500; }
.top nav a { color: var(--ink); text-decoration: none; }
.top nav a:hover { color: var(--purple); }
.top nav .pill { background: var(--purple); color: var(--white); border-radius: 999px; padding: 6px 20px; box-shadow: 0 4px 0 var(--ink); }
.top nav .pill:hover { color: var(--white); transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }

/* ---------------------------------------------------------------- language menu
   <details class="langs">: the browser opens and closes it (no script). The button shows the
   page's language by its own name; the list links to the same page in every other language. */
.langs { position: relative; }
.langs summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--white); color: var(--ink); font-weight: 500; user-select: none; }
.langs summary::-webkit-details-marker { display: none; }
.langs summary:hover, .langs[open] summary { background: var(--lavender); }
.langs summary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.langs ul { position: absolute; inset-inline-end: 0; top: calc(100% + 10px); z-index: 30; margin: 0; padding: 10px; list-style: none; display: grid; grid-template-columns: repeat(3, max-content); gap: 2px 4px; background: var(--white); border: 3px solid var(--ink); border-radius: 20px; box-shadow: 0 6px 0 var(--ink); text-align: start; font-size: 1rem; }
.langs li { margin: 0; }
.top nav .langs li a, .langs li a { display: block; padding: 5px 12px; border-radius: 10px; white-space: nowrap; color: var(--ink); text-decoration: none; font-weight: 400; }
.langs li a:hover { background: var(--lavender); color: var(--purple); }
.langs li a[aria-current] { background: var(--lavender-deep); font-weight: 600; }
.center .langs { display: inline-block; margin-top: 26px; }
.center .langs ul { inset-inline-end: auto; left: 50%; transform: translateX(-50%); top: auto; bottom: calc(100% + 10px); }

/* ---------------------------------------------------------------- buttons (the game's chunky ones) */
.cta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 26px; }
.btn {
    display: inline-flex; flex-direction: column; justify-content: center; min-width: 230px;
    padding: 13px 28px; border-radius: 20px; text-decoration: none; font-weight: 700; font-size: 1.25rem; line-height: 1.25;
    color: var(--ink); background: var(--white); border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn small { font-weight: 500; font-size: 0.82rem; opacity: 0.85; }
a.btn:hover { transform: translateY(3px); box-shadow: 0 3px 0 var(--ink); }
.btn-play { background: var(--yellow); }
/* store button: an icon beside the two text lines */
.btn-store { flex-direction: row; align-items: center; justify-content: center; gap: 12px; }
.btn-store span { display: flex; flex-direction: column; }
.store-icon { width: 30px; height: 30px; flex: none; fill: var(--green); }
/* not a link yet: the Android app is on its way (see the comment in index.html) */
.btn.is-soon { background: #f6f1ff; border-style: dashed; box-shadow: none; color: var(--ink-soft); cursor: default; }

.facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 0; padding: 0; list-style: none; font-weight: 500; font-size: 0.98rem; }
.facts li { background: var(--white); border-radius: 999px; padding: 6px 16px; border: 2px solid var(--lavender-deep); }

/* ---------------------------------------------------------------- hero */
.hero { padding-bottom: 30px; overflow: hidden; }
.hero-body { display: grid; grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: 30px; padding: 20px 0 30px; }
.hero-logo { width: min(460px, 90%); display: block; margin: 0 0 14px -10px; }
.hero h1 { font-size: clamp(2.1rem, 4.8vw, 3.4rem); }
.tagline { font-size: 1.25rem; color: var(--ink-soft); max-width: 32em; }

/* the stage: a big soft blob with two pets on it and game icons floating around */
.stage { position: relative; height: 470px; }
.stage::before {
    content: ""; position: absolute; inset: 40px 10px 20px 10px; border-radius: 46% 54% 52% 48% / 55% 48% 52% 45%;
    background: linear-gradient(160deg, #ffffff 0%, #e2d5ff 100%); border: 4px solid var(--white);
    box-shadow: 0 18px 40px rgba(124, 77, 255, 0.22);
}
.stage .pet { position: absolute; bottom: 30px; width: 270px; height: 270px; }
.stage .pet-a { left: 4%; }
.stage .pet-b { right: 4%; }
.stage .pet img { width: 100%; height: 100%; display: block; }
.float { position: absolute; width: 92px; height: 92px; border-radius: 22px; filter: drop-shadow(0 8px 10px rgba(43, 26, 102, 0.22)); animation: float 5s ease-in-out infinite; }
.float.f1 { top: 0; left: 6%; animation-delay: -0.5s; }
.float.f2 { top: 18px; left: 38%; animation-delay: -2.1s; }
.float.f3 { top: 4px; right: 5%; animation-delay: -3.3s; }
.float.f4 { top: 150px; left: -1%; width: 78px; height: 78px; animation-delay: -1.4s; }
.float.f5 { top: 140px; right: -1%; width: 78px; height: 78px; animation-delay: -4.2s; }
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-14px) rotate(4deg); }
}

/* ---------------------------------------------------------------- sections */
section { padding: 74px 0; }
/* a white sheet with round corners, like the game's panels */
.sheet { background: var(--white); border-radius: 44px; margin-inline: 10px; box-shadow: 0 10px 0 var(--lavender-deep); }

/* the four promises under the hero */
.promises { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 0; margin: 0; list-style: none; }
.promises li { background: var(--white); border-radius: var(--radius); padding: 22px 18px; text-align: center; border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink); }
.promises li:nth-child(1) { background: #fff3c9; }
.promises li:nth-child(2) { background: #d8f6f9; }
.promises li:nth-child(3) { background: #ffe0ea; }
.promises li:nth-child(4) { background: #e6dcff; }
.promises svg { width: 46px; height: 46px; display: block; margin: 0 auto 8px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.promises strong { display: block; font-size: 1.2rem; font-weight: 700; }
.promises span { color: var(--ink-soft); font-size: 0.98rem; }
.strip { padding: 10px 0 60px; }

/* ---------------------------------------------------------------- the games */
.games { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.game { position: relative; background: var(--white); border-radius: var(--radius); border: 3px solid var(--ink); box-shadow: 0 7px 0 var(--ink); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.15s ease; }
.game:hover { transform: translateY(-4px) rotate(-0.5deg); }
.game .shot { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 3px solid var(--ink); background: var(--lavender); }
.game-body { padding: 0 20px 20px; }
.game-head { display: flex; align-items: flex-end; gap: 12px; margin-top: -34px; margin-bottom: 10px; }
.game-icon { width: 84px; height: 84px; flex: none; border-radius: 22px; background: var(--white); border: 3px solid var(--ink); }
.game:hover .game-icon { animation: wobble 0.6s ease; }
@keyframes wobble {
    0%, 100% { transform: rotate(0); }
    30% { transform: rotate(-9deg) scale(1.06); }
    60% { transform: rotate(7deg) scale(1.06); }
}
.game h3 { margin: 0; font-size: 1.4rem; font-weight: 700; }
.ages { display: inline-block; font-size: 0.82rem; font-weight: 600; background: var(--yellow); border-radius: 999px; padding: 1px 12px; margin-bottom: 4px; }
.game p { color: var(--ink-soft); margin: 0 0 12px; font-size: 1rem; }
.skills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 0.86rem; font-weight: 500; }
.skills li { border-radius: 999px; padding: 2px 12px; background: #e6dcff; }
.skills li:nth-child(2) { background: #d8f6f9; }
.skills li:nth-child(3) { background: #ffe0ea; }
.skills-title { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); margin: 0 0 6px; }
/* the last card of the list: "more games are on the way" (no screenshot, a dashed outline) */
.game.more { border-style: dashed; box-shadow: none; background: #faf7ff; justify-content: center; text-align: center; grid-column: 1 / -1; }
.game.more:hover { transform: none; }
.game.more .game-body { padding: 24px 20px; max-width: 640px; margin: 0 auto; }
.game.more img { width: 120px; height: 120px; }
.game.more p { font-size: 1.08rem; }
.note { text-align: center; color: var(--ink-soft); font-size: 0.95rem; margin: 30px auto 0; max-width: 640px; }

/* ---------------------------------------------------------------- text + picture rows */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; }
.duo-top { align-items: start; }
.duo h2 { text-align: start; }
.duo .lead { text-align: start; margin-inline: 0; }
.duo-art { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 10px; min-height: 300px; }
.duo-art::before { content: ""; position: absolute; inset: 30px 6% 0 6%; border-radius: 50% 50% 46% 54% / 60% 58% 42% 40%; background: linear-gradient(160deg, #fff3c9, #ffe0ea); }
.duo-art .pet { position: relative; width: 240px; height: 240px; }
.duo-art .pet img { width: 100%; height: 100%; display: block; }

.ticks { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.ticks li { position: relative; padding-inline-start: 46px; }
.ticks li::before {
    content: "✓"; position: absolute; inset-inline-start: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
    display: grid; place-items: center; background: var(--green); color: var(--white); font-weight: 700; border: 2px solid var(--ink);
}
.ticks strong { display: block; font-weight: 600; font-size: 1.12rem; }
.ticks span { color: var(--ink-soft); }
/* the "never" list of the safety section: a cross instead of a tick */
.ticks.never li::before { content: "✕"; background: var(--pink); }

/* the values: one coloured word each */
.values { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 0 0 10px; padding: 0; list-style: none; font-weight: 600; font-size: 1.15rem; }
.values li { border-radius: 999px; padding: 8px 22px; border: 3px solid var(--ink); background: var(--white); box-shadow: 0 4px 0 var(--ink); }
.values li:nth-child(6n+1) { background: #ffe0ea; }
.values li:nth-child(6n+2) { background: #d8f6f9; }
.values li:nth-child(6n+3) { background: #fff3c9; }
.values li:nth-child(6n+4) { background: #e6dcff; }
.values li:nth-child(6n+5) { background: #d6f5e6; }

/* cards (parents, install, steps) */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card { background: var(--white); border-radius: var(--radius); padding: 24px; border: 3px solid var(--lavender-deep); }
.sheet .card { background: #faf7ff; }
.card p { color: var(--ink-soft); margin: 0; }
.card .shot { display: block; width: 100%; border-radius: 16px; border: 3px solid var(--ink); margin-bottom: 16px; }
.card .btn { margin-top: 18px; min-width: 0; width: 100%; align-items: center; font-size: 1.1rem; }
.card .btn-store { justify-content: center; }
.card-icon { width: 54px; height: 54px; display: block; margin-bottom: 10px; fill: none; stroke: var(--purple); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.kids-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin: 0 0 34px; }
.kids-row img { width: 96px; height: 96px; border-radius: 50%; border: 4px solid var(--white); box-shadow: 0 6px 0 var(--lavender-deep); animation: float 6s ease-in-out infinite; }
.kids-row img:nth-child(2n) { animation-delay: -2s; }
.kids-row img:nth-child(3n) { animation-delay: -4s; }

/* numbered steps */
.steps { counter-reset: step; }
.step { counter-increment: step; position: relative; padding-top: 38px; }
.step::before {
    content: counter(step); position: absolute; top: -22px; inset-inline-start: 22px; width: 46px; height: 46px; border-radius: 50%;
    display: grid; place-items: center; background: var(--yellow); border: 3px solid var(--ink); font-weight: 700; font-size: 1.3rem;
}

/* the gift: the treasure chest beside the start text */
.gift { display: grid; grid-template-columns: auto 1fr; gap: 30px; align-items: center; max-width: 880px; margin: 0 auto 50px; }
.gift img { width: 220px; animation: float 5s ease-in-out infinite; }
.gift h2 { text-align: start; }
.gift p { color: var(--ink-soft); font-size: 1.12rem; margin: 0; }

.faq { max-width: 800px; margin: 0 auto; }
.faq details { border: 3px solid var(--lavender-deep); border-radius: 20px; padding: 14px 22px; margin-bottom: 12px; background: var(--white); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.1rem; }
.faq details[open] { border-color: var(--purple); }
.faq details[open] summary { color: var(--purple); margin-bottom: 8px; }
.faq p { color: var(--ink-soft); margin: 0; }

.final { text-align: center; }
.final .cta { justify-content: center; }
.final .btn { align-items: center; }
.final .pets { display: flex; justify-content: center; gap: 6px; margin-bottom: 10px; }
.final .pets img { width: 130px; height: 130px; }

/* ---------------------------------------------------------------- footer */
footer { background: var(--ink); padding: 34px 0 44px; color: #d9cfff; font-size: 0.98rem; margin-top: 40px; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: center; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot a { color: var(--white); text-decoration: none; }
.foot a:hover { color: var(--yellow); }

/* ---------------------------------------------------------------- text pages (privacy, terms, ...) */
.doc { max-width: 820px; margin: 20px auto 60px; padding: 40px clamp(20px, 5vw, 56px) 50px; background: var(--white); border-radius: 36px; box-shadow: 0 10px 0 var(--lavender-deep); font-size: 1.05rem; }
.doc h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); color: var(--purple); }
.doc h2 { text-align: start; font-size: 1.4rem; margin-top: 1.8em; }
.doc h3 { font-size: 1.15rem; margin-top: 1.4em; }
.doc .updated { color: var(--ink-soft); font-size: 0.95rem; }
.doc li { margin-bottom: 0.45em; }
.doc table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 0.98rem; }
.doc th, .doc td { border: 2px solid var(--lavender-deep); padding: 8px 12px; text-align: start; vertical-align: top; }
.doc th { background: var(--lavender); }
.table-scroll { overflow-x: auto; }
.center { text-align: center; padding: 60px 0 90px; }
.center .cta { justify-content: center; }
.center .btn { align-items: center; }
.center img { width: 240px; height: 240px; }

@media (max-width: 980px) {
    .hero-body { grid-template-columns: 1fr; text-align: center; }
    .hero-logo { margin-inline: auto; }
    .tagline { margin-inline: auto; }
    .cta, .facts { justify-content: center; }
    .stage { height: 400px; max-width: 560px; width: 100%; margin: 0 auto; }
    .stage .pet { width: 220px; height: 220px; }
    .games { grid-template-columns: repeat(2, 1fr); }
    .promises { grid-template-columns: repeat(2, 1fr); }
    .duo { grid-template-columns: 1fr; gap: 26px; }
    .duo h2, .duo .lead { text-align: center; margin-inline: auto; }
    .cards { grid-template-columns: 1fr; }
    .steps { row-gap: 40px; }
    section { padding: 56px 0; }
}
@media (max-width: 640px) {
    body { font-size: 17px; }
    .top { flex-direction: column; gap: 6px; padding: 12px 0 4px; }
    .top nav { justify-content: center; font-size: 0.95rem; }
    /* the list hangs in the middle of the screen, two names side by side */
    .langs { position: static; }
    .top { position: relative; }
    .langs ul { grid-template-columns: repeat(2, max-content); inset-inline-end: auto; left: 50%; transform: translateX(-50%); top: 100%; }
    .center .langs { position: relative; }
    .games { grid-template-columns: 1fr; }
    .sheet { border-radius: 30px; margin-inline: 0; }
    .gift { grid-template-columns: 1fr; text-align: center; gap: 10px; }
    .gift img { margin: 0 auto; width: 170px; }
    .gift h2 { text-align: center; }
    .stage { height: 330px; }
    .stage .pet { width: 170px; height: 170px; bottom: 24px; }
    .float { width: 68px; height: 68px; border-radius: 16px; }
    .float.f4, .float.f5 { width: 58px; height: 58px; top: 118px; }
    .duo-art .pet { width: 170px; height: 170px; }
    .duo-art { min-height: 220px; }
    .kids-row img { width: 70px; height: 70px; }
    .final .pets img { width: 84px; height: 84px; }
}
@media (max-width: 480px) {
    .btn { min-width: 0; width: 100%; align-items: center; }
    .promises { grid-template-columns: 1fr; }
}
/* visitors who asked their device for less motion: nothing floats or wobbles (the pets are
   swapped for still pictures by the <picture> elements in the pages) */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .float, .kids-row img, .gift img { animation: none; }
    .game:hover .game-icon { animation: none; }
    .btn, .game { transition: none; }
}
