/* ============================================================
   Секции и компоненты
   ============================================================ */

/* ---------- ПРЕЛОАДЕР ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--dark);
  display: flex;
  align-items: flex-end;
  padding: var(--gutter);
  transition: transform .9s var(--ease);
}
.preloader.is-done { transform: translateY(-101%); }

.preloader__inner {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}
.preloader__logo {
  width: clamp(150px, 22vw, 280px);
  height: auto;
}
.preloader__count {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(56px, 14vw, 190px);
  line-height: .8;
  letter-spacing: -.04em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.preloader__bar {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(var(--gutter) - 10px);
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.preloader__bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 2px;
}

/* ---------- КУРСОР ---------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  z-index: 450;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
}
.cursor.is-on { opacity: 1; }

.cursor__dot,
.cursor__ring {
  position: absolute;
  top: 0; left: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.cursor__dot {
  width: 6px; height: 6px;
  background: var(--accent);
}
.cursor__ring {
  width: 38px; height: 38px;
  border: 1.5px solid var(--line-strong);
  display: grid;
  place-items: center;
  transition: width .35s var(--ease), height .35s var(--ease),
              background-color .35s var(--ease), border-color .35s var(--ease);
}
.cursor__label {
  font-family: var(--font-sub);
  font-style: normal;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--light);
  opacity: 0;
  transform: scale(.7);
  transition: opacity .25s, transform .25s var(--ease);
  white-space: nowrap;
}
.cursor.is-hover .cursor__ring {
  width: 62px; height: 62px;
  border-color: transparent;
  background: var(--accent);
}
.cursor.is-hover .cursor__dot { opacity: 0; }
.cursor.is-view .cursor__ring { width: 96px; height: 96px; }
.cursor.is-view .cursor__label { opacity: 1; transform: scale(1); }

/* ---------- ПРОГРЕСС ---------- */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 320;
  background: transparent;
}
.progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transform-origin: 0 50%;
}

/* ---------- ШАПКА ---------- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 300;
  padding-block: clamp(14px, 1.6vw, 22px);
  transition: background-color .4s var(--ease), color .4s var(--ease),
              backdrop-filter .4s, transform .5s var(--ease);
}
.header.is-stuck {
  background: rgba(30, 30, 30, .78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header.is-hidden { transform: translateY(-110%); }
.header.is-light { color: var(--dark); }
.header.is-light.is-stuck {
  background: rgba(235, 235, 235, .82);
  border-bottom-color: var(--inv-line);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 44px);
}

.logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.logo img {
  width: clamp(112px, 11vw, 158px);
  height: auto;
  transition: transform .5s var(--ease), opacity .4s;
}
.logo:hover img { transform: scale(1.04); }

.nav {
  display: flex;
  gap: clamp(14px, 1.8vw, 30px);
  margin-left: auto;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
}
.nav a {
  position: relative;
  padding-block: 4px;
  opacity: .78;
  transition: opacity .3s;
}
.nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform .45s var(--ease);
}
.nav a:hover { opacity: 1; }
.nav a:hover::after,
.nav a.is-active::after { transform: scaleX(1); transform-origin: 0 50%; }
.nav a.is-active { opacity: 1; color: var(--accent); }

.burger {
  display: none;
  width: 44px; height: 44px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-direction: column;
}
.burger span {
  display: block;
  width: 18px; height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .4s var(--ease), opacity .3s;
}
.burger[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child  { transform: translateY(-3.5px) rotate(-45deg); }

/* ---------- КНОПКИ ---------- */
.btn {
  --btn-bg: var(--accent);
  --btn-fg: var(--light);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .01em;
  color: var(--btn-fg);
  background: var(--btn-bg);
  overflow: hidden;
  isolation: isolate;
  white-space: nowrap;
  transition: color .35s var(--ease), border-color .35s var(--ease);
}
.btn > * { position: relative; z-index: 1; }
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--light);
  border-radius: inherit;
  transform: translateY(101%);
  transition: transform .5s var(--ease);
}
.btn:hover { color: var(--dark); }
.btn:hover::before { transform: translateY(0); }
.btn svg { transition: transform .45s var(--ease); }
.btn:hover svg { transform: translateX(4px); }

.btn--lg { padding: 17px 32px; font-size: 15px; }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--fg);
  border: 1.5px solid var(--line-strong);
}
.btn--ghost::before { background: var(--accent); }
.btn--ghost:hover { color: var(--light); border-color: var(--accent); }

.header__cta { padding: 11px 20px; font-size: 13px; }

.arrow {
  width: 52px; height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  transition: background-color .35s var(--ease), border-color .35s var(--ease),
              color .35s var(--ease);
}
.arrow:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--light);
}

/* ---------- КАРТОЧКА (общая) ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(24px, 2.4vw, 36px);
  transition: transform .55s var(--ease), border-color .45s, background-color .45s;
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding-top: clamp(120px, 16vh, 200px);
  padding-bottom: clamp(40px, 6vh, 80px);
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
/* фоновое видео главного экрана */
.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.9) contrast(1.03);
}

/* затемнение поверх видео — без него текст не читается */
.hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top,
      var(--dark) 0%,
      rgba(30, 30, 30, .82) 26%,
      rgba(30, 30, 30, .52) 62%,
      rgba(30, 30, 30, .62) 100%),
    linear-gradient(to right,
      rgba(30, 30, 30, .74) 0%,
      rgba(30, 30, 30, .30) 55%,
      rgba(30, 30, 30, .10) 100%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .55;
}
.blob--1 {
  width: 46vw; height: 46vw;
  max-width: 640px; max-height: 640px;
  right: -8vw; top: 4vh;
  background: radial-gradient(circle, var(--accent) 0%, transparent 68%);
  opacity: .34;
  animation: float1 18s ease-in-out infinite;
}
.blob--2 {
  width: 34vw; height: 34vw;
  max-width: 460px; max-height: 460px;
  left: -6vw; bottom: -6vh;
  background: radial-gradient(circle, #ff8a45 0%, transparent 68%);
  opacity: .20;
  animation: float2 22s ease-in-out infinite;
}
@keyframes float1 {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  50%      { transform: translate3d(-4%, 6%, 0) scale(1.12); }
}
@keyframes float2 {
  0%, 100% { transform: translate3d(0,0,0) scale(1.06); }
  50%      { transform: translate3d(6%, -5%, 0) scale(.94); }
}

.hero__inner { position: relative; z-index: 1; width: 100%; }

.hero__title {
  margin-block: clamp(18px, 2.4vw, 34px) clamp(28px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  font-size: clamp(30px, 6.6vw, 100px);
  line-height: 1.02;
  letter-spacing: -.035em;
  max-width: 20ch;
  text-shadow: 0 2px 40px rgba(30, 30, 30, .55);
}
.hero__line { display: block; }
.hero__line--accent { color: var(--accent); }

.hero__foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(24px, 4vw, 64px);
  padding-top: clamp(20px, 2.6vw, 34px);
  border-top: 1px solid var(--line);
}
.hero__lead { max-width: 46ch; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero__scroll {
  position: absolute;
  right: 0; bottom: -8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sub);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero__scroll-line {
  width: 1px; height: 54px;
  background: linear-gradient(var(--accent), transparent);
  animation: scrollLine 2.2s ease-in-out infinite;
}
@keyframes scrollLine {
  0%   { transform: scaleY(0); transform-origin: 0 0; }
  45%  { transform: scaleY(1); transform-origin: 0 0; }
  55%  { transform: scaleY(1); transform-origin: 0 100%; }
  100% { transform: scaleY(0); transform-origin: 0 100%; }
}

/* ---------- БЕГУЩАЯ СТРОКА ---------- */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: var(--surface);
  padding-block: clamp(14px, 1.6vw, 22px);
}
.marquee__track {
  display: flex;
  width: max-content;
  will-change: transform;
}
.marquee__group {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.4vw, 40px);
  padding-right: clamp(20px, 2.4vw, 40px);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 2.6vw, 40px);
  letter-spacing: -.02em;
  white-space: nowrap;
}
.marquee__group i {
  color: var(--accent);
  font-style: normal;
  font-size: .55em;
}

/* ---------- ПОРТФОЛИО ---------- */
.filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: clamp(24px, 3vw, 44px);
}
.filter__btn {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  transition: background-color .35s var(--ease), border-color .35s var(--ease), color .35s var(--ease);
}
.filter__btn sup {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  transition: color .35s;
}
.filter__btn:hover { border-color: var(--accent); }
.filter__btn[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--light);
}
.filter__btn[aria-selected="true"] sup { color: rgba(235, 235, 235, .8); }

/* строка над сеткой: разделы слева, поиск справа */
.work__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 24px;
  margin-bottom: clamp(24px, 3vw, 44px);
}
.work__bar .filter { margin-bottom: 0; flex: 1 1 520px; }

.search {
  flex: 0 1 300px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  color: var(--muted);
  transition: border-color .35s var(--ease), color .35s;
}
.search:focus-within { border-color: var(--accent); color: var(--fg); }
.search svg { flex-shrink: 0; }
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  outline: none;
}
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { filter: invert(1) grayscale(1); cursor: pointer; }

.work__empty {
  padding: clamp(40px, 6vw, 80px) 0;
  text-align: center;
  color: var(--muted);
  font-family: var(--font-sub);
}

.work__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 26px);
}

.work-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color .45s, transform .55s var(--ease);
}
.work-card:hover { border-color: var(--line-strong); transform: translateY(-6px); }
.work-card[hidden] { display: none; }
.work-card.is-entering { animation: cardIn .7s var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.work-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-2);
}
.work-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform .9s var(--ease), filter .6s;
  filter: saturate(.9);
}
.work-card:hover .work-card__media img { transform: scale(1.08); filter: saturate(1.05); }

.work-card__cats {
  position: absolute;
  left: 14px; top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.work-card__cats span,
.work-card__count {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(30, 30, 30, .72);
  backdrop-filter: blur(8px);
  font-family: var(--font-sub);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--light);
}
.work-card__cats span:first-child { background: var(--accent); }
.work-card__count {
  position: absolute;
  right: 14px; bottom: 14px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .4s, transform .5s var(--ease);
}
.work-card:hover .work-card__count,
.work-card:focus-visible .work-card__count { opacity: 1; transform: none; }

.work-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px clamp(18px, 1.6vw, 24px) 22px;
}
.work-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.work-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(19px, 1.5vw, 24px);
  letter-spacing: -.02em;
  line-height: 1.1;
}
.work-card__year {
  flex-shrink: 0;
  font-family: var(--font-sub);
  font-size: 12px;
  color: var(--muted);
}
.work-card__client {
  font-family: var(--font-sub);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
  margin-bottom: 14px;
}
.work-card__tags {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.work-card__tags li {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--font-sub);
  font-size: 11px;
  color: var(--muted-strong);
}

/* ---------- ОБО МНЕ (светлая инверсия) ---------- */
.about {
  background: var(--inv-bg);
  color: var(--inv-fg);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.about + .process { border-radius: var(--r-xl) var(--r-xl) 0 0; margin-top: -1px; background: var(--bg); }
.about .eyebrow { color: var(--accent); }
.about .muted { color: var(--inv-muted); }

.about__inner {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 90px);
  align-items: center;
}
.about__media { position: relative; }
.about__photo {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: rgba(30, 30, 30, .06);
}
.about__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* портрет почти 4:5 — кроп минимальный, держим голову в верхней трети */
  object-position: center 30%;
}

.about__badge {
  position: absolute;
  right: -18px; bottom: -18px;
  width: clamp(96px, 10vw, 132px);
  height: clamp(96px, 10vw, 132px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--dark);
  color: var(--light);
}
.about__badge svg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  animation: spin 22s linear infinite;
}
.about__badge text {
  font-family: var(--font-sub);
  font-weight: 700;
  font-size: 8.4px;
  letter-spacing: .1em;
  text-transform: uppercase;
  fill: currentColor;
}
.about__badge i {
  font-style: normal;
  font-size: 22px;
  color: var(--accent);
}
@keyframes spin { to { transform: rotate(360deg); } }

.about__text h2 { margin-block: 14px 22px; }
.about__p {
  color: var(--inv-muted);
  max-width: 52ch;
  margin-bottom: 14px;
}
.about__facts {
  display: grid;
  gap: 2px;
  margin-top: clamp(24px, 3vw, 40px);
  border-top: 1px solid var(--inv-line);
}
.about__facts li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  padding-block: 14px;
  border-bottom: 1px solid var(--inv-line);
  font-family: var(--font-sub);
}
.about__facts b { font-size: 15px; }
.about__facts span { font-size: 13px; color: var(--inv-muted); }

/* ---------- ПРОЦЕСС ---------- */
.process__list {
  display: grid;
  grid-template-columns: 1fr;
  counter-reset: step;
}
.process__item {
  position: relative;
  display: grid;
  grid-template-columns: clamp(80px, 9vw, 150px) minmax(0, 1fr) minmax(0, 1.5fr);
  align-items: baseline;
  column-gap: clamp(16px, 2.4vw, 40px);
  padding: clamp(22px, 2.4vw, 34px) 0;
  border-top: 2px solid var(--line);
  transition: border-color .5s var(--ease);
}
.process__item:last-child { border-bottom: 2px solid var(--line); }
.process__item:hover { border-top-color: var(--accent); }
.process__num {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 3.4vw, 54px);
  line-height: 1;
  letter-spacing: -.04em;
  color: transparent;
  -webkit-text-stroke: 1.4px var(--line-strong);
  transition: -webkit-text-stroke-color .5s;
}
.process__item:hover .process__num { -webkit-text-stroke-color: var(--accent); }
.process__item h3 { margin: 0; }
.process__item p { color: var(--muted); font-size: .95em; }

/* ---------- КОНТАКТЫ ---------- */
.contact__box {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: var(--accent);
  color: var(--light);
  padding: clamp(32px, 5vw, 80px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .82fr);
  gap: clamp(28px, 4vw, 72px);
  align-items: center;
}
.contact__blob {
  position: absolute;
  right: -12%; top: -40%;
  width: 60%; aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.30) 0%, transparent 65%);
  pointer-events: none;
}
.contact__head { position: relative; z-index: 1; }
.contact__eyebrow { color: var(--light); }
.contact__eyebrow::before { background: var(--light); }
.contact__title { margin-block: 16px 20px; }
.contact__lead { color: rgba(235, 235, 235, .88); max-width: 42ch; }

.contact__links {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2px;
  border-top: 1px solid rgba(235, 235, 235, .3);
}
.contact__links a {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: clamp(14px, 1.5vw, 20px) 6px;
  border-bottom: 1px solid rgba(235, 235, 235, .3);
  transition: padding-left .45s var(--ease), background-color .4s;
}
.contact__links a:hover { padding-left: 18px; background: rgba(255, 255, 255, .09); }
.contact__label {
  font-family: var(--font-sub);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(235, 235, 235, .74);
}
.contact__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(16px, 1.5vw, 22px);
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.contact__links svg { transition: transform .45s var(--ease); }
.contact__links a:hover svg { transform: translate(4px, -4px); }

/* ---------- ПОДВАЛ ---------- */
.footer {
  padding-block: clamp(40px, 5vw, 72px);
  border-top: 1px solid var(--line);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(20px, 3vw, 48px);
}
.footer__logo { display: block; }
.footer__logo img {
  width: clamp(160px, 18vw, 240px);
  height: auto;
}
.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-family: var(--font-sub);
  font-size: 14px;
}
.footer__nav a { opacity: .72; transition: opacity .3s, color .3s; }
.footer__nav a:hover { opacity: 1; color: var(--accent); }
.footer__copy {
  font-family: var(--font-sub);
  font-size: 13px;
  line-height: 1.5;
  text-align: right;
}

/* ---------- ЛАЙТБОКС ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 480;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 40px);
}
.lightbox[hidden] { display: none; }
.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 15, .86);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .4s;
}
.lightbox.is-open .lightbox__backdrop { opacity: 1; }

.lightbox__panel {
  position: relative;
  width: min(1320px, 100%);
  height: min(88vh, 900px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px) scale(.98);
  transition: opacity .45s var(--ease), transform .55s var(--ease);
}
.lightbox.is-open .lightbox__panel { opacity: 1; transform: none; }

/* картинки разных пропорций (длинные экраны сайтов, квадратные мокапы) —
   вписываем целиком, без кропа */
.lightbox__media {
  margin: 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #161616;
}
.lightbox__stage {
  position: relative;
  flex: 1;
  min-height: 0;
}
.lightbox__view {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
/* высокая картинка (скриншот сайта целиком): во всю ширину и прокручивается */
.lightbox__view.is-tall {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.lightbox__view.is-tall img {
  position: static;
  display: block;
  width: 100%;
  height: auto;
  object-fit: initial;
}
.lightbox__stage img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  transition: opacity .3s;
}
.lightbox__stage img.is-loading { opacity: 0; }

.lightbox__nav {
  position: absolute;
  top: 50%;
  width: 48px; height: 48px;
  margin-top: -24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(30, 30, 30, .7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  transition: background-color .35s, border-color .35s;
}
.lightbox__nav:hover { background: var(--accent); border-color: var(--accent); }
.lightbox__nav--prev { left: 14px; }
.lightbox__nav--next { right: 14px; }
.lightbox__nav[hidden],
.lightbox__count[hidden] { display: none; }
.lightbox__count {
  position: absolute;
  left: 14px; bottom: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(30, 30, 30, .72);
  font-family: var(--font-sub);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}

.lightbox__body {
  padding: 72px clamp(24px, 2.6vw, 36px) clamp(24px, 2.6vw, 36px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}
.lightbox__body h3 { margin-block: 2px; }
.lightbox__client {
  font-family: var(--font-sub);
  font-size: 15px;
  color: var(--muted-strong);
}
.lightbox__text { color: var(--muted); font-size: .95em; white-space: pre-line; }   /* абзацы из админки — пустой строкой */
.lightbox__tags { display: flex; flex-wrap: wrap; gap: 7px; }
.lightbox__tags button {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--font-sub);
  font-size: 12px;
  color: var(--muted-strong);
  transition: border-color .3s, color .3s;
}
.lightbox__tags button:hover { border-color: var(--accent); color: var(--fg); }
/* лента миниатюр под картинкой, листается вбок */
.lightbox__thumbs {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  padding: 12px 14px 14px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  border-top: 1px solid var(--line);
}
.lightbox__thumbs:empty { display: none; }
.lightbox__thumbs button {
  position: relative;
  flex: 0 0 auto;
  width: clamp(88px, 9vw, 128px);
  aspect-ratio: 16 / 10;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 2px solid transparent;
  opacity: .5;
  transition: opacity .3s, border-color .3s;
}
.lightbox__thumbs button:hover { opacity: .9; }
.lightbox__thumbs button[aria-current="true"] { opacity: 1; border-color: var(--accent); }
.lightbox__thumbs img { width: 100%; height: 100%; object-fit: cover; object-position: top; }   /* у скриншота сайта видно шапку */

/* автолистание: полоска на активной миниатюре = сколько осталось до следующего слайда.
   Конец анимации и переключает слайд (js/main.js); ручное переключение
   начинает отсчёт заново. */
.lightbox__thumbs.is-playing button[aria-current="true"]::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  height: 3px;
  width: 100%;
  background: var(--accent);
  transform-origin: 0 50%;
  animation: slideTimer var(--slide-dur, 3s) linear forwards;
}
.lightbox__thumbs.is-paused button[aria-current="true"]::after { animation-play-state: paused; }
@keyframes slideTimer {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.lightbox__close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(30, 30, 30, .7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  transition: background-color .35s, transform .4s var(--ease);
}
.lightbox__close:hover { background: var(--accent); transform: rotate(90deg); }

/* ============================================================
   АНИМАЦИИ ПОЯВЛЕНИЯ
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s var(--ease), transform .9s var(--ease);
  transition-delay: var(--d, 0ms);
}
[data-reveal].is-in { opacity: 1; transform: none; }

.split__word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}
.split__word > span {
  display: inline-block;
  transform: translateY(105%) rotate(4deg);
  transition: transform .95s var(--ease);
  transition-delay: var(--d, 0ms);
}
.is-in .split__word > span,
.split__word.is-in > span { transform: none; }

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 1200px) {
  .work__grid    { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .nav {
    position: fixed;
    inset: 0;
    z-index: -1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: var(--gutter);
    background: var(--dark);
    color: var(--light);
    font-size: clamp(28px, 7vw, 46px);
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -.03em;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-14px);
    transition: opacity .4s var(--ease), transform .5s var(--ease);
  }
  .nav.is-open {
    z-index: 1;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
  .nav a::after { display: none; }
  .burger { display: flex; margin-left: auto; }
  .header__cta { display: none; }

  .hero__foot { grid-template-columns: 1fr; align-items: start; }
  .hero__scroll { display: none; }

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

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

  /* галерея: картинка сверху, описание под ней, вся панель скроллится */
  .lightbox__panel {
    /* minmax(0, …): иначе лента миниатюр растягивает колонку шире экрана */
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    height: auto;
    max-height: 92vh;
    overflow-y: auto;
  }
  .lightbox__body { padding-top: clamp(20px, 4vw, 32px); overflow: visible; }
  /* высота картинки по пропорции, а не по экрану — меньше пустых полей */
  .lightbox__stage { flex: none; aspect-ratio: 4 / 3; max-height: 62vh; }
  .lightbox__media { min-height: auto; }   /* иначе сетка сжимает блок и лента наезжает на текст */
}

@media (max-width: 640px) {
  .work__grid { grid-template-columns: 1fr; }
  .process__item { grid-template-columns: 56px minmax(0, 1fr); row-gap: 8px; }
  .process__item p { grid-column: 2; }

  .section-head { flex-direction: column; align-items: flex-start; }
  /* в колонке flex-basis 480px превращается в высоту — сбрасываем */
  .section-head > * { flex-basis: auto; }

  .filter { gap: 8px; }
  .search { flex-basis: 100%; }
  .filter__btn { padding: 10px 16px; font-size: 13px; }

  .lightbox { padding: 0; }
  .lightbox__panel {
    height: 100%;
    max-height: none;
    grid-template-rows: auto auto;
    border: 0;
    border-radius: 0;
  }
  .lightbox__nav { width: 42px; height: 42px; margin-top: -21px; }

  .footer__inner { flex-direction: column; }
  .footer__copy { text-align: left; }

  .about__badge { right: -8px; bottom: -8px; }
}

/* грубый указатель (тач) — свой курсор не нужен, счётчик фото видно сразу */
@media (hover: none), (pointer: coarse) {
  .cursor { display: none; }
  .work-card__count { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
  .split__word > span { transform: none; }
  .blob { animation: none; }
  .about__badge svg { animation: none; }
  .hero__scroll-line { animation: none; }
  .work-card.is-entering { animation: none; }
}
