/* =====================================================================
   ПОРТФОЛИО — стили
   Цвета и шрифты меняются в блоке :root ниже.
   ===================================================================== */

:root {
  --bg: #0a0708;
  --bg-2: #110b0d;
  --surface: #150d10;
  --line: rgba(236, 228, 223, 0.09);
  --line-strong: rgba(236, 228, 223, 0.18);
  --text: #ece4df;
  --muted: #a3928f;
  --dim: #6f6260;
  --accent: #c8102e;
  --accent-soft: #e0435a;
  --accent-deep: #5c0716;

  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --caps: 'Cormorant SC', 'Cormorant Garamond', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --gutter: clamp(16px, 5vw, 72px);
  --maxw: 1320px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 72px;
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}
body.lb-lock, body.menu-open { overflow: hidden; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
em { font-style: italic; }

::selection { background: var(--accent); color: #fff; }

:focus-visible { outline: 1px solid var(--accent-soft); outline-offset: 4px; }

/* зерно поверх всего сайта */
.grain {
  position: fixed; inset: -50%;
  z-index: 90; pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(8) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); }
  75% { transform: translate(-2%, -1%); }
}

.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  z-index: 120;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--accent-soft));
  transform-origin: 0 50%; transform: scaleX(0);
}

/* общие мелочи */
.eyebrow, .kicker {
  font-family: var(--sans);
  font-size: 11px; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent-soft);
}
.kicker { color: var(--muted); letter-spacing: .18em; }

.study {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--dim);
}
.study::before { content: ''; width: 18px; height: 1px; background: currentColor; }

/* =====================================================================
   ШАПКА
   ===================================================================== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--gutter);
  transition: background .4s var(--ease), border-color .4s var(--ease), height .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  --header-h: 60px;
  background: rgba(10, 7, 8, .78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-color: var(--line);
}

.brand {
  font-family: var(--caps);
  font-size: 20px; font-weight: 600;
  letter-spacing: .28em;
  color: var(--text);
  white-space: nowrap;
}
.brand i { font-style: normal; color: var(--accent); }

.nav { display: flex; gap: clamp(14px, 2vw, 30px); }
.nav a {
  position: relative;
  font-size: 12px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
  padding: 6px 0;
  transition: color .3s var(--ease);
}
.nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease);
}
.nav a:hover, .nav a.is-active { color: var(--text); }
.nav a:hover::after, .nav a.is-active::after { transform: scaleX(1); transform-origin: left; }

.burger { display: none; width: 44px; height: 44px; position: relative; z-index: 110; }
.burger span {
  position: absolute; left: 11px; right: 11px; height: 1px; background: var(--text);
  transition: transform .45s var(--ease), top .45s var(--ease);
}
.burger span:first-child { top: 18px; }
.burger span:last-child { top: 25px; }
.menu-open .burger span:first-child { top: 22px; transform: rotate(45deg); }
.menu-open .burger span:last-child { top: 22px; transform: rotate(-45deg); }

/* =====================================================================
   ГЛАВНЫЙ ЭКРАН
   ===================================================================== */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--header-h) + 40px) var(--gutter) clamp(40px, 7vh, 80px);
  overflow: hidden;
  isolation: isolate;
}
.hero-glow {
  position: absolute; z-index: -1;
  width: 70vmax; height: 70vmax; border-radius: 50%;
  top: -30vmax; right: -18vmax;
  background: radial-gradient(circle, rgba(200, 16, 46, .30) 0%, rgba(92, 7, 22, .18) 35%, transparent 65%);
  filter: blur(20px);
  animation: drift 18s ease-in-out infinite alternate;
}
.hero-glow--2 {
  width: 55vmax; height: 55vmax;
  top: auto; right: auto; bottom: -32vmax; left: -20vmax;
  background: radial-gradient(circle, rgba(120, 10, 30, .28) 0%, transparent 62%);
  animation-duration: 24s; animation-direction: alternate-reverse;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-6vmax, 5vmax) scale(1.12); }
}

.hero-eyebrow {
  display: flex; flex-wrap: wrap; gap: 10px 28px;
  margin-bottom: clamp(16px, 3vh, 32px);
  font-size: 12px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase;
  color: var(--muted);
}
.hero-eyebrow span { display: inline-flex; align-items: center; gap: 28px; }
.hero-eyebrow span + span::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(76px, 17.5vw, 290px);
  line-height: .82;
  letter-spacing: -.035em;
  text-transform: uppercase;
  color: var(--text);
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: .04em; }
.hero-title .line > span { display: inline-block; }
.hero-title .line--2 { padding-left: 16vw; }
.hero-title em {
  text-transform: none;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.02em;
  color: transparent;
  background: linear-gradient(100deg, var(--accent-soft) 0%, var(--accent) 45%, #7d0a1d 100%);
  -webkit-background-clip: text; background-clip: text;
  padding-right: .08em;
}

.hero-bottom {
  margin-top: clamp(28px, 6vh, 64px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px;
  align-items: end;
}
.hero-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(20px, 2.1vw, 28px);
  line-height: 1.35;
  color: var(--muted);
  max-width: 30ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  height: 50px; padding: 0 28px;
  font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  border-radius: 999px;
  transition: color .4s var(--ease), border-color .4s var(--ease), background .4s var(--ease), transform .4s var(--ease);
  isolation: isolate;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--text);
  transform: translateY(101%); transition: transform .5s var(--ease);
}
.btn--primary:hover { color: var(--bg); }
.btn--primary:hover::before { transform: translateY(0); }
.btn--ghost { border: 1px solid var(--line-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); background: rgba(200, 16, 46, .08); }

.hero-index-label {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--dim);
  margin-bottom: 10px;
}
.hero-index ol { columns: 2; column-gap: 32px; }
.hero-index li { break-inside: avoid; }
.hero-index a {
  display: flex; align-items: baseline; gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--serif); font-size: 20px; line-height: 1.2;
  color: var(--text);
  transition: color .3s var(--ease), padding .4s var(--ease);
}
.hero-index a span { font-family: var(--sans); font-size: 11px; letter-spacing: .1em; color: var(--accent-soft); }
.hero-index a:hover { color: var(--accent-soft); padding-left: 8px; }

.scroll-cue {
  position: absolute; left: 50%; bottom: 18px;
  width: 1px; height: 44px; overflow: hidden;
  background: var(--line);
  transform: translateX(-50%);
}
.scroll-cue span {
  position: absolute; left: 0; top: 0; width: 1px; height: 100%;
  background: var(--accent);
  animation: cue 2.2s var(--ease) infinite;
}
@keyframes cue { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }

/* вступительная анимация */
.js .hero-title .line > span { transform: translateY(105%); animation: rise 1.2s var(--ease) forwards; }
.js .hero-title .line--2 > span { animation-delay: .12s; }
.js .hero-eyebrow, .js .hero-bottom { opacity: 0; animation: fade 1.2s var(--ease) .5s forwards; }
@keyframes rise { to { transform: translateY(0); } }
@keyframes fade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* бегущая строка */
.marquee {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow: hidden; white-space: nowrap;
  padding: 18px 0;
  background: var(--bg-2);
}
.marquee-track { display: inline-flex; align-items: center; animation: marquee 45s linear infinite; }
.marquee span {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(22px, 2.6vw, 34px);
  color: var(--text); padding: 0 26px;
}
.marquee i { font-style: normal; color: var(--accent); font-size: 14px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* =====================================================================
   СЕКЦИИ
   ===================================================================== */
.about, .work, .contacts {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(80px, 13vh, 150px) var(--gutter);
}
.work { border-top: 1px solid var(--line); max-width: none; }
.work > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }

/* --- О себе --- */
.about {
  display: grid; grid-template-columns: minmax(220px, 1fr) 2.2fr; gap: clamp(32px, 6vw, 100px);
}
.about-aside { position: sticky; top: 120px; align-self: start; }
.sec-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(46px, 6.4vw, 96px);
  line-height: .95; letter-spacing: -.02em;
  margin-top: 12px;
}
.roles { margin-top: 28px; }
.roles li {
  font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--muted);
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.about-lead {
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 50px);
  line-height: 1.15; letter-spacing: -.01em;
}
.about-lead em { color: var(--accent-soft); }
.about-text { margin-top: 32px; max-width: 62ch; color: var(--muted); font-size: 17px; font-weight: 300; }

.facts {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin-top: 56px;
  border-top: 1px solid var(--line);
}
.facts > div { padding: 24px 24px 0 0; }
.facts > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.facts dt { font-family: var(--serif); font-size: clamp(26px, 2.6vw, 36px); line-height: 1.1; }
.facts dd { margin-top: 6px; font-size: 13px; color: var(--muted); }

.tools { margin-top: 56px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chips li {
  font-size: 13px; padding: 8px 16px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--text);
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.chips li:hover { border-color: var(--accent); background: rgba(200, 16, 46, .08); }

/* --- Заголовок раздела с работами --- */
.sec-head {
  display: grid;
  grid-template-columns: auto 1fr minmax(260px, 420px);
  gap: 20px clamp(24px, 4vw, 64px);
  align-items: end;
  margin-bottom: clamp(48px, 8vh, 88px);
}
.sec-num {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(64px, 9vw, 140px); line-height: .8;
  color: transparent;
  -webkit-text-stroke: 1px rgba(200, 16, 46, .75);
}
.sec-lead { color: var(--muted); font-size: 15px; font-weight: 300; padding-bottom: 8px; }

/* --- Подгруппа --- */
.group + .group { margin-top: clamp(72px, 11vh, 120px); }
.group-head {
  display: grid; grid-template-columns: 90px 1fr; gap: 16px;
  padding-top: 22px; margin-bottom: 36px;
  border-top: 1px solid var(--line);
}
.group-idx { font-size: 12px; letter-spacing: .14em; color: var(--accent-soft); padding-top: 10px; }
.group-title { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.4vw, 48px); line-height: 1.05; }
.group-text { margin-top: 14px; max-width: 72ch; color: var(--muted); font-weight: 300; }

/* --- Карточки --- */
.cards { display: grid; gap: clamp(28px, 3vw, 44px) clamp(20px, 2.4vw, 36px); }
.cards.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cards.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card { display: flex; flex-direction: column; }

.card-media {
  --ratio: 4/3; --pos: center;
  position: relative; display: block; width: 100%;
  aspect-ratio: var(--ratio);
  border-radius: 4px;
  cursor: zoom-in;
  text-align: left;
}
.media-frame {
  position: absolute; inset: 0; overflow: hidden;
  border-radius: inherit;
  background:
    linear-gradient(110deg, transparent 30%, rgba(236, 228, 223, .04) 50%, transparent 70%) 0 0 / 250% 100%,
    var(--surface);
  animation: shimmer 1.8s linear infinite;
  box-shadow: inset 0 0 0 1px var(--line);
}
.card-media.is-loaded .media-frame, .card-media.is-missing .media-frame { animation: none; }
@keyframes shimmer { to { background-position: -250% 0, 0 0; } }

.media-frame img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: var(--pos);
  opacity: 0;
  transform: scale(1.02);
  transition: opacity .8s var(--ease), transform 1.2s var(--ease), filter .8s var(--ease);
}
.card-media.is-loaded img { opacity: 1; transform: scale(1); }
.card-media:hover img { transform: scale(1.045); }

.media-frame::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(10, 7, 8, .55));
  opacity: 0; transition: opacity .5s var(--ease);
}
.card-media:hover .media-frame::after { opacity: 1; }

/* «стопка» для карточек с несколькими картинками */
.card-media.is-stack::before, .card-media.is-stack::after {
  content: ''; position: absolute; left: 6%; right: 6%; height: 100%;
  border-radius: 4px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .6s var(--ease);
}
.card-media.is-stack::before { top: -8px; transform: scaleX(.96); opacity: .6; z-index: -1; }
.card-media.is-stack::after { top: -16px; left: 12%; right: 12%; opacity: .3; z-index: -2; }
.card-media.is-stack:hover::before { transform: translateY(-4px) scaleX(.96); }
.card-media.is-stack:hover::after { transform: translateY(-8px); }
.card-media.is-stack { margin-top: 16px; isolation: isolate; }

.media-count {
  position: absolute; left: 12px; bottom: 12px;
  font-size: 11px; font-weight: 500; letter-spacing: .08em;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(10, 7, 8, .62);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line-strong);
}
.media-open {
  position: absolute; right: 12px; top: 12px;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  opacity: 0; transform: scale(.6) rotate(-45deg);
  transition: opacity .4s var(--ease), transform .5s var(--ease);
}
.media-open svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.card-media:hover .media-open, .card-media:focus-visible .media-open { opacity: 1; transform: none; }

.card-media.is-missing .media-frame img { display: none; }
.card-media.is-missing .media-frame::before {
  content: 'Изображение не найдено'; position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim);
}

.card-body { padding-top: 22px; }
.card-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(24px, 2.1vw, 30px); line-height: 1.12;
  margin-top: 8px;
  transition: color .3s var(--ease);
}
.card:hover .card-title { color: var(--accent-soft); }
.card-text { margin-top: 10px; color: var(--muted); font-size: 15px; font-weight: 300; max-width: 52ch; }

/* --- Развороты (figures) --- */
.figures { display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(28px, 3vw, 44px) clamp(20px, 2.4vw, 36px); }
.figure { grid-column: span 2; }
/* 5 разворотов: 3 + 2 крупнее */
.figures:has(> .figure:nth-child(5):last-child) > .figure:nth-child(n+4) { grid-column: span 3; }
.figure figcaption {
  display: grid; grid-template-columns: 34px 1fr; gap: 10px;
  padding-top: 18px;
}
.fig-num { font-size: 11px; letter-spacing: .1em; color: var(--accent-soft); padding-top: 6px; }
.fig-text strong { display: block; font-family: var(--serif); font-weight: 500; font-size: 22px; line-height: 1.15; }
.fig-text span { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); font-weight: 300; }

/* =====================================================================
   КОНТАКТЫ
   ===================================================================== */
.contacts { border-top: 1px solid var(--line); max-width: none; }
.contacts > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.contacts-head { display: flex; gap: clamp(24px, 4vw, 64px); align-items: flex-end; margin-bottom: clamp(40px, 7vh, 80px); }
.contacts-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(50px, 8.5vw, 136px); line-height: .92; letter-spacing: -.025em;
  margin-top: 12px;
}
.contacts-title em { color: var(--accent-soft); }

.contact-list { border-top: 1px solid var(--line); }
.contact-list a {
  position: relative;
  display: grid; grid-template-columns: 180px 1fr auto; align-items: center; gap: 24px;
  padding: clamp(20px, 3vh, 32px) 0;
  border-bottom: 1px solid var(--line);
  overflow: hidden; isolation: isolate;
}
.contact-list a::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(200, 16, 46, .14), transparent 70%);
  transform: scaleX(0); transform-origin: left;
  transition: transform .6s var(--ease);
}
.contact-list a:hover::before { transform: scaleX(1); }
.cl-label { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.cl-value {
  font-family: var(--serif); font-size: clamp(26px, 3.6vw, 52px); line-height: 1.1;
  transition: transform .5s var(--ease), color .3s var(--ease);
  word-break: break-word;
}
.contact-list a:hover .cl-value { transform: translateX(12px); color: var(--accent-soft); }
.cl-arrow {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  font-size: 20px;
  transition: background .4s var(--ease), border-color .4s var(--ease), transform .5s var(--ease);
}
.contact-list a:hover .cl-arrow { background: var(--accent); border-color: var(--accent); transform: rotate(45deg); }

/* =====================================================================
   ПОДВАЛ
   ===================================================================== */
.footer {
  padding: 48px var(--gutter) 36px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.disclaimer {
  max-width: 90ch;
  font-size: 12px; line-height: 1.7; color: var(--dim);
}
.disclaimer strong { color: var(--muted); font-weight: 500; }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.footer-bottom a:hover { color: var(--accent-soft); }

/* =====================================================================
   ПОЯВЛЕНИЕ ПРИ ПРОКРУТКЕ
   ===================================================================== */
.js .reveal { opacity: 0; transform: translateY(36px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* =====================================================================
   ПРОСМОТР ИЗОБРАЖЕНИЙ
   ===================================================================== */
.lb {
  position: fixed; inset: 0; z-index: 200;
  display: grid; grid-template-rows: auto 1fr auto;
  background: rgba(8, 5, 6, .94);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  opacity: 0; visibility: hidden;
  transition: opacity .45s var(--ease), visibility 0s linear .45s;
}
.lb.is-open { opacity: 1; visibility: visible; transition: opacity .45s var(--ease); }

.lb-top {
  display: flex; align-items: center; gap: 20px;
  padding: 16px var(--gutter);
  border-bottom: 1px solid var(--line);
}
.lb-cap { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 16px; }
.lb-title { font-family: var(--serif); font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-count { font-size: 12px; letter-spacing: .14em; color: var(--accent-soft); }
.lb-close, .lb-nav {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  border: 1px solid var(--line-strong);
  transition: background .3s var(--ease), border-color .3s var(--ease), transform .4s var(--ease);
}
.lb-close svg, .lb-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.lb-close:hover { background: var(--accent); border-color: var(--accent); transform: rotate(90deg); }
.lb-nav:hover { background: var(--accent); border-color: var(--accent); }

.lb-stage {
  position: relative; min-height: 0;
  display: flex; align-items: center; justify-content: center; gap: 20px;
  padding: 20px var(--gutter);
}
.lb-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px var(--line);
  opacity: 0; transform: scale(.985);
  transition: opacity .45s var(--ease), transform .6s var(--ease);
  min-width: 0;
}
.lb-img.is-shown { opacity: 1; transform: none; }
.lb.is-single .lb-nav, .lb.is-single .lb-thumbs { display: none; }

.lb-thumbs {
  display: flex; gap: 8px; justify-content: safe center;
  padding: 12px var(--gutter) 18px;
  overflow-x: auto; scrollbar-width: none;
}
.lb-thumbs::-webkit-scrollbar { display: none; }
.lb-thumbs button {
  flex: none; width: 64px; height: 44px; border-radius: 3px; overflow: hidden;
  opacity: .4; outline: 1px solid transparent; outline-offset: 2px;
  transition: opacity .3s var(--ease), outline-color .3s var(--ease);
}
.lb-thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.lb-thumbs button:hover { opacity: .8; }
.lb-thumbs button.is-active { opacity: 1; outline-color: var(--accent); }

/* =====================================================================
   МУЗЫКА
   ===================================================================== */
.sound {
  position: fixed; right: var(--gutter); bottom: 24px; z-index: 110;
  display: inline-flex; align-items: center; gap: 12px;
  height: 44px; padding: 0 18px 0 16px;
  border-radius: 999px;
  background: rgba(21, 13, 16, .7);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-strong);
  font-size: 11px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted);
  transition: border-color .3s var(--ease), color .3s var(--ease);
}
.sound:hover, .sound.is-on { border-color: var(--accent); color: var(--text); }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.bars i { width: 2px; height: 4px; background: var(--accent); border-radius: 1px; transition: height .3s var(--ease); }
.sound.is-on .bars i { animation: eq 1s ease-in-out infinite; }
.sound.is-on .bars i:nth-child(2) { animation-delay: -.4s; }
.sound.is-on .bars i:nth-child(3) { animation-delay: -.7s; }
.sound.is-on .bars i:nth-child(4) { animation-delay: -.2s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }

/* =====================================================================
   АДАПТИВ
   ===================================================================== */
@media (max-width: 1100px) {
  .nav { gap: 16px; }
  .nav a { font-size: 11px; letter-spacing: .1em; }
  .sec-head { grid-template-columns: auto 1fr; }
  .sec-lead { grid-column: 1 / -1; max-width: 60ch; }
}

@media (max-width: 960px) {
  .burger { display: block; }
  .nav {
    position: fixed; inset: 0;
    flex-direction: column; justify-content: center; gap: 4px;
    padding: 80px var(--gutter) 40px;
    background: rgba(10, 7, 8, .97);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    opacity: 0; visibility: hidden;
    transition: opacity .45s var(--ease), visibility 0s linear .45s;
  }
  .menu-open .nav { opacity: 1; visibility: visible; transition: opacity .45s var(--ease); }
  .nav a {
    font-family: var(--serif); font-size: clamp(34px, 8vw, 52px);
    letter-spacing: 0; text-transform: none; color: var(--text);
    padding: 4px 0;
    transform: translateY(20px); opacity: 0;
    transition: transform .6s var(--ease), opacity .6s var(--ease), color .3s;
  }
  .nav a::after { display: none; }
  .nav a.is-active { color: var(--accent-soft); }
  .menu-open .nav a { transform: none; opacity: 1; }
  .menu-open .nav a:nth-child(2) { transition-delay: .04s; }
  .menu-open .nav a:nth-child(3) { transition-delay: .08s; }
  .menu-open .nav a:nth-child(4) { transition-delay: .12s; }
  .menu-open .nav a:nth-child(5) { transition-delay: .16s; }
  .menu-open .nav a:nth-child(6) { transition-delay: .20s; }
  .menu-open .nav a:nth-child(7) { transition-delay: .24s; }
  .menu-open .site-header { background: transparent; border-color: transparent; backdrop-filter: none; }

  .hero-bottom { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; }
  .about-aside { position: static; }
  .roles { display: flex; flex-wrap: wrap; gap: 0 20px; }
  .roles li { border: 0; padding: 0; }

  .cards.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .figures { grid-template-columns: repeat(2, 1fr); }
  .figure, .figures:has(> .figure:nth-child(5):last-child) > .figure:nth-child(n+4) { grid-column: auto; }
  .figures > .figure:nth-child(5):last-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  :root { --header-h: 62px; }
  body { font-size: 15px; }
  .hero-title { font-size: clamp(64px, 22vw, 120px); }
  .hero-title .line--2 { padding-left: 10vw; }
  .hero-eyebrow { gap: 8px 16px; font-size: 11px; letter-spacing: .2em; }
  .hero-eyebrow span { gap: 16px; }
  .hero-index ol { columns: 1; }
  .hero-actions .btn { flex: 1; padding: 0 14px; letter-spacing: .1em; font-size: 11px; white-space: nowrap; }
  .scroll-cue { display: none; }

  .facts { grid-template-columns: 1fr; }
  .facts > div, .facts > div + div { padding: 18px 0; border-left: 0; border-bottom: 1px solid var(--line); }

  .sec-head { grid-template-columns: 1fr; gap: 12px; }
  .sec-num { font-size: 64px; }
  .group-head { grid-template-columns: 1fr; gap: 6px; }
  .group-idx { padding-top: 0; }

  .cards.cols-3, .cards.cols-2 { grid-template-columns: 1fr; }
  .figures { grid-template-columns: 1fr; }
  .figures > .figure:nth-child(5):last-child { grid-column: auto; }
  .media-open { opacity: 1; transform: none; width: 34px; height: 34px; }

  .contacts-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .contact-list a { grid-template-columns: 1fr auto; gap: 4px 16px; }
  .cl-label { grid-column: 1; }
  .cl-value { grid-column: 1; font-size: 26px; }
  .cl-arrow { grid-column: 2; grid-row: 1 / span 2; width: 44px; height: 44px; }

  .lb-top { padding: 10px 16px; gap: 12px; }
  .lb-cap { flex-direction: column; gap: 0; }
  .lb-title { font-size: 18px; }
  .lb-stage { padding: 12px 0; gap: 0; }
  .lb-nav { position: absolute; bottom: 12px; z-index: 2; width: 44px; height: 44px; background: rgba(10, 7, 8, .7); }
  .lb-prev { left: 16px; } .lb-next { right: 16px; }
  .lb-thumbs { padding: 10px 16px 14px; }

  .sound { right: 16px; bottom: 16px; }
  .sound-label { display: none; }
  .sound { padding: 0 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
}
