:root {
  --bg: radial-gradient(800px 380px at 6% 18%, rgba(77, 163, 255, 0.06),
          transparent 26%),
    radial-gradient(700px 300px at 94% 78%, rgba(77, 163, 255, 0.05),
      transparent 30%),
    radial-gradient(500px 420px at 50% 40%, rgba(77, 163, 255, 0.04),
      transparent 45%),
    #0b0f14;

  --card: #121826;
  --accent: #4da3ff;
  --text: #e6eaf2;
  --muted: #9aa4bf;
  --border: #1f2940;
}

/* Floating social buttons (Telegram + VK) */
.fab-container {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  display: flex;
  gap: 8px;
  align-items: center;
}

.fab {
  width: 64px;
  height: 64px;
  display: inline-block;
}

.fab img {
  width: 64px;
  height: 64px;
  display: block;
  border-radius: 8px;
}

@media (max-width: 480px) {
  .fab-container {
    right: 12px;
    bottom: 12px;
  }
}

[data-theme="light"] {
  --bg: radial-gradient(800px 360px at 8% 12%, rgba(52, 102, 242, 0.05),
        transparent 26%),
    radial-gradient(600px 300px at 92% 80%, rgba(52, 102, 242, 0.04),
      transparent 26%),
    #eef2f6;

  --card: #ffffff;
  --accent: #3466f2;
  --text: #0f1724;
  --muted: #475569;
  --border: rgba(15, 23, 42, 0.08);
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Arial, sans-serif;
  background: var(--bg);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  color: var(--text);
  min-height: 100vh;
}

/* Container used on the main page */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px;
}

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
}

/* Language switcher */
.lang-switch {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 24px;
}

.lang-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.lang-btn.active {
  color: var(--accent);
  border-color: var(--accent);
}

.badge {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(77, 163, 255, 0.08);
  color: var(--accent);
  font-size: 13px;
  margin-bottom: 16px;
}

h1 {
  font-size: clamp(32px, 5vw, 48px);
  margin-bottom: 12px;
}

h2 {
  font-size: 28px;
  margin-bottom: 24px;
}

p {
  color: var(--muted);
  max-width: 720px;
}

section {
  margin-bottom: 64px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0)
  );
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.card h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.card p {
  font-size: 14px;
}

footer {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  color: var(--muted);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* Theme toggle (button created dynamically by theme.js) */
#themeToggle {
  position: fixed;
  left: 24px;
  top: 180px;
  width: 96px;
  height: 96px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 200, 70, 0.22);
  background: radial-gradient(
    circle at 35% 30%,
    #fff6b8 0%,
    #ffd54f 18%,
    #ffb300 45%,
    #ff9800 100%
  );
  color: var(--text);
  cursor: pointer;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(255, 165, 0, 0.14),
    inset 0 6px 18px rgba(255, 255, 255, 0.18);
  font-size: 48px;
}

#themeToggle::before {
  content: attr(data-icon);
  position: relative;
  z-index: 2;
  font-size: 48px;
  line-height: 1;
  display: inline-block;
  transition: transform 360ms cubic-bezier(.2, .9, .2, 1),
    opacity 320ms ease;
}

#themeToggle::after {
  content: "";
  position: absolute;
  left: -18px;
  top: -18px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  filter: blur(18px);
  background: radial-gradient(circle, rgba(255, 200, 70, 0.18),
    transparent 40%);
  pointer-events: none;
}

#themeToggle:focus {
  outline: none;
}

#themeToggle:focus-visible {
  box-shadow: 0 0 0 6px rgba(255, 200, 70, 0.18);
  border-color: rgba(255, 200, 70, 0.6);
}

#themeToggle:hover {
  transform: translateY(-3px);
}

html:not([data-theme="light"]) #themeToggle {
  background: radial-gradient(
    circle at 40% 30%,
    #3a3f46 0%,
    #2a3036 30%,
    #1b2025 70%
  );
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45),
    inset 0 4px 12px rgba(255, 255, 255, 0.02);
}

html:not([data-theme="light"]) #themeToggle::after {
  background: radial-gradient(circle, rgba(90, 100, 120, 0.1),
    transparent 40%);
  filter: blur(22px);
}

html:not([data-theme="light"]) #themeToggle::before {
  transform: scale(0.9) rotate(-12deg);
  opacity: 0.95;
}

[data-theme="light"] #themeToggle::before {
  transform: scale(1) rotate(0deg);
  opacity: 1;
}

/* Background glows for dark/light themes (keep for visual effect) */
html:not([data-theme="light"]) body::before,
html:not([data-theme="light"]) body::after,
[data-theme="light"] body::before,
[data-theme="light"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: screen;
  will-change: opacity, filter, transform;
  transform: translateZ(0);
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  html:not([data-theme="light"]) body::before,
  html:not([data-theme="light"]) body::after,
  [data-theme="light"] body::before,
  [data-theme="light"] body::after {
    filter: none;
    opacity: 1;
    will-change: auto;
    transform: none;
  }
}

html:not([data-theme="light"]) body::before {
  background-image: radial-gradient(
      920px 560px at 0% 8%,
      rgba(77, 163, 255, 0.42) 0%,
      rgba(77, 163, 255, 0.2) 26%,
      transparent 52%
    ),
    radial-gradient(
      820px 500px at 100% 92%,
      rgba(77, 163, 255, 0.34) 0%,
      rgba(77, 163, 255, 0.18) 24%,
      transparent 50%
    );
  filter: blur(22px);
  opacity: 1;
}

html:not([data-theme="light"]) body::after {
  background-image: radial-gradient(
    760px 420px at 50% 0%,
    rgba(77, 163, 255, 0.36) 0%,
    rgba(77, 163, 255, 0.16) 30%,
    transparent 58%
  );
  filter: blur(12px);
  opacity: 1;
  background-repeat: no-repeat;
  background-position: top center;
}

@media (max-width: 640px) {
  #themeToggle {
    right: auto;
    left: 12px;
    top: 12px;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
  }
}

/* Smooth transitions */
body,
.card,
.container,
input,
button,
select,
textarea {
  transition: background-color 240ms ease, color 240ms ease,
    border-color 240ms ease, box-shadow 240ms ease;
}

