/* ══════════════════════════════════════════════════════════════════════════
   A1 — стили лендинга поверх Nocturne (assets/nocturne.css).
   Здесь только то, чего нет в дизайн-системе: сетка страницы, секции,
   типографическая шкала лендинга и лестница прозрачностей.
   Цвета, радиусы, тени, шрифты — исключительно через var(--…) из Nocturne.
   ══════════════════════════════════════════════════════════════════════ */

/* — база — */

body {
  margin: 0;
  background: var(--color-bg);
  text-wrap: pretty;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover { color: var(--color-accent-300); }

/* Nocturne задаёт :focus-visible с акцентной обводкой — дефолтное кольцо
   браузера не используется нигде. Здесь только страховка на случай, если
   в разметке появится элемент вне компонентов системы. */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* — каркас страницы — */

.page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}

/* Декоративное свечение: акцент как glow, не как заливка. */
.ground {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 680px at 84% -180px,
      color-mix(in srgb, var(--color-accent-900) 78%, transparent), transparent 60%),
    radial-gradient(1000px 760px at -8% 100%,
      color-mix(in srgb, black 32%, transparent), transparent 55%);
}

.shell {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 72px);
  animation: fade-in 150ms ease-out both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .shell { animation: none; }
}

/* — иконки (спрайт из Phosphor regular) — */

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.i {
  flex: none;
  fill: currentColor;
  width: 16px;
  height: 16px;
}

.i-13 { width: 13px; height: 13px; }
.i-14 { width: 14px; height: 14px; }
.i-17 { width: 17px; height: 17px; }

/* — шапка — */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 26px 0 0;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand-mark {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: 19px;
  letter-spacing: -0.02em;
}

.brand-note {
  font-size: 13px;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Переключатель языка: активный — статичный span с акцентной обводкой,
   неактивный — обычная ссылка, то есть переход, а не состояние в JS. */
a.seg-opt {
  color: inherit;
  text-decoration: none;
}

a.seg-opt:hover { color: var(--color-text); }

/* Акцентная рамка активного языка в Nocturne — это inset-тень внутри .seg,
   который клипует содержимое по своему padding-box. Радиус клипа и радиус
   опции совпадают, поэтому сглаживание дуги в углу срезается почти целиком и
   рамка выглядит разорванной. Вместо второго контура внутри серого пускаем
   активную опцию на бордюр контейнера: снимаем клип, выводим её на 1px наружу
   и скругляем по внешнему радиусу — акцент замещает серую линию, а не спорит
   с ней. Соседняя опция при этом накрывается по вертикальному разделителю,
   поэтому двойной линии между RU и EN не возникает. */
.seg {
  overflow: visible;
}

.seg-opt:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.seg-opt:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.seg-opt.is-active {
  margin: -1px;
  color: var(--color-accent);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}

.gh-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 62%, transparent);
}

/* — кнопки: Nocturne даёт вид, здесь только отступ под иконку — */

.btn { gap: 8px; }

/* — герой — */

.hero {
  padding: clamp(52px, 9vh, 104px) 0 clamp(40px, 7vh, 72px);
}

.hero-title {
  font-size: clamp(36px, 5.4vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  margin-left: -0.06em; /* оптическое выравнивание по левому краю */
  max-width: 22ch;
}

.hero-lead {
  font-size: 17px;
  line-height: 1.65;
  margin: 0;
  max-width: 52ch;
  color: color-mix(in srgb, var(--color-text) 80%, transparent);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

/* — разделители: 1px, затухающий по 48px с каждого конца — */

.rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: linear-gradient(to right,
    transparent,
    var(--color-divider) 48px calc(100% - 48px),
    transparent);
}

/* — секции — */

.section {
  padding: clamp(44px, 7vh, 80px) 0 clamp(32px, 5vh, 56px);
}

.section--products {
  padding-bottom: clamp(20px, 4vh, 40px);
}

.kicker {
  display: block;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 20px;
}

.section-title {
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
  max-width: 26ch;
}

.section-lead {
  font-size: 15.5px;
  line-height: 1.7;
  margin: 0 0 40px;
  max-width: 56ch;
  color: color-mix(in srgb, var(--color-text) 76%, transparent);
}

/* — что мы делаем — */

.pillars {
  display: flex;
  flex-wrap: wrap;
  gap: 28px clamp(24px, 5vw, 64px);
}

.section--build .kicker { margin-bottom: 28px; }

.pillar {
  flex: 1 1 260px;
  min-width: 0;
}

.pillar-title {
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}

.pillar-body {
  font-size: 15.5px;
  line-height: 1.7;
  margin: 0;
  color: color-mix(in srgb, var(--color-text) 76%, transparent);
}

/* — продукты — */

.group {
  padding: 0 0 40px;
}

.group-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 20px;
}

.group-title {
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0;
}

.group-count {
  font-size: 13px;
  color: color-mix(in srgb, var(--color-text) 58%, transparent);
  font-feature-settings: 'tnum' 1;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 14px;
}

/* Карточка целиком — ссылка. Край рисуется бордюром, потому что именно он
   меняется на hover; тени и трансформы система на карточках не использует. */
.product-card {
  display: block;
  padding: 18px 18px 16px;
  border: 1px solid var(--color-divider);
  color: inherit;
  text-decoration: none;
}

.product-card:hover {
  color: inherit;
  border-color: color-mix(in srgb, var(--color-accent) 45%, var(--color-divider));
  background: color-mix(in srgb, var(--color-accent-900) 28%, var(--color-surface));
}

.product-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
}

.product-title {
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0;
}

.product-head .i { color: var(--color-accent); }

.product-body {
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 12px;
  color: color-mix(in srgb, var(--color-text) 72%, transparent);
}

.product-repo {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--color-text) 58%, transparent);
}

/* — скилы — */

.section-note {
  font-size: 15.5px;
  line-height: 1.7;
  margin: 0 0 40px;
  max-width: 58ch;
  color: color-mix(in srgb, var(--color-text) 62%, transparent);
}

.section--skills .section-lead {
  max-width: 58ch;
  margin-bottom: 12px;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}

.skill-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--color-divider);
}

.skill-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.skill-title {
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0;
}

.skill-count {
  font-size: 12.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
  font-feature-settings: 'tnum' 1;
}

.skill-body {
  font-size: 14.5px;
  line-height: 1.65;
  margin: 0;
  color: color-mix(in srgb, var(--color-text) 76%, transparent);
}

/* Футер карточки прижат вниз, чтобы ссылки стояли на одной линии
   независимо от длины описания. */
.skill-links {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  padding-top: 4px;
}

.skill-docs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.skills-next {
  font-size: 14.5px;
  line-height: 1.7;
  margin: 28px 0 0;
  max-width: 58ch;
  color: color-mix(in srgb, var(--color-text) 58%, transparent);
}

/* — внедрение AI и контакты — */

.split {
  display: flex;
  flex-wrap: wrap;
  gap: 32px clamp(24px, 6vw, 88px);
}

.split .kicker { margin-bottom: 18px; }

.col-adoption {
  flex: 1 1 320px;
  min-width: 0;
}

.col-contacts {
  flex: 0 1 340px;
  min-width: 0;
}

.split-title {
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.25;
  letter-spacing: -0.012em;
  margin: 0 0 14px;
}

.col-adoption .split-title { max-width: 24ch; }

.split-body {
  font-size: 15.5px;
  line-height: 1.7;
  margin: 0;
  color: color-mix(in srgb, var(--color-text) 76%, transparent);
}

.col-adoption .split-body { max-width: 50ch; }

.col-contacts .split-body {
  max-width: 40ch;
  margin-bottom: 20px;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

/* — подвал — */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
  padding: 0 0 44px;
  font-size: 13px;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}

.footer-link {
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-link:hover {
  color: var(--color-text);
}
