@import url('/assets/css/fonts.css');

/* ---------------------------------------------------------------- токены */
:root {
  color-scheme: light;
  --ink:        #0c1322;
  --ink-2:      #16203a;
  --paper:      #ffffff;
  --paper-2:    #f5f7fb;
  --paper-3:    #eef2f9;
  --surface:    #ffffff;   /* подложка карточек: в тёмной теме приподнята */
  --text:       #14203a;
  --muted:      #5b6784;
  --line:       #e2e8f3;
  --line-hover: #c9d6ef;
  --accent:     #2f5bff;
  --accent-2:   #7aa2ff;
  --gold:       #c99a3a;
  --radius:     14px;
  --radius-lg:  22px;
  --shadow:     0 1px 2px rgba(16, 28, 56, .05), 0 12px 32px -18px rgba(16, 28, 56, .35);
  --maxw:       1140px;
  /* высота тёмной шапки: одинаковая на всех страницах */
  --head-h:     clamp(320px, 27vw, 440px);
  /* Герой выше обложек разделов: в нём стоит фигура в полный рост,
     и при высоте обложки она не помещается целиком */
  --hero-h:     clamp(460px, 40vw, 660px);
  --header-h:   68px;   /* используется бургер-панелью как точка отсчёта */
  --font:       'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --display:    'Unbounded', var(--font);
  --mono:       ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

/* Тёмная тема. Страница намеренно темнее, чем ink на баннерах: тогда полоса
   с картинкой читается приподнятой, а не сливается с фоном. Все оттенки
   уведены в синеву, чтобы совпадать с тоном рендеров. Тема ставится атрибутом
   data-theme в <head> до первой отрисовки — мигания светлым нет. */
:root[data-theme='dark'] {
  color-scheme: dark;
  --paper:      #070d18;   /* фон страницы — самый тёмный уровень */
  --paper-2:    #0c1322;   /* тонированные секции, совпадают с ink */
  --paper-3:    #1a2440;   /* чипы, теги, подложки превью */
  --surface:    #121b2e;   /* карточки приподняты над фоном */
  --text:       #e7ecf7;
  --muted:      #93a2c0;
  --line:       #1f2a44;
  --line-hover: #33456b;
  --accent:     #4a72ff;   /* на тёмном ярче: иначе теряет контраст */
  --accent-2:   #8fb0ff;
  --gold:       #d3a94a;
  --shadow:     0 1px 2px rgba(0, 0, 0, .4), 0 14px 34px -18px rgba(0, 0, 0, .8);
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.62;
  color: var(--text);
  background: var(--paper);
  font-feature-settings: 'liga' 1, 'kern' 1;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.02em;
  margin: 0 0 .6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.2rem + 3.4vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem); }
h3 { font-size: clamp(1.08rem, 1rem + .5vw, 1.32rem); }
p  { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
.section { padding: clamp(56px, 7vw, 96px) 0; }
.section--tint { background: var(--paper-2); }
.section--dark { background: var(--ink); color: #e7ecf7; }
.section--dark h2, .section--dark h3 { color: #fff; }
.section--dark a { color: var(--accent-2); }

.eyebrow {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
.section--dark .eyebrow { color: var(--accent-2); }

.lead { font-size: clamp(1.02rem, .98rem + .35vw, 1.2rem); color: var(--muted); max-width: 68ch; }
.section--dark .lead { color: #b9c4dc; }

/* ---------------------------------------------------------------- шапка */
/* Шапка — продолжение тёмного героя, а не отдельная светлая плашка.
   На главной она сливается с ним встык, на внутренних страницах читается
   как тёмный колонтитул над светлым содержимым. */
/* Заливка ровно та же, что у героя, и без нижней границы — иначе на главной
   между шапкой и героем проступает шов. */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink);
}
.site-header__inner {
  display: flex; align-items: center; gap: 32px;
  min-height: var(--header-h);
}

/* Переключатель темы: показываем ту иконку, в которую переключимся */
.theme-toggle {
  flex: none;
  display: grid; place-items: center;
  width: 38px; height: 38px; padding: 0;
  background: none; border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%; color: #8b9ac0; cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.theme-toggle:hover { color: #fff; border-color: rgba(255, 255, 255, .4); }
.theme-toggle .icon { width: 17px; height: 17px; grid-area: 1 / 1; }
.theme-toggle .icon--sun { display: none; }
:root[data-theme='dark'] .theme-toggle .icon--sun { display: block; }
:root[data-theme='dark'] .theme-toggle .icon--moon { display: none; }

/* Кнопка-бургер: только на узких экранах */
.burger {
  display: none;
  width: 44px; height: 44px; padding: 0;
  background: none; border: 0; cursor: pointer;
  align-content: center; gap: 5px;
}
.burger span {
  display: block; width: 22px; height: 2px; margin-inline: auto;
  background: #fff; border-radius: 2px;
  transition: transform .2s ease, opacity .15s ease;
}
.burger[aria-expanded='true'] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded='true'] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded='true'] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Логотип — набор, а не иконка: имя и тонкая акцентная засечка перед ним */
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--display); font-weight: 600; font-size: 1rem;
  color: #fff; letter-spacing: -.02em; white-space: nowrap;
}
.brand::before {
  content: ''; width: 3px; height: 19px; border-radius: 2px;
  background: var(--accent); flex: none;
  transition: height .18s ease;
}
.brand:hover { text-decoration: none; color: #fff; }
.brand:hover::before { height: 26px; }

.nav {
  margin-left: auto; margin-right: 22px; display: flex; gap: 22px;
  overflow-x: auto; scrollbar-width: none;
  /* на узких экранах список уезжает вбок — правый край растворяем */
  -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent);
          mask-image: linear-gradient(90deg, #000 88%, transparent);
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  position: relative; padding: 7px 0;
  font-family: var(--mono); font-size: .84rem;
  letter-spacing: .11em; text-transform: uppercase;
  color: #93a2c4; white-space: nowrap;
}
.nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .18s ease;
}
.nav a:hover { color: #fff; text-decoration: none; }
.nav a:hover::after { transform: scaleX(1); }
.nav a[aria-current='page'] { color: #fff; }
.nav a[aria-current='page']::after { transform: scaleX(1); }

@media (min-width: 1100px) {
  .nav { mask-image: none; -webkit-mask-image: none; }
}

/* Панель меню на телефоне: семь пунктов в строку не помещаются,
   поэтому раскрываем их на весь экран под шапкой. */
@media (max-width: 860px) {
  .burger { display: grid; }
  .theme-toggle { margin-left: auto; }
  .nav {
    position: fixed; left: 0; right: 0; top: var(--header-h); bottom: 0;
    margin: 0; padding: 8px 24px 40px;
    flex-direction: column; gap: 0;
    background: var(--ink);
    overflow-y: auto; overscroll-behavior: contain;
    mask-image: none; -webkit-mask-image: none;
    opacity: 0; transform: translateY(-8px); pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
  }
  .nav[data-open='true'] { opacity: 1; transform: none; pointer-events: auto; }
  .nav a {
    padding: 18px 0; font-size: .95rem; letter-spacing: .13em;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
  }
  .nav a::after { display: none; }
  .nav a[aria-current='page'] { color: var(--accent-2); }
}

@media (max-width: 620px) {
  :root { --header-h: 60px; }
  .site-header__inner { gap: 18px; }
  .brand { font-size: .92rem; }
}

/* Отбивка под тёмной шапкой. В тёмной теме ink баннера и фон страницы
   различаются на пару процентов, и стык читается грязной границей вместо
   осознанного перехода. Линия яркая по центру и гаснет к краям — так она
   выглядит частью композиции, а не рамкой. */
.hero, .banner {
  border-style: solid;
  border-width: 0 0 1px;
  border-image: linear-gradient(90deg,
      transparent 0%,
      rgba(122, 162, 255, .08) 14%,
      rgba(122, 162, 255, .55) 40%,
      rgba(122, 162, 255, .55) 60%,
      rgba(122, 162, 255, .08) 86%,
      transparent 100%) 1;
}

/* ---------------------------------------------------------------- герой */
/* Фон рисует CSS, портрет лежит отдельным слоем: одна сплошная заливка,
   поэтому стыков нет по построению — их нечему стыковать. */
.hero {
  position: relative; overflow: hidden;
  min-height: var(--hero-h);
  display: flex; align-items: center;
  padding: clamp(32px, 4vw, 56px) 0;
  background: var(--ink);
  color: #e7ecf7;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(122, 162, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 162, 255, .07) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(130% 100% at 82% 20%, #000 0%, transparent 72%);
}
.hero::after {
  content: ''; position: absolute; width: 620px; height: 620px;
  right: -120px; top: -260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 91, 255, .30), transparent 62%);
}

/* Портрет прижат к низу и выходит за верх секции, правый край уезжает
   за границу — обе кромки срезает overflow. Остаётся левая, её растворяет
   маска, поэтому фигура выходит из фона без единой видимой границы. */
/* Холст с лавинным эффектом: лежит поверх статичной сетки, но под фигурой
   и текстом. Слева гасится маской — там читается имя, фон должен молчать. */
.hero__canvas {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 40%, rgba(0, 0, 0, .28) 54%, #000 74%);
          mask-image: linear-gradient(90deg, transparent 0%, transparent 40%, rgba(0, 0, 0, .28) 54%, #000 74%);
}

/* Фигура вырезана по контуру, поэтому масок больше нет: она стоит на фоне
   как объект, выходит за низ секции и садится поверх собственного гало.
   Обёртка нужна ради параллакса — на неё вешается сдвиг от курсора,
   а анимация появления живёт на картинке, иначе трансформы дерутся. */
.hero__portrait {
  position: absolute; z-index: 1;
  /* фигура целиком внутри секции: высота ровно по ней, низ по её краю.
     Отступ справа заметный — прижатая к краю вырезка выглядит приклеенной */
  right: 15%; bottom: 0;
  height: 100%; width: auto;
  pointer-events: none;
}
.hero__portrait-img {
  position: relative; z-index: 1;
  height: 100%; width: auto; display: block;
  /* тень под фигурой привязывает её к фону, иначе вырезка выглядит наклейкой */
  filter: drop-shadow(0 26px 42px rgba(0, 0, 0, .55));
}
/* Второй слой искр — поверх фигуры. Маска из двух частей, пересечение:
   силуэт из альфы самой картинки (искры не выходят за пиджак) и вертикальный
   градиент, гасящий верх (по лицу не бегает никогда). */
.hero__overlay {
  position: absolute; z-index: 2; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  -webkit-mask-image: url('/assets/img/hero-figure.webp'),
                      linear-gradient(180deg, transparent 46%, #000 62%);
          mask-image: url('/assets/img/hero-figure.webp'),
                      linear-gradient(180deg, transparent 46%, #000 62%);
  -webkit-mask-size: 100% 100%, 100% 100%;
          mask-size: 100% 100%, 100% 100%;
  -webkit-mask-repeat: no-repeat, no-repeat;
          mask-repeat: no-repeat, no-repeat;
  -webkit-mask-composite: source-in;
          mask-composite: intersect;
}

/* Гало за спиной: раньше свечение шло по всей секции, теперь оно привязано
   к фигуре и лежит именно под ней */
.hero__halo {
  position: absolute; z-index: 0;
  left: 50%; top: 46%;
  width: 118%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 91, 255, .30) 0%, rgba(47, 91, 255, .12) 42%, transparent 68%);
}

/* max-width вешаем на внутренний блок, а не на .wrap — иначе колонка
   перестаёт совпадать с сеткой остальных секций */
.hero__body { position: relative; z-index: 2; }
/* колонка уже фигуры: иначе блоки текста заходят под её плечо */
.hero__body > * { max-width: 40rem; }

@media (max-width: 1100px) { .hero__portrait { right: 4%; height: 96%; } }

/* На узком экране фигура за текстом не работает: строки ложатся прямо на лицо.
   Поэтому раскладка становится вертикальной — сначала текст, под ним портрет
   отдельным блоком, прижатый к правому краю и к низу секции. */
@media (max-width: 820px) {
  .hero {
    display: flex; flex-direction: column;
    min-height: 0;
    padding: clamp(18px, 5vw, 32px) 0 clamp(26px, 7vw, 44px);
  }
  .hero__body > * { max-width: none; }
  .hero__portrait {
    order: -1;                 /* фигура наверх, текст под ней */
    /* именно relative, а не static: наложение внутри позиционируется
       от фигуры, иначе оно растягивается на всю секцию и маска по силуэту
       перестаёт совпадать — искры уезжают на лицо и мимо фигуры */
    position: relative;
    width: min(74%, 350px); height: auto;
    margin: 0 auto clamp(16px, 4vw, 26px);
    opacity: 1;
  }
  .hero__portrait-img {
    width: 100%; height: auto;
    filter: drop-shadow(0 14px 26px rgba(0, 0, 0, .5));
  }
  .hero__halo { display: none; }
  /* на телефоне анимация только за фигурой: по человеку ничего не бегает */
  .hero__overlay { display: none; }
  .hero__canvas {
    display: block;
    /* гасим низ, где лежит текст: сверху фон за фигурой, снизу чисто */
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 32%, transparent 48%);
            mask-image: linear-gradient(180deg, #000 0%, #000 32%, transparent 48%);
    -webkit-mask-composite: source-over;
            mask-composite: add;
  }
}


/* ------------------------------------------------------------- движение */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes portrait-in {
  from { opacity: 0; transform: translateX(34px) scale(1.03); }
  to   { opacity: 1; transform: none; }
}
/* Сетка медленно уплывает ровно на шаг клетки — стык незаметен,
   а фон перестаёт быть мёртвым */
@keyframes grid-drift {
  from { background-position: 0 0; }
  to   { background-position: 54px 54px; }
}
@keyframes glow-breathe {
  0%, 100% { opacity: .6; transform: scale(.94); }
  50%      { opacity: 1;  transform: scale(1.14); }
}

/* Длительности вдвое больше прежних: фоновое движение должно быть заметным,
   но неторопливым — быстрое мельтешение утомляет на длинном чтении. */
.hero::before { animation: grid-drift 32s linear infinite; }
.hero::after  { animation: glow-breathe 12s ease-in-out infinite; }
.hero__halo   { animation: glow-breathe 15s ease-in-out infinite; }
.hero__portrait-img { animation: portrait-in 1.4s cubic-bezier(.2, .7, .3, 1) backwards; }
.hero__body > * { animation: rise 1s cubic-bezier(.2, .7, .3, 1) backwards; }
.hero__body > :nth-child(1) { animation-delay: .05s; }
.hero__body > :nth-child(2) { animation-delay: .13s; }
.hero__body > :nth-child(3) { animation-delay: .21s; }
.hero__body > :nth-child(4) { animation-delay: .29s; }
.hero__body > :nth-child(5) { animation-delay: .37s; }

/* Класс навешивает JS, поэтому без него ничего не спрячется */
.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }

.hero h1 { color: #fff; margin-bottom: .3em; }
.hero__role {
  font-size: clamp(1.02rem, .96rem + .5vw, 1.24rem);
  color: #fff; font-weight: 500; margin-bottom: .5em;
}
.hero__company { color: #fff; }
.hero__tagline {
  color: #a9b6d2; font-size: 1.02rem; max-width: 46ch;
  border-left: 2px solid var(--accent); padding-left: 16px; margin-bottom: 28px;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px;
  font-size: .95rem; font-weight: 500; border: 1px solid transparent;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #2049e0; }
.btn--ghost { border-color: rgba(255, 255, 255, .26); color: #dfe6f5; }
.btn--ghost:hover { border-color: #fff; background: rgba(255, 255, 255, .06); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: var(--ink-2); }

/* ---------------------------------------------------------------- цифры */
.stats {
  display: grid; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* в две колонки подписи рвутся на «лет в» / «информационной» — на телефоне в одну */
@media (max-width: 560px) { .stats { grid-template-columns: minmax(0, 1fr); } }
.stat { background: var(--surface); padding: 22px 20px; }
.stat__value {
  font-family: var(--display); font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem);
  font-weight: 600; letter-spacing: -.03em; color: var(--text); line-height: 1.1;
}
.stat__label { font-size: .87rem; color: var(--muted); margin-top: 6px; }

/* ---------------------------------------------------------------- сетки */
.grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px)  { .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 700px)  { .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 24px;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.card:hover { border-color: var(--line-hover); box-shadow: var(--shadow); }
.card h3 { margin-bottom: .45em; }
.card p:last-child { margin-bottom: 0; }
.card__num {
  font-family: var(--mono); font-size: .74rem; color: var(--accent);
  letter-spacing: .12em; display: block; margin-bottom: 12px;
}

/* ------------------------------------------------------------- таймлайн */
.timeline { position: relative; margin: 0; padding: 0 0 0 4px; list-style: none; }
.timeline::before {
  content: ''; position: absolute; left: 6px; top: 10px; bottom: 10px;
  width: 2px; background: linear-gradient(var(--accent), var(--line));
}
.tl-item { position: relative; padding: 0 0 34px 34px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: 0; top: 8px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--paper); border: 3px solid var(--accent);
}
.tl-year {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .1em;
  color: var(--accent); display: flex; align-items: center; gap: 8px; margin-bottom: 5px;
}
.tl-icon { width: 17px; height: 17px; }
.tl-title { font-family: var(--display); font-weight: 600; font-size: 1.08rem; letter-spacing: -.01em; }
.tl-org { color: var(--muted); font-size: .93rem; margin-bottom: 8px; }
.tl-item p { margin: 0; color: var(--muted); }

/* --------------------------------------------------------------- списки */
.entries { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.entry {
  display: grid; gap: 4px 24px; padding: 20px 4px;
  border-bottom: 1px solid var(--line);
  grid-template-columns: minmax(0, 1fr);
  transition: background .16s ease;
}
.entry:hover { background: var(--paper-2); }
@media (min-width: 760px) {
  .entry { grid-template-columns: 160px minmax(0, 1fr) auto; align-items: baseline; }
}
.entry__date { font-family: var(--mono); font-size: .82rem; color: var(--muted); letter-spacing: .04em; }
.entry__title { font-weight: 500; color: var(--text); }
.entry__title a { color: inherit; }
.entry__title a:hover { color: var(--accent); }
.entry__meta { font-size: .85rem; color: var(--muted); }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .74rem; font-family: var(--mono);
  letter-spacing: .06em; padding: 3px 9px; border-radius: 999px;
  background: var(--paper-3); color: var(--muted); white-space: nowrap;
  /* без этого в одноколоночной раскладке тег растягивается на всю ячейку грида */
  justify-self: start;
}

/* Тот же список на тёмной секции */
.entries--dark { border-top-color: rgba(255, 255, 255, .13); }
.entries--dark .entry { border-bottom-color: rgba(255, 255, 255, .13); }
.entries--dark .entry:hover { background: rgba(255, 255, 255, .03); }
.entries--dark .entry__title { color: #e7ecf7; }
.entries--dark .entry__date { color: #8b9ac0; }
.entries--dark .tag { background: rgba(255, 255, 255, .07); color: #a9b6d2; }

.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.plain li:last-child { border-bottom: 0; }
.plain strong { font-weight: 600; }
.plain span { color: var(--muted); }

.award { display: flex; gap: 16px; align-items: flex-start; }
.award__year {
  font-family: var(--mono); font-size: .8rem; color: var(--gold);
  border: 1px solid rgba(201, 154, 58, .4); border-radius: 999px;
  padding: 3px 11px; white-space: nowrap; margin-top: 3px;
}

/* --------------------------------------------------------------- баннер */
/* Рендер здания под заголовком: снизу затемнение, чтобы текст читался
   в любом случае, сверху лёгкое — небо на рендере и так почти чёрное. */
/* Картинка обычным <img>, а не фоном: aspect-ratio вместе с max-height
   заставляет блок ужимать ширину, и баннер перестаёт быть во всю ширину. */
.banner { position: relative; background: var(--ink); color: #e7ecf7; }
/* Высота тёмной шапки — одна на весь сайт: и герой, и обложки разделов,
   и вписанные кадры. Меняется в одном месте. */
.banner__frame { position: relative; width: 100%; }
.banner__img {
  display: block; width: 100%;
  height: var(--head-h);
  object-fit: cover; object-position: center;
}

/* Объект справа — тот же приём, что в герое. Нужен, когда сюжет вытянут по
   вертикали: полоса шириной 2000 и высотой 440 имеет пропорцию 4.5:1, и любое
   кадрирование показало бы только середину здания. Здесь оно влезает целиком. */
.banner--object {
  position: relative; overflow: hidden;
  min-height: var(--head-h);
  display: flex; align-items: center;
  padding: clamp(28px, 4vw, 52px) 0;
}
.banner--object::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(122, 162, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 162, 255, .07) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(130% 100% at 80% 20%, #000 0%, transparent 72%);
}
.banner--object .banner__frame {
  position: absolute; z-index: 1;
  right: 3%; bottom: 0; top: auto;
  width: auto; height: 104%;
}
/* Маска в два слоя: боковые кромки плюс верхняя. Без второго слоя верхний
   край кадра проступает горизонтальной полосой — фон рендера чуть светлее ink. */
.banner--object .banner__img {
  height: 100%; width: auto; object-fit: contain;
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0%, #000 26%, #000 90%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 11%);
          mask-image:
    linear-gradient(90deg, transparent 0%, #000 26%, #000 90%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 11%);
  -webkit-mask-composite: source-in;
          mask-composite: intersect;
}
.banner--object .banner__body {
  position: relative; inset: auto; z-index: 2;
  width: 100%; padding: 0; background: none; align-items: center;
}

/* Второй объект в левом поле, до текстовой колонки. Фон у кадра тот же ink,
   что у секции, поэтому достаточно растушевать кромки — стыка не видно.
   Растягивать его фоном секции нельзя: при пропорции полосы 5:1 от сцены
   остаётся одна тарелка во весь экран. */
.banner__aside {
  position: absolute; z-index: 0;
  left: 0; bottom: 4%;
  height: 62%; width: auto;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 76%, transparent 100%),
                      linear-gradient(180deg, transparent 0%, #000 16%, #000 84%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 76%, transparent 100%),
                      linear-gradient(180deg, transparent 0%, #000 16%, #000 84%, transparent 100%);
  -webkit-mask-composite: source-in;
          mask-composite: intersect;
}
/* места на левое поле хватает только на широком экране */
@media (max-width: 1400px) { .banner__aside { display: none; } }
.banner--object .banner__body > .wrap > * { max-width: 44rem; }
@media (max-width: 1100px) { .banner--object .banner__frame { right: -3%; height: 96%; opacity: .9; } }
@media (max-width: 820px)  { .banner--object .banner__frame { right: -12%; height: 88%; opacity: .35; } }

/* Исключение — рендер здания: там важна вся композиция, поэтому кадр показан
   целиком, а обёртка ужимается ровно по нему, чтобы растушёвка кромок легла
   на края картинки, а не на края секции. */
.banner--contain .banner__frame { width: fit-content; max-width: 100%; margin-inline: auto; }
.banner--contain .banner__frame::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, var(--ink) 0%, rgba(12, 19, 34, 0) 13%, rgba(12, 19, 34, 0) 87%, var(--ink) 100%),
    linear-gradient(180deg, var(--ink) 0%, rgba(12, 19, 34, 0) 9%);
}
.banner--contain .banner__img {
  width: auto; max-width: 100%;
  height: var(--head-h);
  object-fit: contain;
}

/* Затемнение к левому верху — там сидит текст, там же самое пустое небо */
.banner__body {
  position: absolute; inset: 0;
  display: flex; align-items: flex-start;
  padding: clamp(28px, 5vw, 84px) 0;
  /* Горизонтальное затемнение, а не диагональное: у диагонали плотность
     зависит от высоты строки, и подзаголовок попадал на светлые места.
     Плотная зона перекрывает всю текстовую колонку (до ~60% ширины). */
  background:
    linear-gradient(90deg,
      rgba(12, 19, 34, .94) 0%,
      rgba(12, 19, 34, .90) 38%,
      rgba(12, 19, 34, .68) 54%,
      rgba(12, 19, 34, .22) 68%,
      transparent 80%),
    linear-gradient(180deg, transparent 80%, rgba(12, 19, 34, .40) 100%);
}
.banner h1 { color: #fff; margin-bottom: .35em; }
.banner .eyebrow { color: var(--accent-2); }
.banner .lead { color: #c3cfe8; margin-bottom: 0; }

@media (max-width: 860px) {
  /* на узком экране целиком кадр не показать — режу по сюжету, текст вниз */
  .banner--contain .banner__frame { width: 100%; }
  .banner--contain .banner__frame::after { background: none; }
  .banner--contain .banner__img { width: 100%; object-fit: cover; object-position: 62% top; }
  .banner__body {
    align-items: flex-end;
    background: linear-gradient(180deg, rgba(12, 19, 34, .35) 0%, rgba(12, 19, 34, .28) 40%, rgba(12, 19, 34, .92) 100%);
  }
}
.banner .wrap { position: relative; z-index: 1; }
.banner h1 { color: #fff; margin-bottom: .35em; }
.banner .eyebrow { color: var(--accent-2); }
.banner .lead { color: #c3cfe8; margin-bottom: 0; }

/* -------------------------------------------------------------- контакты */
.contact-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 22px 24px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface);
  transition: border-color .18s ease, transform .18s ease;
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.contact-card__label { font-family: var(--mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.contact-card__value { color: var(--text); font-weight: 500; }
.contact-card__note { font-size: .85rem; color: var(--muted); }

/* Прямые контакты крупнее профилей — это то, ради чего заходят на страницу */
.contact-card--lead { padding: 28px 30px; gap: 6px; }
.contact-card--lead .contact-card__value {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.1rem, 1rem + .8vw, 1.45rem);
  letter-spacing: -.02em; line-height: 1.25;
}

/* ---------------------------------------------------------------- подвал */
.site-footer {
  background: var(--ink); color: #97a5c2;
  padding: 56px 0 40px; font-size: .9rem;
}
.site-footer a { color: #c3d0ea; }
.site-footer__grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 800px) { .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h4 {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .14em;
  text-transform: uppercase; color: #6f7fa3; font-weight: 400; margin-bottom: 14px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer__bottom {
  margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .1);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  font-size: .84rem; color: #6f7fa3;
}

/* --------------------------------------------------------------- фото */
.strip {
  display: grid; gap: 12px; margin-top: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 700px)  { .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .strip { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.strip figure { margin: 0; }
/* height:auto обязателен — иначе атрибут height у <img> перебивает aspect-ratio */
.strip img {
  width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: var(--radius); background: var(--paper-3);
}
.strip figcaption { font-size: .82rem; color: var(--muted); padding-top: 8px; }
.section--dark .strip figcaption { color: #9aa8c4; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filters button {
  font: inherit; font-size: .92rem; cursor: pointer;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.filters button:hover { border-color: var(--line-hover); color: var(--text); }
.filters button[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: #fff; }

.gal {
  display: grid; gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 700px)  { .gal { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .gal { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.gal__item { margin: 0; cursor: zoom-in; }
.gal__item img {
  width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: var(--radius); background: var(--paper-3);
  transition: transform .2s ease, box-shadow .2s ease;
}
.gal__item:hover img { transform: translateY(-3px); box-shadow: var(--shadow); }
.gal__item figcaption { padding-top: 9px; font-size: .86rem; line-height: 1.45; }
.gal__date { display: block; font-family: var(--mono); font-size: .74rem; color: var(--muted); margin-top: 3px; }

.lb {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 12, 22, .94);
  display: grid; place-items: center; padding: 24px;
}
.lb[hidden] { display: none; }
.lb img { max-width: min(100%, 900px); max-height: 78vh; border-radius: var(--radius); }
.lb__caption { color: #dfe6f5; text-align: center; margin-top: 16px; max-width: 60ch; font-size: .95rem; }
.lb__counter { color: #6f7fa3; font-family: var(--mono); font-size: .78rem; margin-top: 6px; }
.lb button {
  position: absolute; cursor: pointer; font: inherit; color: #fff;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2);
  width: 46px; height: 46px; border-radius: 50%; font-size: 1.2rem; line-height: 1;
}
.lb button:hover { background: rgba(255, 255, 255, .2); }
.lb__close { top: 20px; right: 20px; }
.lb__prev  { left: 20px;  top: 50%; transform: translateY(-50%); }
.lb__next  { right: 20px; top: 50%; transform: translateY(-50%); }
@media (max-width: 620px) {
  .lb__prev { left: 12px; }
  .lb__next { right: 12px; }
}

/* --------------------------------------------------------------- иконки */
.icon { width: 22px; height: 22px; flex: none; display: block; }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat__icon { color: var(--accent); margin-bottom: 12px; }

.card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card__head .card__num { margin-bottom: 0; }
.card__icon { color: var(--accent); }
.card:hover .card__icon { color: var(--text); }

/* Карточки на тёмной секции «Вне работы» */
.card--ghost { background: transparent; border-color: rgba(255, 255, 255, .14); }
.card--ghost:hover { border-color: rgba(122, 162, 255, .42); box-shadow: none; }
.card--ghost .card__icon { color: var(--accent-2); margin-bottom: 14px; }
.card--ghost:hover .card__icon { color: #fff; }
.card--ghost p { color: #a9b6d2; }

.contact-card__icon { color: var(--accent); margin-bottom: 10px; }
.contact-card--lead .contact-card__icon { width: 26px; height: 26px; }

.filters button { display: inline-flex; align-items: center; gap: 8px; }
.filters__icon { width: 17px; height: 17px; opacity: .75; }
.filters button[aria-pressed='true'] .filters__icon { opacity: 1; }

.tag__icon { width: 14px; height: 14px; opacity: .6; }

.plain__row { display: flex; gap: 14px; align-items: flex-start; }
.plain__icon { color: var(--accent); margin-top: 3px; opacity: .8; }

.award { position: relative; }
.award__icon {
  position: absolute; top: 24px; right: 24px;
  width: 26px; height: 26px; color: var(--gold); opacity: .38;
}
.card:hover .award__icon { opacity: .7; }

/* Точечные поправки тёмной темы: элементы, построенные на ink, в ней теряются —
   ink стал почти равен фону страницы. */
:root[data-theme='dark'] .filters button[aria-pressed='true'] {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
:root[data-theme='dark'] .btn--dark {
  background: var(--surface); border-color: var(--line); color: var(--text);
}
:root[data-theme='dark'] .btn--dark:hover { background: var(--paper-3); }
:root[data-theme='dark'] .site-footer { border-top: 1px solid var(--line); }
:root[data-theme='dark'] .award__year { border-color: rgba(211, 169, 74, .45); }

/* ----------------------------------------------------------- утилита */
.page-head { padding: clamp(44px, 5vw, 76px) 0 8px; }
.mt-0 { margin-top: 0; }
.mb-l { margin-bottom: 36px; }
.center { text-align: center; }
.disclaimer { font-size: .84rem; color: var(--muted); max-width: 78ch; }

/* Привязки к prefers-reduced-motion здесь намеренно нет: по решению заказчика
   анимации показываются всем одинаково, независимо от системной настройки. */

@media print {
  .site-header, .site-footer, .btn-row { display: none; }
  body { font-size: 12pt; }
  .hero { background: #fff; color: #000; }
}
