/* Тема siptelefoniya.ru — «бумажная топографическая карта».
   Сайт про SIP без привязки к месту, поэтому и дизайн — как полевая карта:
   кремовая топобумага с едва заметными контурными линиями, рамки с двойной
   линией, штриховые маршруты вместо сплошных акцентов, ромбы-точки маршрута
   у заголовков карточек, секции нумеруются «квадратами координатной сетки»,
   под лидом героя — масштабная линейка (scale bar), как на настоящей карте.
   Финальный блок — ночная карта: глубокий чернильно-синий с контурными
   кольцами на фоне и «бумажной» кнопкой.
   Палитра — картографический синий #3d6a8f (ни у кого нет) на тёплой
   кремовой топобумаге; чернила с тёплым подмесом.
   Шрифт заголовков — Iowan Old Style / Constantia / Cambria (у соседей
   Georgia/Palatino/Optima/Baskerville/моно/Verdana/Trebuchet/Futura/Didot/
   Gill Sans/Franklin Gothic/Clarendon/системный гротеск — таких нет).
   Никаких «объектных» мотивов соседей (шильдик, протокол, коммутатор,
   календарь, картотека, софтфон-плитки) — только картографический язык:
   контуры, сетка, штрихи, масштаб, компас-ромбы. */

:root {
  --font-head: "Iowan Old Style", "Palatino Linotype", Constantia, Cambria, serif;
  --bg: #f7f2e6;             /* топобумага, крем */
  --bg-alt: #efe7d2;         /* другой слой бумаги */
  --card: #fffcf3;           /* лист легенды */
  --line: #ddd2b6;           /* карандашная сетка */
  --ink: #26241c;            /* тёплые картографические чернила */
  --muted-ink: #6e6650;
  --radius: 4px;             /* острые рамки карты */
  --tint: #e3e0e8;           /* лёгкая заливка слоя */
  --deep: #24303e;           /* ночная карта */
  --shadow: 0 1px 0 rgba(38, 36, 28, 0.06);
}

/* Заголовки: карта набрана книгой — засечки, спокойный вес */
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: 0; }
h1 { line-height: 1.2; }
h2 { line-height: 1.26; }
h3 { font-size: 18px; }

::selection { background: color-mix(in srgb, var(--accent) 22%, var(--bg)); }
:focus-visible { outline: 2px dashed var(--accent); outline-offset: 2px; }

/* Шапка: рамка карты сверху + линейка делений под ней */
.topbar {
  background: var(--card);
  border-bottom: 3px double var(--ink);
  box-shadow: none;
}
.topbar .wrap { height: 58px; }
.topbar::after {
  content: "";
  display: block;
  height: 7px;
  background: repeating-linear-gradient(90deg,
    color-mix(in srgb, var(--ink) 42%, transparent) 0 1px,
    transparent 1px 14px);
}
.brand { font-family: var(--font-head); font-size: 19px; letter-spacing: 0.01em; }
.brand::before {
  content: "◆";
  margin-right: 9px;
  color: var(--accent);
  font-size: 14px;
  vertical-align: 0.1em;
}
.nav a { font-family: var(--font-head); font-size: 14.5px; }
.nav a:hover { text-decoration: none; color: var(--accent-dark); }

/* Кнопки: компасный ромб-стрелка, острые углы */
.btn {
  border-radius: 3px;
  font-family: var(--font-head);
  letter-spacing: 0.02em;
  box-shadow: var(--shadow);
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn:hover { transform: translate(0, -1px); }
.btn::after {
  content: " \00a0→";
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
}
.btn-sm::after { content: ""; }
.btn-sm { border-radius: 3px; }

/* Hero: полевой планшет с контурными линиями рельефа */
.hero {
  padding: 56px 0 50px;
  background-image:
    repeating-radial-gradient(circle at 108% -18%,
      transparent 0 46px,
      color-mix(in srgb, var(--accent) 7%, transparent) 46px 47px,
      transparent 47px 92px),
    repeating-radial-gradient(circle at -12% 118%,
      transparent 0 56px,
      color-mix(in srgb, var(--accent) 5%, transparent) 56px 57px,
      transparent 57px 118px);
}
.hero .wrap { border-left: 0; padding-left: 22px; }
.hero h1 { max-width: 22em; }
.hero .lead { max-width: 36em; }

/* Масштабная линейка под лидом — как на бумажной карте */
.hero .lead::after {
  content: "";
  display: block;
  width: 176px;
  height: 6px;
  margin-top: 18px;
  border: 1px solid var(--ink);
  background: repeating-linear-gradient(90deg,
    var(--ink) 0 22px, var(--card) 22px 44px);
}

/* Примечание героя: штриховая «маршрутная легенда» с точкой начала */
.hero-note {
  display: inline-block;
  margin-top: 22px;
  padding: 8px 14px;
  border: 1px dashed var(--ink);
  border-radius: 2px;
  background: color-mix(in srgb, var(--card) 72%, transparent);
  font-size: 13px;
  color: var(--muted-ink);
}
.hero-note::before {
  content: "◎ ";
  color: var(--accent);
}

/* Секции: номера — квадраты координатной сетки */
section.sec { padding: 48px 0 44px; }
section.sec h2::before {
  content: counter(sec, decimal-leading-zero);
  display: inline-block;
  margin-right: 11px;
  width: 1.75em;
  height: 1.55em;
  background: var(--accent);
  color: #f6f1e3;
  border-radius: 2px;
  text-align: center;
  line-height: 1.55em;
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.5em;
  font-weight: 700;
  letter-spacing: 0.08em;
  vertical-align: 0.4em;
}

/* Карточки: листы легенды; ромб-точка маршрута у заголовка */
.cards { gap: 15px; margin: 20px 0; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 17px 19px;
  transition: border-color 0.15s ease;
}
.card:hover { border-color: var(--accent); }
.card h3::before {
  content: "◆ ";
  color: var(--accent);
  font-size: 12px;
  vertical-align: 0.22em;
  margin-right: 2px;
}
.card p { font-size: 15.5px; color: color-mix(in srgb, var(--ink) 86%, var(--bg)); }

/* Отзывы: заметки на полях карты — штриховая линия маршрута */
.card.quote {
  border-left: 3px dashed var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--card));
}
.card.quote::before { content: none; }
.card.quote h3::before { content: none; }
.card.quote p:first-child { font-family: var(--font-head); font-size: 16px; }
.card.quote p:first-child::before {
  content: "«";
  color: var(--accent);
}
.card.quote .muted {
  padding-top: 6px;
  border-top: 1px dotted var(--line);
  font-size: 12.5px;
}

/* Чек-лист маршрута: ромбы-точки по пути */
.checks { margin-top: 16px; }
.checks li { padding: 6px 0 6px 28px; }
.checks li::before {
  content: "◆";
  left: 4px;
  top: 6px;
  color: var(--accent);
  font-size: 13px;
}

/* Факты: таблица координат — капители слева, штриховые разделители */
.facts { margin: 18px 0; }
.facts th, .facts td { padding: 12px 4px; border-bottom: 1px dashed var(--line); }
.facts th {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-ink);
}
.facts td { color: var(--ink); font-size: 15.5px; }
.facts tr:last-child th, .facts tr:last-child td { border-bottom: 0; }

/* FAQ: листы разворота атласа, маркер — компасный «+», раскрывается в ромб */
#faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 3px;
  margin: 0 0 9px;
  padding: 0 18px;
}
#faq details summary { padding: 14px 36px 14px 0; font-family: var(--font-head); }
#faq details summary::after {
  content: "+";
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 21px;
  font-weight: 400;
  transition: transform 0.15s ease;
}
#faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
#faq details p { margin: 0 4px 15px; color: var(--muted-ink); }

/* Финальный CTA: ночная карта с контурными кольцами */
section.sec-cta {
  background:
    repeating-radial-gradient(circle at 82% 30%,
      transparent 0 38px,
      rgba(255, 255, 255, 0.05) 38px 39px,
      transparent 39px 84px),
    repeating-radial-gradient(circle at 8% 110%,
      transparent 0 52px,
      rgba(255, 255, 255, 0.04) 52px 53px,
      transparent 53px 112px),
    var(--deep);
  border-top: 3px double rgba(255, 255, 255, 0.55);
  padding: 54px 0;
}
section.sec-cta h2 { color: #f3eee0; }
section.sec-cta p { color: rgba(238, 233, 218, 0.78); max-width: 36em; }
section.sec-cta .btn {
  background: var(--card);
  color: var(--deep);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.5);
}
section.sec-cta .btn:hover { background: #fff; color: var(--accent-dark); }

/* Футер: нижняя кромка карты */
.footer { background: var(--bg-alt); border-top: 3px double var(--ink); }
.footer-brand { font-family: var(--font-head); font-size: 16.5px; }
.footer-brand::before {
  content: "◆ ";
  color: var(--accent);
  font-size: 12px;
}

/* Статьи: хлебные крошки как маршрут со стрелками, CTA-лист со штрихом */
.crumbs { font-family: var(--font-head); font-size: 13.5px; }
.crumbs a::after { content: " →"; color: var(--accent); }
.ctabox {
  border: 1px solid var(--line);
  border-left: 3px dashed var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--card));
  padding: 26px 28px;
}
.ctabox .btn { box-shadow: none; }
.article table th { background: var(--bg-alt); font-family: var(--font-head); }
.article table th, .article table td { border-color: var(--line); }
.article blockquote {
  margin: 18px 0;
  padding: 4px 0 4px 18px;
  border-left: 3px dashed var(--accent);
  color: var(--muted-ink);
}
.related { list-style: none; }
.related li { padding-left: 22px; position: relative; }
.related li::before {
  content: "◆";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-size: 12px;
}

/* Плитки статей на главной: заголовок с картографическим подчёркиванием */
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; text-decoration-style: dotted; }

/* Мобильная адаптация: контуры и пады ужимаются */
@media (max-width: 640px) {
  .hero { padding: 44px 0 40px; background-image: none; }
  section.sec { padding: 38px 0 34px; }
  .card { padding: 15px 16px; }
  .hero .lead::after { width: 132px; }
  section.sec h2::before {
    width: 1.6em;
    height: 1.4em;
    line-height: 1.4em;
    margin-right: 9px;
  }
}
