/* ==========================================================================
   artcod.ru — общие стили
   Структура: токены → шрифты → базовые элементы → шапка → секции → футер → адаптив
   ========================================================================== */

/* ---------- Шрифты ---------- */
@font-face { font-family: "Montserrat"; font-weight: 400; font-style: normal; font-display: swap; src: local("Montserrat Regular"), url("../fonts/Montserrat-Regular.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 500; font-style: normal; font-display: swap; src: local("Montserrat Medium"), url("../fonts/Montserrat-Medium.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-style: normal; font-display: swap; src: local("Montserrat SemiBold"), url("../fonts/Montserrat-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-style: normal; font-display: swap; src: local("Montserrat Bold"), url("../fonts/Montserrat-Bold.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 800; font-style: normal; font-display: swap; src: local("Montserrat ExtraBold"), url("../fonts/Montserrat-ExtraBold.woff2") format("woff2"); }

/* ---------- Токены ---------- */
:root {
  --bg: #0d0e1a;
  --bg-elevated: #14151f;
  --card: rgba(255, 255, 255, 0.04);
  --card-strong: rgba(27, 32, 38, 0.6);
  --card-border: rgba(255, 255, 255, 0.06);
  --text: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.88);
  --muted: #9c9cb9;
  --muted-2: #8a939e;
  --nav: #9598b0;
  --accent: #ffa83f;
  --link: #7ac1ff;
  --header-h: 72px;
  --container: 1200px;
  --gutter: 24px;
  --radius: 16px;
  --radius-lg: 32px;
  --transition: 0.2s ease;
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

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

body {
  margin: 0;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.menu-open { overflow: hidden; }

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

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, p { margin: 0; }

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

.section { padding: 80px 0; position: relative; }

.section-title {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  margin-bottom: 48px;
}

.section-title--left { text-align: left; }

.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;
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 32px;
  border-radius: 8px;
  border: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform var(--transition);
  text-align: center;
}

.btn--light { background: #fff; color: rgba(0, 0, 0, 0.88); }
.btn--light:hover { background: #e9e9ef; }
.btn--block { width: 100%; }
.btn:active { transform: translateY(1px); }

/* Ссылка-стрелка */
.arrow-link {
  display: inline-block;
  font-weight: 500;
  transition: color var(--transition);
}
.arrow-link:hover { color: var(--accent); }

/* ==========================================================================
   Шапка
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* Фон и блюр вынесены в псевдоэлемент: backdrop-filter на самой шапке
   сделал бы её containing block для position: fixed у мобильного меню */
.header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(13, 14, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.logo img { height: 40px; width: auto; }

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

.nav__list {
  display: flex;
  align-items: center;
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__link {
  display: inline-block;
  padding: 6px 0;
  font-size: 16px;
  color: var(--nav);
  transition: color var(--transition);
  white-space: nowrap;
}

.nav__link:hover,
.nav__link.is-active { color: var(--accent); }

/* Бургер — скрыт на десктопе */
.burger {
  display: none;
  position: relative;
  z-index: 110;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.burger__line {
  position: absolute;
  left: 10px;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease, top 0.25s ease;
}

.burger__line:nth-child(1) { top: 14px; }
.burger__line:nth-child(2) { top: 21px; }
.burger__line:nth-child(3) { top: 28px; }

.burger[aria-expanded="true"] .burger__line:nth-child(1) { top: 21px; transform: rotate(45deg); }
.burger[aria-expanded="true"] .burger__line:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] .burger__line:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* ==========================================================================
   Главная: hero
   ========================================================================== */
.hero {
  position: relative;
  padding: 72px 0 80px;
  background: var(--bg) url("../images/hero-bg.png") center top / cover no-repeat;
  overflow: hidden;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero__logo { width: min(716px, 100%); height: auto; }

.hero__text {
  max-width: 720px;
  margin-top: 32px;
  font-size: 32px;
  font-weight: 500;
  line-height: 1.2;
}

.hero__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 1000px;
  margin-top: 40px;
}

.hero-card {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.hero-card img { width: 100%; }
.hero-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4); }

/* ==========================================================================
   Главная: продукты
   ========================================================================== */
.products {
  background: var(--bg) url("../images/products-bg.png") center / cover no-repeat;
}

.products__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.product-card {
  display: flex;
  flex-direction: column;
  padding: 48px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--card-border);
}

.product-card--wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.product-card__title { font-size: 20px; font-weight: 600; line-height: 1.2; }
.product-card__text { margin-top: 24px; font-size: 16px; line-height: 1.4; color: var(--muted); }
.product-card__link { margin-top: 32px; font-size: 20px; }
.product-card__body { display: flex; flex-direction: column; flex: 1; }
.product-card__body .product-card__link { margin-top: auto; padding-top: 32px; }
.product-card__img { margin-top: 40px; border-radius: 12px; overflow: hidden; background: #fff; }
.product-card__img img { width: 100%; }
.product-card--wide .product-card__img { margin-top: 0; }

/* ==========================================================================
   Главная: этапы работы (шестиугольники)
   ========================================================================== */
.stages {
  background: var(--bg) url("../images/stages-bg.png") center / cover no-repeat;
}

.stages__list {
  /* 5 шестиугольников + 4 зазора по 8px должны влезть в контейнер */
  --hex-w: min(220px, calc((100% - 32px) / 5));
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 0 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stage {
  position: relative;
  width: var(--hex-w);
  aspect-ratio: 1 / 0.9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  text-align: center;
  /* обводка: внешний слой — цвет рамки, ::before — заливка с отступом 1px */
  background: rgba(255, 255, 255, 0.35);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  flex-shrink: 0;
}

.stage::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: #14161f;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}

.stage > * { position: relative; }

.stage:nth-child(even) { margin-top: calc(var(--hex-w) * 0.48); }

.stage__num { font-size: 24px; font-weight: 700; line-height: 1; margin-bottom: 8px; color: #e3e3ee; }
.stage__name { font-size: 18px; font-weight: 600; line-height: 1.25; color: #d6d6e2; }

/* ==========================================================================
   Главная: технологии
   ========================================================================== */
.tech__box {
  list-style: none;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 48px;
  padding: 24px 32px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: var(--card);
}

.tech__item {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke: 1.2px #d8d9e6;
  paint-order: stroke fill;
}

/* ==========================================================================
   Главная: сотрудничество и контакты
   ========================================================================== */
.coop {
  background: var(--bg) url("../images/coop-bg.png") center / cover no-repeat;
}

.coop__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.coop-card {
  display: flex;
  flex-direction: column;
  padding: 48px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--card-border);
}

.coop-card__title { font-size: 24px; font-weight: 400; line-height: 1.2; }
.coop-card__text { margin-top: 24px; font-size: 18px; line-height: 1.5; color: var(--muted); }
.coop-card__img { margin-top: auto; padding-top: 40px; }
.coop-card__img img { width: 100%; border-radius: 12px; }

.contacts-card {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 48px;
  margin-top: 20px;
  padding: 40px 48px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--card-border);
}

.contacts-card__title { font-size: 20px; font-weight: 500; color: var(--muted); margin-bottom: 12px; }
.contacts-card__row { font-size: 20px; font-weight: 500; line-height: 1.3; color: var(--muted); margin-top: 8px; }
.contacts-card a:hover { color: var(--accent); }

/* ==========================================================================
   Страницы продуктов
   ========================================================================== */
.page-hero { padding: 56px 0 80px; }

.page-hero__title {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.2;
  color: #f3f3f3;
  margin-bottom: 40px;
}

.page-hero__shot {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.page-hero__shot img { width: 100%; }

.page-hero__bottom {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
  margin-top: 40px;
}

.page-hero__text { max-width: 720px; font-size: 20px; line-height: 1.4; color: var(--muted-2); }
.page-hero__bottom .btn { min-width: 320px; }

/* Возможности */
.features { padding: 40px 0; }

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 64px;
  align-items: center;
  padding: 60px 0;
}

.feature--reverse .feature__media { order: -1; }

.feature__title { font-size: 40px; font-weight: 700; line-height: 1.2; }
.feature__text { margin-top: 24px; font-size: 16px; line-height: 1.5; color: var(--muted-2); }

.feature__media {
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.feature__media img { width: 100%; }

/* Стоимость */
.pricing { background: #0d1117; }

.price-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  padding: 48px 64px;
  border-radius: var(--radius-lg);
  background: var(--card-strong);
  border: 1px solid var(--card-border);
}

.price-card__title { font-size: 32px; font-weight: 600; line-height: 1.2; color: var(--text-soft); }
.price-card__text { margin-top: 24px; font-size: 16px; line-height: 1.5; color: var(--muted-2); }
.price-card__value { margin-top: 32px; font-size: 32px; font-weight: 500; line-height: 1.2; }
.price-card__value small { display: inline-block; margin-left: 12px; font-size: 13px; font-weight: 400; line-height: 1.2; color: var(--muted-2); vertical-align: middle; }
.price-card__note { margin-top: 20px; font-size: 16px; line-height: 1.5; color: var(--muted-2); }

/* Документация */
.docs { background: #0d1117; }

.docs__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.doc-card {
  display: flex;
  flex-direction: column;
  padding: 32px;
  border-radius: var(--radius-lg);
  background: var(--card-strong);
  border: 1px solid var(--card-border);
  transition: transform var(--transition), border-color var(--transition);
}

.doc-card:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.14); }
.doc-card__icon { width: 44px; height: 44px; margin-bottom: 32px; }
.doc-card__title { font-size: 20px; font-weight: 600; line-height: 1.2; color: var(--text-soft); }
.doc-card__text { margin-top: 16px; font-size: 16px; line-height: 1.5; color: var(--muted-2); }
.doc-card__link { margin-top: auto; padding-top: 24px; font-size: 16px; font-weight: 600; color: var(--link); }
.doc-card__link:hover { text-decoration: underline; }

/* ==========================================================================
   Футер
   ========================================================================== */
.footer {
  padding: 64px 0 40px;
  background: var(--bg);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px 64px;
}

.footer__logo img { height: 36px; width: auto; }

.footer__col-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 16px;
}

.footer__text, .footer__list { font-size: 15px; line-height: 1.6; color: rgba(255, 255, 255, 0.6); }
.footer__text + .footer__text { margin-top: 12px; }
.footer__text a:hover { color: #fff; }

.footer__list { margin: 0; padding: 0; list-style: none; }
.footer__list li + li { margin-top: 12px; }
.footer__list a { font-weight: 500; transition: color var(--transition); }
.footer__list a:hover { color: #fff; }

.footer__company { margin-top: 24px; }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
}

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

/* Планшет */
@media (max-width: 1024px) {
  .section { padding: 64px 0; }
  .section-title { font-size: 34px; margin-bottom: 36px; }

  .hero__text { font-size: 26px; }

  .stages__list { --hex-w: min(180px, calc((100% - 32px) / 5)); }
  .stage__num { font-size: 20px; }
  .stage__name { font-size: 15px; }

  .tech__item { font-size: 22px; }

  .page-hero__title, .feature__title { font-size: 34px; }
  .feature { gap: 40px; padding: 40px 0; }

  .price-card { gap: 40px; padding: 40px; }
  .docs__grid { grid-template-columns: repeat(2, 1fr); }

  .footer__grid { grid-template-columns: 1fr 1fr; }
}

/* Меню сворачивается в бургер */
@media (max-width: 900px) {
  .burger { display: block; }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    z-index: 105;
    display: block;
    padding: 24px var(--gutter) 40px;
    background: rgba(13, 14, 26, 0.98);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s;
  }

  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__list li + li { border-top: 1px solid rgba(255, 255, 255, 0.06); }

  .nav__link {
    display: block;
    padding: 18px 0;
    font-size: 20px;
    font-weight: 500;
    color: #fff;
  }

  .hero__cards { grid-template-columns: 1fr; max-width: 420px; }

  .products__grid, .coop__grid { grid-template-columns: 1fr; }
  .product-card--wide { grid-template-columns: 1fr; gap: 0; }
  .product-card--wide .product-card__img { margin-top: 40px; }
  .product-card, .coop-card { padding: 32px; }

  .contacts-card { grid-template-columns: 1fr; padding: 32px; }

  /* Шестиугольники: сетка, чётные не смещаются */
  .stages__list { --hex-w: 200px; flex-wrap: wrap; gap: 12px; }
  .stage:nth-child(even) { margin-top: 0; }

  .page-hero__bottom { grid-template-columns: 1fr; gap: 24px; }
  .page-hero__bottom .btn { min-width: 0; width: 100%; }

  .feature, .feature--reverse { grid-template-columns: 1fr; }
  .feature--reverse .feature__media { order: 0; }

  .price-card { grid-template-columns: 1fr; }
}

/* Телефон */
@media (max-width: 639px) {
  :root { --header-h: 64px; --gutter: 16px; }

  .logo img { height: 34px; }

  .section { padding: 48px 0; }
  .section-title { font-size: 28px; margin-bottom: 28px; }

  .hero { padding: 40px 0 56px; }
  .hero__text { font-size: 20px; margin-top: 24px; }
  .hero__cards { margin-top: 32px; gap: 16px; }

  .product-card, .coop-card { padding: 24px; }
  .product-card__link { font-size: 18px; }
  .coop-card__title { font-size: 20px; }
  .coop-card__text { font-size: 16px; }
  .contacts-card { padding: 24px; }
  .contacts-card__title, .contacts-card__row { font-size: 17px; }

  .stages__list { --hex-w: 150px; gap: 8px; }
  .stage { padding: 12px; }
  .stage__num { font-size: 18px; margin-bottom: 4px; }
  .stage__name { font-size: 12px; }

  .tech__box { gap: 10px 24px; padding: 20px 16px; }
  .tech__item { font-size: 18px; }

  .page-hero { padding: 32px 0 48px; }
  .page-hero__title { font-size: 28px; margin-bottom: 24px; }
  .page-hero__shot { border-radius: 16px; }
  .page-hero__text { font-size: 17px; }

  .features { padding: 16px 0; }
  .feature { padding: 32px 0; gap: 24px; }
  .feature__title { font-size: 26px; }
  .feature__media { border-radius: 16px; }

  .price-card { padding: 28px 24px; border-radius: 20px; gap: 28px; }
  .price-card__title { font-size: 24px; }
  .price-card__value { font-size: 28px; }

  .docs__grid { grid-template-columns: 1fr; gap: 16px; }
  .doc-card { padding: 24px; border-radius: 20px; }
  .doc-card__icon { margin-bottom: 20px; }

  .footer { padding: 48px 0 32px; }
  .footer__grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ==========================================================================
   404
   ========================================================================== */
.not-found { min-height: calc(100vh - var(--header-h)); display: flex; align-items: center; }
.not-found__inner { text-align: center; }
.not-found__code { font-size: 96px; font-weight: 800; line-height: 1; color: var(--accent); }
.not-found__title { margin-top: 16px; font-size: 32px; font-weight: 600; }
.not-found__text { margin: 16px auto 32px; max-width: 420px; color: var(--muted); }
