/* МК МЕДТЕХНИКА - портал. Общая дизайн-система.
   Направление: светлый клинический. Один синий акцент, hairline-линии, ноль теней. */

:root {
  --bg: #FAFAF8;
  --bg-card: #FFFFFF;
  --ink: #1A1A1A;
  --ink-soft: #55555A;
  --ink-faint: #8A8A90;
  --accent: #0B4DA2;
  --accent-hover: #0A4390;
  --hairline: rgba(26, 26, 26, 0.12);
  --hairline-soft: rgba(26, 26, 26, 0.07);
  --ghost: rgba(11, 77, 162, 0.05);
  --warn-bg: rgba(11, 77, 162, 0.04);

  --font-sans: 'Onest', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;

  --space-section: clamp(72px, 10vw, 132px);
  --wrap: 1240px;
  --radius: 2px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* лёгкая зернистость, чтобы фон не выглядел пластиковым */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

body > * { position: relative; z-index: 1; }

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

a { color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 56px);
}

/* ---------- типографика ---------- */

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(34px, 5.4vw, 62px); font-weight: 700; }
h2 { font-size: clamp(27px, 3.4vw, 40px); }
h3 { font-size: clamp(19px, 1.7vw, 23px); }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.lead {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 62ch;
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* явный плейсхолдер: то, чего нам не хватает от заказчика */
.todo {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--accent);
  background: var(--warn-bg);
  border: 1px dashed rgba(11, 77, 162, 0.3);
  border-radius: var(--radius);
  padding: 2px 7px;
  display: inline-block;
}

.section-label {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}
.section-label .idx { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: 0.1em; }
.section-label .ttl { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }

section { padding: var(--space-section) 0; }

/* ---------- появление блоков ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.on { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

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

header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 68px;
}

.logo {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
  list-style: none;
  padding: 0;
  margin-block: 0;
}

.nav-links a {
  text-decoration: none;
  font-size: 14.5px;
  color: var(--ink-soft);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.nav-links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* выпадающий список услуг */
.has-sub { position: relative; }
.sub {
  position: absolute;
  top: calc(100% + 12px);
  left: -18px;
  min-width: 288px;
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 8px;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}
.has-sub:hover .sub,
.has-sub:focus-within .sub { opacity: 1; visibility: visible; transform: none; }
.sub a {
  display: block;
  padding: 9px 12px;
  font-size: 14.5px;
  color: var(--ink-soft);
  border-bottom: none;
  border-radius: var(--radius);
}
.sub a:hover { background: var(--ghost); color: var(--ink); border-bottom: none; }

.nav-phone {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
  /* п. 11.3 ТЗ: попадание пальцем. Ссылка-текст сама по себе даёт 22px */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
}
.nav-phone:hover { color: var(--accent); }

.nav-cta { display: flex; gap: 10px; }

.burger {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--ink);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--hairline);
}
.btn-ghost:hover { background: transparent; border-color: var(--ink); color: var(--ink); }

.btn-sm { padding: 11px 16px; font-size: 14px; }

/* ---------- карточки и сетки ---------- */

/* элементы сетки по умолчанию не сжимаются ниже ширины содержимого
   (min-width: auto) - длинное слово раздвигает колонку и ломает раскладку */
[class*="-grid"] > *, .grid > * { min-width: 0; }

.grid { display: grid; gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); }
.grid > * { background: var(--bg); padding: clamp(22px, 3vw, 34px); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card-idx {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--accent);
  display: block;
  margin-bottom: 14px;
}

.card h3 { margin-bottom: 10px; }
.card p { color: var(--ink-soft); font-size: 15.5px; }

a.card { text-decoration: none; display: block; transition: background 0.2s; }
a.card:hover { background: var(--bg-card); }
a.card:hover h3 { color: var(--accent); }

/* гигантское контурное число на фоне */
.ghost-num {
  position: absolute;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(120px, 20vw, 280px);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--ghost);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

/* ---------- формы ---------- */

.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-faint); }
.field input, .field textarea, .field select {
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--ink);
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 12px 14px;
  width: 100%;
  transition: border-color 0.2s;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field textarea { min-height: 116px; resize: vertical; }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-soft); }
.consent input { margin-top: 3px; width: 17px; height: 17px; flex-shrink: 0; accent-color: var(--accent); }
.consent a { color: var(--accent); }

/* ---------- футер ---------- */

footer {
  border-top: 1px solid var(--hairline);
  padding: clamp(48px, 6vw, 72px) 0 36px;
  font-size: 14.5px;
  color: var(--ink-soft);
}
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.foot-grid h4 { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); font-weight: 500; margin-bottom: 14px; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.foot-grid a { text-decoration: none; color: var(--ink-soft); }
.foot-grid a:hover { color: var(--accent); }
.foot-req { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.8; color: var(--ink-faint); }
.foot-bottom {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--hairline-soft);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
}

/* ---------- хлебные крошки ---------- */

.crumbs {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 30px;
}
.crumbs a { text-decoration: none; color: var(--ink-faint); }
.crumbs a:hover { color: var(--accent); }
.crumbs span { margin: 0 8px; opacity: 0.5; }

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

.faq { border-top: 1px solid var(--hairline); }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary {
  padding: 22px 0;
  cursor: pointer;
  font-size: 17px;
  font-weight: 500;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '';
  flex-shrink: 0;
  width: 13px; height: 13px;
  margin-top: 6px;
  border-right: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 0.25s;
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq details p { padding-bottom: 22px; color: var(--ink-soft); max-width: 74ch; }

/* ---------- внутренние страницы ---------- */

.page-hero { position: relative; overflow: hidden; padding: 28px 0 clamp(48px, 6vw, 76px); }
.page-hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(30px, 5vw, 64px); align-items: center; }
.page-hero h1 { margin: 20px 0 20px; }
.page-hero .lead { margin-bottom: 30px; }
.page-hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.page-hero-photo { border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; }
.page-hero-photo img { width: 100%; height: 100%; object-fit: cover; }

/* перечень: что входит в услугу */
.checklist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); margin: 0; padding: 0; }
.checklist li { background: var(--bg); list-style: none; padding: 20px clamp(18px, 2.2vw, 26px); display: flex; gap: 13px; align-items: flex-start; }
.checklist svg { flex-shrink: 0; margin-top: 4px; color: var(--accent); }
.checklist b { display: block; font-weight: 600; margin-bottom: 4px; }
.checklist span { font-size: 14.5px; color: var(--ink-soft); }

/* порядок работ: нумерованная цепочка */
.flow { counter-reset: f; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.flow li {
  counter-increment: f;
  list-style: none;
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: clamp(16px, 3vw, 34px);
  padding: 26px 0;
  border-bottom: 1px solid var(--hairline);
}
.flow li::before {
  content: counter(f, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 500;
  color: var(--accent);
  line-height: 1.2;
}
.flow h3 { margin-bottom: 8px; }
.flow p { color: var(--ink-soft); font-size: 15.5px; max-width: 72ch; }

/* узкая колонка текста */
.prose { max-width: 74ch; }
.prose p { color: var(--ink-soft); }

/* боковой блок с заявкой на странице услуги */
.svc-cta-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(32px, 5vw, 64px); align-items: start; }

@media (max-width: 1000px) {
  .page-hero-grid, .svc-cta-grid { grid-template-columns: 1fr; }
  .page-hero-photo { order: -1; }
}
@media (max-width: 640px) {
  .checklist { grid-template-columns: 1fr; }
  .flow li { grid-template-columns: 44px 1fr; gap: 14px; }
  .flow li::before { font-size: 17px; }
}

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

@media (max-width: 1040px) {
  .nav-links { gap: 18px; }
  .nav-links a { font-size: 14px; }
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .burger { display: inline-flex; }
  .nav-links,
  .nav-cta { display: none; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--hairline);
    padding: 8px clamp(20px, 5vw, 56px) 22px;
    margin: 0;
  }
  .nav-links.open li { border-bottom: 1px solid var(--hairline-soft); }
  .nav-links.open a { display: block; padding: 14px 0; font-size: 16px; border-bottom: none; }
  .nav-links.open .sub {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    border: none;
    background: transparent;
    padding: 0 0 10px 16px;
    min-width: 0;
  }
  .nav-links.open .sub a { padding: 9px 0; font-size: 14.5px; color: var(--ink-faint); }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; gap: 32px; }
}
