/* ---------- Theme tokens ---------- */

:root {
  /* Light defaults */
  --bg:           #ffffff;
  --bg-alt:       #f5f6fa;
  --surface:      #ffffff;
  --surface-2:    #f0f2f8;
  --border:       rgba(15, 17, 23, 0.08);
  --border-strong:rgba(15, 17, 23, 0.16);
  --text:         #0f1117;
  --text-muted:   #4b5263;
  --text-faint:   #8a90a0;

  --accent:       #5a3fd0;
  --accent-2:     #1238b0;
  --accent-soft:  rgba(90, 63, 208, 0.10);
  --gold:         #b8860b;

  --shadow-card:    0 6px 24px rgba(20, 24, 40, 0.06), 0 2px 6px rgba(20, 24, 40, 0.04);
  --shadow-hover:   0 10px 32px rgba(20, 24, 40, 0.10), 0 4px 10px rgba(20, 24, 40, 0.06);
  --shadow-phone:   0 30px 60px rgba(20, 24, 40, 0.18), 0 8px 20px rgba(20, 24, 40, 0.12);

  --radius-card:  16px;
  --radius-lg:    22px;

  --max-w:        1180px;
  --max-w-narrow: 760px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:           #0b0d14;
    --bg-alt:       #0f1220;
    --surface:      #14171f;
    --surface-2:    #1a1f2c;
    --border:       rgba(255, 255, 255, 0.08);
    --border-strong:rgba(255, 255, 255, 0.18);
    --text:         #e7e9ef;
    --text-muted:   #a0a6b8;
    --text-faint:   #6c7286;

    --accent:       #8a72ff;
    --accent-2:     #4a6eff;
    --accent-soft:  rgba(138, 114, 255, 0.14);
    --gold:         #ffd24a;

    --shadow-card:  0 8px 28px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 14px 40px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-phone: 0 40px 70px rgba(0, 0, 0, 0.55), 0 10px 24px rgba(0, 0, 0, 0.35);

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg:           #0b0d14;
  --bg-alt:       #0f1220;
  --surface:      #14171f;
  --surface-2:    #1a1f2c;
  --border:       rgba(255, 255, 255, 0.08);
  --border-strong:rgba(255, 255, 255, 0.18);
  --text:         #e7e9ef;
  --text-muted:   #a0a6b8;
  --text-faint:   #6c7286;

  --accent:       #8a72ff;
  --accent-2:     #4a6eff;
  --accent-soft:  rgba(138, 114, 255, 0.14);
  --gold:         #ffd24a;

  --shadow-card:  0 8px 28px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 14px 40px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-phone: 0 40px 70px rgba(0, 0, 0, 0.55), 0 10px 24px rgba(0, 0, 0, 0.35);

  color-scheme: dark;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue",
               Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}
.container--narrow { max-width: var(--max-w-narrow); }

.link {
  color: var(--accent);
  font-weight: 600;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
}
.skip-link:focus { left: 16px; outline: none; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 17px;
}
.brand:hover { text-decoration: none; }

.brand__mark {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
}

.brand__name {
  font-weight: 800;
}

.nav {
  display: flex;
  gap: 24px;
}
.nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 15px;
}
.nav a:hover { color: var(--text); text-decoration: none; }

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.theme-toggle:hover { background: var(--accent-soft); }
.theme-toggle:active { transform: scale(0.96); }

.theme-toggle__icon { display: none; }
:root:not([data-theme]) .theme-toggle__icon--moon { display: block; }
:root:not([data-theme]) .theme-toggle__icon--sun  { display: none;  }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle__icon--moon { display: none;  }
  :root:not([data-theme]) .theme-toggle__icon--sun  { display: block; }
}
:root[data-theme="light"] .theme-toggle__icon--moon { display: block; }
:root[data-theme="dark"]  .theme-toggle__icon--sun  { display: block; }

@media (max-width: 720px) {
  .nav { display: none; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 90px;
}

.hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}
.hero__blob--1 {
  width: 520px; height: 520px;
  top: -180px; left: -120px;
  background: radial-gradient(circle, var(--accent), transparent 70%);
}
.hero__blob--2 {
  width: 480px; height: 480px;
  bottom: -200px; right: -120px;
  background: radial-gradient(circle, var(--accent-2), transparent 70%);
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero__badge {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.6px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.hero__title {
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
  font-weight: 800;
}
.hero__title-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__title-tail {
  color: var(--text);
  font-weight: 700;
}

.hero__sub {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 0 28px;
}

.hero__cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.hero__platforms {
  font-size: 13px;
  color: var(--text-faint);
  margin: 0;
}

/* Phones fan */
.hero__phones {
  position: relative;
  height: 560px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone {
  position: absolute;
  width: 220px;
  border-radius: 32px;
  background: #000;
  padding: 8px;
  box-shadow: var(--shadow-phone);
  transition: transform 0.4s cubic-bezier(.2,.7,.2,1);
}
.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 24px;
}

.phone--center {
  z-index: 3;
  transform: translateY(-10px) scale(1.04);
}
.phone--left {
  z-index: 2;
  transform: translateX(-130px) translateY(20px) rotate(-9deg);
}
.phone--right {
  z-index: 2;
  transform: translateX(130px) translateY(20px) rotate(9deg);
}

@media (max-width: 980px) {
  .hero { padding: 48px 0 64px; }
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .hero__phones {
    height: 480px;
    order: 2;
  }
  .phone { width: 180px; }
  .phone--left  { transform: translateX(-105px) translateY(20px) rotate(-9deg); }
  .phone--right { transform: translateX(105px)  translateY(20px) rotate(9deg);  }
}

@media (max-width: 520px) {
  .hero__phones { height: 420px; }
  .phone { width: 150px; }
  .phone--left  { transform: translateX(-85px) translateY(16px) rotate(-9deg); }
  .phone--right { transform: translateX(85px)  translateY(16px) rotate(9deg);  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
  cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 24px rgba(90, 63, 208, 0.28);
}
.btn--primary:hover { box-shadow: 0 14px 32px rgba(90, 63, 208, 0.36); }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover { background: var(--surface-2); }

/* ---------- Section ---------- */

.section {
  padding: 72px 0;
}
.section--alt {
  background: var(--bg-alt);
}

.section__title {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.section__lead {
  color: var(--text-muted);
  font-size: 17px;
  margin: 0 0 32px;
  max-width: 640px;
}

/* ---------- About ---------- */

.about {
  display: grid;
  gap: 16px;
  font-size: 17px;
  color: var(--text-muted);
  max-width: 760px;
}
.about strong { color: var(--text); font-weight: 700; }

/* ---------- Features ---------- */

.features {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 22px;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s, box-shadow 0.18s;
}
.feature:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.feature__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}
.feature__icon--xp     { color: var(--gold);   background: color-mix(in srgb, var(--gold) 14%, transparent); }
.feature__icon--events { color: #1ea36b;       background: rgba(30, 163, 107, 0.12); }
.feature__icon--quests { color: #d9743a;       background: rgba(217, 116, 58, 0.12); }
.feature__icon--store  { color: #c93d8b;       background: rgba(201, 61, 139, 0.12); }
.feature__icon--custom { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 14%, transparent); }

.feature__title {
  font-size: 18px;
  margin: 0 0 6px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.feature__desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

/* ---------- Screenshots ---------- */

.screens {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 8px;
}

.screen {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-card);
  text-align: center;
  transition: transform 0.18s, box-shadow 0.18s;
}
.screen:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.screen img {
  width: 100%;
  border-radius: 14px;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  background: var(--surface-2);
}
.screen figcaption {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* ---------- FAQ ---------- */

.faq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
  padding: 0;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-weight: 400;
  font-size: 22px;
  color: var(--text-faint);
  transition: transform 0.2s;
  flex: 0 0 auto;
}
.faq[open] summary::after { transform: rotate(45deg); }

.faq__body {
  padding: 0 22px 20px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}
.faq__body ol { margin: 0; padding-left: 20px; }
.faq__body li { margin-bottom: 6px; }

/* ---------- Authors ---------- */

.authors {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.author {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  box-shadow: var(--shadow-card);
}

.author__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
  flex: 0 0 auto;
}

.author__name {
  font-weight: 700;
  font-size: 15px;
}
.author__role {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 32px 0;
  margin-top: 24px;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
}

.site-footer__links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: center;
}
.site-footer__links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 14px;
}
.site-footer__links a:hover { color: var(--text); text-decoration: none; }

.site-footer__copy {
  color: var(--text-faint);
  font-size: 13px;
}

@media (max-width: 720px) {
  .site-footer__inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 16px;
  }
}

/* ---------- Focus ---------- */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Motion ---------- */

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