/* ==================================================================
   Александра Николаева — портфолио
   Дизайн-система взята из макетов: тёплый айвори, бордо, Playfair.
   ================================================================== */

/* ---------------------------- Токены ---------------------------- */
:root {
  --white:      #FFFFFF;
  --ivory:      #F8F6F3;
  --ivory-deep: #F2EEE9;
  --blush:      #EFE4E2;

  --ink:        #14100F;
  --ink-soft:   #3A3330;
  --muted:      #8A8279;
  --hair:       #E4DED6;

  --accent:     #742B3C;
  --accent-mid: rgba(116, 43, 60, .45);
  --accent-soft:rgba(116, 43, 60, .22);
  --accent-wash:rgba(116, 43, 60, .05);

  --serif: 'Playfair Display', 'Times New Roman', serif;
  --sans:  'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --script:'Cormorant Garamond', Georgia, serif;

  --shell: 1360px;
  --gut: clamp(20px, 5vw, 64px);
  --sect: clamp(72px, 11vw, 168px);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --slow: .8s var(--ease);
}

/* ---------------------------- Сброс ---------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--white);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

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

/* -------------------------- Типографика -------------------------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.12;
  letter-spacing: -.01em;
  margin: 0;
}

.h-display {
  font-size: clamp(44px, 8.5vw, 108px);
  line-height: 1.02;
  letter-spacing: .01em;
}

.h-section {
  font-size: clamp(30px, 4.4vw, 58px);
  line-height: 1.1;
}

.h-card { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.28; }

/* Микро-лейбл капсом — фирменный приём макета */
.label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}
.label--accent { color: var(--accent); }

/* Короткая бордовая засечка над заголовком секции */
.tick {
  width: 40px;
  height: 1px;
  background: var(--accent);
  margin-bottom: 28px;
}

.lede {
  font-family: var(--serif);
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.72;
  color: var(--ink-soft);
}

.quote {
  font-family: var(--script);
  font-style: italic;
  font-size: clamp(19px, 2vw, 27px);
  line-height: 1.5;
  color: var(--accent);
}

/* ---------------------------- Каркас ---------------------------- */
.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding-left: var(--gut);
  padding-right: var(--gut);
}

.section { padding: var(--sect) 0; position: relative; }
.section--ivory { background: var(--ivory); }
.section--tight { padding-top: clamp(48px, 7vw, 96px); }

.section-head { max-width: 760px; margin-bottom: clamp(44px, 5vw, 76px); }
.section-head .h-section { margin-bottom: 14px; }

/* ---------------------------- Шапка ---------------------------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 90;
  padding: 22px 0;
  transition: background .4s var(--ease), padding .4s var(--ease), box-shadow .4s var(--ease);
}
.topbar.is-stuck {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(14px);
  padding: 14px 0;
  box-shadow: 0 1px 0 var(--hair);
}
.topbar__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}

.nav { display: flex; align-items: center; gap: clamp(20px, 2.6vw, 40px); }

/* Полноэкранное меню существует только на узких экранах.
   Без этого правила оно наследует display:flex от .nav и дублирует
   навигацию на десктопе. Включается в медиазапросе ниже. */
.nav--mobile { display: none; }

.nav__link {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
  transition: color .3s var(--ease);
}
.nav__link::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s var(--ease);
}
.nav__link:hover { color: var(--accent); }
.nav__link:hover::after { transform: scaleX(1); transform-origin: left; }

/* Тумблер языка — как в макете: RU ●———— EN */
.lang {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--muted);
}
.lang__btn {
  padding: 2px 1px;
  color: var(--muted);
  letter-spacing: .16em;
  transition: color .3s var(--ease);
}
.lang__btn[aria-pressed="true"] { color: var(--ink); font-weight: 500; }
.lang__track {
  position: relative;
  width: 42px; height: 1px;
  background: var(--hair);
}
.lang__dot {
  position: absolute;
  top: 50%; left: 0;
  width: 7px; height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--accent);
  transition: left .45s var(--ease);
}
.lang[data-lang="en"] .lang__dot { left: 35px; }

/* Бургер (только мобильный) */
.burger { display: none; width: 26px; height: 14px; position: relative; }
.burger span {
  position: absolute; left: 0;
  width: 100%; height: 1px;
  background: var(--ink);
  transition: transform .4s var(--ease), opacity .3s var(--ease);
}
.burger span:nth-child(1) { top: 0; }
.burger span:nth-child(2) { top: 13px; }
body.menu-open .burger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
body.menu-open .burger span:nth-child(2) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------------------------- Герой ---------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 140px 0 80px;
  overflow: hidden;
}
.hero__in { position: relative; width: 100%; }

.hero__title { text-align: center; position: relative; z-index: 3; }
.hero__title .h-display { display: block; }
.hero__title .h-display + .h-display { margin-left: .12em; }

.hero__meta { text-align: center; margin-top: 34px; position: relative; z-index: 3; }
.hero__role {
  font-size: clamp(14px, 1.3vw, 16px);
  letter-spacing: .1em;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.hero__loc { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }

/* Коллаж, следующий за курсором */
.collage { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.collage__item {
  position: absolute;
  will-change: transform;
  transition: opacity 1.1s var(--ease);
}
.collage__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  box-shadow: 0 18px 50px rgba(20, 16, 15, .1);
}
/* тонкая бордовая рамка со смещением — приём макета */
.collage__item::before {
  content: '';
  position: absolute;
  inset: -12px -12px 12px 12px;
  border: 1px solid var(--accent-soft);
  pointer-events: none;
}

.collage__item--a { left: 2%;  top: 14%; width: clamp(120px, 15vw, 208px); aspect-ratio: 3/4;  transform: rotate(-3deg); }
.collage__item--b { right: 4%; top: 8%;  width: clamp(120px, 14vw, 196px); aspect-ratio: 4/3;  transform: rotate(2.5deg); }
.collage__item--c { left: 9%;  bottom: 10%; width: clamp(110px, 13vw, 180px); aspect-ratio: 4/3; transform: rotate(2deg); }
.collage__item--d { right: 7%; bottom: 14%; width: clamp(120px, 15vw, 204px); aspect-ratio: 3/4; transform: rotate(-2deg); }

.hero__scroll {
  position: absolute;
  left: 50%; bottom: 34px;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted);
  z-index: 3;
}
.hero__scroll i {
  width: 1px; height: 44px;
  background: linear-gradient(var(--accent), transparent);
  animation: drip 2.4s var(--ease) infinite;
}
@keyframes drip {
  0%, 100% { transform: scaleY(.35); transform-origin: top; opacity: .5; }
  50%      { transform: scaleY(1);   transform-origin: top; opacity: 1; }
}

/* ---------------------------- Обо мне ---------------------------- */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1fr);
  gap: clamp(36px, 6vw, 96px);
  align-items: center;
}
.about__figure { position: relative; margin: 0; }
.about__figure img {
  position: relative;
  z-index: 1;
  width: 100%; aspect-ratio: 3/4;
  object-fit: cover; object-position: center 20%;
}
/* Смещённая рамка — приём макета. Лежит НАД фоном секции, но под фото,
   поэтому z-index положительный, а не -1. */
.about__figure::before {
  content: '';
  position: absolute;
  inset: -18px 18px 18px -18px;
  border: 1px solid var(--accent-soft);
  z-index: 0;
}
.about__dot {
  position: absolute; top: -22px; right: 14px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}

.about__text p { margin: 0 0 20px; }
.about__stats {
  display: flex;
  gap: clamp(32px, 5vw, 72px);
  margin: 40px 0 34px;
}
.stat__v {
  font-family: var(--serif);
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 1;
  color: var(--accent);
  display: block;
}
.stat__l { font-size: 12px; letter-spacing: .1em; color: var(--muted); margin-top: 8px; display: block; }

.about__quote { border-left: 1px solid var(--accent-soft); padding-left: 22px; }
.about__quote cite { display: block; font-style: normal; font-size: 12px; letter-spacing: .12em; color: var(--muted); margin-top: 8px; }

/* ------------------- Сферы: свободный разброс -------------------
   По референсу: плашки двух типов раскиданы по холсту под лёгкими
   углами, между ними — повёрнутые кадры. Координаты приходят из
   main.js инлайновым style, поворот — через переменную --rot.      */
.scatter {
  position: relative;
  min-height: clamp(380px, 42vw, 560px);
  margin-top: clamp(24px, 3vw, 44px);
}

.sector {
  position: absolute;
  left: var(--x); top: var(--y);
  /* плашки всегда поверх кадров — как в референсе, где тег
     наезжает на фотографию и остаётся читаемым */
  z-index: 1;
  --x: 0; --y: 0; --rot: 0deg;
  transform: rotate(var(--rot));
  transform-origin: center;
  white-space: nowrap;
  transition: transform .5s var(--ease), color .4s var(--ease), border-color .4s var(--ease);
}
.sector:hover { transform: rotate(0deg) translateY(-3px); }

/* Тип 1 — в тонкой бордовой рамке, сериф */
.sector--box {
  font-family: var(--serif);
  font-size: clamp(15px, 1.35vw, 20px);
  color: var(--accent);
  padding: 12px 24px;
  border: 1px solid var(--accent-mid);
  background: var(--white);
}
.sector--box:hover { border-color: var(--accent); }

/* Тип 2 — без рамки, санс, с подчёркиванием */
.sector--line {
  font-family: var(--sans);
  font-size: clamp(13px, 1.05vw, 15px);
  font-weight: 300;
  color: var(--muted);
  padding: 4px 2px 8px;
  border-bottom: 1px solid var(--accent-mid);
  background: none;
}
.sector--line:hover { color: var(--accent); }

/* Кадры внутри разброса */
.scatter-shot {
  position: absolute;
  left: var(--x); top: var(--y);
  width: var(--w);
  z-index: 0;
  --x: 0; --y: 0; --w: 14%; --rot: 0deg;
  margin: 0;
  transform: rotate(var(--rot));
  will-change: transform;
}
.scatter-shot img {
  width: 100%;
  height: auto;
  box-shadow: 0 14px 40px rgba(20, 16, 15, .1);
}

/* ------------- Декоративные кадры внутри секций -------------
   Живут в свободном поле справа и слева от текстовой колонки. */
/* По горизонтали отступаем на ту же величину, что и текст: иначе на
   узких экранах кадр упирается прямо в край окна. */
.decos { position: absolute; inset: 0 var(--gut); pointer-events: none; z-index: 0; }
.deco {
  position: absolute;
  --rot: 0deg;
  --w: 16%;
  width: var(--w);
  margin: 0;
  transform: rotate(var(--rot));
  will-change: transform;
}
.deco img {
  width: 100%;
  height: auto;
  box-shadow: 0 16px 44px rgba(20, 16, 15, .1);
}
/* тонкая смещённая рамка — тот же приём, что и в коллаже */
.deco::before {
  content: '';
  position: absolute;
  inset: -10px 10px 10px -10px;
  border: 1px solid var(--accent-soft);
}
/* Единственное безопасное место для абсолютного кадра — свободная
   полоса справа от заголовка секции (он ограничен 760px). Ниже идут
   карточки во всю ширину, поэтому туда декор не ставим. */
.deco--tr { right: 0; top: clamp(10px, 2vw, 40px); }

/* Второй кадр в секции живёт в потоке рядом со вступлением —
   так наложение на текст исключено по построению. */
.intro-row {
  display: flex;
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  margin: 0 0 clamp(36px, 4vw, 60px);
}
.intro-row .lede { flex: 1 1 auto; max-width: 820px; margin: 0; }

.deco-inline {
  position: relative;
  flex: 0 0 clamp(110px, 14vw, 210px);
  margin: 0;
  --rot: 0deg;
  transform: rotate(var(--rot));
}
.deco-inline img { width: 100%; height: auto; box-shadow: 0 16px 44px rgba(20, 16, 15, .1); }
.deco-inline::before {
  content: '';
  position: absolute;
  inset: -10px 10px 10px -10px;
  border: 1px solid var(--accent-soft);
}

/* Текст всегда над картинками */
.section > .shell { position: relative; z-index: 1; }
.section > .shell > .decos { z-index: 0; }
.section-head, .cards, .steps, .works, .price, .badges, .scatter, .slider { position: relative; z-index: 1; }

/* ==================================================================
   Карта компетенций — дашборд
   ================================================================== */
/* Горизонтальный слайдер на scroll-snap: свайп, колесо и клавиатура
   работают нативно, JS нужен только для стрелок и точек. */
.slider { position: relative; }

.slider__viewport {
  display: flex;
  gap: clamp(16px, 1.8vw, 26px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.slider__viewport::-webkit-scrollbar { display: none; }
.slider__viewport:focus-visible { outline: 1px solid var(--accent-soft); outline-offset: 6px; }

.slide {
  flex: 0 0 clamp(280px, 47%, 580px);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}

.slider__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: clamp(22px, 2.4vw, 34px);
}
.slider__dots { display: flex; gap: 10px; }
.sdot {
  width: 26px; height: 2px;
  background: var(--hair);
  padding: 0;
  transition: background .4s var(--ease);
}
.sdot.is-on { background: var(--accent); }

.slider__arrows { display: flex; gap: 10px; }
.sbtn {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border: 1px solid var(--hair);
  color: var(--ink-soft);
  transition: border-color .35s var(--ease), color .35s var(--ease), opacity .35s var(--ease);
}
.sbtn:hover:not([disabled]) { border-color: var(--accent); color: var(--accent); }
.sbtn[disabled] { opacity: .3; cursor: default; }

.panel {
  background: var(--white);
  border: 1px solid var(--hair);
  padding: clamp(22px, 2.4vw, 34px);
  position: relative;
}
.section--ivory .panel { border-color: var(--hair); }
.panel::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .7s var(--ease);
}
.panel.is-in::after { transform: scaleX(1); }

.panel__head { margin-bottom: 22px; }
.panel__title { font-family: var(--serif); font-size: 19px; color: var(--ink); margin: 0 0 4px; }
.panel__hint { font-size: 12px; color: var(--muted); }


  fill: var(--accent-wash);
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linejoin: round;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(.4);
  transition: opacity .9s var(--ease), transform 1.1s var(--ease);
}
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .06em;
  fill: var(--muted);
}

/* Профиль компетенций — список с тумблерами, без оценок и цифр */
.skills { display: flex; flex-direction: column; }
.skill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
}
.skill + .skill { border-top: 1px solid var(--hair); }
.skill__name {
  font-family: var(--serif);
  font-size: clamp(15px, 1.3vw, 18px);
  color: var(--ink);
}

/* Тумблер повторяет переключатель языка в шапке */
.switch {
  position: relative;
  flex: none;
  width: 42px; height: 1px;
  background: var(--hair);
}
.switch__dot {
  position: absolute;
  top: 50%; left: 0;
  width: 7px; height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--accent-mid);
  transition: left .6s var(--ease), background .6s var(--ease);
}
/* включаются каскадом, когда карточка появляется */
.panel.is-in .switch__dot { left: 35px; background: var(--accent); }

/* Инструменты — сегментные шкалы */
.tool { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; padding: 9px 0; }
.tool + .tool { border-top: 1px solid var(--hair); }
.tool__name { font-size: 14px; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }
.tool__ai {
  font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent-soft);
  padding: 1px 6px; border-radius: 2px;
}
.meter { display: flex; gap: 4px; }
.meter i {
  width: 26px; height: 4px;
  background: var(--hair);
  transform: scaleX(0); transform-origin: left;
  transition: transform .5s var(--ease), background .5s var(--ease);
}
.panel.is-in .meter i { transform: scaleX(1); }
.meter i.on { background: var(--accent); }
.tools__note {
  margin-top: 20px; padding-top: 18px;
  border-top: 1px solid var(--hair);
  font-size: 13px; color: var(--muted); line-height: 1.6;
}

/* Образование — таймлайн */
.timeline { position: relative; padding-top: 26px; }
.timeline::before {
  content: '';
  position: absolute; top: 4px; left: 0;
  width: 100%; height: 1px; background: var(--hair);
}
.timeline__rail {
  position: absolute; top: 4px; left: 0;
  height: 1px; background: var(--accent);
  width: 0;
  transition: width 1.4s var(--ease);
}
.panel.is-in .timeline__rail { width: 100%; }
.timeline__list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.tl { position: relative; padding-right: 12px; }
.tl::before {
  content: '';
  position: absolute; top: -26px; left: 0;
  width: 7px; height: 7px; margin-top: -3px;
  border-radius: 50%; background: var(--accent);
  opacity: 0; transform: scale(.2);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.panel.is-in .tl::before { opacity: 1; transform: scale(1); }
.panel.is-in .tl:nth-child(2)::before { transition-delay: .3s; }
.panel.is-in .tl:nth-child(3)::before { transition-delay: .6s; }
.panel.is-in .tl:nth-child(4)::before { transition-delay: .9s; }
.tl--progress::before { box-shadow: 0 0 0 0 var(--accent-mid); animation: pulse 2.4s ease-out infinite 1.4s; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-mid); }
  70%  { box-shadow: 0 0 0 9px rgba(116, 43, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(116, 43, 60, 0); }
}
.tl__years { font-size: 11px; letter-spacing: .12em; color: var(--accent); display: block; margin-bottom: 6px; }
.tl__place { font-family: var(--serif); font-size: 16px; color: var(--ink); display: block; margin-bottom: 4px; }
.tl__what { font-size: 12.5px; color: var(--muted); line-height: 1.5; display: block; }
.tl__deg { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); display: block; margin-top: 8px; }
.tl__now { color: var(--accent); }

/* Языки — дуги */
.langs { display: flex; justify-content: space-around; gap: 12px; text-align: center; }
.ring { width: 76px; height: 76px; margin: 0 auto 12px; }
.ring__bg { fill: none; stroke: var(--hair); stroke-width: 2; }
.ring__fg {
  fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 50% 50%;
  transition: stroke-dashoffset 1.3s var(--ease);
}
.lang-item__name { font-family: var(--serif); font-size: 15px; color: var(--ink); display: block; }
.lang-item__lvl { font-size: 11px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }


/* Soft skills */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 12.5px;
  padding: 7px 14px;
  border: 1px solid var(--hair);
  color: var(--ink-soft);
  transition: border-color .35s var(--ease), color .35s var(--ease);
}
.chip:hover { border-color: var(--accent-soft); color: var(--accent); }

/* ==================================================================
   Портфолио
   ================================================================== */
.works { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(28px, 3.4vw, 56px) clamp(20px, 2.4vw, 40px); }

.work { grid-column: span 4; position: relative; }
/* коллажный ритм — как в макете: плитки разной высоты и со сдвигом */
.work:nth-child(6n+1) { grid-column: span 7; }
.work:nth-child(6n+2) { grid-column: span 5; margin-top: clamp(30px, 5vw, 80px); }
.work:nth-child(6n+3) { grid-column: span 5; }
.work:nth-child(6n+4) { grid-column: span 7; margin-top: clamp(-20px, -1vw, 0px); }
.work:nth-child(6n+5) { grid-column: span 6; }
.work:nth-child(6n+6) { grid-column: span 6; margin-top: clamp(24px, 4vw, 64px); }

.work__media {
  position: relative;
  overflow: hidden;
  background: var(--ivory-deep);
  aspect-ratio: 4/3;
}
.work:nth-child(6n+2) .work__media,
.work:nth-child(6n+3) .work__media { aspect-ratio: 3/4; }

.work__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.1s var(--ease), filter .8s var(--ease);
}
.work:hover .work__media img { transform: scale(1.045); }

.work__frame {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, .5);
  opacity: 0;
  transition: opacity .5s var(--ease), inset .5s var(--ease);
  pointer-events: none;
}
.work:hover .work__frame { opacity: 1; inset: 16px; }

.work__body { padding-top: 18px; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.work__title { font-family: var(--serif); font-size: clamp(19px, 1.9vw, 26px); color: var(--ink); transition: color .4s var(--ease); }
.work:hover .work__title { color: var(--accent); }
.work__kicker { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.work__year { font-size: 12px; letter-spacing: .12em; color: var(--accent); white-space: nowrap; }
.work__dot {
  position: absolute; top: -5px; right: -5px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  opacity: 0; transform: scale(.4);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.work:hover .work__dot { opacity: 1; transform: scale(1); }

/* ==================================================================
   Карточки (подход, ценность, услуги, форматы)
   ================================================================== */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: clamp(18px, 2vw, 28px); }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
.cards--2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--white);
  border: 1px solid var(--hair);
  border-bottom: 1px solid var(--accent-soft);
  padding: clamp(24px, 2.6vw, 36px);
  position: relative;
  transition: transform .55s var(--ease), border-color .55s var(--ease), box-shadow .55s var(--ease);
}
/* лёгкий разнобой по вертикали — приём макета */
.card:nth-child(3n+2) { transform: translateY(14px); }
.card:nth-child(3n)   { transform: translateY(-8px); }
.card:hover { transform: translateY(-6px); border-color: var(--accent-soft); box-shadow: 0 18px 44px rgba(20, 16, 15, .07); }
.card:nth-child(3n+2):hover { transform: translateY(8px); }
.card:nth-child(3n):hover   { transform: translateY(-14px); }

.card__n {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .16em;
  color: var(--accent);
  display: block;
  margin-bottom: 16px;
}
.card__t { margin-bottom: 12px; }
.card__d { font-size: 14.5px; line-height: 1.66; color: var(--muted); margin: 0; }

/* Плашки-показатели */
.badges { display: flex; flex-wrap: wrap; gap: 14px; margin-top: clamp(36px, 4vw, 56px); }
.badge {
  font-size: 13px;
  padding: 13px 24px;
  border: 1px solid var(--accent-mid);
  color: var(--accent);
  background: var(--white);
}
.badges .badge:nth-child(2) { transform: rotate(-1deg); }
.badges .badge:nth-child(3) { transform: rotate(.8deg); }

/* Формула */
.formula {
  border: 1px solid var(--accent-mid);
  padding: clamp(26px, 3vw, 42px);
  max-width: 820px;
  margin-top: clamp(36px, 4vw, 56px);
  background: var(--white);
}
.formula .label { display: block; margin-bottom: 16px; }
.formula p { font-family: var(--script); font-style: italic; font-size: clamp(17px, 1.8vw, 23px); line-height: 1.55; color: var(--ink); margin: 0; }

/* Процесс — лесенка */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(12px, 1.4vw, 20px); }
.step {
  background: var(--white);
  border: 1px solid var(--hair);
  border-bottom-color: var(--accent-soft);
  padding: clamp(20px, 2vw, 28px);
}
.step:nth-child(2) { transform: translateY(-24px); }
.step:nth-child(3) { transform: translateY(-6px); }
.step:nth-child(4) { transform: translateY(-30px); }
.step:nth-child(5) { transform: translateY(-12px); }
.step__n { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 12px; letter-spacing: .16em; color: var(--accent); margin-bottom: 14px; }
.step__n::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.step__t { font-family: var(--serif); font-size: 17px; color: var(--ink); margin-bottom: 8px; }
.step__d { font-size: 13px; line-height: 1.6; color: var(--muted); }
.process__note { text-align: center; margin-top: clamp(48px, 6vw, 80px); }

/* Стоимость */
.price {
  margin-top: clamp(32px, 4vw, 52px);
  border: 1px solid var(--accent-mid);
  padding: clamp(26px, 3vw, 40px);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 32px;
  background: var(--white);
}
.price__v { font-family: var(--serif); font-size: clamp(19px, 2vw, 26px); color: var(--ink); }
.price__note { font-size: 14px; color: var(--muted); }

/* ==================================================================
   Форма
   ================================================================== */
.contact__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(36px, 6vw, 90px); }

.field { margin-bottom: 30px; position: relative; }
.field > label { display: block; margin-bottom: 10px; }
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--hair);
  background: transparent;
  padding: 10px 0;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 300;
  color: var(--ink);
  border-radius: 0;
  transition: border-color .4s var(--ease);
  appearance: none;
}
.field textarea { resize: vertical; min-height: 96px; }
.field select { cursor: pointer; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-bottom-color: var(--accent); }
.field input::placeholder, .field textarea::placeholder { color: #C4BDB4; }
.field.has-error input,
.field.has-error textarea { border-bottom-color: var(--accent); }
.field__err {
  display: none;
  font-size: 12px;
  color: var(--accent);
  margin-top: 8px;
}
.field.has-error .field__err { display: block; }

.hp { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 34px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  background: transparent;
  position: relative;
  overflow: hidden;
  transition: color .45s var(--ease);
}
.btn::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--accent);
  transform: scaleY(0); transform-origin: bottom;
  transition: transform .45s var(--ease);
  z-index: -1;
}
.btn:hover { color: #fff; }
.btn:hover::before { transform: scaleY(1); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn > * { position: relative; z-index: 1; }

.form__status { margin-top: 20px; font-size: 14px; min-height: 22px; }
.form__status.bad { color: #B4453F; }

/* Успешная отправка — ключевой момент, поэтому крупнее и в рамке,
   а не мелкой строкой под кнопкой */
.form__status.ok {
  font-family: var(--serif);
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.5;
  color: var(--accent);
  border: 1px solid var(--accent-mid);
  padding: 18px 22px;
  margin-top: 26px;
  background: var(--white);
  animation: statusIn .5s var(--ease) both;
}
@keyframes statusIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.contact__side { padding-top: 8px; }
.contact__row { padding: 22px 0; border-top: 1px solid var(--hair); }
.contact__row .label { display: block; margin-bottom: 8px; }
/* :not(.label) — иначе микро-лейбл перебивается этим правилом и уезжает в сериф */
.contact__row a,
.contact__row > span:not(.label) {
  font-family: var(--serif);
  font-size: clamp(17px, 1.6vw, 21px);
  color: var(--ink);
}
.contact__row a { transition: color .35s var(--ease); }
.contact__row a:hover { color: var(--accent); }

/* ---------------------------- Подвал ---------------------------- */
.footer { background: var(--ivory); padding: 34px 0; border-top: 1px solid var(--hair); }
.footer__in { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer__copy { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.footer__copy::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.footer__links { display: flex; gap: 26px; }
.footer__links a { font-size: 12px; color: var(--muted); transition: color .35s var(--ease); }
.footer__links a:hover { color: var(--accent); }

/* ==================================================================
   Страница кейса
   ================================================================== */
.case-hero {
  padding: clamp(140px, 18vh, 200px) 0 clamp(60px, 8vw, 110px);
  position: relative;
}
.case-hero__label { display: block; margin-bottom: 24px; }
.case-hero__title {
  font-size: clamp(38px, 7.4vw, 96px);
  line-height: 1.02;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 28px;
}
.case-hero__sub { font-size: clamp(12px, 1.2vw, 14px); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.case-hero__rule { display: flex; align-items: center; gap: 0; margin: 34px 0; max-width: 460px; }
.case-hero__rule i { flex: 1; height: 1px; background: var(--hair); }
.case-hero__rule b { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }

.case-meta { display: flex; flex-wrap: wrap; gap: 12px 48px; margin-top: 36px; }
.case-meta__item .label { display: block; margin-bottom: 6px; }
.case-meta__item span { font-family: var(--serif); font-size: 17px; color: var(--ink); }

/* Обложку и кадры галереи НЕ кадрируем: это проектные визуализации,
   у них важен весь кадр. Пропорции берём из самого файла. */
.case-cover { position: relative; overflow: hidden; background: var(--ivory-deep); margin: 0; }
.case-cover img { width: 100%; height: auto; }

.case-text { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(32px, 5vw, 80px); }
.case-text__block .label { display: block; margin-bottom: 14px; }
.case-text__block h3 { font-size: clamp(24px, 3vw, 38px); font-style: italic; margin-bottom: 20px; }
.case-text__block p { margin: 0 0 16px; }
.case-text__quote { border-left: 2px solid var(--accent-soft); padding-left: 24px; }
.case-text__quote p { font-family: var(--serif); font-size: clamp(16px, 1.5vw, 20px); line-height: 1.7; color: var(--ink); }

.case-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: clamp(16px, 2vw, 26px); }
.metric {
  background: var(--white);
  border: 1px solid var(--hair);
  border-bottom-color: var(--accent-soft);
  padding: clamp(22px, 2.4vw, 32px);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.metric:nth-child(even) { transform: translateY(18px); }
.metric:hover { box-shadow: 0 16px 40px rgba(20, 16, 15, .07); }
.metric__v { font-family: var(--serif); font-size: clamp(28px, 3.4vw, 44px); line-height: 1; color: var(--accent); display: block; }
.metric__l { font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 12px; display: block; }

/* Колонки, а не грид: кадры разной высоты укладываются без пустот,
   которые неизбежны в сетке с выровненными рядами. */
.case-gallery { columns: 2; column-gap: clamp(20px, 2.6vw, 44px); }
.shot {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  display: inline-block;
  width: 100%;
  margin: 0 0 clamp(24px, 3vw, 48px);
}
.shot__media { overflow: hidden; background: var(--ivory-deep); }
.shot__media img { width: 100%; height: auto; transition: transform 1.2s var(--ease); }
.shot:hover .shot__media img { transform: scale(1.035); }
.shot__cap { font-size: 12px; letter-spacing: .1em; color: var(--muted); margin-top: 14px; }

.case-nav { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: clamp(40px, 5vw, 70px) 0; border-top: 1px solid var(--hair); }
.case-nav a { display: flex; flex-direction: column; gap: 8px; max-width: 46%; }
.case-nav .label { color: var(--muted); }
.case-nav b { font-family: var(--serif); font-weight: 400; font-size: clamp(17px, 1.8vw, 23px); color: var(--ink); transition: color .35s var(--ease); }
.case-nav a:hover b { color: var(--accent); }
.case-nav__next { text-align: right; align-items: flex-end; }

.backlink { display: inline-flex; align-items: center; gap: 12px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); transition: color .35s var(--ease); }
.backlink:hover { color: var(--accent); }
.backlink svg { transition: transform .4s var(--ease); }
.backlink:hover svg { transform: translateX(-5px); }

/* ==================================================================
   Анимация появления
   ================================================================== */
.rv { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.rv.is-in { opacity: 1; transform: none; }

/* Кастомный курсор */
.cursor, .cursor-ring { position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; border-radius: 50%; opacity: 0; }
.cursor { width: 6px; height: 6px; background: var(--accent); margin: -3px 0 0 -3px; transition: opacity .3s; }
.cursor-ring {
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1px solid var(--accent-mid);
  transition: opacity .3s, width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background .35s var(--ease);
}
body.has-cursor .cursor, body.has-cursor .cursor-ring { opacity: 1; }
body.cursor-lg .cursor-ring { width: 66px; height: 66px; margin: -33px 0 0 -33px; background: var(--accent-wash); }
body.cursor-lg .cursor { opacity: 0; }

/* ==================================================================
   Адаптив
   ================================================================== */
@media (max-width: 1180px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .step:nth-child(n) { transform: none; }
  .slide { flex-basis: clamp(280px, 62%, 520px); }
}

@media (max-width: 900px) {
  .nav { display: none; }
  .burger { display: block; }

  .topbar__actions { display: flex; align-items: center; gap: 22px; }

  /* Полноэкранное меню */
  .nav--mobile {
    display: flex;
    position: fixed;
    inset: 0;
    background: var(--ivory);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    z-index: 80;
    opacity: 0;
    visibility: hidden;
    /* visibility переключаем мгновенно, но при закрытии — только после
       того, как отыграет прозрачность. Плавный transition на visibility
       даёт неопределённое промежуточное состояние. */
    transition: opacity .45s var(--ease), visibility 0s linear .45s;
  }
  body.menu-open .nav--mobile {
    opacity: 1;
    visibility: visible;
    transition: opacity .45s var(--ease), visibility 0s linear 0s;
  }
  .nav--mobile .nav__link { font-family: var(--serif); font-size: 28px; }

  .about__grid { grid-template-columns: 1fr; }
  .about__figure { max-width: 400px; }

  .timeline__list { grid-template-columns: 1fr; gap: 26px; }
  .timeline::before, .timeline__rail { width: 1px; height: 100%; top: 0; left: 3px; }
  .panel.is-in .timeline__rail { width: 1px; height: 100%; }
  .timeline { padding-top: 8px; padding-left: 26px; }
  .tl::before { top: 8px; left: -26px; }

  /* Разброс сфер складывается в обычный поток, лёгкий наклон сохраняем */
  .scatter {
    min-height: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 16px;
  }
  .sector { position: static; }
  .scatter-shot { position: static; --w: 40%; order: 9; }

  /* Декор из абсолютного позиционирования — в ряд под заголовком */
  .decos {
    position: static;
    display: flex;
    gap: 12px;
    margin-bottom: clamp(28px, 5vw, 44px);
  }
  .deco { position: static; --w: auto; flex: 1 1 0; }
  .deco::before { inset: -6px 6px 6px -6px; }

  /* Вступление и кадр складываются в колонку */
  .intro-row { flex-direction: column; align-items: flex-start; gap: 26px; }
  .deco-inline { flex: none; width: 46%; }

  .slide { flex-basis: 86%; }

  .works > .work:nth-child(n) { grid-column: span 12; margin-top: 0; }
  .work__media, .works > .work:nth-child(n) .work__media { aspect-ratio: 4/3; }

  .cards--3, .cards--2 { grid-template-columns: 1fr; }
  .card:nth-child(n) { transform: none; }
  .card:nth-child(n):hover { transform: translateY(-6px); }

  .steps { grid-template-columns: 1fr; }
  .contact__grid { grid-template-columns: 1fr; }
  .case-text { grid-template-columns: 1fr; }
  .case-gallery { columns: 1; }
  .metric:nth-child(n) { transform: none; }

  .collage__item--a { width: 96px; top: 10%; left: -2%; }
  .collage__item--b { width: 96px; top: 6%; right: -2%; }
  .collage__item--c { width: 88px; bottom: 6%; left: 0; }
  .collage__item--d { width: 96px; bottom: 10%; right: -2%; }
}

@media (max-width: 560px) {
  /* Шапка: бренд ужимаем, иначе он вытесняет тумблер и бургер */
  .brand { font-size: 12px; letter-spacing: .2em; }
  .topbar__actions { gap: 16px; }
  .lang { gap: 7px; font-size: 11px; }
  .lang__track { width: 30px; }
  .lang[data-lang="en"] .lang__dot { left: 23px; }

  /* Колонка, чтобы вернувшийся в поток индикатор встал под текстом, а не рядом */
  .hero { min-height: auto; padding: 120px 0 56px; flex-direction: column; }
  .hero__title .h-display + .h-display { margin-left: 0; }
  .hero__loc { font-size: 10px; letter-spacing: .16em; }

  /* Индикатор скролла возвращаем в поток — в абсолюте он наезжал на подзаголовок */
  .hero__scroll {
    position: static;
    transform: none;
    margin-top: 44px;
  }
  .hero__scroll i { height: 32px; }

  .collage { opacity: .26; }
  .about__stats { flex-direction: column; gap: 24px; }
  .langs { flex-direction: column; gap: 24px; }
  .footer__in { flex-direction: column; align-items: flex-start; }
  .case-nav a { max-width: 100%; }
  }

/* Уважаем системную настройку «уменьшить движение» */
@media (prefers-reduced-motion: reduce) {
  html, .slider__viewport { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .rv { opacity: 1; transform: none; }
  .switch__dot { left: 35px; background: var(--accent); }
  .panel::after, .timeline__rail { transform: scaleX(1); width: 100%; }
  .cursor, .cursor-ring { display: none; }
}

@media print {
  .topbar, .cursor, .cursor-ring, .hero__scroll { display: none; }
  .rv { opacity: 1; transform: none; }
}
