/* Лендинг «Схемы» — circuits.radiodetali.com
   Статика без сборки и без внешних хостов: сайт работает в РФ, лишний внешний
   хост = лишняя точка отказа. Inter самохостится в /fonts/. Углы всюду прямые —
   это правило бренда, а не вкусовщина. */

@import url(/fonts.css);

:root {
  --brand: #2E3F5C; --brand-dark: #1E2D45;
  --green: #4DB848; --green-dark: #3d9439;
  --orange: #F05A28; --blue: #1E96D1; --blue-dark: #16769f;
  --bg: #F5F6F8; --card: #FFFFFF;
  --text: #1A2332; --muted: #5A6A85; --border: #DDE3EE;
  --on-dark: #C3CDDE; --on-dark-muted: #8FA0BC; --on-dark-faint: #A9B6CC;
  --dark-border: #3d5075; --dark-rule: #33456a;
  --shadow: 0 4px 8px rgba(46,63,92,.06);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--card); color: var(--text);
  font: 400 16px/1.6 Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
h1, h2, h3 { margin: 0; letter-spacing: -.018em; }
p { margin: 0; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 880px; }
.wrap-tight { max-width: 800px; }
.sec { padding: clamp(48px, 6vw, 88px) 0; background: var(--bg); }
.sec-plain { background: var(--card); }
.sec h2 { font-size: clamp(26px, 3vw, 34px); font-weight: 700; margin-bottom: 28px; }

/* Кнопки — прямые углы, без градиентов */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 12px 20px; border: 1px solid transparent;
  font: 600 14px/1 Inter, sans-serif; text-decoration: none; cursor: pointer;
  border-radius: 0;
}
.btn-go { background: var(--green); color: #fff; }
.btn-go:hover { background: var(--green-dark); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--brand); color: var(--brand); }
.btn-ghost:hover { background: var(--brand); color: #fff; }
.btn-lg { min-height: 52px; padding: 16px 28px; font-size: 16px; }
.btn-xl { min-height: 56px; padding: 18px 36px; font-size: 17px; }

.fine { font-size: 13px; color: var(--muted); margin-top: 14px; }
.fine-dark { color: var(--on-dark-faint); }

/* S0. Шапка */
.hdr {
  position: sticky; top: 0; z-index: 50; background: var(--card);
  border-bottom: 1px solid var(--border);
}
.hdr-in { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; }
.brand-home { display: flex; flex: none; }
.brand-name { display: block; text-decoration: none; color: inherit; }
.brand-mark { width: 28px; height: 28px; flex: none; fill: none; stroke: var(--brand); stroke-width: 2.5; }
.brand-mark .brand-node { fill: var(--green); stroke: none; }
.brand-txt b { display: block; font-size: 17px; font-weight: 700; line-height: 1.1; }
.brand-txt small { font-size: 11px; color: var(--muted); }
.brand-txt small a { color: inherit; text-decoration: none; }
.brand-txt small a:hover { color: var(--blue); }
.hdr-nav { margin-left: auto; display: flex; gap: 22px; }
.hdr-nav a { font-size: 14px; color: var(--text); text-decoration: none; }
.hdr-nav a:hover { color: var(--blue); }

/* S1. Первый экран */
.hero { position: relative; overflow: hidden; background: var(--bg); padding: clamp(44px, 6vw, 84px) 0; }
.hero-pat { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .045; }
.hero-pat path { fill: none; stroke: var(--brand); stroke-width: 2; }
.hero-pat circle { fill: var(--brand); }
.hero-in {
  position: relative; display: grid; align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: clamp(32px, 5vw, 64px);
}
.hero h1 { font-size: clamp(32px, 4.4vw, 52px); font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.lead { font-size: 19px; line-height: 1.55; color: var(--muted); margin-top: 18px; max-width: 30em; }
.hero-btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
/* height: auto обязателен. У картинки заданы атрибуты width и height, и пока
   обе величины определены, aspect-ratio не применяется: высота залипала на
   600px, а object-fit срезал схему по бокам — пропадал источник питания. */
.hero-img img {
  display: block; width: 100%; height: auto; aspect-ratio: 3/2; object-fit: contain;
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow);
}

/* S2. Одна фраза */
.oneline { background: var(--card); padding: clamp(36px, 4vw, 56px) 0; }
.oneline p {
  max-width: 940px; margin: 0 auto; text-align: center;
  font-size: clamp(21px, 2.4vw, 28px); font-weight: 500; line-height: 1.4;
}

/* S3. Карточки */
/* Ровно две колонки: карточек четыре, и auto-fit раскладывал их 3+1 —
   одинокая карточка в нижнем ряду читается как недоделанная вёрстка. */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.card {
  background: var(--card); border: 1px solid var(--border); padding: 28px;
  display: flex; flex-direction: column; gap: 20px;
}
.card img {
  width: 240px; height: 240px; align-self: center; object-fit: contain;
  background: var(--bg); border: 1px solid var(--border);
}
.card h3 { font-size: 21px; font-weight: 600; }
.card p { font-size: 16px; line-height: 1.6; color: var(--muted); }

/* S4. ГОСТ */
.gost { background: var(--brand); color: #fff; padding: clamp(48px, 6vw, 88px) 0; }
.gost-in { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: clamp(32px, 5vw, 64px); align-items: center; }
.gost h2 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 700; }
.gost p { margin-top: 18px; font-size: 17px; line-height: 1.65; color: var(--on-dark); }
.gost-tbl { background: var(--brand-dark); border: 1px solid var(--dark-border); padding: 28px 24px; }
.gt-row {
  display: grid; grid-template-columns: minmax(92px, auto) 1fr 1fr;
  align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--dark-rule);
}
.gt-row:last-child { border-bottom: none; }
.gt-row span { font-size: 12px; color: var(--on-dark-muted); }
.gt-head { padding-bottom: 12px; }
.gt-head b { font-size: 13px; font-weight: 600; color: #fff; }
.gt-head i { font-size: 13px; font-style: normal; color: var(--on-dark-muted); }
.gt-s { height: 40px; width: 100%; }
.gt-s g { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.gt-s .g-gost { stroke: #fff; }
.gt-s .g-ansi { stroke: var(--on-dark-muted); }
.gt-s .fill { fill: #fff; }

/* S5. Шаги */
.steps {
  list-style: none; margin: 0 0 40px; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px;
}
.steps li { border-top: 2px solid var(--border); padding-top: 20px; }
.step-n { display: block; font-size: 44px; font-weight: 700; color: var(--orange); line-height: 1; }
.steps h3 { font-size: 20px; font-weight: 600; margin: 10px 0 6px; }
.steps p { font-size: 16px; line-height: 1.6; color: var(--muted); }
/* Примеры схем */
.ex-h { font-size: 20px; font-weight: 600; margin-bottom: 20px; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
/* Карточки растягиваются до высоты самой высокой: подписи стоят на одной
   линии, а картинка центрируется по вертикали в получившемся поле.
   Схемы разной пропорции — выравнивать их обрезкой или подгонкой размера
   исходников нельзя, это реальные документы. */
.ex-grid figure { margin: 0; background: var(--card); border: 1px solid var(--border); display: flex; flex-direction: column; }
/* Вся карточка — ссылка на демо-схему в редакторе, поэтому колонкой-флексом
   должна быть именно она, иначе выравнивание подписей развалится. */
.ex-grid figure > a {
  display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0;
  color: inherit; text-decoration: none;
}
.ex-grid figure:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.ex-grid img { display: block; width: 100%; height: auto; flex: 1 1 auto; min-height: 0; object-fit: contain; }
.ex-grid figcaption {
  border-top: 1px solid var(--border); padding: 12px 14px;
  font-size: 15px; font-weight: 600; color: var(--text);
}
.ex-grid figcaption span { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.ex-go { display: block; font-size: 13px; font-weight: 500; color: var(--green-dark); margin-top: 6px; }
.ex-grid figure:hover .ex-go { text-decoration: underline; }
.ex-note { margin-top: 18px; font-size: 15px; color: var(--muted); }

/* S6. Перечень */
.bom-in { display: grid; grid-template-columns: 200px 1fr; gap: 32px; align-items: center; }
.bom-img { width: 200px; height: 200px; }
.bom-img g { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bom-img .bi-line { stroke: var(--brand); }
.bom-img .bi-rows { stroke: var(--border); stroke-width: 3; }
.bom-img .bi-marks { fill: var(--brand); stroke: none; }
.bom-img .bi-dot { fill: var(--brand); }
.bom-img .bi-arrow { fill: none; stroke: var(--orange); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.bom-in h2 { font-size: 30px; font-weight: 700; margin-bottom: 16px; }
.bom-in p { font-size: 17px; line-height: 1.65; color: var(--muted); max-width: 62ch; }

/* S7. Кому */
.who { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }
.who > div { border-top: 1px solid var(--border); padding-top: 18px; }
.who h3 { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.who p { font-size: 15px; line-height: 1.6; color: var(--muted); }

/* S8. Вопросы — нативный details, без своего JS */
.faq details { border-top: 1px solid var(--border); }
.faq details:last-child { border-bottom: 1px solid var(--border); }
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 40px 22px 0; min-height: 44px;
  font-size: 18px; font-weight: 600; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--blue); }
.faq summary::after {
  content: '+'; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 22px; font-weight: 400; color: var(--muted);
}
.faq details[open] summary::after { content: '−'; }
.faq details > div { padding: 0 40px 24px 0; font-size: 16px; line-height: 1.65; color: var(--muted); }

/* S9. Призыв */
.cta { background: var(--brand); color: #fff; padding: clamp(48px, 6vw, 80px) 0; text-align: center; }
.cta h2 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 700; margin-bottom: 26px; }

/* S10. Подвал */
.ftr { background: var(--brand-dark); color: var(--on-dark-faint); font-size: 13px; padding: 28px 0; }
.ftr-in { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: center; justify-content: space-between; }
.ftr nav { display: flex; flex-wrap: wrap; gap: 20px; }
.ftr a { color: var(--on-dark-faint); text-decoration: none; }
.ftr a:hover { color: #fff; }

/* Куки — страницу не затемняем */
.cookie {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(900px, calc(100% - 24px)); z-index: 60;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  background: var(--card); border: 1px solid var(--border);
  box-shadow: 0 4px 8px rgba(46,63,92,.12); padding: 16px 20px;
}
.cookie[hidden] { display: none; }
.cookie p { flex: 1; min-width: 260px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.cookie-btns { display: flex; gap: 8px; }
.cookie .btn-ghost { border-color: var(--border); color: var(--text); }
.cookie .btn-ghost:hover { border-color: var(--brand); background: transparent; color: var(--text); }

@media (max-width: 700px) {
  .hdr-nav { display: none; }
  /* Навигация скрыта, а прижимал кнопку вправо именно её margin-left: auto */
  .hdr-in .btn-go { margin-left: auto; }
  .cards { grid-template-columns: 1fr; }
  .bom-in { grid-template-columns: 1fr; }
  .card img { width: 200px; height: 200px; }
}

/* Узкий телефон: в шапке рядом с кнопкой не помещается длинная подпись
   «сервис Сети электронных компонентов» — она переносилась в три строки и
   наезжала на кнопку. Ссылка на основной сайт остаётся в подвале. */
@media (max-width: 560px) {
  .hdr-in { gap: 10px; }
  .brand { min-width: 0; }
  .brand-txt small { display: none; }
  .hdr .btn-go { white-space: nowrap; padding: 10px 14px; }
}
