/* ============================================================
   Axil site-v3, светлая редакция.
   Onest + IBM Plex Mono (только код). Один акцент: глубокая бирюза.
   Радиусы: контейнеры 14, интерактив 10. Motion: hover/active + FAQ.
   ============================================================ */

:root {
  --bg: #f4fbfc;
  --surface: #ffffff;
  --ink: #102336;
  --muted: #50677a;
  --faint: #7d91a1;
  --line: #d8e8ed;
  --accent: #00bfd3;
  --accent-deep: #006a7d;
  --accent-soft: #e4fbfd;
  --code-bg: #0b2233;
  --code-ink: #d8f8fb;
  --shadow-soft: 0 24px 60px -24px rgba(16, 35, 54, 0.18);
  --r-box: 14px;
  --r-ui: 10px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

.mono { font-family: var(--mono); }

.shell { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

::selection { background: rgba(0, 191, 211, 0.2); }

h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: var(--r-ui);
  font-weight: 600;
  font-size: 15.5px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .16s ease, border-color .16s ease, transform .1s ease, box-shadow .16s ease;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, #007d92 0%, #00bfd3 100%);
  color: #ffffff;
}

.btn-primary:hover { background: linear-gradient(135deg, #006a7d 0%, #00aabd 100%); box-shadow: 0 10px 24px -10px rgba(0, 191, 211, 0.55); }

.btn-quiet {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.btn-quiet:hover { border-color: var(--accent); color: var(--accent-deep); }

.btn-large { padding: 15px 28px; font-size: 16.5px; }

.btn-compact { padding: 9px 18px; font-size: 14.5px; }

/* ---------- шапка ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 249, 249, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}

.topbar.is-stuck { border-bottom-color: var(--line); }

.topbar-in {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-right: auto;
}

.brand-mark {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  line-height: 1;
}

.brand-logo {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand-name { font-weight: 800; font-size: 19px; }

.nav-links { display: flex; gap: 24px; }

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 15px;
  transition: color .15s ease;
}

.nav-links a:hover { color: var(--ink); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 12px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-ui);
  cursor: pointer;
}

.nav-toggle span { width: 17px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .18s ease; }

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

.nav-sheet { display: none; }

.nav-sheet[hidden] { display: none; }

/* ---------- hero ---------- */

.hero { padding: 72px 0 32px; }

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-copy { position: relative; }

.hero h1 { font-size: clamp(28px, 2.8vw, 34px); font-weight: 800; margin-bottom: 18px; }

.hero-sub { font-size: 18px; color: var(--muted); max-width: 30em; margin-bottom: 28px; }

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Живое демо в hero: на десктопе iframe с приложением, на мобильных
   миниатюра, разворачивающаяся в полноэкранный оверлей. */

.hero-demo { position: relative; z-index: 3; display: flex; justify-content: center; }

/* тёмный «корпус» телефона вокруг живого демо.
   Экран внутри - честные 440x956 CSS-пикселей (логическое разрешение
   iPhone Pro Max), чтобы раскладка приложения была как на телефоне;
   под высоту окна корпус подгоняется через zoom из app.js. */
.phone-chassis {
  position: relative;
  width: 462px;
  background: #1a2422;
  border-radius: 52px;
  padding: 30px 11px 16px;
  box-shadow:
    0 34px 80px -30px rgba(16, 35, 54, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* кнопка питания справа и качелька громкости слева */
.phone-chassis::before,
.phone-chassis::after {
  content: "";
  position: absolute;
  width: 3px;
  border-radius: 3px;
  background: #101815;
}

.phone-chassis::before { right: -3px; top: 150px; height: 64px; }
.phone-chassis::after { left: -3px; top: 122px; height: 96px; }

.phone-speaker {
  position: absolute;
  top: 13px;
  left: 50%;
  transform: translateX(-50%);
  width: 54px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.phone-live-badge {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  background: linear-gradient(135deg, #007d92 0%, #00bfd3 100%);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--r-ui);
  padding: 7px 14px;
  white-space: nowrap;
  box-shadow: 0 10px 24px -8px rgba(0, 191, 211, 0.5);
}

.phone-live {
  display: flex;
  flex-direction: column;
  width: 440px;
  height: 956px;
  border-radius: 32px;
  overflow: hidden;
  background-color: var(--surface);
  background-size: cover;
  background-position: top center;
}

.phone-statusbar {
  flex: 0 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px 0 28px;
  background: #ffffff;
  color: #111827;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

.phone-status-icons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.phone-signal {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.phone-signal span {
  width: 3px;
  border-radius: 2px;
  background: currentColor;
}

.phone-signal span:nth-child(1) { height: 4px; }
.phone-signal span:nth-child(2) { height: 6px; }
.phone-signal span:nth-child(3) { height: 8px; }
.phone-signal span:nth-child(4) { height: 10px; }

.phone-wifi {
  position: relative;
  width: 14px;
  height: 10px;
}

.phone-wifi::before,
.phone-wifi::after {
  content: "";
  position: absolute;
  left: 50%;
  border: 2px solid currentColor;
  border-bottom: 0;
  transform: translateX(-50%);
}

.phone-wifi::before {
  bottom: 1px;
  width: 14px;
  height: 8px;
  border-radius: 12px 12px 0 0;
}

.phone-wifi::after {
  bottom: 1px;
  width: 7px;
  height: 4px;
  border-radius: 8px 8px 0 0;
}

.phone-battery {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 22px;
  height: 11px;
  border: 1.8px solid currentColor;
  border-radius: 3px;
  padding: 1px;
}

.phone-battery::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 3px;
  width: 2px;
  height: 5px;
  border-radius: 0 2px 2px 0;
  background: currentColor;
}

.phone-battery span {
  display: block;
  width: 70%;
  height: 100%;
  border-radius: 1px;
  background: currentColor;
}

.phone-live iframe {
  width: 100%;
  flex: 1;
  min-height: 0;
  border: 0;
  display: block;
}

/* миниатюра на мобильных: тот же корпус, меньше */
.phone-mini {
  position: relative;
  width: min(240px, 64%);
  padding: 18px 8px 12px;
  border: 0;
  border-radius: 32px;
  background: #1a2422;
  cursor: pointer;
  box-shadow: 0 26px 60px -26px rgba(16, 35, 54, 0.48);
  font-family: inherit;
}

.phone-mini::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.phone-mini img { opacity: 0.6; border-radius: 20px; }

.phone-mini-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #007d92 0%, #00bfd3 100%);
  color: #ffffff;
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--r-ui);
  padding: 12px 20px;
  white-space: nowrap;
  box-shadow: 0 12px 28px -8px rgba(0, 191, 211, 0.55);
}

/* режим выбирается скриптом по ширине экрана при загрузке.
   В мини-режиме прячем ВЕСЬ корпус (иначе пустая рамка шириной 462px
   вылезает за экран телефона и ломает вертикальную прокрутку). */
.hero-demo .phone-mini { display: none; }
.hero-demo.mode-mini .phone-chassis { display: none; }
.hero-demo.mode-mini .phone-mini { display: block; }

/* ---------- полноэкранный оверлей демо (мобильные) ---------- */

.demo-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.demo-overlay[hidden] { display: none; }

.demo-overlay-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.demo-overlay-title { font-weight: 600; font-size: 15px; }

.demo-overlay-body { flex: 1; min-height: 0; }

.demo-overlay-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.hero-footnote {
  position: relative;
  z-index: 2;
  margin-top: 20px;
  font-size: 14px;
  color: var(--faint);
}

/* рукописная стрелка-акцент от текста к живому демо */
.hero-arrow {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 26px;
  color: var(--accent-deep);
}

.hero-arrow-note {
  font-family: "Caveat", cursive;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  transform: rotate(-3deg);
  max-width: 11em;
}

.hero-arrow-img {
  display: block;
  width: 104px;
  height: 109px;
  flex-shrink: 0;
  margin-top: -4px;
  transform: rotate(-40deg);
  background: currentColor;
  -webkit-mask: url("arrow.webp") center / contain no-repeat;
  mask: url("arrow.webp") center / contain no-repeat;
}

/* Десктоп: маскот крупный, лежит по низу hero и «выглядывает» из-за
   телефона - его правый край (хвост) уходит под корпус демо, который
   стоит выше по z-index. На мобильном (медиазапрос ниже) возвращается
   в поток между текстом и демо. */
.hero-mascot {
  position: absolute;
  left: clamp(40px, 8vw, 120px);
  bottom: -24px;
  z-index: 1;
  width: clamp(430px, 56vw, 760px);
  max-width: none;
  height: auto;
  filter: drop-shadow(0 18px 28px rgba(16, 35, 54, 0.18));
  pointer-events: none;
}

/* ---------- секции ---------- */

.section { padding: 104px 0 0; }

.sec-intro { max-width: 620px; margin-bottom: 44px; }

.sec-intro h2 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 12px; }

.sec-intro p { color: var(--muted); font-size: 17px; }

/* ---------- зачем приложение ---------- */

.why-grid {
  display: grid;
  grid-template-columns: 7fr 4fr;
  gap: 56px;
  align-items: start;
}

.why-col { display: flex; flex-direction: column; gap: 30px; }

.why-item h3 { font-size: 19px; margin-bottom: 7px; }

.why-item p { color: var(--muted); font-size: 15.5px; max-width: 36em; }

.why-sources {
  font-size: 13.5px;
  color: var(--faint);
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.why-sources a { color: var(--accent-deep); }

.why-phone { margin: 0; }

.why-phone img {
  width: min(280px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  background: var(--surface);
}

.why-phone figcaption {
  margin-top: 14px;
  font-size: 14.5px;
  color: var(--muted);
  text-align: center;
}

/* ---------- CRM: скрин на всю ширину ---------- */

.crm-shot img {
  border: 1px solid var(--line);
  border-radius: var(--r-box);
  box-shadow: var(--shadow-soft);
}

.crm-grid-after { margin-top: 32px; }

/* ---------- CRM ---------- */

.crm-grid {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: 56px;
  align-items: start;
}

.crm-head h2 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 12px; }

.crm-head p { color: var(--muted); font-size: 17px; }

.crm-note {
  margin-top: 18px;
  padding: 14px 18px;
  background: var(--accent-soft);
  border-radius: var(--r-box);
  color: var(--accent-deep) !important;
  font-size: 15.5px !important;
}

.crm-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 28px;
  padding-top: 6px;
}

.crm-list li {
  color: var(--muted);
  font-size: 15.5px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ---------- API ---------- */

.api-grid {
  display: grid;
  grid-template-columns: 6fr 5fr;
  gap: 56px;
  align-items: center;
}

.api-copy h2 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 12px; }

.api-copy > p { color: var(--muted); font-size: 17px; margin-bottom: 18px; }

.plain-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }

.plain-list li {
  color: var(--muted);
  font-size: 15.5px;
  padding-left: 18px;
  position: relative;
}

.plain-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 7px;
  height: 2px;
  background: var(--accent);
}

.api-code {
  background: var(--code-bg);
  border-radius: var(--r-box);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.api-code-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(216, 248, 251, 0.14);
  color: var(--code-ink);
  font-size: 13px;
}

.api-ok { color: #7fd8b0; }

.api-code pre {
  padding: 18px;
  color: var(--code-ink);
  font-size: 13.5px;
  line-height: 1.7;
  overflow-x: auto;
}

.api-events {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(216, 248, 251, 0.14);
}

.api-events span {
  color: rgba(216, 248, 251, 0.75);
  font-size: 13.5px;
  padding-left: 16px;
  position: relative;
}

.api-events span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 7px;
  height: 2px;
  background: #7fd8b0;
}

/* ---------- CRM: приглашение к демо ---------- */

.crm-demo-ask {
  margin-top: 14px;
  color: var(--muted);
  font-size: 15.5px;
}

.crm-demo-ask a { color: var(--accent-deep); font-weight: 600; }

/* ---------- процесс ---------- */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 36px;
}

.step h3 { font-size: 19px; margin-bottom: 8px; }

.step p { color: var(--muted); font-size: 15px; margin-bottom: 10px; }

.step-when { font-size: 13.5px; color: var(--faint); }

/* ---------- тарифы ---------- */

.price-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}

.price-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-box);
  padding: 28px 26px;
}

.price-card-main { border-color: var(--accent); box-shadow: var(--shadow-soft); }

.price-tag {
  position: absolute;
  top: -11px;
  left: 26px;
  background: linear-gradient(135deg, #007d92 0%, #00bfd3 100%);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 7px;
  padding: 2px 10px;
}

.price-card h3 { font-size: 20px; }

.price-for { color: var(--faint); font-size: 14px; margin: 4px 0 18px; }

.price-value { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }

.price-term { color: var(--muted); font-size: 14px; margin: 2px 0 18px; }

.price-card ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }

.price-card li {
  color: var(--muted);
  font-size: 14.5px;
  padding-left: 16px;
  position: relative;
}

.price-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 7px;
  height: 2px;
  background: var(--accent);
}

.price-after {
  margin-top: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.price-after p { color: var(--faint); font-size: 14.5px; max-width: 40em; }

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

.faq-grid {
  display: grid;
  grid-template-columns: 4fr 7fr;
  gap: 56px;
  align-items: start;
}

.faq-grid h2 { font-size: clamp(26px, 3vw, 36px); }

.faq-items { display: flex; flex-direction: column; }

.faq-items details { border-bottom: 1px solid var(--line); }

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

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

.faq-items summary::after {
  content: "+";
  font-family: var(--mono);
  font-size: 18px;
  color: var(--accent);
  transition: transform .2s ease;
  flex-shrink: 0;
}

.faq-items details[open] summary::after { transform: rotate(45deg); }

.faq-items details p {
  padding: 0 2px 18px;
  color: var(--muted);
  font-size: 15.5px;
  max-width: 56em;
}

/* ---------- финальный CTA ---------- */

.closing { padding: 112px 0 96px; }

.closing-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.closing-mascot {
  width: 130px;
  margin-bottom: 22px;
  filter: drop-shadow(0 14px 24px rgba(16, 35, 54, 0.16));
}

.closing h2 { font-size: clamp(28px, 3.4vw, 40px); margin-bottom: 10px; }

.closing p { color: var(--muted); font-size: 17px; margin-bottom: 26px; }

/* ---------- подвал ---------- */

.footer { border-top: 1px solid var(--line); background: var(--surface); }

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr auto;
  gap: 32px;
  padding-top: 40px;
  padding-bottom: 28px;
}

.footer-brand { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; align-content: start; }

.footer-brand p {
  flex-basis: 100%;
  color: var(--faint);
  font-size: 14px;
  max-width: 30em;
  margin-top: 6px;
}

.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; padding-top: 4px; }

.footer-links a, .footer-contact a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14.5px;
}

.footer-links a:hover, .footer-contact a:hover { color: var(--ink); }

.footer-contact { padding-top: 4px; }

.footer-base {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  padding-bottom: 20px;
  color: var(--faint);
  font-size: 13px;
}

/* ---------- тех-страница ---------- */

.tech-hero { padding: 64px 0 0; }

.tech-hero h1 { font-size: clamp(30px, 3.4vw, 42px); font-weight: 800; margin-bottom: 14px; }

.tech-hero .hero-sub a { color: var(--accent-deep); }

.tech-section { padding-top: 64px; }

.tech-section h2 { font-size: clamp(22px, 2.4vw, 30px); margin-bottom: 18px; }

.tech-list { gap: 14px; }

.tech-closing { padding: 88px 0 72px; }

.footer-inline-link { color: var(--muted); }

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

@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-phones { justify-content: flex-start; }
  .hero-mascot { display: none; }
  /* демо ниже текста: стрелка смотрит вниз */
  .hero-arrow-note { font-size: 30px; }
  .hero-arrow-img { transform: none; margin-top: 0; width: 72px; height: 76px; }
  .why-grid { grid-template-columns: 1fr; gap: 36px; }
  .crm-grid, .api-grid, .faq-grid { grid-template-columns: 1fr; gap: 32px; }
  .api-code { order: 2; }
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .price-grid { grid-template-columns: 1fr; max-width: 540px; }
  .price-card-main { order: -1; }
}

@media (max-width: 760px) {
  .nav-links, .topbar .btn-compact { display: none; }
  .nav-toggle { display: flex; }

  .nav-sheet:not([hidden]) {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 24px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }

  .nav-sheet a {
    text-decoration: none;
    font-weight: 500;
    padding: 12px 2px;
    border-bottom: 1px solid var(--line);
  }

  .nav-sheet a:last-child { border-bottom: 0; margin-top: 10px; }

  .hero { padding-top: 40px; }
  .section { padding-top: 72px; }
  .demo-band { margin-top: 72px; }

  .crm-list { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; gap: 26px; }
  .closing { padding: 80px 0 72px; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 460px) {
  .hero-actions .btn { flex: 1; }
  .price-after { flex-direction: column; align-items: flex-start; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .faq-items summary::after { transition: none; }
}
