@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Nunito:wght@400;600;700;800&display=swap');

:root {
  --bg-main: #F5F3FF;
  --bg-alt: #FFFFFF;
  --bg-warm: #FFF3E9;
  --primary: #7C5CFC;
  --primary-active: #9B7FFF;
  --accent: #FF7A45;
  --pink: #FF5D8F;
  --teal: #2DD4BF;
  --yellow: #FFC93C;
  --text-main: #241F3D;
  --text-secondary: #6E6A85;
  --border-soft: rgba(36, 31, 61, 0.08);
  --font-heading: 'Baloo 2', sans-serif;
  --font-body: 'Nunito', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html.hide #preloader {
  opacity: 0;
  visibility: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--bg-main);
  color: var(--text-secondary);
  overflow-x: hidden;
}

body.fixed {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--text-main);
  line-height: 1.15;
}

/* Preloader */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#preloader img {
  width: 64px;
  height: 64px;
}

/* Puzzle-piece decoration */
.hud-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 12% 20%, rgba(124, 92, 252, 0.08) 0, transparent 8%),
    radial-gradient(circle at 85% 15%, rgba(255, 122, 69, 0.08) 0, transparent 9%),
    radial-gradient(circle at 75% 80%, rgba(45, 212, 191, 0.08) 0, transparent 8%),
    radial-gradient(circle at 20% 85%, rgba(255, 93, 143, 0.08) 0, transparent 8%);
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1100;
  padding: 20px 0;
  transition: background 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled,
.site-header.menu-open {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  padding: 14px 0;
  box-shadow: 0 4px 24px rgba(36, 31, 61, 0.06);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo img {
  height: 34px;
  width: 34px;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 21px;
  color: var(--text-main);
  white-space: nowrap;
}

.logo-text .grad {
  background: linear-gradient(90deg, var(--primary), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.main-nav .nav-link {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
  position: relative;
}

.main-nav .nav-link:hover {
  color: var(--primary);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  padding: 14px 30px;
  border-radius: 999px;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--pink) 100%);
  color: #FFFFFF;
  box-shadow: 0 10px 24px rgba(255, 93, 143, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 28px rgba(255, 122, 69, 0.4);
}

.btn-outline {
  background: #FFFFFF;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #FFFFFF;
}

.btn-small {
  padding: 11px 24px;
  font-size: 14px;
}

/* Burger */
.burger-btn {
  display: none;
  background: transparent;
  border: 0;
  width: 32px;
  height: 24px;
  position: relative;
  cursor: pointer;
  z-index: 1100;
}

.burger-btn span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--text-main);
  border-radius: 3px;
  transition: transform 0.3s ease, opacity 0.3s ease, top 0.3s ease;
}

.burger-btn span:nth-child(1) { top: 0; }
.burger-btn span:nth-child(2) { top: 11px; }
.burger-btn span:nth-child(3) { top: 22px; }

.burger-btn.act span:nth-child(1) { top: 11px; transform: rotate(45deg); background: var(--primary); }
.burger-btn.act span:nth-child(2) { opacity: 0; }
.burger-btn.act span:nth-child(3) { top: 11px; transform: rotate(-45deg); background: var(--primary); }

#mobile-menu {
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(320px, 80vw);
  background: #FFFFFF;
  box-shadow: -8px 0 32px rgba(36, 31, 61, 0.12);
  z-index: 1050;
  padding: 100px 32px 40px;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateX(24px);
}

#mobile-menu.opened {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

#mobile-menu .mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
}

#mobile-menu .nav-link {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 700;
  color: var(--text-main);
}

/* Hero */
.hero {
  position: relative;
  padding: 180px 0 120px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: url('../img/hero-bg.webp') center / cover no-repeat, var(--bg-main);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(245, 243, 255, 0.35) 0%, rgba(245, 243, 255, 0.92) 100%);
}

.hero .container {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero-content .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(124, 92, 252, 0.1);
  border: 2px solid rgba(124, 92, 252, 0.15);
  padding: 8px 18px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.hero-content .eyebrow::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-content h1 {
  font-size: 52px;
  font-weight: 800;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

.hero-content .subtitle {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 520px;
  margin-bottom: 36px;
}

.hero-visual {
  position: relative;
}

@keyframes floatCta {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.btn-primary.levitate {
  animation: floatCta 3s ease-in-out infinite;
}

.btn-primary.levitate:hover {
  animation-play-state: paused;
}

/* Section basics */
section {
  position: relative;
  padding: 100px 0;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 16px;
}

.section-title {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 24px;
  max-width: 640px;
}

.section-text {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.section-bg-graphite {
  background: var(--bg-alt);
}

.section-bg-steel {
  background: var(--bg-warm);
}

/* Two column layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.two-col.reverse .col-text { order: 2; }
.two-col.reverse .col-media { order: 1; }

.col-media img {
  border-radius: 24px;
  box-shadow: 0 16px 40px rgba(36, 31, 61, 0.1);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 32px;
}

.feature-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: #FFFFFF;
  border: 2px solid var(--border-soft);
  border-radius: 18px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(124, 92, 252, 0.14);
}

.feature-card .icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124, 92, 252, 0.14), rgba(255, 93, 143, 0.14));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.feature-card .icon svg {
  width: 18px;
  height: 18px;
}

.feature-card p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-main);
  font-weight: 600;
}

/* Stat cards (Challenges) */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.stat-card {
  padding: 24px;
  background: #FFFFFF;
  border: 2px solid var(--border-soft);
  border-radius: 20px;
  position: relative;
  box-shadow: 0 10px 28px rgba(36, 31, 61, 0.06);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 24px;
  width: 36px;
  height: 5px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, var(--primary), var(--pink));
}

.stat-card .icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(124, 92, 252, 0.14), rgba(45, 212, 191, 0.14));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 16px;
}

.stat-card .icon svg {
  width: 20px;
  height: 20px;
}

.stat-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.stat-card p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* CTA inline */
.section-cta {
  margin-top: 36px;
}

/* Split media */
.split-media {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(36, 31, 61, 0.1);
}

.split-media img {
  border-radius: 0;
  box-shadow: none;
}

/* Footer */
.site-footer {
  position: relative;
  padding: 72px 0 32px;
  background: url('../img/footer-bg.webp') center / cover no-repeat, var(--bg-warm);
  border-top: 2px solid var(--border-soft);
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand .logo {
  margin-bottom: 16px;
}

.footer-brand .logo img {
  height: 30px;
  width: 30px;
}

.footer-brand p {
  font-size: 14px;
  line-height: 1.6;
  max-width: 340px;
}

.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-main);
  margin-bottom: 18px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col a {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  border-top: 2px solid var(--border-soft);
  font-size: 13px;
  font-weight: 600;
  flex-wrap: wrap;
}

/* Legal pages */
.legal-page {
  padding: 160px 0 100px;
}

.legal-content h1 {
  font-size: 34px;
  margin-bottom: 8px;
}

.legal-content .date {
  color: var(--primary);
  font-weight: 700;
}

.legal-content h2 {
  font-size: 20px;
  margin: 28px 0 10px;
}

.legal-content p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0 0 14px;
}

.legal-content ul,
.legal-content ol {
  padding-left: 20px;
  margin: 0 0 14px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
}

.legal-content ul { list-style: disc; }
.legal-content ol { list-style: decimal; }

.legal-content a {
  color: var(--primary);
  font-weight: 700;
}

/* Responsive */
@media (max-width: 1024px) {
  .main-nav { display: none; }
  .header-actions .btn-outline,
  .header-actions .btn-primary { display: none; }
  .burger-btn { display: block; }

  .hero-content h1 { font-size: 42px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .hero { padding: 140px 0 80px; }
  .hero .container { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 280px; margin: 0 auto; }
  .hero-content h1 { font-size: 34px; }

  .two-col { grid-template-columns: 1fr; gap: 32px; }
  .two-col.reverse .col-text,
  .two-col.reverse .col-media { order: initial; }

  .feature-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }

  section { padding: 64px 0; }
  .section-title { font-size: 28px; }

  .footer-top { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; align-items: center; text-align: center; }
}

@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .hero-content h1 { font-size: 28px; }
  .hero-content .subtitle { font-size: 15px; }
  .btn { padding: 16px 32px; font-size: 16px; }
  .logo img { height: 28px; width: 28px; }
  .logo-text { font-size: 18px; }
}
