/* Meeplery — общие стили сайта.
   Палитра взята из иконки приложения (градиент + стеклянные миплы). */

:root {
  --blue-100: #d6ecf7;
  --blue-300: #85c5ea;
  --blue-400: #7bd2fb;
  --blue-500: #419ece;
  --blue-700: #0469a2;

  --bg: #ffffff;
  --bg-soft: #f2f4f7;
  --card: #ffffff;
  --border: rgba(0, 0, 0, 0.09);
  --text: #1c1c1e;
  --text-secondary: #6b7280;
  --accent: var(--blue-500);
  --accent-strong: var(--blue-700);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(4, 105, 162, 0.07);

  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1080px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui,
    sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-soft: #111114;
    --card: #1c1c1e;
    --border: rgba(255, 255, 255, 0.12);
    --text: #f2f2f7;
    --text-secondary: #9ca3af;
    --accent: var(--blue-400);
    --accent-strong: var(--blue-300);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(34px, 6vw, 56px); font-weight: 700; }
h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 700; }
h3 { font-size: 20px; font-weight: 600; }
p { margin: 0; }

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.brand img { width: 30px; height: 30px; border-radius: 7px; display: block; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.lang-switch a {
  padding: 4px 11px;
  border-radius: 999px;
  color: var(--text-secondary);
  text-decoration: none;
}

.lang-switch a[aria-current="true"] {
  background: var(--accent);
  color: #fff;
}

/* ---------- Hero ---------- */

.hero {
  padding: 0;               /* общий отступ секций hero не нужен */
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(330deg, var(--blue-400) 0%, var(--blue-500) 45%, var(--blue-700) 100%);
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: start;
  gap: 48px;
  padding-top: 84px;
  padding-bottom: 104px;
}
/* Текст hero — у верха телефона, а не по его середине */
.hero .wrap > div:first-child { padding-top: 56px; }

.hero h1 { color: #fff; }

/* ---------- Навигация белым по синему (вместо шапки) ---------- */

.topband {
  background: linear-gradient(330deg, var(--blue-400) 0%, var(--blue-500) 45%, var(--blue-700) 100%);
}

.topnav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
}
.hero .topnav { padding-bottom: 0; }

.topnav a {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 24px;        /* одна высота строки у ссылок и «Meeplery» — ссылки на всех страницах на одной высоте */
  text-decoration: none;
  opacity: 0.88;
}
.topnav a:hover { opacity: 1; text-decoration: underline; }
.topnav .topnav-brand { font-size: 18px; opacity: 1; }

.topnav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-left: auto;
}

.hero .lead {
  margin-top: 18px;
  font-size: clamp(17px, 2.2vw, 21px);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.9);
  max-width: 30em;
}

.hero-actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.hero-note {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.78);
}

.btn-store {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 14px;
  background: #fff;
  color: var(--blue-700);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
}

a.btn-store:hover { color: var(--blue-700); transform: translateY(-1px); }
.btn-store svg { width: 20px; height: 20px; fill: currentColor; }

/* Вторая строка hero: доступ к бете через TestFlight */
/* Подпись к бете — под кнопкой, а не рядом */
.hero-actions--beta {
  margin-top: 14px;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.btn-beta {
  display: inline-flex;
  align-items: center;
  padding: 11px 20px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
}

.btn-beta:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
.hero-note a { color: #fff; }

/* ---------- Рамка телефона ---------- */

.phone {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}

/* Снимки уже в корпусе iPhone (рамка симулятора, фон прозрачный) */
.phone img {
  width: 100%;
  height: auto;
  display: block;
}

.phone--sm { max-width: 216px; }

/* ---------- Секции ---------- */

section { padding: 56px 0; }
section.soft { background: var(--bg-soft); }

.section-head { max-width: 34em; margin-bottom: 44px; }
.section-head p {
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 18px;
}

.features { display: grid; gap: 72px; }

.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 56px;
}

.feature:nth-child(even) .feature-text { order: 2; }

.feature h3 { font-size: clamp(22px, 3vw, 28px); }

.feature p {
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 17px;
  max-width: 32em;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Карусель снимков ---------- */

.feature h2 { font-size: clamp(28px, 4vw, 40px); }

/* Снимки лежат стопкой, виден один; первый задаёт размер */
.carousel { position: relative; touch-action: pan-y; }  /* горизонтальный жест — свайп карусели */
.carousel img {
  position: relative;
  opacity: 0;
}
.carousel img:not(:first-child) {
  position: absolute;
  inset: 0;
}
/* Новый снимок проявляется поверх старого: старый остаётся непрозрачным
   под ним до конца перехода, поэтому фон страницы не просвечивает */
.carousel img.is-prev { opacity: 1; z-index: 1; }
.carousel img.is-active { opacity: 1; z-index: 2; transition: opacity 0.6s ease; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}
.carousel-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--text-secondary);
  opacity: 0.3;
  cursor: pointer;
}
.carousel-dots button.is-active { opacity: 1; background: var(--accent); }

/* Подписи к снимкам: активная подсвечена, клик переключает снимок */
.slide-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.slide-list button {
  display: block;
  width: 100%;
  padding: 5px 0 5px 12px;
  border: 0;
  border-left: 3px solid transparent;
  background: none;
  font: inherit;
  font-size: 14px;
  text-align: left;
  color: var(--text-secondary);
  cursor: pointer;
}
.slide-list .is-active button {
  border-left-color: var(--accent);
  color: var(--text);
  font-weight: 600;
}

/* Подпись под снимком — только на узком экране, вместо списка */
.carousel-caption {
  display: none;
  margin-top: 12px;
  text-align: center;
  font-weight: 600;
}
/* Все подписи лежат в одной ячейке, видна одна: высота — по самой длинной,
   и страница не прыгает при смене снимка */
.carousel-caption span { grid-area: 1 / 1; visibility: hidden; }
.carousel-caption span.is-active { visibility: visible; }

/* Блок с телефоном слева */
.feature--flip .feature-text { order: 2; }

@media (max-width: 860px) {
  .feature--flip .feature-text { order: 0; }
  .slide-list { display: none; }
  .carousel-caption { display: grid; }
}

/* ---------- Шаги ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  counter-reset: step;
}

.step {
  padding: 26px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.step::before {
  counter-increment: step;
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: var(--blue-100);
  color: var(--blue-700);
  font-weight: 700;
}

.step p { margin-top: 10px; color: var(--text-secondary); font-size: 16px; }

/* ---------- FAQ ---------- */

.faq { max-width: 760px; }

.faq details {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 18px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  color: var(--accent);
  font-weight: 400;
  font-size: 24px;
  line-height: 1;
}

.faq details[open] summary::after { content: "–"; }

.faq details p {
  margin-top: 12px;
  color: var(--text-secondary);
  max-width: 62ch;
}

/* ---------- Текстовые страницы ---------- */

.doc { padding: 56px 0 80px; }
.doc .wrap { max-width: 760px; }
.doc h1 { font-size: clamp(30px, 5vw, 40px); }
.doc h2 { font-size: 22px; margin-top: 40px; }
.doc h3 { margin-top: 28px; }
.doc p, .doc li { color: var(--text); font-size: 17px; }
.doc p { margin-top: 14px; }
.doc ul { margin-top: 14px; padding-left: 22px; }
.doc li { margin-top: 8px; }
.doc .updated { margin-top: 10px; color: var(--text-secondary); font-size: 15px; }

.callout {
  margin-top: 28px;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  font-size: 16px;
  color: var(--text-secondary);
}

/* ---------- Футер ---------- */

.site-footer {
  padding: 40px 0 56px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  font-size: 15px;
  color: var(--text-secondary);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
  justify-content: space-between;
}

.site-footer nav { display: flex; flex-wrap: wrap; gap: 12px 22px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---------- Адаптив ---------- */

@media (max-width: 860px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-top: 76px;
    padding-bottom: 88px;
    text-align: center;
  }
  .hero .wrap > div:first-child { padding-top: 0; }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-actions--beta { align-items: center; }
  .feature { grid-template-columns: 1fr; gap: 28px; text-align: center; }
  .feature:nth-child(even) .feature-text { order: 0; }
  .feature p { margin-left: auto; margin-right: auto; }
  .steps { grid-template-columns: 1fr; }
  section { padding: 44px 0; }
  .features { gap: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a.btn-store:hover { transform: none; }
}
