/* ==========================================================================
   НИИ — Новые Интеллектуальные Инструменты
   Токены из брифа. Один шрифт: Manrope (локально, подмножества).
   ========================================================================== */

@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-cyrillic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0400-052F, U+20BD;
}
@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-03FF, U+2000-206F;
}

:root {
  --ink: #0E0F12;
  --paper: #FFFFFF;
  --surface: #F3F4F6;
  --line: #E4E6EA;
  --muted: #5B606B;
  --cyan: #00BFFF;
  --cyan-ink: #0077B6;

  /* производные для тёмного блока */
  --ink-surface: #16181D;
  --ink-line: #2A2D34;
  --ink-muted: #A3A8B2;

  --font: "Manrope", Arial, sans-serif;

  --radius-btn: 8px;
  --radius-card: 16px;

  --container: 1200px;
  --gutter: 24px;

  --header-h: 72px;
}

/* ---------- Reset ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

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

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: var(--cyan-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, input, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--cyan-ink);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-btn);
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ---------- Layout ---------- */

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section {
  padding: clamp(72px, 9vw, 120px) 0;
  border-top: 1px solid var(--line);
}

.section--surface { background: var(--surface); }

.section--dark {
  background: var(--ink);
  color: var(--paper);
  border-top-color: var(--ink);
}
.section--dark .section__lead { color: var(--ink-muted); }

.section__head { max-width: 720px; margin-bottom: clamp(40px, 5vw, 64px); }

.section__head--split {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  gap: 40px;
  align-items: end;
}
.section__head--split .section__lead { margin-top: 0; margin-bottom: 6px; }

.eyebrow {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--muted);
  margin-bottom: 16px;
}
.eyebrow--dark { color: var(--ink-muted); }

.section__title {
  font-size: clamp(36px, 3.4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.section__lead {
  margin-top: 20px;
  font-size: 18px;
  color: var(--muted);
  max-width: 600px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: var(--radius-btn);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex: none; }

.btn--primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn--primary:hover { background: #24262C; border-color: #24262C; }

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

.btn--sm { padding: 10px 16px; font-size: 15px; }

/* Текстовая ссылка со стрелкой */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--cyan-ink);
  text-decoration: none;
}
.arrow-link svg { width: 16px; height: 16px; flex: none; }
.arrow-link:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---------- Header ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  padding: 16px 0; /* защитное поле не меньше половины высоты знака */
}

.brand__logo { height: 32px; width: auto; }

.brand__tagline {
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
}

.nav { display: flex; align-items: center; gap: 32px; }

.nav__list { display: flex; gap: 28px; }

.nav__link {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  padding: 6px 0;
}
.nav__link:hover { color: var(--cyan-ink); }

.burger {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  margin-right: -10px;
  background: transparent;
  border: 0;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.burger__line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform .2s ease, opacity .2s ease;
}
.burger[aria-expanded="true"] .burger__line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] .burger__line:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] .burger__line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */

.hero { overflow: hidden; }

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(40px, 5vw, 80px);
  align-items: center;
  min-height: min(calc(100vh - var(--header-h)), 760px);
  padding-top: 72px;
  padding-bottom: 72px;
}

.hero__title {
  font-size: clamp(36px, 5vw, 72px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  max-width: 14ch;
}

.hero__lead {
  margin-top: 28px;
  font-size: clamp(17px, 1.4vw, 20px);
  color: var(--muted);
  max-width: 540px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

/* Доска продуктов в первом экране */
.board {
  position: relative;
  overflow: hidden;
  padding: 36px;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  isolation: isolate;
}

/* Диагональ буквы И: та же геометрия, что в логотипе (полоса 79.5–124.5 × 100) */
.board__diag {
  position: absolute;
  z-index: 0;
  right: -76px;
  top: -40px;
  height: 640px;
  width: auto;
  pointer-events: none;
}

.board__content { position: relative; z-index: 1; max-width: 270px; display: flex; flex-direction: column; flex: 1; }

.board__title {
  margin-top: 12px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.board__list { margin-top: 36px; display: grid; gap: 0; }

.board__item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  padding: 14px 0;
  border-top: 1px solid #D9DCE1;
}
.board__item:last-child { border-bottom: 1px solid #D9DCE1; }
.board__num { font-size: 13px; font-weight: 600; color: var(--muted); padding-top: 3px; }
.board__name { display: block; font-size: 16px; font-weight: 600; line-height: 1.3; }
.board__note { margin-top: 2px; font-size: 14px; color: var(--muted); line-height: 1.4; }

.board__link { margin-top: auto; padding-top: 28px; color: var(--ink); }
.board__link:hover { color: var(--cyan-ink); }

/* ---------- Направления ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 28px 28px 32px;
  display: flex;
  flex-direction: column;
}

.card__index {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
  padding-bottom: 40px;
}

.card__title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.card__text {
  margin-top: 12px;
  color: var(--muted);
  font-size: 16px;
}

.card__for {
  margin-top: auto;
  padding-top: 20px;
  font-size: 15px;
  color: var(--ink);
}
.card__for::before {
  content: "";
  display: block;
  height: 1px;
  background: var(--line);
  margin-bottom: 16px;
}
.card__label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 2px;
}

/* ---------- Отрасли ---------- */

.domains {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.domain {
  border-top: 1px solid var(--ink);
  padding-top: 20px;
}

.domain__title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.domain__text {
  margin-top: 12px;
  font-size: 16px;
  color: var(--muted);
}

/* ---------- Продукты (тёмный блок, светлые карточки) ---------- */

.products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.product {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius-card);
}

.product--wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.product__media {
  position: relative;
  height: 300px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.product--wide .product__media { height: auto; min-height: 320px; border-bottom: 0; border-right: 1px solid var(--line); }

.product__media--photo { background: #273240; }
.product__media--photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }

.product__media-label {
  position: absolute;
  left: 16px;
  bottom: 16px;
  max-width: calc(100% - 32px);
  padding: 5px 10px;
  border-radius: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
}

/* Образец сводки Медиаполе24 (вёрстка, не картинка) */
.sheet {
  width: min(82%, 420px);
  margin-top: 48px;
  padding: 24px 26px 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  border-bottom: 0;
  color: #1E262D;
  align-self: flex-end;
}
.sheet__brand {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.sheet__brand i { font-style: normal; color: #DE0B1C; }
.sheet__kicker {
  margin-top: 18px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.sheet__title {
  margin-top: 6px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.sheet__meta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
  color: var(--muted);
}
.sheet__meta b { color: #1E262D; font-weight: 600; }

/* Схема архива (вёрстка) */
.scheme {
  width: min(86%, 480px);
  padding: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
}
.scheme__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.scheme__head strong { font-size: 15px; color: var(--ink); font-weight: 700; }
.scheme__path {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0;
  font-size: 13px;
  font-weight: 600;
}
.scheme__path span { padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; }
.scheme__path svg { width: 14px; height: 14px; color: var(--cyan-ink); flex: none; }
.scheme__files {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.scheme__files span {
  padding: 12px 6px;
  border-top: 2px solid var(--cyan);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: #2C3943;
}

.product__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 28px 30px 30px;
}

.product__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 36px;
}
.product__logo img { height: 36px; width: auto; }

.product__badge {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
}

.product__title {
  margin-top: 22px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.product__text { margin-top: 10px; color: var(--muted); font-size: 16px; max-width: 520px; }

.product__for {
  margin-top: 16px;
  font-size: 15px;
  color: var(--ink);
}
.product__label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 2px;
}

.product__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: auto;
  padding-top: 26px;
}

.section--dark :focus-visible { outline-color: var(--cyan); }
.product :focus-visible { outline-color: var(--cyan-ink); }

/* ---------- Как работаем ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
}

.step {
  border-top: 1px solid var(--ink);
  padding-top: 24px;
}

.step__num {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 24px;
}

.step__title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.step__text {
  margin-top: 12px;
  font-size: 16px;
  color: var(--muted);
}

.step__meta {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

/* ---------- Принципы (внутри «Как работаем») ---------- */

.principles {
  margin-top: clamp(56px, 7vw, 88px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.principle {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 28px;
}

.principle__title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.principle__text {
  margin-top: 10px;
  font-size: 15px;
  color: var(--muted);
}

/* ---------- Контакты ---------- */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 64px;
  align-items: start;
}

.contact__info { position: relative; }

.contact__list {
  margin-top: 40px;
  display: grid;
  gap: 20px;
}

.contact__row dt {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 4px;
}

.contact__row dd a {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.contact__row dd a:hover { border-bottom-color: var(--cyan-ink); color: var(--cyan-ink); }

.contact__hint {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--muted);
  max-width: 420px;
}
.contact__hint strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 6px; }
.contact__hint ul { list-style: disc; padding-left: 20px; display: grid; gap: 4px; }

.contact__art {
  margin-top: 56px;
  width: 160px;
  height: 200px;
  overflow: hidden;
}
.contact__art svg { width: 100%; height: 100%; }

/* ---------- Форма ---------- */

.form {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 36px;
  display: grid;
  gap: 20px;
}

.form__field { display: grid; gap: 8px; }

.form__label {
  font-size: 14px;
  font-weight: 500;
}

.form__input {
  width: 100%;
  padding: 13px 14px;
  background: var(--paper);
  border: 1px solid #C9CCD2;
  border-radius: var(--radius-btn);
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
}
.form__input::placeholder { color: #7A7F8A; }
.form__input:hover { border-color: var(--muted); }
.form__input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.form__input[aria-invalid="true"] { border-color: #B3261E; box-shadow: 0 0 0 1px #B3261E; }

.form__textarea { resize: vertical; min-height: 120px; }

.form__field--check {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.form__check {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--ink);
  flex: none;
}

.form__check-label {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}

.form__error {
  font-size: 14px;
  font-weight: 500;
  color: #B3261E;
}
.form__error[hidden] { display: none; }

.form__submit { justify-self: start; }

.form__status { font-size: 15px; color: var(--ink); min-height: 1.5em; }
.form__status:empty { display: none; }

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  font-size: 14px;
  color: var(--muted);
}

.footer__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 32px;
  align-items: center;
}

.footer__brand { display: flex; align-items: center; gap: 16px; }
.footer__copy { color: var(--ink); font-weight: 500; }
.footer__legal { color: var(--muted); }
.footer__link { color: var(--muted); font-weight: 500; }
.footer__link:hover { color: var(--cyan-ink); }

/* ==========================================================================
   Адаптив
   ========================================================================== */

@media (max-width: 1100px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
  .contact { gap: 40px; }
  .hero__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); }
  .board { min-height: 480px; padding: 28px; }
  .board__diag { height: 560px; right: -90px; }
}

@media (max-width: 900px) {
  .brand__tagline { display: none; }

  .hero__inner {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-top: 56px;
    padding-bottom: 56px;
    gap: 48px;
  }
  .hero__title { max-width: 18ch; }
  .board { min-height: 0; padding-bottom: 40px; }
  .board__content { max-width: none; padding-right: 160px; }
  .board__diag { height: 440px; top: auto; bottom: -70px; right: -80px; }

  .section__head--split { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .section__head--split .section__lead { margin-bottom: 0; }

  .cards { grid-template-columns: minmax(0, 1fr); }
  .card__index { padding-bottom: 20px; }

  .domains { grid-template-columns: minmax(0, 1fr); gap: 28px; }

  .products { grid-template-columns: minmax(0, 1fr); }
  .product--wide { display: flex; }
  .product--wide .product__media { height: 300px; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }

  .principles { grid-template-columns: minmax(0, 1fr); }

  .contact { grid-template-columns: minmax(0, 1fr); }
  .contact__art { display: none; }

  .footer__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
  }
}

@media (max-width: 768px) {
  :root { --header-h: 64px; }

  .nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 24px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }
  .nav.is-open { display: flex; }
  .nav__list { flex-direction: column; gap: 0; }
  .nav__link {
    display: block;
    padding: 14px 0;
    font-size: 18px;
    border-bottom: 1px solid var(--line);
  }
  .nav__cta { margin-top: 20px; align-self: stretch; padding: 14px 22px; font-size: 16px; }

  .burger { display: flex; }

  .steps { grid-template-columns: minmax(0, 1fr); gap: 32px; }

  .product__body { padding: 24px; }
  .product__media { height: 280px; }
  .sheet { width: min(88%, 420px); margin-top: 40px; padding: 20px; }
  .scheme { width: min(90%, 480px); padding: 16px; }
  .scheme__files { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .form { padding: 24px; }
}

@media (max-width: 420px) {
  :root { --gutter: 20px; }
  .hero__title { font-size: 36px; }
  .hero__actions .btn { width: 100%; }
  .section__title { font-size: 32px; }
  .board { padding: 24px; padding-bottom: 32px; }
  .board__content { padding-right: 72px; }
  .board__diag { height: 300px; bottom: -50px; right: -70px; }
  .scheme__path { gap: 5px; font-size: 12px; }
  .scheme__path span { padding: 6px 8px; }
}
