* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root, [data-theme="dark"] {
  --bg: #0a0a0c;
  --bg-elev: #131418;
  --bg-elev-2: #1b1d22;
  --border: #262830;
  --text: #f5f6f8;
  --muted: #8a8f9a;
  --accent: #3b9eff;
  --accent-glow: rgba(59, 158, 255, 0.35);
  --header-bg: rgba(10, 10, 12, 0.78);
  --bg-radial: radial-gradient(1200px 600px at 50% -200px, rgba(59,158,255,0.10), transparent 60%);
}

[data-theme="light"] {
  --bg: #f7f8fa;
  --bg-elev: #ffffff;
  --bg-elev-2: #f0f2f5;
  --border: #e3e6ec;
  --text: #0d1117;
  --muted: #5b6472;
  --accent: #0a84ff;
  --accent-glow: rgba(10, 132, 255, 0.25);
  --header-bg: rgba(247, 248, 250, 0.85);
  --bg-radial: radial-gradient(1200px 600px at 50% -200px, rgba(10,132,255,0.10), transparent 60%);
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

body {
  background: var(--bg-radial), var(--bg);
  padding-bottom: 60px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: opacity .2s;
}
.brand:active { opacity: 0.7; }

.brand-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  background: transparent;
}

.logo {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
}
.logo span { color: var(--accent); }

@media (min-width: 640px) {
  .logo { font-size: 34px; }
  .brand-logo { width: 44px; height: 44px; }
}

.header-actions { display: flex; align-items: center; gap: 8px; }

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .15s, box-shadow .2s, opacity .2s;
  white-space: nowrap;
}
.contact-btn:hover { box-shadow: 0 6px 18px -6px var(--accent-glow); }
.contact-btn:active { transform: scale(0.94); }
.contact-btn svg { width: 16px; height: 16px; }
@media (max-width: 480px) {
  .contact-btn span { display: none; }
  .contact-btn { padding: 8px; width: 40px; height: 40px; justify-content: center; border-radius: 12px; }
  .contact-btn svg { width: 18px; height: 18px; }
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s, border-color .2s, transform .15s;
}
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle svg { width: 20px; height: 20px; }

[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.search-wrap { position: relative; width: 100%; }

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

#search {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px 12px 42px;
  border-radius: 14px;
  font-size: 15px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
#search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 14px 40px;
}

.section { margin-top: 22px; }
.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 6px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border), transparent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 8px;
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(6, 1fr); gap: 18px 10px; } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(8, 1fr); } }

.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
  border-radius: 16px;
  cursor: pointer;
  user-select: none;
  transition: transform .15s ease, background .2s ease;
}
.app:active {
  transform: scale(0.92);
  background: color-mix(in oklab, var(--accent) 10%, transparent);
}
.app:hover .app-icon {
  box-shadow: 0 8px 24px -8px var(--accent-glow);
  border-color: color-mix(in oklab, var(--accent) 40%, transparent);
}

.app-icon {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: transform .15s, filter .25s;
}
.app-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.app-icon .fallback { font-size: 22px; font-weight: 700; color: var(--accent); }
.app:hover .app-icon { filter: drop-shadow(0 6px 14px var(--accent-glow)); }

.app span.label {
  font-size: 11.5px;
  color: var(--text);
  text-align: center;
  line-height: 1.25;
  max-width: 78px;
  word-break: break-word;
}

@media (min-width: 640px) {
  .app-icon { width: 64px; height: 64px; }
  .app span.label { font-size: 12px; max-width: 90px; }
}

.empty { text-align: center; color: var(--muted); padding: 30px 16px; font-size: 14px; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px 8px; }
.footer a { color: var(--muted); text-decoration: none; transition: color .2s; }
.footer a:hover { color: var(--accent); }
.section.hidden { display: none; }

/* Contact page */
.contact-page { max-width: 720px; }
.contact-hero { text-align: center; padding: 28px 12px 8px; }
.contact-hero h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 10px; }
.contact-hero p { color: var(--muted); font-size: 14.5px; line-height: 1.55; max-width: 520px; margin: 0 auto; }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 24px;
}
@media (min-width: 640px) { .contact-grid { grid-template-columns: 1fr 1fr; } }

.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text);
  transition: transform .15s, border-color .2s, box-shadow .25s;
}
.contact-card:hover { border-color: var(--accent); box-shadow: 0 10px 24px -12px var(--accent-glow); }
.contact-card:active { transform: scale(0.98); }

.contact-icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
}
.contact-icon svg { width: 24px; height: 24px; }
.contact-icon.tiktok   { background: linear-gradient(135deg, #25F4EE, #000, #FE2C55); }
.contact-icon.telegram { background: linear-gradient(135deg, #2AABEE, #229ED9); }
.contact-icon.facebook { background: #1877F2; }
.contact-icon.email    { background: linear-gradient(135deg, #ff5e62, #ff9966); }

.contact-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.contact-platform { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.contact-handle { font-size: 15px; font-weight: 600; word-break: break-all; }

/* Back to top button */
.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 22px;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 30px -10px var(--accent-glow);
  transition: transform .2s ease, background .2s, border-color .2s;
  z-index: 60;
}
.back-to-top:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.back-to-top svg { width: 20px; height: 20px; }
.back-to-top[hidden] { display: none; }
