/* ============================================================
   Delevoper — дизайн-система сайта студии
   Тёмная тема по умолчанию, светлая через [data-theme="light"]
   Без внешних зависимостей: системные шрифты, inline SVG.
   ============================================================ */

:root {
  /* Акцент (бренд СМАРТСОФТ: зелёный) */
  --accent: #22c55e;
  --accent-strong: #16a34a;
  --accent-soft: rgba(34, 197, 94, 0.12);
  --accent-glow: rgba(34, 197, 94, 0.35);
  --gold: #f5c044;
  --grad-mid: #34d399;

  /* Тёмная тема (default) */
  --bg: #0a0f1a;
  --bg-2: #0f1626;
  --bg-3: #141d30;
  --card: #111a2c;
  --card-hover: #16223a;
  --border: #22304d;
  --border-strong: #2f4065;
  --text: #e8eefb;
  --text-2: #a9b7d4;
  --text-3: #7b8cab;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --header-bg: rgba(10, 15, 26, 0.85);

  --radius: 14px;
  --radius-lg: 20px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans",
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --maxw: 1160px;
}

[data-theme="light"] {
  --bg: #f7f9fc;
  --bg-2: #ffffff;
  --bg-3: #eef2f9;
  --card: #ffffff;
  --card-hover: #f4f7fc;
  --border: #dde4f0;
  --border-strong: #c3cede;
  --text: #0f172a;
  --text-2: #43506b;
  --text-3: #6b7893;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  --header-bg: rgba(247, 249, 252, 0.9);
  /* В светлой теме акцент темнее: контраст текста ≥ 4.5:1 (WCAG AA) */
  --accent: #15803d;
  --accent-soft: rgba(21, 128, 61, 0.09);
  --accent-glow: rgba(21, 128, 61, 0.22);
  --gold: #b45309;
  --grad-mid: #0d9488;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- Шапка ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; height: 68px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 700; font-size: 1.22rem;
  letter-spacing: -0.01em; text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 34px; height: 34px; flex: none;
  background: linear-gradient(135deg, var(--accent), #0d9488);
  border-radius: 9px;
  display: grid; place-items: center;
  color: #06210f; font-weight: 800; font-size: 1.05rem;
}
.logo-mark span { transform: translateY(-1px); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--text-2); text-decoration: none;
  padding: 8px 12px; border-radius: 8px; font-size: 0.95rem;
  transition: color 0.15s, background 0.15s;
}
.nav a:hover { color: var(--text); background: var(--bg-3); text-decoration: none; }
.nav a.active { color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  width: 40px; height: 40px; flex: none;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-2); color: var(--text-2);
  cursor: pointer; display: grid; place-items: center;
  transition: color 0.15s, border-color 0.15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle svg { width: 19px; height: 19px; }
[data-theme="light"] .icon-sun { display: none; }
:root:not([data-theme="light"]) .icon-moon { display: none; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 11px;
  font-weight: 600; font-size: 1rem; line-height: 1.2;
  cursor: pointer; border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}
.btn-primary {
  background: var(--accent); color: #052512;
  box-shadow: 0 6px 20px var(--accent-glow);
}
.btn-primary:hover { background: #2fd46c; }
.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 16px 30px; font-size: 1.06rem; border-radius: 13px; }
.btn-sm { padding: 9px 16px; font-size: 0.92rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 84px 0 72px;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(620px 340px at 78% 12%, var(--accent-soft), transparent 65%),
    radial-gradient(520px 300px at 12% 85%, rgba(13, 148, 136, 0.1), transparent 65%);
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: flex-start; }
.hero-visual { padding-top: 6px; }
.nowrap { white-space: nowrap; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-2); color: var(--text-2);
  font-size: 0.86rem; margin-bottom: 22px;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }

.hero h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.55rem);
  line-height: 1.16; letter-spacing: -0.02em; font-weight: 800;
  margin-bottom: 16px; max-width: 620px;
}
.hero h1 .grad {
  background: linear-gradient(92deg, var(--accent), var(--grad-mid) 60%, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  color: var(--text-2); font-size: 1.05rem; max-width: 540px; margin-bottom: 26px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.hero-notes {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  color: var(--text-2); font-size: 0.92rem;
}
.hero-notes .note { display: flex; align-items: center; gap: 7px; }
.hero-notes svg { width: 15px; height: 15px; color: var(--text-3); flex: none; }

/* Карточка-витрина справа в hero */
.hero-visual { position: relative; }
.stack {
  position: relative; display: grid; gap: 14px;
  padding: 24px; border-radius: var(--radius-lg);
  background: var(--card); border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.stack-row { display: flex; align-items: center; gap: 12px; }
.stack-ic {
  width: 42px; height: 42px; flex: none; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.stack-ic svg { width: 21px; height: 21px; }
.stack-row b { display: block; font-size: 0.98rem; }
.stack-row span { display: block; color: var(--text-3); font-size: 0.85rem; }
.stack .chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip {
  font-size: 0.8rem; padding: 4px 11px; border-radius: 999px;
  border: 1px solid transparent; color: var(--text-2);
  background: var(--bg-3);
}

/* ---------- Секции ---------- */
.section { padding: 68px 0; }
.section.alt { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow {
  display: inline-block; font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}
.section-head h2 {
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  line-height: 1.2; letter-spacing: -0.015em; font-weight: 800;
  margin-bottom: 14px;
}
.section-head p { color: var(--text-2); font-size: 1.05rem; }

/* Сетки карточек */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
  display: flex; flex-direction: column; gap: 10px;
}
.card:hover { transform: translateY(-3px); border-color: var(--border-strong); background: var(--card-hover); }
.card-ic {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; margin-bottom: 4px;
}
.card-ic svg { width: 23px; height: 23px; }
.card h3 { font-size: 1.12rem; font-weight: 700; letter-spacing: -0.01em; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p { color: var(--text-2); font-size: 0.95rem; }
.card .price { margin-top: auto; padding-top: 12px; font-weight: 800; color: var(--accent); font-size: 1.22rem; letter-spacing: -0.01em; }
.card .term { color: var(--text-3); font-size: 0.85rem; margin-top: -6px; padding-bottom: 6px; }
.card .link-more { margin-top: 8px; font-size: 0.92rem; font-weight: 600; }
.card .card-cta { margin-top: 10px; }
.card { position: relative; }
.badge-hit {
  position: absolute; top: 16px; right: 16px;
  background: var(--accent); color: #052512;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
}

/* Боли (problems) */
.problem {
  display: flex; gap: 14px; padding: 18px 20px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.problem .x {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  background: rgba(244, 63, 94, 0.12); color: #f87171;
  display: grid; place-items: center; font-weight: 800; font-size: 1.05rem;
}
.problem p { color: var(--text-2); font-size: 0.98rem; }
.problem b { color: var(--text); }

/* Преимущества-метрики */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.metric {
  text-align: center; padding: 26px 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
}
.metric .num {
  font-size: 2rem; font-weight: 800; letter-spacing: -0.02em;
  background: linear-gradient(92deg, var(--accent), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.metric .lbl { color: var(--text-2); font-size: 0.9rem; margin-top: 4px; }

/* Кейсы */
.case {
  overflow: hidden; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); transition: transform 0.2s, border-color 0.2s;
}
.case:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.case-thumb {
  height: 150px; position: relative; overflow: hidden;
  display: grid; place-items: center;
}
.case-thumb .thumb-name {
  color: rgba(255, 255, 255, 0.92); font-weight: 800; font-size: 1.25rem;
  letter-spacing: -0.01em; z-index: 1; padding: 0 18px; text-align: center;
}
.case-thumb .thumb-tag {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em;
  padding: 4px 9px; border-radius: 999px; text-transform: uppercase;
  background: rgba(5, 37, 18, 0.75); color: #4ade80;
}
.case-thumb .thumb-tag.dev { background: rgba(37, 50, 80, 0.8); color: #93c5fd; }
.case-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.case-body h3 { font-size: 1.05rem; font-weight: 700; }
.case-body p { color: var(--text-2); font-size: 0.92rem; flex: 1; }
.case-body .case-link { font-size: 0.9rem; font-weight: 600; }
.case-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.case-meta .chip { font-size: 0.74rem; }

/* Градиенты миниатюр кейсов */
.g-patient   { background: linear-gradient(135deg, #0e7490, #065f46); }
.g-earnflow  { background: linear-gradient(135deg, #7c3aed, #2563eb); }
.g-skyai     { background: linear-gradient(135deg, #be185d, #7c3aed); }
.g-gsk       { background: linear-gradient(135deg, #b45309, #78350f); }
.g-shop      { background: linear-gradient(135deg, #0369a1, #0f172a); }
.g-corp      { background: linear-gradient(135deg, #166534, #052e16); }

/* Процесс */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: step; }
.step {
  position: relative; padding: 24px 20px 20px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
}
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-family: var(--mono); font-weight: 800; font-size: 1.6rem;
  color: transparent; -webkit-text-stroke: 1.4px var(--accent);
  display: block; margin-bottom: 10px;
}
.step h3 { font-size: 1.02rem; margin-bottom: 6px; }
.step p { color: var(--text-2); font-size: 0.9rem; }

/* FAQ */
.faq { max-width: 820px; margin: 0 auto; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; background: var(--card); }
.faq-q {
  width: 100%; text-align: left; cursor: pointer;
  background: none; border: none; color: var(--text);
  font-family: inherit; font-size: 1.02rem; font-weight: 600;
  padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; gap: 14px;
}
.faq-q .chev { flex: none; width: 18px; height: 18px; color: var(--text-3); transition: transform 0.2s; }
.faq-item.open .chev { transform: rotate(180deg); color: var(--accent); }
.faq-a { display: none; padding: 0 20px 18px; color: var(--text-2); font-size: 0.96rem; }
.faq-item.open .faq-a { display: block; }

/* Финальный CTA */
.cta-panel {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg); padding: 52px 40px; text-align: center;
  background: linear-gradient(135deg, #0c2b18, #052512 55%, #123b2e);
  border: 1px solid rgba(34, 197, 94, 0.35);
}
[data-theme="light"] .cta-panel { background: linear-gradient(135deg, #eafaf0, #d9f5e4); }
.cta-panel h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -0.015em; margin-bottom: 12px; }
.cta-panel p { color: var(--text-2); max-width: 560px; margin: 0 auto 26px; font-size: 1.05rem; }
.cta-panel .hero-cta { justify-content: center; margin-bottom: 16px; }
.cta-panel .cta-note { color: var(--text-3); font-size: 0.88rem; }

/* Контакты */
.contacts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.contact {
  padding: 22px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--border);
  text-align: center; text-decoration: none; color: var(--text);
  transition: transform 0.2s, border-color 0.2s;
}
.contact:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.contact .contact-ic {
  width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
}
.contact .contact-ic svg { width: 21px; height: 21px; }
.contact b { display: block; font-size: 1rem; }
.contact span { display: block; color: var(--text-3); font-size: 0.88rem; margin-top: 3px; }

/* ---------- Футер ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 52px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 34px; padding-bottom: 36px; }
.footer h4 { font-size: 0.95rem; margin-bottom: 14px; letter-spacing: 0.02em; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 9px; }
.footer ul a { color: var(--text-2); font-size: 0.92rem; }
.footer ul a:hover { color: var(--accent); }
.footer .about { color: var(--text-2); font-size: 0.92rem; max-width: 320px; margin-top: 12px; }
.footer .requisites { color: var(--text-3); font-size: 0.83rem; line-height: 1.55; }
.footer-bottom {
  border-top: 1px solid var(--border); padding: 18px 0;
  display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: space-between;
  color: var(--text-3); font-size: 0.84rem;
}

/* ---------- Страница услуги ---------- */
.page-hero { padding: 56px 0 34px; }
.crumbs { font-size: 0.86rem; color: var(--text-3); margin-bottom: 18px; }
.crumbs a { color: var(--text-2); }
.page-hero h1 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 14px; }
.page-hero .lead { color: var(--text-2); font-size: 1.08rem; max-width: 720px; margin-bottom: 26px; }
.includes { list-style: none; display: grid; gap: 10px; }
.includes li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); font-size: 0.97rem; }
.includes svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 4px; }

/* ---------- Утилиты ---------- */
.hc-short { display: none; }

/* Grid/flex-дети не должны распирать родителя (min-width: auto → 0) */
.hero-inner > *, .footer-grid > *, .grid > *, .contacts > *,
.stack-row > div, .steps > *, .metrics > * { min-width: 0; }

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Мобильные ---------- */
@media (max-width: 1020px) {
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero-visual { max-width: 560px; padding-top: 0; }
  .grid-4, .steps { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .contacts { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* Планшеты: бургер-меню + компактная шапка */
@media (min-width: 761px) and (max-width: 900px) {
  .burger {
    width: 40px; height: 40px; border: 1px solid var(--border);
    border-radius: 10px; background: var(--bg-2); color: var(--text);
    cursor: pointer; display: grid; place-items: center;
  }
  .burger svg { width: 20px; height: 20px; }
  .nav {
    position: fixed; top: 68px; left: 0; right: 0; z-index: 40;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg-2); border-bottom: 1px solid var(--border);
    padding: 12px 16px 16px; display: none;
    box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; font-size: 1.02rem; }
  .header-cta .btn { padding: 8px 12px; font-size: 0.88rem; }
  .header-cta .hc-full { display: none; }
  .header-cta .hc-short { display: inline; }
  .header-inner { gap: 8px; }
  .header-actions { gap: 6px; }
  .logo { font-size: 1.12rem; }
}

@media (min-width: 901px) {
  .burger { display: none; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .header-inner { height: 62px; gap: 8px; }
  .header-actions { gap: 6px; }
  .logo { font-size: 1.12rem; }
  .nav {
    position: fixed; top: 62px; left: 0; right: 0; z-index: 40;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg-2); border-bottom: 1px solid var(--border);
    padding: 12px 16px 16px; display: none;
    box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; font-size: 1.02rem; }
  .burger {
    width: 40px; height: 40px; border: 1px solid var(--border);
    border-radius: 10px; background: var(--bg-2); color: var(--text);
    cursor: pointer; display: grid; place-items: center;
  }
  .burger svg { width: 20px; height: 20px; }
  .header-cta .btn { padding: 8px 12px; font-size: 0.88rem; }
  .header-cta .hc-full { display: none; }
  .header-cta .hc-short { display: inline; }
  .hero { padding: 40px 0 48px; }
  .hero-sub { font-size: 1rem; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .hero-cta .btn-ghost { padding: 12px 20px; font-size: 0.95rem; }
  .cta-panel .hero-cta { flex-direction: row; flex-wrap: wrap; }
  .cta-panel .hero-cta .btn { width: auto; flex: 1 1 220px; }
  .section { padding: 52px 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .cta-panel { padding: 36px 22px; }
  .hero-visual { max-width: 100%; }
}

@media (max-width: 480px) {
  .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid-4 { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
}
