/* Wonderkid Factory — one stylesheet, no framework, no web fonts.
   System fonts are deliberate: they render instantly, cause no layout shift,
   and avoid shipping visitor data to a font CDN, which keeps the privacy
   policy's "no third parties" claim honest.
   Palette mirrors the game (src/ui/theme/theme.ts). */

:root {
  color-scheme: dark;
  --bg: #0f1712;
  --surface: #182420;
  --raised: #1f2e28;
  --border: #2c3d35;
  --primary: #3fa96a;
  --primary-dark: #2a7a4b;
  --accent: #d8a94e;
  --text: #f2f5f1;
  --text-2: #9fb3a8;
  --text-3: #6c7f75;
  --wrap: 1080px;
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible,
button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

img { max-width: 100%; height: auto; display: block; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(15, 23, 18, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.85rem 0;
}
.brand { display: flex; align-items: center; gap: 0.65rem; color: var(--text); font-weight: 800; }
.brand:hover { text-decoration: none; }
.brand span { white-space: nowrap; }
.brand img { width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0; }
.nav { display: flex; gap: 1.25rem; font-size: 0.95rem; }
.nav a { color: var(--text-2); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

/* ---------- hero ---------- */
.hero { padding: clamp(3rem, 9vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem); text-align: center; }
.hero img.app-icon {
  width: 108px; height: 108px; border-radius: 24px; margin: 0 auto 1.5rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
h1 {
  font-size: clamp(2.2rem, 6.5vw, 3.7rem);
  line-height: 1.05; letter-spacing: -0.02em; font-weight: 800;
  margin-bottom: 1rem; text-wrap: balance;
}
.tagline {
  font-size: clamp(1.05rem, 2.6vw, 1.3rem); color: var(--text-2);
  max-width: 40ch; margin: 0 auto 2rem; text-wrap: balance;
}
.badge {
  display: inline-block; font-size: 0.78rem; font-weight: 800;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--accent); border: 1px solid rgba(216, 169, 78, 0.45);
  background: rgba(216, 169, 78, 0.09);
  padding: 0.35rem 0.8rem; border-radius: 999px; margin-bottom: 1.5rem;
}

/* ---------- buttons ---------- */
.actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 700; font-size: 1rem;
  padding: 0.85rem 1.6rem; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #08130c; }
.btn-primary:hover { background: #4bbd79; }
.btn-secondary { background: var(--raised); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--text-3); }

/* ---------- sections ---------- */
section { padding: clamp(2.5rem, 7vw, 4.5rem) 0; }
h2 {
  font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 800;
  letter-spacing: -0.015em; margin-bottom: 0.6rem; text-wrap: balance;
}
.section-intro { color: var(--text-2); max-width: 60ch; margin-bottom: 2.25rem; }

/* 320px min gives a balanced 3 + 3 at full width rather than a gappy 4 + 2. */
.features { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
}
.card h3 { font-size: 1.12rem; margin-bottom: 0.45rem; }
.card p { color: var(--text-2); font-size: 0.97rem; }
.card .k {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--primary); display: block; margin-bottom: 0.6rem;
}

/* ---------- screenshots ---------- */
.shots {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.shots figure { margin: 0; }
.shots img {
  border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface);
}
.shots figcaption {
  color: var(--text-3); font-size: 0.86rem; text-align: center; margin-top: 0.7rem;
}

/* ---------- quote ---------- */
.quote {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius); padding: 1.5rem 1.75rem;
}
.quote p { font-size: 1.08rem; }
.quote cite { display: block; margin-top: 0.6rem; color: var(--text-3); font-size: 0.9rem; font-style: normal; }

/* ---------- prose (privacy / support) ---------- */
.prose { max-width: 72ch; padding-bottom: 2rem; }
.prose h2 { font-size: 1.4rem; margin: 2.4rem 0 0.7rem; }
.prose h3 { font-size: 1.08rem; margin: 1.6rem 0 0.4rem; }
.prose p, .prose li { color: var(--text-2); }
.prose ul, .prose ol { margin: 0.6rem 0 1rem 1.3rem; }
.prose li { margin-bottom: 0.4rem; }
.prose strong { color: var(--text); }
.updated { color: var(--text-3); font-size: 0.9rem; }
.callout {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.15rem 1.35rem; margin: 1.5rem 0;
}
.callout p { color: var(--text); }

.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); padding: 1.05rem 0; }
.faq summary {
  cursor: pointer; font-weight: 700; list-style: none;
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--primary); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--text-2); margin-top: 0.7rem; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 2rem;
  padding: 2.5rem 0; color: var(--text-3); font-size: 0.92rem;
}
.site-footer .wrap { display: flex; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap; }
.site-footer a { color: var(--text-2); }
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }

@media (max-width: 620px) {
  .nav { gap: 1rem; font-size: 0.9rem; }
  .site-header .wrap { padding: 0.7rem 0; }
  .btn { width: 100%; justify-content: center; }
  /* Same-page anchor — drop it rather than let the header wrap to two lines. */
  .nav a[href$="#game"] { display: none; }
}

@media (max-width: 380px) {
  .brand span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
