/* home_concepts shared base: токены бренда azamat.ai + шрифты + общие блоки.
   Копируется в <variant>/assets/base.css скриптом sync.sh — правь здесь. */

@font-face {
  font-family: 'Switzer';
  src: url('fonts/switzer-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Switzer';
  src: url('fonts/switzer-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Switzer';
  src: url('fonts/switzer-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/jetbrains-mono-400-500-latin.woff2') format('woff2');
  font-weight: 400 500;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2190-21BB;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/jetbrains-mono-400-500-cyrillic.woff2') format('woff2');
  font-weight: 400 500;
  font-display: swap;
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --bg: oklch(0.905 0.011 230);
  --surface: oklch(0.952 0.008 230);
  --ink: oklch(0.18 0.045 238);
  --muted: oklch(0.46 0.032 238);
  --hairline: color-mix(in oklab, var(--ink) 17%, transparent);
  --hairline-strong: color-mix(in oklab, var(--ink) 32%, transparent);
  --accent: oklch(0.55 0.14 35);
  --accent-warm: oklch(0.46 0.13 35);
  --accent-weak: color-mix(in oklab, var(--accent) 11%, transparent);
  /* Onest грузится через Google Fonts (<link> в head каждого варианта), Switzer — фолбэк */
  --sans: 'Onest', 'Switzer', ui-sans-serif, system-ui, sans-serif;
  --display: 'Onest', 'Switzer', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --gutter: clamp(20px, 4vw, 56px);
}
/* Тёмная тема: по системной настройке, либо принудительно через
   data-theme на <html> (переключатель в навбаре, localStorage) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: oklch(0.16 0.024 242);
    --surface: oklch(0.205 0.026 242);
    --ink: oklch(0.87 0.012 230);
    --muted: oklch(0.66 0.02 235);
    --accent: oklch(0.61 0.115 35);
    --accent-warm: oklch(0.69 0.082 42);
    --accent-weak: color-mix(in oklab, var(--accent) 12%, transparent);
  }
}
:root[data-theme="dark"] {
  --bg: oklch(0.16 0.024 242);
  --surface: oklch(0.205 0.026 242);
  --ink: oklch(0.87 0.012 230);
  --muted: oklch(0.66 0.02 235);
  --accent: oklch(0.61 0.115 35);
  --accent-warm: oklch(0.69 0.082 42);
  --accent-weak: color-mix(in oklab, var(--accent) 12%, transparent);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, .display { font-family: var(--display); }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 28px;
  background: var(--ink);
  color: var(--bg);
  font: 600 16px var(--sans);
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn:hover { background: var(--accent); transform: translateY(-1px); }

/* Бегущая лента логотипов: дорожка дублируется в разметке дважды. */
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: clamp(40px, 6vw, 88px);
  width: max-content;
  padding-right: clamp(40px, 6vw, 88px);
  animation: marquee 36s linear infinite;
}
.marquee img {
  /* Wordmark-лого не должны читаться как заголовки: ограничиваем и высоту, и ширину */
  width: auto;
  height: auto;
  max-height: 24px;
  max-width: 128px;
  opacity: 0.62;
  filter: grayscale(1);
  transition: filter 0.25s ease, opacity 0.25s ease;
}
.marquee img.ink { filter: brightness(0); opacity: 0.55; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .marquee img.ink { filter: brightness(0) invert(1); opacity: 0.6; }
}
:root[data-theme="dark"] .marquee img.ink { filter: brightness(0) invert(1); opacity: 0.6; }
/* Кликабельные клиенты: у каждого знак + название; серые в покое, цвет при наведении */
.marquee a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.25s ease;
}
.marquee a:hover { background: #fff; }
.marquee a:hover img { filter: none !important; opacity: 1; }
/* Белые исходники (jua.ai) на белой плашке гасим в чёрный, иначе исчезают */
.marquee a:hover img.wm-light { filter: brightness(0) !important; }
.marquee .mq-name {
  font: 600 15px/1 var(--sans);
  letter-spacing: -0.01em;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.25s ease;
}
.marquee a:hover .mq-name { color: #0e1013; }
.marquee .mq-mark {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: none;
  border: 1px solid var(--hairline-strong);
  border-radius: 9px;
  font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  transition: color 0.25s ease, border-color 0.25s ease;
}
/* На белой плашке — фиксированные тёмные цвета, независимо от темы */
.marquee a:hover .mq-mark { color: #a34a2b; border-color: #a34a2b; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* Мини-лента скриншотов («Все кейсы»): бесшовный луп, натуральные пропорции.
   Дорожка дублируется в разметке дважды, сдвиг -50% = ровно период. */
.shot-strip {
  display: block;
  width: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.shot-strip .strip-track {
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  padding-right: 10px;
  animation: marquee 60s linear infinite;
}
.shot-strip a { display: block; flex: none; }
.shot-strip img {
  height: 108px;
  width: auto;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  background: var(--bg);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
/* Наведение на конкретный скриншот: подсветка, клик открывает его кейс */
.shot-strip a:hover img {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(14, 16, 19, 0.18);
}
.case-all:hover .strip-track, .card-link:hover .strip-track { animation-play-state: paused; }

/* «Все кейсы» — карточка в конце секции кейсов: лента кликабельна поштучно,
   строка снизу ведёт на список всех кейсов */
.case-all {
  display: inline-flex;
  flex-direction: column;
  gap: 18px;
  width: min(720px, 92vw);
  padding: 20px 22px 22px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  text-align: left;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.case-all:hover {
  border-color: var(--accent);
  box-shadow: 0 16px 44px rgba(14, 16, 19, 0.13);
}
.case-all-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%;
  text-decoration: none;
}
.case-all b { display: block; font-family: var(--display); font-size: 18px; font-weight: 600; color: var(--ink); transition: color 0.2s ease; }
.case-all-row:hover b { color: var(--accent-warm); }
.case-all small { color: var(--muted); font-size: 13.5px; }
.cases-more { text-align: center; }

/* «Все услуги» — ссылка под сеткой демо */
.svc-all {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 44px;
  padding: 12px 22px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--hairline-strong);
  border-radius: 24px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.svc-all:hover { color: var(--accent-warm); border-color: var(--accent-warm); }

/* Секция «Команда»: аватары-жетоны line-art */
.team { text-align: center; border-top: 1px solid var(--hairline); }
.team .team-sub { color: var(--muted); font-size: 15px; max-width: 52ch; margin: 14px auto 44px; }
.team-avatars {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 10px; max-width: 720px; margin: 0 auto 40px;
}
.team-avatars .avatar {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em;
  color: var(--ink);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.team-avatars .avatar:hover { transform: translateY(-3px); border-color: var(--accent); }
.team-avatars .avatar.founder {
  width: 68px; height: 68px;
  border: 1.5px solid var(--accent);
  color: var(--accent-warm);
  font-size: 15px;
}
.team-roles {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px 18px; margin: 0 auto 40px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
}

/* Секция «Статьи»: карточки с обложками */
.articles { text-align: center; border-top: 1px solid var(--hairline); }
.articles-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 24px);
  max-width: 1100px; margin: 52px auto 44px;
}
@media (max-width: 860px) { .articles-grid { grid-template-columns: 1fr; max-width: 480px; } }
.article-card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 14px 14px 20px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  text-decoration: none; text-align: left;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.article-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 16px 44px rgba(14, 16, 19, 0.13);
}
.article-card img {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--hairline);
}
.article-card b {
  font-family: var(--display); font-size: 16.5px; font-weight: 600;
  line-height: 1.25; color: var(--ink); padding: 0 6px;
}
.article-card .meta { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 0 6px; }

/* Центрированная ссылка-хвост секции */
.sec-link {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  border: 1px solid var(--hairline-strong); border-radius: 24px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.sec-link:hover { color: var(--accent-warm); border-color: var(--accent-warm); }

/* Навбар как на живом сайте: бренд, секции, EN/RU, CTA */
.nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 62px;
  padding: 8px var(--gutter);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.nav-brand { display: flex; align-items: center; flex: none; }
.nav-brand img { height: 30px; width: auto; }
.nav-brand .only-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav-brand .only-light { display: none; }
  :root:not([data-theme="light"]) .nav-brand .only-dark { display: block; }
}
:root[data-theme="dark"] .nav-brand .only-light { display: none; }
:root[data-theme="dark"] .nav-brand .only-dark { display: block; }

/* Переключатель темы: ползунок ☼/☾ как на живом сайте */
.theme-toggle {
  position: relative;
  display: inline-flex; align-items: center; justify-content: space-between;
  width: 62px; height: 32px; padding: 3px;
  border: 1px solid var(--hairline-strong); border-radius: 6px;
  background: color-mix(in oklab, var(--surface) 34%, transparent);
  color: var(--muted); cursor: pointer;
  transition: border-color 0.2s ease;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle .thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: 26px;
  border-radius: 4px; background: var(--ink);
  transition: transform 0.2s ease;
}
.theme-toggle span { position: relative; z-index: 1; display: grid; place-items: center; width: 26px; height: 26px; font-size: 14px; }
.theme-toggle .sun { color: var(--bg); }
.theme-toggle .moon { color: var(--muted); }
.is-dark .theme-toggle .thumb { transform: translateX(28px); }
.is-dark .theme-toggle .sun { color: var(--muted); }
.is-dark .theme-toggle .moon { color: var(--bg); }
.nav-links {
  display: flex; flex: 1; justify-content: center; flex-wrap: wrap;
  gap: 4px clamp(14px, 2.2vw, 28px);
  font-size: 14px;
}
.nav-links a {
  position: relative; white-space: nowrap;
  color: var(--muted); text-decoration: none;
  transition: color 0.2s ease;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: -8px;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0.5); opacity: 0; transition: transform 0.2s ease, opacity 0.2s ease;
  transform-origin: center;
}
.nav-links a:hover { color: var(--accent-warm); }
.nav-links a:hover::after { transform: scaleX(1); opacity: 1; }
/* Скроллспай: подсветка текущей секции */
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after { transform: scaleX(1); opacity: 1; }
.nav-right { display: flex; align-items: center; gap: 14px; flex: none; }
.lang-switch {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  white-space: nowrap;
}
.lang-switch a { color: var(--muted); text-decoration: none; transition: color 0.2s ease; }
.lang-switch a:hover { color: var(--accent-warm); }
.lang-switch b { color: var(--ink); font-weight: 500; }
.lang-switch i { font-style: normal; color: var(--hairline-strong); }
.nav .btn.btn-sm { min-height: 38px; padding: 0 16px; font-size: 14px; }
@media (max-width: 860px) {
  .nav-links, .nav .btn.btn-sm { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
