/* =========================
   1. ТЕМЫ И ПЕРЕМЕННЫЕ
   ========================= */

:root {
  --bg-body: #f6e9ff;
  --bg-section: #ffd4f3;

  --text-main: #502047;
  --text-dark: #1b0b23;   /* светлая тема */

  --btn-bg: #5f112e;
  --btn-hover-bg: #dbe2ff;
  --btn-active-bg: #c8d3ff;
  --text-btn: #ffe3f3;

  --border-color: #b57bb3;
}

/* Переменные в тёмной теме переопределяются на другие цвета */
.dark-theme {
  --bg-body: #120716;
  --bg-section: #2b1633;

  --text-main: #f1cbff;
  --text-dark: #ffffff;   /* тёмная тема */

  --btn-bg: #4c1230;
  --btn-hover-bg: #6b3a54;
  --btn-active-bg: #513050;
  --text-btn: #ffe3ff;

  --border-color: #825a85;
}


/* =========================
   2. БАЗОВЫЕ НАСТРОЙКИ
   ========================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}


/* =========================
   3. ТИПОГРАФИКА
   ========================= */

h1, h2, h3 {
  color: var(--text-dark);
  margin-top: 0;
}

h1 {
  font-size: clamp(24px, 5vw, 40px);
}

/* Мини-иконка перед h3 */
h3::before {
  content: "🌙 ";
}

/* =========================
   4. ССЫЛКИ И КНОПКИ
   ========================= */

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

/* Стрелочка после всех ссылок по умолчанию */
a::after {
  content: " →";
  opacity: 0.6;
}

/* Но для навигации стрелочка не нужна */
.main-nav a::after,
.footer-nav a::after {
  content: "";
}

/* Кнопка переключения темы */
#theme-toggle {
  position: fixed;
  top: 10px;
  right: 10px;
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: var(--btn-bg);
  color: var(--text-btn);
  transition: transform 0.2s, background-color 0.2s;
}

#theme-toggle:hover {
  transform: scale(0.95);
  background: var(--btn-hover-bg);
}

/* Универсальная кнопка */
.primary-btn {
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
  background: var(--btn-bg);
  color: var(--text-btn);
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.primary-btn:hover {
  transform: scale(0.95);
  background: var(--btn-hover-bg);
}

.primary-btn:active {
  transform: scale(0.9);
  background: var(--btn-active-bg);
}


/* =========================
   5. ОБЩИЙ ЛЕЙАУТ: HEADER / NAV / SECTION / FOOTER
   ========================= */

header {
  max-width: 900px;
  margin: 80px auto 20px;
  padding: 0 20px;
  text-align: center;
}

/* Верхнее меню */
.main-nav {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* Ссылки в главном и нижнем меню выглядят как кнопки */
.main-nav a,
.footer-nav a {
  background: var(--btn-bg);
  color: var(--text-btn);
  display: inline-block;
  font-size: 15px;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  transition: transform 0.2s ease, background-color 0.2s, color 0.2s;
  transform: scale(1);
}

.main-nav a:hover,
.footer-nav a:hover {
  background: var(--btn-hover-bg);
  color: var(--text-main);
  transform: scale(0.9);
}

.main-nav a:active,
.footer-nav a:active {
  background: var(--btn-active-bg);
  transform: scale(0.82);
}

/* Базовый стиль для всех секций */
section {
  background: var(--bg-section);
  max-width: 900px;
  padding: calc(20px + 1vw);
  margin: 30px auto;
  border-radius: 12px;
  border: 1px dashed var(--border-color);
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  color: var(--text-main);
}

/* Футер */
footer {
  max-width: 900px;
  margin: 30px auto 40px;
  padding: 0 20px;
  text-align: center;
  color: var(--text-dark);
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

footer p {
  margin: 5px 0 0;
}


/* =========================
   6. СЕКЦИЯ ФУНКЦИОНАЛА 
   ========================= */

.features-section {
  font-weight: bold;
}

/* Сетка для списка преимуществ */
.features-section ol {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
}

/* Карточки преимуществ */
.features-section li {
  background: var(--bg-body);
  padding: 20px;
  border-radius: 12px;

  /* анимация появления */
  opacity: 0;
  transform: translateY(20px);
  animation: feature-fade-up 0.6s ease-out forwards;

  /* плавный hover-эффект */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Задержка появления для каждой карточки по очереди */
.features-section li:nth-child(1) { animation-delay: 0.1s; }
.features-section li:nth-child(2) { animation-delay: 0.25s; }
.features-section li:nth-child(3) { animation-delay: 0.4s; }
.features-section li:nth-child(4) { animation-delay: 0.55s; }

/* Ховер карточек */
.features-section li:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.18);
}

/* Анимированное подчёркивание заголовка "Функционал" */
.features-title {
  position: relative;
  display: inline-block;
  padding-bottom: 4px;
}

.features-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--btn-bg), var(--btn-hover-bg));
  transform-origin: left;
  transform: scaleX(0);
  animation: title-underline 0.7s ease-out forwards;
  animation-delay: 0.15s;
}


/* =========================
   7. СЕКЦИЯ КАК ЭТО РАБОТАЕТ
   ========================= */

.how-it-works {
  text-align: center;
}

.how-it-works a {
  display: inline-block;
  padding: 12px 20px;
  background: var(--btn-bg);
  color: var(--text-btn);
  border-radius: 10px;
  transition: transform 0.3s, background-color 0.3s;
  animation: pulse 2s infinite;
}

.how-it-works a:hover {
  transform: scale(0.9);
  background: var(--btn-hover-bg);
}

.how-it-works a:active {
  transform: scale(0.82);
}


/* =========================
   8. СЕКЦИЯ PLATFORM: iOS / ANDROID
   ========================= */

.download-os {
  max-width: 900px;
  margin: 30px auto;
  padding: 30px;
  background: var(--bg-section);
  border-radius: 12px;
  border: 1px dashed var(--border-color);
  text-align: center;
}

.os-grid {
  display: flex;
  justify-content: center;
  gap: 25px;
  align-items: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.os-card {
  background: var(--bg-body);
  padding: 20px;
  width: 140px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.2s ease;
}

.os-card:hover {
  transform: translateY(-5px);
}

.os-icon {
  width: 25px;
  height: 25px;
  opacity: 0.85;
}


/* =========================
   9. СЕКЦИИ СОВЕТ ПЕРЕД СНОМ" И "ТАЙМЕР
   ========================= */

.sleep-tips,
.relax-timer {
  max-width: 900px;
  margin: 30px auto;
  padding: 30px;
  background: var(--bg-section);
  border-radius: 12px;
  border: 1px dashed var(--border-color);
  text-align: center;
}

/* Кружок таймера */
.timer-circle {
  width: 120px;
  height: 120px;
  margin: 20px auto;
  border-radius: 50%;
  border: 4px solid var(--btn-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 600;
  color: var(--text-dark);
}


/* =========================
   10. ФОН ДЛЯ СТРАНИЦЫ ФУНКЦИОНАЛ
   ========================= */

body.features-page {
  background-image:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.4), transparent 55%),
    radial-gradient(circle at bottom right, rgba(255, 200, 255, 0.35), transparent 55%);
  background-color: var(--bg-body);
  background-size: 140% 140%;
  animation: bg-move 18s ease-in-out infinite alternate;
}


/* =========================
   11. АДАПТИВНОСТЬ
   ========================= */

@media (max-width: 700px) {
  .main-nav {
    flex-direction: column;
    align-items: center;
  }

  section {
    margin: 20px 10px;
    padding: 20px;
  }

  .features-section ol {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}


/* =========================
   12. АНИМАЦИИ KEYFRAMES
   ========================= */

@keyframes pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes bg-move {
  0%   { background-position: 0% 0%, 100% 100%; }
  100% { background-position: 20% 10%, 80% 90%; }
}

@keyframes feature-fade-up {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes title-underline {
  0%   { transform: scaleX(0); }
  100% { transform: scaleX(1); }
}


/* пиксельный шрифт для заголовков и игровых штук */
.pixel-heading {
  font-family: "Press Start 2P", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 14px;
}

/* можно применить к h1 на главной */
header h1 {
  font-family: "Press Start 2P", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  text-transform: uppercase;
}

header h3 {
  font-family: "Press Start 2P", system-ui, sans-serif;
  font-size: 10px;
  text-transform: uppercase;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.hero-text {
  max-width: 600px;
}

.hero-cat img {
  width: 96px;
  image-rendering: pixelated; /* подчёркивает пиксельность */
  filter: drop-shadow(0 0 6px rgba(0,0,0,0.25));
  animation: cat-bob 2.5s ease-in-out infinite;
}

@keyframes cat-bob {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

.xp-widget {
  max-width: 900px;
  margin: 30px auto;
  padding: 24px;
  background: var(--bg-section);
  border-radius: 12px;
  border: 1px dashed var(--border-color);
  text-align: center;
  box-shadow: 0 0 10px rgba(0,0,0,0.08);
}

.xp-widget p {
  font-family: "Press Start 2P", system-ui, sans-serif;
  font-size: 10px;
}

#xp-value {
  font-size: 18px;
}


/* ===== ПУЗЫРЬКИ СПОКОЙСТВИЯ ===== */

.calm-bubbles .bubbles-area {
  margin-top: 16px;
  padding: 18px;
  background: var(--bg-body);
  border-radius: 12px;
  border: 1px dashed var(--border-color);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  font-size: 14px;
}

/* сами пузырьки */
.bubble {
  position: absolute;
  bottom: -20px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd4f3 0%, #ff9fdc 60%, rgba(255, 159, 220, 0) 100%);
  opacity: 0.9;
  animation: bubble-float 2.4s ease-out forwards;
}

@keyframes bubble-float {
  0% {
    transform: translateY(0) scale(0.7);
    opacity: 1;
  }
  100% {
    transform: translateY(-140px) scale(1.1);
    opacity: 0;
  }
}

/* ===== ПРОВЕРКА УСТАЛОСТИ ===== */

.tired-check .tired-buttons {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.tired-check .tired-btn {
  font-size: 13px;
  padding: 8px 14px;
}

/* ===== СЛУЧАЙНЫЙ ЗВУК ПРИРОДЫ ===== */

.nature-sound #sound-text {
  margin-bottom: 16px;
}

/* Общий блок для контента */
.content-section {
  background: var(--bg-section);
  max-width: 900px;
  padding: calc(20px + 1vw);
  margin: 30px auto;
  border-radius: 12px;
  border: 1px dashed var(--border-color);
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

/* сетка категорий */
.content-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.content-card {
  background: var(--bg-body);
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--border-color);
  font-size: 14px;
}

/* галерея котиков */
.cats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.cat-card {
  background: var(--bg-body);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 12px;
  text-align: center;
  font-size: 13px;
}

.pixel-cat {
  width: 72px;
  height: 72px;
  image-rendering: pixelated;
  display: block;
  margin: 0 auto 8px;
}

/* список звуков */
.sound-list {
  list-style: none;
  padding-left: 0;
  margin-top: 12px;
}

.sound-list li {
  margin-bottom: 8px;
  padding-left: 0;
  font-size: 14px;
}
