/* Kopu Games site. One stylesheet for every page; fonts are self-hosted (no third-party requests). */

@font-face { font-family: "Fredoka"; src: url("fonts/fredoka.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/nunito.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }

:root {
  --bg: #fff8f0;
  --bg-dot: #ecdfcf;
  --surface: #ffffff;
  --surface-2: #fbf1e6;
  --ink: #1f1b2e;
  --muted: #5f586f;
  --line: #eadfd2;
  --accent: #c63d23;
  --accent-bg: #ff6b4a;
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(31, 27, 46, .06), 0 10px 30px -12px rgba(31, 27, 46, .18);
  --shadow-lift: 0 2px 4px rgba(31, 27, 46, .08), 0 22px 44px -16px rgba(31, 27, 46, .28);

  --peel: #f0645a;   --peel-2: #c4324a;
  --slide: #3f8de8;  --slide-2: #1c3e8c;
  --tilt: #8c5ce6;   --tilt-2: #3c2278;
  --math: #ff9f1c;   --math-2: #1f1b2e;

  --display: "Fredoka", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 22px;
  --wrap: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14121b; --bg-dot: #25212f; --surface: #1d1a27; --surface-2: #231f2f;
    --ink: #f3eef8; --muted: #aaa3b9; --line: #2e2a3b;
    --accent: #ff8f73; --accent-bg: #ff6b4a; --on-accent: #1a1016;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .6);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 22px 44px -16px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14121b; --bg-dot: #25212f; --surface: #1d1a27; --surface-2: #231f2f;
  --ink: #f3eef8; --muted: #aaa3b9; --line: #2e2a3b;
  --accent: #ff8f73; --accent-bg: #ff6b4a; --on-accent: #1a1016;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 22px 44px -16px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.65 var(--body); overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; font-family: var(--display); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent-bg); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: 10px; z-index: 50; }
.skip:focus { left: 12px; }

/* ---------- header ---------- */
.site-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-head.scrolled { border-bottom-color: var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 16px; height: 68px; }
.brand { white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 600 1.3rem/1 var(--display); }
.brand img { width: 34px; height: 34px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: .95rem; padding: 8px 12px; border-radius: 999px; }
.nav a:hover { background: var(--surface-2); }
.nav .hide-sm { display: none; }
@media (min-width: 640px) { .nav .hide-sm { display: inline-block; } }
.theme-btn { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; margin-left: 4px; }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: none; }
}

/* ---------- buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; font: 700 1rem/1 var(--body); text-decoration: none; padding: 15px 22px; border-radius: 999px; border: 2px solid transparent; transition: transform .15s, box-shadow .15s, background .15s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent-bg); color: #fff; box-shadow: 0 8px 20px -8px rgba(255, 107, 74, .7); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn svg { width: 18px; height: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .8rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.status { white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 800; color: var(--muted); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--math); box-shadow: 0 0 0 4px color-mix(in srgb, var(--math) 25%, transparent); }
.status.live::before { background: #2fb36d; box-shadow: 0 0 0 4px rgba(47, 179, 109, .22); }

/* ---------- sections ---------- */
section { padding: 72px 0; }
@media (min-width: 900px) { section { padding: 104px 0; } }
.eyebrow { font: 700 .82rem/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(2rem, 4.4vw, 2.9rem); }
.section-head p { color: var(--muted); margin-top: 14px; font-size: 1.08rem; }

.dots { background-image: radial-gradient(var(--bg-dot) 1.6px, transparent 1.7px); background-size: 28px 28px; }

/* ---------- hero ---------- */
.hero { padding: 40px 0 72px; position: relative; }
.hero .wrap { display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) { .hero { padding: 72px 0 112px; } .hero .wrap { grid-template-columns: 1.05fr 1fr; } }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 600; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { font-size: clamp(1.05rem, 2vw, 1.22rem); color: var(--muted); margin-top: 20px; max-width: 34ch; }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.collage { position: relative; aspect-ratio: 1 / 1; max-width: 480px; width: 100%; margin: 0 auto; }
.collage a { position: absolute; width: 44%; border-radius: 24%; box-shadow: var(--shadow-lift); overflow: hidden; transition: transform .25s ease; animation: bob 6s ease-in-out infinite; }
.collage a img { width: 100%; height: auto; }
.collage a:nth-child(1) { left: 4%;  top: 6%;  --r: -8deg; }
.collage a:nth-child(2) { right: 3%; top: 0;   --r: 7deg;  animation-delay: -1.5s; }
.collage a:nth-child(3) { left: 0;   bottom: 2%; --r: 5deg; animation-delay: -3s; }
.collage a:nth-child(4) { right: 6%; bottom: 6%; --r: -6deg; animation-delay: -4.5s; }
.collage a { transform: rotate(var(--r)); }
.collage a:hover { transform: rotate(0deg) scale(1.05); z-index: 2; animation-play-state: paused; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@media (prefers-reduced-motion: reduce) { .collage a { animation: none; } .btn:hover, .game:hover { transform: none; } html { scroll-behavior: auto; } }

/* ---------- game cards ---------- */
.games { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .games { grid-template-columns: repeat(2, 1fr); gap: 24px; } }
.game { --c1: var(--peel); --c2: var(--peel-2); position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: transform .2s, box-shadow .2s; }
.game:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.game .band { position: relative; height: 130px; background: linear-gradient(150deg, var(--c1), var(--c2)); }
.game .band::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .18) 1.6px, transparent 1.7px); background-size: 22px 22px; }
.game .icon { position: absolute; left: 24px; bottom: -40px; width: 104px; height: 104px; border-radius: 26px; box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .45); border: 4px solid var(--surface); z-index: 1; }
.game .body { padding: 60px 24px 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.game h3 { font-size: 1.55rem; }
.game .sub { color: var(--muted); font-weight: 700; font-size: .95rem; margin-top: -6px; }
.game p.pitch { color: var(--muted); }
.game .foot { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.game .more { font-weight: 800; color: var(--accent); white-space: nowrap; }
.game .more::after { content: " \2192"; transition: margin .2s; }
.game:hover .more::after { margin-left: 4px; }
.game[data-game="slide"] { --c1: var(--slide); --c2: var(--slide-2); }
.game[data-game="tilt"]  { --c1: var(--tilt);  --c2: var(--tilt-2); }
.game[data-game="math"]  { --c1: #4a4260; --c2: var(--math-2); }

/* ---------- principles ---------- */
.band-soft { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.principles { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .principles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .principles { grid-template-columns: repeat(4, 1fr); } }
.principle { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.principle .tile { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 18px; color: #fff; }
.principle .tile svg { width: 24px; height: 24px; }
.principle h3 { font-size: 1.2rem; margin-bottom: 8px; }
.principle p { color: var(--muted); font-size: .98rem; }

/* ---------- about / tester ---------- */
.split { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 72px; } }
.about-copy p + p { margin-top: 16px; }
.about-copy p { color: var(--muted); font-size: 1.06rem; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.stat b { display: block; font: 600 2.4rem/1 var(--display); }
.stat span { color: var(--muted); font-size: .95rem; font-weight: 700; }
.stat:nth-child(1) b { color: var(--peel); }
.stat:nth-child(2) b { color: var(--slide); }
.stat:nth-child(3) b { color: var(--tilt); }
.stat:nth-child(4) b { color: var(--math); }

.cta-card { position: relative; overflow: hidden; border-radius: 30px; padding: 40px 24px; background: linear-gradient(140deg, #ff7a59, #c4324a 55%, #7b3fb8); color: #fff; }
@media (min-width: 720px) { .cta-card { padding: 64px; } }
.cta-card::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .16) 1.6px, transparent 1.7px); background-size: 26px 26px; pointer-events: none; }
.cta-card > * { position: relative; z-index: 1; }
.cta-card h2 { font-size: clamp(1.9rem, 4.4vw, 2.8rem); max-width: 18ch; }
.cta-card p { margin-top: 14px; max-width: 56ch; opacity: .94; font-size: 1.06rem; }
.cta-card .ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.cta-card .btn-light { background: #fff; color: #7a1f33; }
.cta-card .btn-outline { border-color: rgba(255, 255, 255, .6); color: #fff; }
.steps { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; font-weight: 700; }
.steps li::before { content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 9px; background: rgba(255, 255, 255, .22); display: grid; place-items: center; font: 600 .95rem/1 var(--display); }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding: 48px 0 40px; color: var(--muted); font-size: .95rem; }
.site-foot .cols { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .site-foot .cols { grid-template-columns: 1.6fr 1fr 1fr; } }
.site-foot h4 { font: 700 .8rem/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); margin: 0 0 14px; }
.site-foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }
.site-foot .blurb { max-width: 36ch; margin-top: 12px; }
.site-foot .legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: .88rem; }

/* ---------- game pages ---------- */
.game-hero { --c1: var(--peel); --c2: var(--peel-2); position: relative; color: #fff; background: linear-gradient(150deg, var(--c1), var(--c2)); padding: 48px 0 56px; overflow: hidden; }
.game-hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .16) 1.6px, transparent 1.7px); background-size: 26px 26px; pointer-events: none; }
.game-hero .wrap { position: relative; z-index: 1; display: grid; gap: 28px; align-items: center; }
@media (min-width: 820px) { .game-hero { padding: 80px 0 88px; } .game-hero .wrap { grid-template-columns: auto 1fr; gap: 48px; } }
.game-hero .big-icon { width: 148px; height: 148px; border-radius: 36px; box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .55); border: 5px solid rgba(255, 255, 255, .9); }
@media (min-width: 820px) { .game-hero .big-icon { width: 220px; height: 220px; border-radius: 52px; } }
.game-hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
.game-hero .sub { font: 500 clamp(1.1rem, 2.4vw, 1.5rem)/1.3 var(--display); opacity: .92; margin-top: 6px; }
.game-hero .lede { margin-top: 18px; max-width: 52ch; font-size: 1.1rem; opacity: .95; }
.game-hero .ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; align-items: center; }
.play-pill { display: inline-flex; align-items: center; gap: 10px; background: rgba(0, 0, 0, .28); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 800; text-decoration: none; border: 1px solid rgba(255, 255, 255, .25); }
.play-pill small { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.play-pill svg { width: 22px; height: 22px; flex: none; }
.back { display: inline-flex; gap: 6px; align-items: center; color: #fff; opacity: .9; font-weight: 800; text-decoration: none; font-size: .95rem; }
.back:hover { opacity: 1; text-decoration: underline; }
.game-hero[data-game="slide"] { --c1: var(--slide); --c2: var(--slide-2); }
.game-hero[data-game="tilt"]  { --c1: var(--tilt);  --c2: var(--tilt-2); }
.game-hero[data-game="math"]  { --c1: #4a4260; --c2: #16131f; }

.howto { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; counter-reset: h; }
@media (min-width: 820px) { .howto { grid-template-columns: repeat(3, 1fr); } }
.howto li { counter-increment: h; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.howto li::before { content: counter(h); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--c, var(--accent-bg)); color: #fff; font: 600 1.2rem/1 var(--display); margin-bottom: 14px; }
.howto h3 { font-size: 1.2rem; margin-bottom: 6px; }
.howto p { color: var(--muted); }
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
@media (min-width: 720px) { .features { grid-template-columns: repeat(2, 1fr); } }
.features li { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.features li::before { content: ""; flex: none; width: 14px; height: 14px; margin-top: 6px; border-radius: 4px; background: var(--c, var(--accent-bg)); transform: rotate(12deg); }
.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 0 20px; }
.faq summary { cursor: pointer; font-weight: 800; padding: 18px 28px 18px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; translate: 0 -50%; font: 500 1.5rem/1 var(--display); color: var(--muted); transition: rotate .2s; }
.faq details[open] summary::after { rotate: 45deg; }
.faq details p { color: var(--muted); padding-bottom: 18px; }
.more-games { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.mini { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; color: inherit; text-decoration: none; transition: transform .2s, box-shadow .2s; }
.mini:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.mini img { width: 56px; height: 56px; border-radius: 15px; }
.mini b { font-family: var(--display); font-weight: 600; font-size: 1.1rem; display: block; line-height: 1.2; }
.mini span { color: var(--muted); font-size: .88rem; font-weight: 700; }

/* ---------- prose (privacy) ---------- */
.prose { max-width: 760px; margin: 0 auto; padding: 48px 16px 80px; }
.prose h1 { font-size: clamp(2.2rem, 5vw, 3rem); }
.prose h2 { font-size: 1.45rem; margin: 40px 0 10px; }
.prose p, .prose li { color: var(--muted); }
.prose p + p { margin-top: 12px; }
.prose strong { color: var(--ink); }
.prose .meta { margin-top: 10px; }
.prose ul { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose code { background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-size: .88em; color: var(--ink); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); margin: 14px 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; min-width: 480px; }
.prose th, .prose td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--muted); }
.prose th { color: var(--ink); background: var(--surface-2); }
.prose tr:last-child td { border-bottom: 0; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; margin-top: 28px; }
.toc b { display: block; margin-bottom: 6px; }
.toc ul { margin: 0; columns: 2; column-gap: 24px; }
@media (max-width: 520px) { .toc ul { columns: 1; } }

/* ---------- 404 ---------- */
.lost { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 48px 16px; }
.lost h1 { font-size: clamp(3rem, 12vw, 7rem); color: var(--accent); }
.lost p { color: var(--muted); margin: 12px auto 28px; max-width: 40ch; font-size: 1.1rem; }
