/* ═══════════════ TwoMeows — стилі ═══════════════ */

:root {
  /* Небо зі скріншота: блакить згори → сіро-лавандовий низ */
  --sky-top: #a9d3e9;
  --sky-mid: #cfe3ef;
  --sky-low: #dde6ec;
  --sky-bottom: #c9d0da;

  --ink: #2d3a4d;          /* основний текст */
  --ink-soft: #52627a;     /* другорядний текст */
  --accent: #ff9f45;       /* теплий помаранчевий CTA */
  --accent-dark: #f08624;
  --violet: #7c6bd6;       /* вторинний фіолетовий */
  --violet-soft: #eae6fb;
  --card-bg: rgba(255, 255, 255, 0.78);
  --card-border: rgba(255, 255, 255, 0.9);

  --radius: 24px;
  --shadow: 0 10px 30px rgba(45, 74, 105, 0.12);
  --shadow-soft: 0 4px 14px rgba(45, 74, 105, 0.08);

  --header-h: 64px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  font-family: "Nunito", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg,
    var(--sky-top) 0%,
    var(--sky-mid) 35%,
    var(--sky-low) 70%,
    var(--sky-bottom) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ═══ Хмаринки ═══ */
.clouds { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 100px;
  filter: blur(2px);
  animation: drift 60s linear infinite;
}
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.cloud-1 { width: 180px; height: 48px; top: 12%; left: -200px; }
.cloud-1::before { width: 70px; height: 70px; top: -32px; left: 28px; }
.cloud-1::after  { width: 50px; height: 50px; top: -22px; left: 88px; }
.cloud-2 { width: 240px; height: 60px; top: 34%; left: -260px; animation-duration: 85s; animation-delay: -30s; opacity: .7; }
.cloud-2::before { width: 90px; height: 90px; top: -40px; left: 40px; }
.cloud-2::after  { width: 64px; height: 64px; top: -28px; left: 120px; }
.cloud-3 { width: 150px; height: 40px; top: 58%; left: -170px; animation-duration: 70s; animation-delay: -50s; opacity: .5; }
.cloud-3::before { width: 56px; height: 56px; top: -26px; left: 24px; }
.cloud-3::after  { width: 44px; height: 44px; top: -18px; left: 72px; }
.cloud-4 { width: 200px; height: 52px; top: 78%; left: -220px; animation-duration: 95s; animation-delay: -15s; opacity: .45; }
.cloud-4::before { width: 76px; height: 76px; top: -34px; left: 34px; }
.cloud-4::after  { width: 56px; height: 56px; top: -24px; left: 100px; }

@keyframes drift {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(100vw + 300px)); }
}

/* ═══ Котики-маскоти ═══ */
.cats-layer { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.cat {
  position: fixed;
  top: 50%;
  width: 150px;
  transition: transform .7s cubic-bezier(.34, 1.4, .64, 1), opacity .4s ease;
  opacity: 0;
  will-change: transform;
  filter: drop-shadow(0 8px 16px rgba(45, 74, 105, 0.22));
}
/* індивідуальні розміри — щоб котики виглядали однаковими */
.cat-hello { width: 140px; }
.cat-point { width: 140px; }
.cat-cool  { width: 104px; }
.cat-book  { width: 250px; }
.cat-sleep { width: 270px; }

.cat-left  { left: 0;  transform: translate(-105%, -50%); }
.cat-right { right: 0; transform: translate(105%, -50%) scaleX(1); }
.cat.visible { opacity: 1; }
.cat-left.visible  { transform: translate(-2%, -50%); animation: bob-l 3.4s ease-in-out .7s infinite; }
.cat-right.visible { transform: translate(2%, -50%);  animation: bob-r 3.4s ease-in-out .7s infinite; }

@keyframes bob-l {
  0%, 100% { transform: translate(-2%, -50%) rotate(0deg); }
  50%      { transform: translate(-1%, -51.5%) rotate(1.2deg); }
}
@keyframes bob-r {
  0%, 100% { transform: translate(2%, -50%) rotate(0deg); }
  50%      { transform: translate(1%, -51.5%) rotate(-1.2deg); }
}

/* ═══ Шапка ═══ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 clamp(16px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
  z-index: 50;
}

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-icon { width: 36px; height: 36px; }
.logo-text { font-size: 22px; font-weight: 900; color: var(--ink); letter-spacing: -0.5px; }
.logo-text em { font-style: normal; color: var(--accent-dark); }

.main-nav { display: flex; gap: 22px; margin-left: auto; }
.main-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 15px;
  transition: color .2s;
}
.main-nav a:hover { color: var(--accent-dark); }

.lang-switch { display: flex; gap: 4px; background: rgba(255,255,255,.7); border-radius: 999px; padding: 4px; }
.lang-switch button {
  border: none;
  background: transparent;
  font-family: inherit;
  font-weight: 800;
  font-size: 12px;
  color: var(--ink-soft);
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s;
}
.lang-switch button.active { background: var(--violet); color: #fff; }
.lang-switch button:not(.active):hover { background: var(--violet-soft); }

/* ═══ Загальна розмітка ═══ */
main { position: relative; z-index: 1; }

.section { padding: clamp(48px, 8vw, 96px) clamp(20px, 6vw, 72px); }
.section-inner { max-width: 1080px; margin: 0 auto; }
.section-narrow { max-width: 760px; }

h1 { font-size: clamp(34px, 5vw, 56px); font-weight: 900; line-height: 1.15; letter-spacing: -1px; }
h2 { font-size: clamp(26px, 3.6vw, 40px); font-weight: 900; text-align: center; margin-bottom: 18px; letter-spacing: -0.5px; }
h3 { font-size: 19px; font-weight: 800; margin-bottom: 8px; }

.accent { color: var(--accent-dark); }
.section-lead {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 40px;
  font-size: 18px;
  color: var(--ink-soft);
  font-weight: 600;
}

/* Поява при прокрутці */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.shown { opacity: 1; transform: none; }

/* ═══ Кнопки ═══ */
.btn {
  display: inline-block;
  text-decoration: none;
  font-family: inherit;
  font-weight: 800;
  font-size: 17px;
  padding: 14px 30px;
  border-radius: 999px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 8px 22px rgba(240, 134, 36, 0.4);
}
.btn-primary:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 12px 28px rgba(240, 134, 36, 0.5); }
.btn-lg { font-size: 19px; padding: 17px 40px; }

/* ═══ Hero ═══ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(32px, 6vw, 90px);
  flex-wrap: wrap;
  padding: calc(var(--header-h) + 40px) clamp(20px, 6vw, 72px) 60px;
}
.hero-text { max-width: 560px; }
.hero-badge {
  display: inline-block;
  background: var(--violet-soft);
  color: var(--violet);
  font-weight: 800;
  font-size: 14px;
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero-sub { font-size: 18px; color: var(--ink-soft); font-weight: 600; margin: 18px 0 26px; }
.hero-cta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.soon-badge { font-weight: 700; font-size: 14px; color: var(--ink-soft); }
.hero-points { list-style: none; display: flex; gap: 20px; flex-wrap: wrap; margin-top: 26px; }
.hero-points li { font-weight: 700; font-size: 14px; color: var(--ink-soft); }

/* Мокап телефона */
.hero-phone { flex-shrink: 0; }
.phone {
  width: 290px;
  background: #1e2430;
  border-radius: 42px;
  padding: 12px;
  box-shadow: 0 30px 60px rgba(30, 42, 60, 0.35);
  position: relative;
  transform: rotate(3deg);
}
.phone-notch {
  position: absolute;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  width: 110px; height: 22px;
  background: #1e2430;
  border-radius: 0 0 16px 16px;
  z-index: 2;
}
.phone-screen {
  background: linear-gradient(180deg, #f7f2ff, #fdf8ef);
  border-radius: 32px;
  padding: 34px 18px 20px;
  overflow: hidden;
}
.app-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.app-title { font-weight: 900; font-size: 15px; }
.app-chapter { font-size: 11px; color: var(--ink-soft); font-weight: 700; }
.app-cover { width: 100%; border-radius: 16px; box-shadow: var(--shadow-soft); }
.app-text { font-size: 14px; font-weight: 600; margin: 14px 2px; line-height: 1.65; }
.app-word {
  position: relative;
  background: linear-gradient(120deg, #ffe6a7, #ffd067);
  padding: 2px 7px;
  border-radius: 8px;
  font-weight: 900;
  color: #8a5a00;
  white-space: nowrap;
}
.app-word-hint {
  position: absolute;
  top: -30px; left: 50%;
  transform: translateX(-50%);
  background: var(--violet);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 8px;
  white-space: nowrap;
}
.app-word-hint::after {
  content: "";
  position: absolute;
  bottom: -4px; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--violet);
  border-bottom: none;
}
.app-progress { height: 6px; background: #e8e0f5; border-radius: 99px; margin: 10px 2px; }
.app-progress-fill { width: 45%; height: 100%; background: linear-gradient(90deg, var(--violet), #a08df0); border-radius: 99px; }
.app-controls { display: flex; justify-content: center; align-items: center; gap: 26px; font-size: 18px; margin-top: 10px; }
.app-play {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 6px 16px rgba(240, 134, 36, 0.45);
}

/* ═══ Картки ═══ */
.cards-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; }
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(6px);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-emoji { font-size: 40px; margin-bottom: 12px; }
.card p { color: var(--ink-soft); font-size: 15px; font-weight: 600; }

/* ═══ Кроки ═══ */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; margin-top: 36px; }
.step {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 30px 22px 26px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  position: relative;
}
.step-num {
  position: absolute;
  top: -14px; left: 50%;
  transform: translateX(-50%);
  width: 32px; height: 32px;
  background: var(--violet);
  color: #fff;
  font-weight: 900;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(124, 107, 214, 0.4);
}
.step-emoji { font-size: 42px; margin-bottom: 10px; }
.step p { color: var(--ink-soft); font-size: 14px; font-weight: 600; }

/* ═══ Для батьків ═══ */
.pedagog-badge {
  display: flex;
  gap: 22px;
  align-items: center;
  background: linear-gradient(120deg, rgba(124, 107, 214, .14), rgba(255, 255, 255, .85));
  border: 2px solid rgba(124, 107, 214, .35);
  border-radius: var(--radius);
  padding: 28px 30px;
  margin: 36px 0 30px;
  box-shadow: var(--shadow-soft);
}
.pedagog-icon { font-size: 52px; flex-shrink: 0; }
.pedagog-badge h3 { color: var(--violet); font-size: 21px; }
.pedagog-badge p { color: var(--ink-soft); font-weight: 600; }

/* ═══ Для дітей ═══ */
.kids-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.kids-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
}
.kids-item span { font-size: 34px; }
.kids-item p { font-weight: 700; font-size: 15px; color: var(--ink); }

/* ═══ Бібліотека ═══ */
.book { text-align: center; }
.book-cover {
  width: 100%;
  height: auto;        /* без цього атрибути width/height у <img> задають height і вбивають aspect-ratio */
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition: transform .2s ease;
}
.book:hover .book-cover { transform: translateY(-5px) rotate(-1deg); }
.book h3 { font-size: 16px; margin-top: 14px; }
.book-meta { font-size: 13px; font-weight: 700; color: var(--ink-soft); }

/* Полиця, що їде сама.
   .shelf-track містить два однакових набори, тому зсув на -50% ширини треку
   дорівнює рівно одному набору — шва не видно. Анімація тільки на transform:
   не смикає лейаут і не потребує JS (rAF у фонових вкладках не працює). */
.shelf {
  --shelf-card: 200px;
  --shelf-gap: 26px;
  --shelf-speed: 120s;
  /* виходимо за падінги секції, але НЕ через 100vw: там ширина зі смугою
     прокрутки, і сторінка отримує зайві ~8px по горизонталі */
  margin-inline: calc(clamp(20px, 6vw, 72px) * -1);
  margin-bottom: 34px;
  padding-block: 10px;             /* щоб підйом обкладинки на hover не зрізало */
  overflow: hidden;
  /* широке затухання по краях: котик-книгочей стоїть фіксовано біля правого
     краю, і полиця однаково проїде під ним — хай проїжджає вже майже прозорою */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}
.shelf-track {
  display: flex;
  width: max-content;
  animation: shelf-scroll var(--shelf-speed) linear infinite;
}
.shelf:hover .shelf-track,
.shelf:focus-within .shelf-track { animation-play-state: paused; }
.shelf-set { display: flex; gap: var(--shelf-gap); padding-right: var(--shelf-gap); }
.shelf .book { flex: 0 0 var(--shelf-card); width: var(--shelf-card); }
.shelf .book-cover { display: block; }
/* назви різної довжини — обрізаємо до двох рядків, інакше ряд «стрибає» */
.shelf .book h3 {
  font-size: 15px;
  margin-top: 12px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.shelf figcaption { min-height: 70px; }   /* рівний низ і для одно-, і для дворядкових назв */
@keyframes shelf-scroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}
@media (max-width: 600px) { .shelf { --shelf-card: 148px; --shelf-gap: 16px; } }
@media (prefers-reduced-motion: reduce) {
  .shelf { overflow-x: auto; }
  .shelf-track { animation: none; }
  .shelf-set + .shelf-set { display: none; }   /* клон непотрібен без руху */
}

.genres { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip {
  background: rgba(255, 255, 255, .8);
  border: 1px solid rgba(255,255,255,.95);
  font-weight: 700;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  color: var(--ink-soft);
}

/* ═══ Метод ═══ */
.method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; margin-top: 36px; }
.method-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 26px 26px;
  box-shadow: var(--shadow-soft);
}
.method-item p { color: var(--ink-soft); font-size: 15px; font-weight: 600; }

/* ═══ CTA ═══ */
.cta-box {
  text-align: center;
  background: linear-gradient(150deg, rgba(255,255,255,.92), rgba(255, 243, 224, .9));
  border: 1px solid #fff;
  border-radius: 32px;
  padding: 120px 32px 48px;
  box-shadow: var(--shadow);
  position: relative;
}
.cta-cats { position: absolute; top: -110px; left: 50%; transform: translateX(-50%); }
.cta-cats img { width: 168px; filter: drop-shadow(0 10px 18px rgba(45, 74, 105, 0.25)); }
.cta-box p { color: var(--ink-soft); font-weight: 600; font-size: 17px; max-width: 560px; margin: 0 auto 28px; }
.cta-note { font-size: 13px !important; margin-top: 16px !important; }

/* ═══ FAQ ═══ */
.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 16px;
  padding: 18px 22px;
  list-style: none;
  position: relative;
  padding-right: 48px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "▾";
  position: absolute;
  right: 20px;
  color: var(--violet);
  font-size: 18px;
  transition: transform .25s;
}
.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-item p { padding: 0 22px 18px; color: var(--ink-soft); font-weight: 600; font-size: 15px; }

/* ═══ Footer ═══ */
.site-footer {
  position: relative;
  z-index: 1;
  background: rgba(45, 58, 77, 0.92);
  color: #cfd8e6;
  padding: 44px clamp(20px, 6vw, 72px);
  margin-top: 40px;
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.footer-brand .logo-text { color: #fff; }
.footer-brand p { font-size: 14px; font-weight: 600; opacity: .8; }
.footer-links { display: flex; gap: 24px; margin-left: auto; flex-wrap: wrap; }
.footer-links a { color: #cfd8e6; font-weight: 700; font-size: 14px; text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-copy { width: 100%; font-size: 13px; opacity: .6; }

/* ═══ Адаптивність ═══ */
@media (max-width: 900px) {
  .main-nav { display: none; }
  .cat-hello { width: 96px; }
  .cat-point { width: 96px; }
  .cat-cool  { width: 72px; }
  .cat-book  { width: 170px; }
  .cat-sleep { width: 185px; }
}

@media (max-width: 640px) {
  .hero { padding-top: calc(var(--header-h) + 24px); text-align: center; }
  .hero-cta { justify-content: center; }
  .hero-points { justify-content: center; }
  .phone { transform: rotate(0); width: 260px; }
  .pedagog-badge { flex-direction: column; text-align: center; }
  /* котики не мають перекривати текст на вузьких екранах */
  .cat { opacity: 0 !important; }
  .cat.visible { opacity: .95 !important; }
  .cat-hello { width: 76px; }
  .cat-point { width: 76px; }
  .cat-cool  { width: 58px; }
  .cat-book  { width: 130px; }
  .cat-sleep { width: 140px; }
  .cta-cats img { width: 130px; }
  .cta-cats { top: -86px; }
  .cta-box { padding-top: 96px; }
}

/* ═══ Доступність ═══ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cloud { animation: none; }
  .cat, .cat.visible { animation: none; transition: opacity .3s; }
  .reveal { transition: none; opacity: 1; transform: none; }
}
