/* DDMail — информационный сайт. Системные шрифты, без внешних ресурсов. */
:root {
  --bg: #ffffff;
  --bg-soft: #f4f4f8;
  --card: #ffffff;
  --fg: #171a33;
  --muted: #5f6380;
  --line: #e3e4ee;
  --accent: #282e6c;
  --accent-ink: #ffffff;
  --accent-soft: #e8e9f5;
  --code: #efeff6;
  --shadow: 0 1px 2px rgba(23, 26, 51, .06), 0 8px 24px rgba(23, 26, 51, .07);
  --radius: 16px;
  --wrap: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1124;
    --bg-soft: #151831;
    --card: #1a1d3a;
    --fg: #ecedf7;
    --muted: #a2a6c6;
    --line: #2a2e52;
    --accent: #a9b1ff;
    --accent-ink: #0f1124;
    --accent-soft: #23285a;
    --code: #20244a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0f1124;
    --bg-soft: #151831;
    --card: #1a1d3a;
    --fg: #ecedf7;
    --muted: #a2a6c6;
    --line: #2a2e52;
    --accent: #a9b1ff;
    --accent-ink: #0f1124;
    --accent-soft: #23285a;
    --code: #20244a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(32px, 5vw, 52px); }
h2 { font-size: clamp(24px, 3.2vw, 34px); }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }
code, kbd {
  font: .9em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--code);
  border-radius: 6px;
  padding: .1em .35em;
  overflow-wrap: anywhere;
}
pre {
  background: var(--code);
  border-radius: 12px;
  padding: 14px 16px;
  overflow-x: auto;
  font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
pre code { background: none; padding: 0; }
.muted { color: var(--muted); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 780px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--card); padding: 8px 12px; border-radius: 8px; }

/* Шапка */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-weight: 700; font-size: 19px; }
.logo img { border-radius: 8px; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a:not(.btn) { color: var(--fg); text-decoration: none; padding: 8px 12px; border-radius: 10px; }
.nav a:not(.btn):hover { background: var(--bg-soft); }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.nav .btn { margin-left: 8px; }
.menu-btn { display: none; }
@media (max-width: 820px) {
  .js .menu-btn {
    display: inline-block; margin-left: auto;
    background: var(--bg-soft); color: var(--fg); border: 1px solid var(--line);
    border-radius: 10px; padding: 8px 14px; font: inherit; cursor: pointer;
  }
  .nav { flex-wrap: wrap; }
  .js .nav { display: none; }
  .js .nav.open {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; left: 0; right: 0; top: 64px;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px;
  }
  .js .nav.open .btn { margin: 8px 0 0; text-align: center; }
}

/* Кнопки */
.btn {
  display: inline-block; text-decoration: none; font-weight: 600;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 12px; padding: 14px 22px; line-height: 1.2;
}
.btn:hover { filter: brightness(1.06); }
.btn-small { padding: 9px 14px; font-size: 15px; }
.btn-ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* Секции */
section { padding: clamp(48px, 8vw, 96px) 0; }
.soft { background: var(--bg-soft); }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }
.lead { font-size: clamp(18px, 2vw, 21px); color: var(--muted); max-width: 640px; }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* Первый экран */
.hero { padding-top: clamp(40px, 7vw, 80px); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero h1 span { color: var(--accent); }
.hero .note { font-size: 15px; margin-top: 14px; }
.phones { position: relative; display: flex; justify-content: center; align-items: flex-start; gap: 0; }
.phone {
  width: 260px; border-radius: 34px; padding: 10px; background: #12142a;
  box-shadow: 0 30px 60px rgba(23, 26, 51, .28);
}
.phone img { display: block; border-radius: 26px; }
.phones .phone + .phone { margin-left: -70px; margin-top: 70px; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .phone { width: 200px; }
  .phones .phone + .phone { margin-left: -50px; margin-top: 50px; }
}

/* Карточки возможностей */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card h3 { margin-top: 6px; }
.card p:last-child { margin-bottom: 0; }
.icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.icon svg { width: 24px; height: 24px; }
a.card { color: inherit; text-decoration: none; display: block; }
a.card:hover { border-color: var(--accent); }

/* Ряд «картинка + текст» */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split.rev > :first-child { order: 2; }
.split .phone { margin: 0 auto; }
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; gap: 32px; }
  .split.rev > :first-child { order: 0; }
}
.checks { list-style: none; padding: 0; margin: 0 0 1em; }
.checks li { position: relative; padding-left: 30px; margin-bottom: 10px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: .45em; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23282e6c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/12px no-repeat;
}

/* Шаги */
.steps { counter-reset: step; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.steps .card::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; margin-bottom: 12px;
}

/* Магазины приложений */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: inline-flex; flex-direction: column; justify-content: center; min-width: 150px;
  padding: 10px 18px; border-radius: 12px; text-decoration: none;
  background: var(--fg); color: var(--bg);
}
.store-sub { font-size: 12px; opacity: .8; line-height: 1.2; }
.store-name { font-size: 18px; font-weight: 700; line-height: 1.3; }
.store-soon { background: var(--bg-soft); color: var(--muted); border: 1px dashed var(--line); }

/* Галерея скриншотов */
.shots { display: flex; gap: 20px; overflow-x: auto; padding: 8px 4px 20px; scroll-snap-type: x mandatory; }
.shots figure { margin: 0; flex: 0 0 220px; scroll-snap-align: start; }
.shots img { border-radius: 22px; border: 1px solid var(--line); display: block; }
.shots figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; text-align: center; }

/* Финальный призыв */
.cta {
  background: linear-gradient(135deg, #282e6c 0%, #3d448f 100%);
  color: #fff; border-radius: 24px; padding: clamp(32px, 6vw, 56px);
}
.cta h2 { color: #fff; }
.cta p { color: rgba(255, 255, 255, .9); }
.cta .btn { background: #f9f8f4; color: #282e6c; }

/* Документация */
.doc { padding: 40px 0 80px; }
.doc h1 { font-size: clamp(30px, 4vw, 40px); }
.doc h2 { font-size: 24px; margin-top: 2em; scroll-margin-top: 80px; }
.doc h3 { margin-top: 1.5em; scroll-margin-top: 80px; }
.doc li { margin-bottom: .4em; }
.crumbs { font-size: 15px; color: var(--muted); margin-bottom: 16px; }
.crumbs a { color: var(--muted); }
.table-wrap { overflow-x: auto; margin: 0 0 1.2em; }
table { border-collapse: collapse; width: 100%; font-size: 16px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 14px; }
.callout {
  border-left: 4px solid var(--accent); background: var(--accent-soft);
  padding: 14px 18px; border-radius: 0 12px 12px 0; margin: 1.2em 0;
}
.callout p:last-child { margin: 0; }
.toc { background: var(--bg-soft); border-radius: 12px; padding: 16px 20px; margin: 0 0 2em; }
.toc ol { margin: 0; padding-left: 20px; }

/* FAQ */
details {
  border: 1px solid var(--line); border-radius: 14px; background: var(--card);
  padding: 0 20px; margin-bottom: 12px;
}
summary {
  cursor: pointer; list-style: none; font-weight: 600; padding: 18px 28px 18px 0; position: relative;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 0; top: 14px; font-size: 24px; color: var(--accent); font-weight: 400; }
details[open] summary::after { content: "−"; }
details > :not(summary) { margin-top: 0; }
details > :last-child { margin-bottom: 18px; }
.faq-group { margin-top: 2.2em; }

/* Подвал */
.foot { border-top: 1px solid var(--line); padding: 48px 0 32px; background: var(--bg-soft); }
.foot-grid { display: grid; gap: 32px; grid-template-columns: 1.4fr 1fr 1.3fr 1fr; }
.foot-grid > div > a:not(.logo) { display: block; color: var(--fg); text-decoration: none; margin-bottom: 8px; font-size: 15px; }
.foot-grid > div > a:not(.logo):hover { color: var(--accent); }
.foot-h { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.foot-bottom { margin-top: 32px; font-size: 14px; }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .foot-grid { grid-template-columns: 1fr; } }
