/* ============================================================
   Kelika — Landing site styles
   Focus Teal palette (light + dark) — birebir DESIGN.md token'ları
   ============================================================ */

/* ---------- Design tokens: LIGHT (default) ---------- */
:root {
  --primary: #0EA5E9;
  --primary-dark: #0369A1;
  --accent: #F59E0B;
  --accent-ink: #B7770A;
  --background: #FFFFFF;
  --surface: #F1F5F9;
  --border: #E2E8F0;
  --text: #0F172A;
  --text-2: #475569;
  --success: #16A34A;
  --error: #DC2626;
  --warning: #F59E0B;
  --rank: #94A3B8;

  /* Derived (color-mix over background) */
  --surface-2: #F8FAFC;
  --primary-soft: rgba(14, 165, 233, 0.10);
  --primary-soft-2: rgba(14, 165, 233, 0.16);
  --accent-soft: rgba(245, 158, 11, 0.14);
  --hero-glow: radial-gradient(60% 60% at 80% 10%, rgba(14,165,233,0.14), transparent 70%),
               radial-gradient(50% 50% at 10% 30%, rgba(245,158,11,0.10), transparent 70%);

  /* Shadows (primary-tinted, per design §1.5) */
  --shadow-sm: 0 4px 12px -6px rgba(14, 165, 233, 0.35);
  --shadow-md: 0 10px 24px -12px rgba(14, 165, 233, 0.40);
  --shadow-lg: 0 22px 50px -22px rgba(2, 60, 110, 0.40);
  --shadow-card: 0 10px 30px -18px rgba(20, 30, 50, 0.30);

  --frame: #0B1220;          /* phone bezel */
  --header-bg: rgba(255, 255, 255, 0.72);

  --r: 16px;                  /* default card radius */
  --r-lg: 22px;
  --maxw: 1120px;
}

/* ---------- Design tokens: DARK ---------- */
[data-theme="dark"] {
  --primary: #38BDF8;
  --primary-dark: #7DD3FC;
  --accent: #FBBF24;
  --accent-ink: #FCD34D;
  --background: #0B1220;
  --surface: #172033;
  --border: #2C3A52;
  --text: #E8EEF6;
  --text-2: #93A4BC;
  --success: #34D399;
  --error: #F87171;
  --warning: #FBBF24;
  --rank: #94A3B8;

  --surface-2: #111A2B;
  --primary-soft: rgba(56, 189, 248, 0.12);
  --primary-soft-2: rgba(56, 189, 248, 0.20);
  --accent-soft: rgba(251, 191, 36, 0.16);
  --hero-glow: radial-gradient(60% 60% at 80% 10%, rgba(56,189,248,0.16), transparent 70%),
               radial-gradient(50% 50% at 10% 30%, rgba(251,191,36,0.10), transparent 70%);

  --shadow-sm: 0 4px 12px -6px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 10px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 22px 50px -22px rgba(0, 0, 0, 0.7);
  --shadow-card: 0 14px 34px -18px rgba(0, 0, 0, 0.65);

  --frame: #05080F;
  --header-bg: rgba(11, 18, 32, 0.72);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.55;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.35s ease, color 0.35s ease;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

/* preload: kill transitions until JS marks ready */
.preload * { transition: none !important; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 84px 0; }
.section--tight { padding: 56px 0; }
.center { text-align: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 7px 14px; border-radius: 999px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }

h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; margin: 0; font-weight: 800; }
.h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); }
.h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--text-2); line-height: 1.6; }
.section-head { max-width: 680px; margin: 0 auto 52px; text-align: center; }
.section-head .lead { margin-top: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
  border: none; border-radius: 14px; padding: 14px 24px; text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-md); }
.btn--primary:hover { box-shadow: var(--shadow-lg); }
.btn--ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Store badges ---------- */
.store-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.store-badge {
  position: relative;
  display: inline-flex; align-items: center; gap: 12px;
  background: #0b0b0d; color: #fff;
  padding: 11px 18px; border-radius: 14px; min-width: 184px;
  border: 1px solid rgba(255,255,255,0.12);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.store-badge:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.store-badge svg { flex: none; }
.store-badge .sb-text { display: flex; flex-direction: column; line-height: 1.05; }
.store-badge .sb-top { font-size: 10px; font-weight: 500; letter-spacing: 0.02em; opacity: 0.85; text-transform: uppercase; }
.store-badge .sb-main { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.store-badge .sb-soon {
  position: absolute; top: -9px; right: 10px;
  background: var(--accent); color: #1a1206;
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
}
[data-theme="dark"] .store-badge { background: #05080f; border-color: rgba(255,255,255,0.16); }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header .container { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; font-size: 1.18rem; letter-spacing: -0.02em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: var(--shadow-sm); }

.nav { display: flex; align-items: center; gap: 30px; }
.nav a { color: var(--text-2); font-weight: 600; font-size: 0.97rem; }
.nav a:hover { color: var(--text); text-decoration: none; }

.controls { display: flex; align-items: center; gap: 10px; }

/* Language toggle (segmented, with flags) */
.lang-toggle {
  display: inline-flex; background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px; gap: 2px;
}
.lang-toggle button {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; font-size: 12.5px; font-weight: 700; color: var(--text-2);
  background: transparent; border: none; cursor: pointer;
  padding: 6px 11px; border-radius: 999px; transition: color 0.2s ease, background-color 0.2s ease;
}
.lang-toggle button .flag { width: 20px; height: 14px; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,0.06); flex: none; }
.lang-toggle button[aria-pressed="true"] { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }

/* Theme toggle (sun / moon switch) */
.theme-toggle {
  position: relative; width: 70px; height: 34px; flex: none;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; padding: 0;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.theme-toggle .tt-icon {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 1;
  width: 17px; height: 17px; color: var(--text-2); transition: color 0.3s ease, opacity 0.3s ease;
}
.theme-toggle .tt-sun { left: 8px; }
.theme-toggle .tt-moon { right: 8px; }
.theme-toggle .tt-knob {
  position: absolute; top: 3px; left: 3px; z-index: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--background);
  box-shadow: 0 2px 6px -1px rgba(0,0,0,0.3);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
}
[data-theme="dark"] .theme-toggle .tt-knob { transform: translateX(36px); }
[data-theme="dark"] .theme-toggle .tt-moon { color: var(--primary); }
:root .theme-toggle .tt-sun { color: var(--accent); }
[data-theme="dark"] .theme-toggle .tt-sun { color: var(--text-2); }

/* Mobile menu button */
.menu-btn {
  display: none; width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; align-items: center; justify-content: center;
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 40px; }
.hero::before {
  content: ""; position: absolute; inset: 0; background: var(--hero-glow); pointer-events: none; z-index: 0;
}
.hero .container { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero-copy h1 { margin: 20px 0 0; }
.hero-copy .lead { margin-top: 20px; max-width: 540px; }
.hero-copy .store-row { margin-top: 32px; }
.hero-copy .hero-note { margin-top: 16px; font-size: 0.9rem; color: var(--text-2); display: inline-flex; align-items: center; gap: 8px; }
.hero-copy .hero-note svg { width: 16px; height: 16px; color: var(--success); }

.hero-art { position: relative; display: flex; justify-content: center; }
.hero-art .blob {
  position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, var(--primary-soft-2), transparent 70%);
  filter: blur(8px); z-index: 0;
}
.hero-art .phone { position: relative; z-index: 1; }

/* Floating chips around hero phone */
.float-chip {
  position: absolute; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--background); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow-card);
  font-size: 13.5px; font-weight: 700; color: var(--text);
}
.float-chip svg { width: 18px; height: 18px; }
.float-chip.c1 { top: 14%; left: -6%; }
.float-chip.c2 { bottom: 16%; right: -6%; }
.float-chip .fc-streak { color: var(--warning); }
.float-chip .fc-check { color: var(--success); }
@media (prefers-reduced-motion: no-preference) {
  .float-chip.c1 { animation: floaty 5s ease-in-out infinite; }
  .float-chip.c2 { animation: floaty 6s ease-in-out infinite 0.6s; }
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- Phone frame ---------- */
.phone {
  background: var(--frame); border-radius: 46px; padding: 9px;
  box-shadow: var(--shadow-lg); width: 270px; max-width: 78vw;
}
.phone img { border-radius: 38px; width: 100%; }
.phone--sm { width: 230px; }

/* ---------- Trust strip ---------- */
.trust { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.trust .container { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 34px; padding-top: 26px; padding-bottom: 26px; }
.trust-item { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text-2); font-size: 0.96rem; }
.trust-item svg { width: 20px; height: 20px; color: var(--primary); flex: none; }

/* ---------- Features grid ---------- */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 28px; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); border-color: var(--primary-soft-2); }
.feature .ficon {
  width: 52px; height: 52px; border-radius: 15px; display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary); margin-bottom: 18px;
}
.feature .ficon svg { width: 26px; height: 26px; }
.feature.accent .ficon { background: var(--accent-soft); color: var(--accent-ink); }
.feature.success .ficon { background: rgba(22,163,74,0.12); color: var(--success); }
[data-theme="dark"] .feature.success .ficon { background: rgba(52,211,153,0.14); }
.feature h3 { margin-bottom: 8px; }
.feature p { margin: 0; color: var(--text-2); font-size: 0.98rem; }

/* ---------- Steps (how it works) ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; align-items: start; }
.step { text-align: center; display: flex; flex-direction: column; align-items: center; }
.step .step-num {
  width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1rem;
  margin-bottom: 22px; box-shadow: var(--shadow-sm);
}
.step .phone { margin-bottom: 24px; }
.step h3 { margin-bottom: 10px; }
.step p { margin: 0; color: var(--text-2); max-width: 320px; }

/* ---------- Games ---------- */
.games-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 48px; }
.game-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 22px 18px; text-align: center; transition: transform 0.2s ease, border-color 0.2s ease;
}
.game-card:hover { transform: translateY(-4px); border-color: var(--primary-soft-2); }
.game-card .gicon {
  width: 46px; height: 46px; border-radius: 13px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
}
.game-card .gicon svg { width: 24px; height: 24px; }
.game-card h3 { font-size: 1.02rem; margin-bottom: 5px; }
.game-card p { margin: 0; font-size: 0.86rem; color: var(--text-2); }

.shots-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; justify-items: center; }
.shots-row .phone { width: 100%; }

/* ---------- Progress (split) ---------- */
.split { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 56px; align-items: center; }
.split.reverse .split-art { order: -1; }
.split-art { display: flex; justify-content: center; }
.split-copy h2 { margin-bottom: 18px; }
.split-copy .lead { margin-bottom: 24px; }
.bullets { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.bullets li { display: flex; align-items: flex-start; gap: 12px; color: var(--text-2); }
.bullets li svg { width: 22px; height: 22px; color: var(--success); flex: none; margin-top: 1px; }
.bullets li strong { color: var(--text); font-weight: 700; }

/* ---------- Privacy band ---------- */
.privacy-band { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.privacy-band .pb {
  display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center;
}
.privacy-band .pb-icon {
  width: 64px; height: 64px; border-radius: 18px; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.privacy-band .pb-icon svg { width: 32px; height: 32px; }
.privacy-band h2 { margin-bottom: 6px; }
.privacy-band p { margin: 0; color: var(--text-2); max-width: 620px; }

/* ---------- Download CTA ---------- */
.cta {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 28px; padding: 60px 40px; text-align: center; color: #fff;
  position: relative; overflow: hidden; box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .cta { background: linear-gradient(135deg, #0c4a6e, #075985); }
.cta::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 80% at 50% -10%, rgba(255,255,255,0.18), transparent 70%);
  pointer-events: none;
}
.cta img.cta-icon { width: 76px; height: 76px; border-radius: 20px; margin: 0 auto 22px; box-shadow: 0 10px 30px -8px rgba(0,0,0,0.4); position: relative; }
.cta h2 { color: #fff; position: relative; }
.cta p { color: rgba(255,255,255,0.9); margin: 14px auto 30px; max-width: 520px; position: relative; }
.cta .store-row { justify-content: center; position: relative; }
.cta .store-badge { background: #0b0b0d; border-color: rgba(255,255,255,0.18); }

/* ---------- Footer ---------- */
.footer { padding: 56px 0 40px; border-top: 1px solid var(--border); background: var(--background); }
.footer .f-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; margin-bottom: 36px; }
.footer .brand { margin-bottom: 14px; }
.footer .f-about { max-width: 320px; color: var(--text-2); font-size: 0.95rem; margin: 0; }
.footer .f-links { display: flex; gap: 60px; flex-wrap: wrap; }
.footer .f-col h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); margin: 0 0 14px; }
.footer .f-col a { display: block; color: var(--text); font-weight: 600; font-size: 0.95rem; margin-bottom: 10px; }
.footer .f-col a:hover { color: var(--primary); text-decoration: none; }
.footer .f-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--border); padding-top: 22px; color: var(--text-2); font-size: 0.88rem;
}

/* ---------- Legal (privacy) page ---------- */
.legal { padding: 56px 0 80px; }
.legal-wrap { max-width: 780px; margin: 0 auto; }
.legal h1 { font-size: clamp(2rem, 4vw, 2.6rem); margin-bottom: 8px; }
.legal .meta { color: var(--text-2); font-size: 0.95rem; margin-bottom: 8px; }
.legal h2 { font-size: 1.3rem; font-weight: 700; margin: 38px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.legal p { color: var(--text); margin: 12px 0; }
.legal ul { padding-left: 22px; }
.legal li { margin: 9px 0; color: var(--text); }
.legal code { background: var(--surface); border: 1px solid var(--border); padding: 2px 7px; border-radius: 6px; font-size: 0.9em; }
.legal .legal-foot { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 0.88rem; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 600; margin-bottom: 28px; }
.back-link svg { width: 18px; height: 18px; }
.back-link:hover { color: var(--primary); text-decoration: none; }

/* ---------- Reveal on scroll (progressive enhancement) ---------- */
/* Visible by default — only hidden/animated when JS is active (html.js). */
.reveal { opacity: 1; }
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal, .js .reveal { opacity: 1 !important; transform: none !important; } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-copy { text-align: center; }
  .hero-copy .lead { margin-left: auto; margin-right: auto; }
  .hero-copy .store-row { justify-content: center; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; gap: 48px; max-width: 420px; margin: 0 auto; }
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .shots-row { grid-template-columns: repeat(2, 1fr); gap: 28px; }
  .split { grid-template-columns: 1fr; gap: 36px; text-align: center; }
  .split.reverse .split-art { order: 0; }
  .split-art { order: -1; }
  .bullets { text-align: left; max-width: 460px; margin: 0 auto; }
  .privacy-band .pb { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .privacy-band p { margin: 0 auto; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .section { padding: 60px 0; }
  .container { padding: 0 18px; }
  .features-grid { grid-template-columns: 1fr; }
  .games-grid { grid-template-columns: 1fr; }
  .shots-row { grid-template-columns: 1fr; max-width: 280px; margin: 0 auto; }
  .controls .lang-label { display: none; }
  .cta { padding: 44px 22px; }
  .store-badge { min-width: 168px; }
  .brand span { display: none; }
}

/* ---------- Mobile nav drawer ---------- */
.mobile-nav {
  display: none; position: fixed; inset: 68px 0 0; z-index: 40;
  background: var(--background); padding: 24px;
  flex-direction: column; gap: 6px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a { color: var(--text); font-weight: 700; font-size: 1.15rem; padding: 14px 8px; border-bottom: 1px solid var(--border); }
.mobile-nav a:hover { text-decoration: none; color: var(--primary); }
body.nav-open { overflow: hidden; }
