:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1c1b22;
  --muted: #5f5d6b;
  --line: #e7e4dd;
  --accent: #5b4bdb;
  --accent-ink: #ffffff;
  --puzzle: #1fa37a;
  --tower: #e8743b;
  --radius: 18px;
  --max: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121117;
    --surface: #1b1a22;
    --text: #f1eff7;
    --muted: #a6a3b5;
    --line: #2c2a36;
    --accent: #8f82ff;
    --accent-ink: #121117;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
img { max-width: 100%; display: block; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--accent-ink);
  padding: 8px 14px; border-radius: 8px; z-index: 10;
}
.skip:focus { left: 16px; top: 16px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em;
  color: var(--text); text-decoration: none;
}
.brand img { width: 32px; height: 32px; }
.nav { display: flex; gap: 22px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

/* Hero */
.hero { padding: 88px 0 72px; text-align: center; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.08; letter-spacing: -0.035em; margin: 0 0 18px; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); letter-spacing: -0.025em; margin: 0 0 12px; line-height: 1.2; }
h3 { font-size: 1.2rem; margin: 0 0 6px; letter-spacing: -0.01em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 620px; margin: 0 auto 30px; }

.btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; text-decoration: none;
  border: 1px solid var(--line); color: var(--text); background: var(--surface);
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn:hover { filter: brightness(1.05); }

/* Sections */
section { padding: 64px 0; }
.section-head { margin-bottom: 32px; }
.section-head p { color: var(--muted); margin: 0; max-width: 620px; }

/* Featured */
.featured {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 40px;
}
.featured .art {
  aspect-ratio: 1; border-radius: 24px; display: grid; place-items: center;
  background: linear-gradient(145deg, color-mix(in srgb, var(--puzzle) 22%, transparent), color-mix(in srgb, var(--accent) 18%, transparent));
}
.featured .art img { width: 55%; border-radius: 22%; box-shadow: 0 18px 40px rgba(0,0,0,.18); }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column; gap: 14px;
  text-decoration: none; color: inherit; transition: transform .15s ease, box-shadow .15s ease;
}
a.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,.08); }
.card .icon { width: 72px; height: 72px; border-radius: 18px; }
.card p { margin: 0; color: var(--muted); }
.meta { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--muted);
}
.tag.soon { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.feature .num {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  font-weight: 700; margin-bottom: 12px; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.feature p { margin: 0; color: var(--muted); }

/* App page */
.app-hero { padding: 72px 0 40px; }
.app-hero .wrap { display: grid; grid-template-columns: 160px 1fr; gap: 32px; align-items: center; }
.app-hero .icon { width: 160px; height: 160px; border-radius: 36px; box-shadow: 0 18px 40px rgba(0,0,0,.15); }
.app-hero h1 { margin-bottom: 8px; }
.app-hero .lead { margin: 0 0 20px; text-align: left; }
.app-hero .btns { justify-content: flex-start; }
.store-btn { background: var(--text); color: var(--bg); border-color: var(--text); }
.store-btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

/* Prose (privacy / support) */
.prose { max-width: 760px; padding: 56px 20px 80px; margin: 0 auto; }
.prose h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.prose h2 { font-size: 1.35rem; margin-top: 36px; }
.prose p, .prose li { color: var(--text); }
.prose .muted { color: var(--muted); }
.breadcrumb { font-size: .9rem; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--muted); }

details {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 20px; margin-bottom: 12px;
}
details summary { font-weight: 600; cursor: pointer; }
details p { margin: 10px 0 0; color: var(--muted); }

.contact-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin-top: 32px;
}

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 32px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.site-footer h4 { margin: 0 0 10px; font-size: .9rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--muted); text-decoration: none; font-size: .92rem; }
.site-footer a:hover { color: var(--text); }
.site-footer .tagline { color: var(--muted); font-size: .92rem; margin: 10px 0 0; }
.copy { color: var(--muted); font-size: .85rem; margin-top: 36px; }

@media (max-width: 820px) {
  .featured { grid-template-columns: 1fr; padding: 24px; }
  .features { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .app-hero .wrap { grid-template-columns: 1fr; }
  .app-hero .icon { width: 120px; height: 120px; border-radius: 28px; }
}
@media (max-width: 520px) {
  .nav { gap: 14px; }
  .nav a { font-size: .88rem; }
  .hero { padding: 60px 0 48px; }
}
