/* ==========================================================================
   FreeGPT — mobile-first landing
   Базовые стили рассчитаны на телефон; @media (min-width) расширяют вёрстку.
   ========================================================================== */

:root {
  /* Светлая тема — значения по умолчанию */
  --bg: #ffffff;
  --bg-alt: #f9f9f9;
  --surface: #ffffff;
  --surface-2: #f4f4f4;
  --border: #e5e5e5;
  --text: #0d0d0d;
  --muted: #5d5d5d;
  --accent: #10a37f;
  --accent-soft: rgba(16, 163, 127, .12);
  --invert-bg: #0d0d0d;
  --invert-text: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .06);
  --radius: 16px;
  --radius-sm: 12px;
  --topbar-h: 56px;
  --gutter: 20px;
}

html[data-theme="dark"] {
  --bg: #0d0d0d;
  --bg-alt: #131313;
  --surface: #1a1a1a;
  --surface-2: #262626;
  --border: #2c2c2e;
  --text: #ececec;
  --muted: #a0a0a8;
  --accent: #19c37d;
  --accent-soft: rgba(25, 195, 125, .14);
  --invert-bg: #ffffff;
  --invert-text: #0d0d0d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 12px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* место под липкую кнопку на мобильных */
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

img, svg { max-width: 100%; }
svg { display: block; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }

a { color: inherit; text-decoration: none; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 12px; top: 12px;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 10px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Шапка ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.topbar.is-scrolled { border-bottom-color: var(--border); }

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand__mark {
  width: 40px; height: 26px;
  display: block;
  object-fit: contain;
  object-position: center;
}
.brand__mark img { width: 100%; height: 100%; object-fit: contain; }
html[data-theme="dark"] .brand__mark { filter: invert(1); }
.brand__name { font-weight: 600; letter-spacing: -.01em; font-size: 17px; }

.topbar__actions { display: flex; align-items: center; gap: 8px; }

.iconbtn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0;
}
.iconbtn svg { width: 19px; height: 19px; }
.iconbtn .i-moon { display: none; }
html[data-theme="dark"] .iconbtn .i-sun { display: none; }
html[data-theme="dark"] .iconbtn .i-moon { display: block; }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 16px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, opacity .18s ease, background-color .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }

.btn--primary { background: var(--invert-bg); color: var(--invert-text); }
.btn--ghost { border-color: var(--border); background: var(--surface); }
.btn--quiet { color: var(--muted); min-height: 44px; }
.btn--quiet:hover { color: var(--text); }

.topbar__cta { min-height: 40px; padding: 8px 16px; font-size: 15px; }

.btn--big {
  width: 100%;
  min-height: 58px;
  padding: 10px 22px;
  font-size: 17px;
}
.btn--center { max-width: 420px; margin-inline: auto; }

.btn__icon { width: 22px; height: 22px; flex: none; }
.btn__icon svg { width: 22px; height: 22px; }
.btn__text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.btn__label { font-weight: 600; }
.btn__meta { font-size: 12.5px; opacity: .62; font-weight: 400; }

/* ---------- Hero ---------- */

.hero {
  padding-top: 34px;
  text-align: left;
  position: relative;
  /* подсветка за заголовком не должна давать горизонтальную прокрутку */
  overflow-x: clip;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -140px -30% auto -30%;
  height: 420px;
  background: radial-gradient(60% 60% at 50% 40%, var(--accent-soft), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 12px;
  margin-bottom: 18px;
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.hero__title {
  font-size: clamp(30px, 8.6vw, 46px);
  font-weight: 700;
  letter-spacing: -.035em;
}
.grad {
  background: linear-gradient(96deg, var(--accent), #6aa6ff 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__sub {
  margin-top: 14px;
  font-size: 16.5px;
  color: var(--muted);
  max-width: 46ch;
}

.cta {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}

.hint {
  margin-top: 4px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 42ch;
}
.is-hidden { display: none !important; }

.trust {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13.5px;
  color: var(--muted);
}
.trust li { display: flex; align-items: center; gap: 7px; }
.trust li::before {
  content: "";
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--muted);
  opacity: .6;
}
.trust li:first-child::before { display: none; }

/* ---------- Телефон с чатом ---------- */

.phone-stage {
  margin-top: 38px;
  display: flex;
  justify-content: center;
  padding-inline: var(--gutter);
}

.phone {
  position: relative;
  width: min(320px, 86vw);
  aspect-ratio: 9 / 17;
  border-radius: 40px;
  padding: 10px;
  /* корпус и экран всегда тёмные — независимо от темы страницы */
  --surface-2: #303030;
  --text: #ececec;
  --muted: #9b9b9b;
  --border: #2c2c2e;
  background: #1c1c1e;
  border: 1px solid #2c2c2e;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18), 0 18px 40px rgba(0, 0, 0, .22);
}
.phone__notch {
  position: absolute;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  width: 32%; height: 20px;
  background: #101012;
  border-radius: 999px;
  z-index: 2;
}

.phone__screen {
  height: 100%;
  border-radius: 31px;
  background: #0d0d0d;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat__top {
  padding: 34px 14px 8px;
  display: flex;
  justify-content: center;
  flex: none;
}
.chat__model {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
}
.chat__model svg { width: 13px; height: 13px; }

.chat {
  flex: 1;
  overflow: hidden;
  padding: 6px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: flex-end;
}

.msg {
  font-size: 13.5px;
  line-height: 1.5;
  max-width: 86%;
  animation: pop .28s ease both;
}
.msg--user {
  align-self: flex-end;
  background: var(--surface-2);
  padding: 9px 13px;
  border-radius: 18px 18px 5px 18px;
}
.msg--ai {
  align-self: flex-start;
  color: var(--text);
  max-width: 96%;
}
.msg--ai .caret {
  display: inline-block;
  width: 7px; height: 15px;
  background: var(--text);
  border-radius: 1px;
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }

.composer {
  flex: none;
  margin: 8px 12px 16px;
  min-height: 44px;
  border-radius: 22px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 13.5px;
}
.composer__plus { font-size: 19px; line-height: 1; opacity: .7; }
.composer__ph { flex: 1; }
.composer__mic svg { width: 16px; height: 16px; }

/* ---------- Секции ---------- */

.section { padding: 56px 0; }
.section--alt { background: var(--bg-alt); }

.h2 {
  font-size: clamp(24px, 6.4vw, 34px);
  font-weight: 700;
  letter-spacing: -.03em;
}
.lead {
  margin-top: 10px;
  color: var(--muted);
  font-size: 16px;
  max-width: 52ch;
}

/* Карточки возможностей */
.grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card__ico { font-size: 22px; line-height: 1; display: block; margin-bottom: 12px; }
.card h3 { font-size: 17px; font-weight: 600; }
.card p { margin-top: 7px; color: var(--muted); font-size: 14.5px; }

/* Таблица сравнения */
.table-scroll {
  margin-top: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.cmp {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13.5px;
}
.cmp th, .cmp td {
  padding: 13px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  hyphens: auto;
}
.cmp thead th { font-weight: 600; font-size: 12px; color: var(--muted); }
.cmp col.c-feature { width: 44%; }
.cmp tbody th { font-weight: 500; }
.cmp td { color: var(--muted); }
.cmp tr:last-child th, .cmp tr:last-child td { border-bottom: none; }
.cmp .is-me { color: var(--text); font-weight: 600; background: var(--accent-soft); }
.cmp thead .is-me { color: var(--accent); }
.note { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* Список загрузок */
.dl-list {
  margin-top: 24px;
  max-width: 520px;
  margin-inline: auto;
}
.dl {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .18s ease, transform .12s ease;
}
.dl:active { transform: scale(.99); }
.dl:hover { border-color: color-mix(in srgb, var(--text) 28%, var(--border)); }
.dl__ico {
  width: 40px; height: 40px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--surface-2);
}
.dl__ico svg { width: 22px; height: 22px; }
.dl__txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.dl__txt b { font-weight: 600; font-size: 16px; }
.dl__txt small { color: var(--muted); font-size: 13px; }
.dl__arrow { color: var(--muted); font-size: 18px; flex: none; }
.dl--main { min-height: 84px; }
.dl.is-recommended {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.specs {
  margin: 18px auto 0;
  max-width: 520px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.specs > div { background: var(--surface); padding: 14px 16px; }
.specs dt { font-size: 12.5px; color: var(--muted); }
.specs dd { margin: 3px 0 0; font-size: 14.5px; font-weight: 500; }

#platforms .note { margin: 16px auto 0; max-width: 520px; text-align: center; }

/* Шаги установки */
.steps {
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: s;
  display: grid;
  gap: 12px;
}
.steps li {
  counter-increment: s;
  position: relative;
  padding: 18px 18px 18px 60px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.steps li::before {
  content: counter(s);
  position: absolute;
  left: 18px; top: 18px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--invert-bg);
  color: var(--invert-text);
  font-size: 14px;
  font-weight: 600;
}
.steps b { display: block; font-weight: 600; font-size: 16px; }
.steps span { display: block; margin-top: 5px; color: var(--muted); font-size: 14.5px; }

/* FAQ */
.faq { margin-top: 24px; border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 34px 18px 0;
  position: relative;
  font-weight: 500;
  font-size: 16px;
  min-height: 56px;
  display: flex;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  font-size: 22px;
  font-weight: 400;
  color: var(--muted);
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq__body { padding: 0 0 18px; }
.faq__body p { color: var(--muted); font-size: 15px; }

/* Финальный блок */
.final {
  padding: 64px 0 72px;
  text-align: center;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}
.final .lead { margin-inline: auto; }
.final .btn { margin-top: 26px; }

/* Подвал */
.footer {
  padding: 40px 0 48px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.brand--footer { margin-bottom: 18px; }
.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  font-size: 15px;
  color: var(--muted);
}
.footer__nav a { padding: 6px 0; }
.disclaimer {
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--muted);
  opacity: .85;
  max-width: 68ch;
}
.copy { margin-top: 14px; font-size: 12.5px; color: var(--muted); }

/* ---------- Липкая кнопка (мобильные) ---------- */

.stickybar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 45;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  transform: translateY(120%);
  transition: transform .26s ease;
}
.stickybar.is-visible { transform: translateY(0); }
.stickybar .btn { width: 100%; }

/* ---------- Планшет ---------- */

@media (min-width: 640px) {
  :root { --gutter: 32px; }
  .hero { padding-top: 56px; text-align: center; }
  .hero__sub { margin-inline: auto; }
  .pill { margin-inline: auto; display: flex; width: max-content; }
  .cta { align-items: center; }
  .hint { text-align: center; }
  .btn--big { width: auto; min-width: 280px; }
  .trust { justify-content: center; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .specs { grid-template-columns: repeat(4, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .cmp { font-size: 14.5px; }
  .cmp th, .cmp td { padding: 15px 16px; }
  .cmp thead th { font-size: 13.5px; }
  .h2, .lead { text-align: center; }
  .lead { margin-inline: auto; }
  .section { padding: 72px 0; }
}

/* ---------- Десктоп ---------- */

@media (min-width: 1024px) {
  :root { --topbar-h: 64px; }
  body { padding-bottom: 0; }
  .stickybar { display: none; }
  .hero { padding-top: 76px; }
  .hero__title { font-size: 60px; }
  .hero__sub { font-size: 19px; }
  .phone-stage { margin-top: 56px; }
  .phone { width: 340px; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .section { padding: 96px 0; }
  .footer__nav { justify-content: flex-start; }
}

/* ---------- Доступность ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
