/* ============================================
   DESIGN TOKENS — edit here, applies everywhere
   ============================================ */
:root {
  /* Colors — global */
  --color-bg:       #1A1A2E;
  --color-surface:  #2D1B69;
  --color-text:     #FFFFFF;
  --color-muted:    rgba(255, 255, 255, 0.6);
  --color-accent:   #C084FC;
  --color-border:   rgba(192, 132, 252, 0.25);

  /* Extended palette */
  --color-yellow:       #FFD966;
  --color-pink:         #FF6FA3;
  --color-pink-light:   #FFA8C8;
  --color-purple:       #C084FC;
  --color-purple-dark:  #7C3AED;
  --color-dark:         #1A1A2E;

  /* Hero */
  --gradient-hero: linear-gradient(160deg, #FFE08A 0%, #FFB3D1 55%, #E8A0FF 100%);

  /* Typography */
  --font-display: 'Nunito', sans-serif;
  --font-body:    'Nunito', sans-serif;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.25rem;
  --text-xl:   1.5rem;
  --text-2xl:  2rem;
  --text-3xl:  3rem;
  --text-4xl:  4.5rem;

  /* Spacing (4px base) */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-6:  24px;
  --space-8:  32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;

  /* Layout */
  --max-width: 1200px;
  --radius:    2px;

  /* Animation */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 200ms;
}

/* ============================================
   RESET
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { cursor: pointer; font: inherit; border: none; background: none; }

/* ============================================
   ACCESSIBILITY
   ============================================ */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-accent);
  color: #fff;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  z-index: 9999;
  transition: top var(--duration);
}
.skip-link:focus { top: var(--space-4); }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

@media (min-width: 768px) {
  .container { padding-inline: var(--space-12); }
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
}

/* ── Gradient background ── */
.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  z-index: 0;
}

/* ── Stars / sparkles ── */
.star {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  user-select: none;
}

/* star-1: слева, середина высоты — рядом с низом заголовка */
.star-1 {
  bottom: 40%;
  left: 2%;
  width: 56px;
  animation: sparkle 5s ease-in-out infinite alternate;
}
/* star-2: между заголовком и персонажем */
.star-2 {
  top: 38%;
  left: 36%;
  width: 36px;
  animation: sparkle 4s ease-in-out infinite alternate;
  animation-delay: 0.5s;
}
/* star-3: маленькая, правее center */
.star-3 {
  top: 20%;
  right: 32%;
  width: 20px;
  animation: sparkle 6s ease-in-out infinite alternate;
  animation-delay: 1.2s;
}
/* star-4: правый верхний угол */
.star-4 {
  top: 5%;
  right: 4%;
  width: 64px;
  animation: sparkle 5.5s ease-in-out infinite alternate;
  animation-delay: 0.2s;
}
/* star-5: правый нижний */
.star-5 {
  bottom: 8%;
  right: 12%;
  width: 40px;
  animation: sparkle 4.5s ease-in-out infinite alternate;
  animation-delay: 1.7s;
}
/* star-6: между тэглайном и персонажем */
.star-6 {
  top: 60%;
  left: 33%;
  width: 112px;
  animation: sparkle 5s ease-in-out infinite alternate;
  animation-delay: 0.8s;
}

@keyframes sparkle {
  from { transform: translateY(0)    rotate(0deg);   opacity: 0.75; }
  to   { transform: translateY(-12px) rotate(22deg); opacity: 1;    }
}

@keyframes breathe {
  from { transform: scale(1);    }
  to   { transform: scale(1.03); }
}

/* ── Персонаж — смещён правее, выход за правый край ── */
.hero-right {
  position: absolute;
  right: -6%;      /* смещение вправо */
  bottom: 0;
  z-index: 2;
  pointer-events: none;
  width: 64%;
}

.hero-character {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100vh;
  max-height: 100svh;
  object-fit: contain;
  object-position: bottom right;
  transform-origin: bottom center;
  will-change: transform;
  backface-visibility: hidden;
  animation: breathe 8s ease-in-out infinite alternate;
}

/* ── Левый блок: только заголовок ── */
.hero-left {
  position: relative;
  z-index: 4;
  padding: var(--space-12) 0 0 5%;
  overflow: visible;
}

/* Заголовок: -20px влево от исходного отступа */
.hero-title-svg {
  display: block;
  width: 58vw;
  min-width: 280px;
  height: auto;
  margin-left: -20px;
}

/* ── Тэглайн: позиция по Y выставляется через JS (positionTagline) ── */
.hero-tagline-svg {
  position: absolute;
  left: calc(5% - 20px);   /* выравнивание с заголовком */
  top: 55%;                 /* fallback до загрузки JS */
  width: 22vw;
  min-width: 180px;
  height: auto;
  z-index: 4;
}

/* ── Нижняя панель: соцсети слева, кнопки по центру экрана ── */
.hero-bottom-bar {
  position: absolute;
  bottom: var(--space-8);
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  padding: 0 5%;
}

/* Соцсети: выровнены по левому краю заголовка */
.hero-socials {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: 0 0 auto;
  margin-left: -20px;
}

.hero-socials a {
  display: flex;
  align-items: center;
  opacity: 0.9;
  transition: transform var(--duration) var(--ease-out),
              opacity  var(--duration) var(--ease-out);
}

.hero-socials a:hover {
  transform: scale(1.1) rotate(-6deg);
  opacity: 1;
}

/* Иконки 1.5× меньше (112 → 75px) */
.hero-socials img {
  width: 75px;
  height: 75px;
  object-fit: contain;
}

/* Кнопки: между иконками и персонажем */
.hero-btns {
  position: absolute;
  left: calc(24% + 149px);
  transform: translateX(-50%);
  display: flex;
  gap: calc(var(--space-4) * 1.1);
  white-space: nowrap;
}

/* ── Кнопки 1.5× меньше (1.75rem → 1.2rem) ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 36px;
  background: var(--color-dark);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  border: 2.5px solid var(--color-dark);
  border-radius: 50px;
  white-space: nowrap;
  transition: transform var(--duration) var(--ease-out),
              box-shadow var(--duration) var(--ease-out);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(26, 26, 46, 0.35);
}

/* Hero buttons: 30% larger than base .btn */
.hero-btns .btn {
  padding: 18px 47px;
  font-size: 1.55rem;
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--color-dark);
  border-color: var(--color-dark);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.6);
}

/* ── Mobile ≤ 600px ── */
@media (max-width: 600px) {
  /* Заголовок: отступ сверху фиксированный, выравнивание с краем */
  .hero-left {
    padding: var(--space-8) 0 0 var(--space-6);
  }

  .hero-title-svg {
    width: 72vw;
    margin-left: 0;
  }

  .hero-tagline-svg {
    position: absolute;
    left: var(--space-6);
    top: 52%;
    width: 48vw;
    min-width: 120px;
  }

  /* Персонаж: transform задаётся через JS (layoutHero) */
  .hero-right {
    right: 5%;
  }

  /* Нижняя панель: кнопки сверху, иконки снизу, всё по центру */
  .hero-bottom-bar {
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    bottom: var(--space-6);
    padding: 0;
  }

  /* Кнопки идут первыми */
  .hero-btns {
    position: static;
    transform: none;
    order: -1;
    gap: var(--space-3);
    flex-wrap: nowrap;
  }

  /* Переопределяем крупный desktop-размер кнопок */
  .hero-btns .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  /* Соцсети: убираем отрицательный отступ, он не нужен на мобиле */
  .hero-socials {
    margin-left: 0;
    gap: var(--space-2);
  }

  .hero-socials img { width: 36px; height: 36px; }
}

/* ── Tablet 601–1023px ── */
@media (min-width: 601px) and (max-width: 1023px) {
  .hero-title-svg  { width: 56vw; }

  .hero-tagline-svg { width: 28vw; top: 54%; }

  .hero-right { width: 60%; right: -5%; }

  .hero-character {
    height: 100vh;
    height: 100svh;
    width: auto;
    max-height: none;
  }

  .hero-socials img { width: 52px; height: 52px; }
  .btn { font-size: 1rem; padding: 12px 28px; }
}

/* ── Desktop 1024px+ ── */
@media (min-width: 1024px) {
  .hero-left { padding: var(--space-16) 0 0 5%; }

  .hero-title-svg  { width: 58vw; }

  .hero-tagline-svg { width: 22vw; min-width: 200px; }

  .hero-right { width: 65%; right: -8%; }

  .hero-character {
    height: 100vh;
    height: 100svh;
    width: auto;
    max-height: none;
  }
}

/* ── Wide 1440px+ ── */
@media (min-width: 1440px) {
  .hero-title-svg  { width: 55vw; }
  .hero-tagline-svg { width: 20vw; }
}
