/* =========================================================
   Денис Кондратьев — портфолио v3
   Светлая тема (залочена), лёгкая крупная типографика.
   Шрифты: Onest Light/Medium (дисплей) · Golos Text (текст)
   ========================================================= */

:root {
  --bg: #ffffff;
  /* Фон белый, поэтому поверхностям нужен лёгкий тон, иначе чипсы и плашки
     сливаются с полотном и держатся на одной обводке. */
  --surface: #f4f5f7;
  /* Подложка блоков с картинками: карточки работ, плитки концептов и ИИ.
     Картинка ложится поверх (object-fit: cover), поэтому цвет виден, пока она
     не загрузилась. Белый, как и полотно страницы; форму плитки держит тень. */
  --surface-2: #ffffff;
  --ink: #121418;
  --ink-soft: #5d636d;
  --ink-faint: #8d929b;
  --line: rgba(18, 20, 24, 0.09);
  /* Интерактив — сине-голубой. Два оттенка, потому что один не читается везде:
     на белом #38A8F0 даёт контраст 2.6 (мало), на тёмном #0E72B0 — 3.5.
     Поэтому светлым секциям тёмный тон (5.2), тёмной карточке — светлый (7.0). */
  --hover: #0e72b0;
  --hover-on-dark: #38a8f0;
  --accent: #0e72b0;
  /* Сине-голубой статуса: перекликается с холодной гаммой видео «Обо мне»,
     которое стоит прямо над карточкой контактов. */
  --ok: #38a8f0;
  --dark: #131519;
  --dark-ink: #f1f1ef;
  --dark-soft: #9ba0a9;

  --r-card: 8px;
  --r-pill: 999px;

  /* Без теней: пятно вокруг каждой плитки складывалось в серую дымку и пачкало
     белое полотно. Форму плитки держат скругление и её собственная подложка. */
  --shadow-card: none;
  --shadow-lift: none;

  --font-display: "Onest", system-ui, sans-serif;
  --font-body: "Golos Text", system-ui, sans-serif;

  --wrap: 1480px;
  --pad: 20px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; color-scheme: light; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
h1, h2 { font-family: var(--font-display); font-weight: 300; letter-spacing: -0.025em; line-height: 1.04; }
figure { margin: 0; }
/* Стрелка внешней ссылки — svg, а не глиф: размер ведём от кегля текста,
   цвет наследуется через currentColor. */
.ext {
  display: inline-block; flex: 0 0 auto;
  width: 1.05em; height: 1.05em; vertical-align: -0.16em;
  transition: transform 0.2s var(--ease);
}
a:hover .ext, button:hover .ext { transform: translate(2px, -2px); }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Nav ---------- */
.nav-wrap { position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; justify-content: center; padding: 12px var(--pad); }
.nav {
  width: 100%; max-width: var(--wrap);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  height: 56px; padding: 0 8px 0 18px;
  border-radius: var(--r-pill);
  color: #fff;
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease), color 0.35s var(--ease);
}
.nav__brand { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em; }
.nav__links { display: flex; gap: 24px; }
.nav__links a { font-family: var(--font-display); font-weight: 500; font-size: 0.93rem; opacity: 0.82; transition: opacity 0.2s var(--ease), color 0.2s var(--ease); }
/* Поверх видео шапка светлая — ховер берём светлый тон; когда шапка «залипла»
   на белом полотне, нужен тёмный, иначе ссылка перестаёт читаться. */
.nav__links a:hover { opacity: 1; color: var(--hover-on-dark); }
.nav.is-solid .nav__links a:hover { color: var(--hover); }
.nav__cta {
  display: inline-flex; align-items: center; gap: 0.35em;
  font-family: var(--font-display); font-weight: 600; font-size: 0.9rem;
  padding: 0.6em 1.15em; border-radius: var(--r-pill);
  background: #fff; color: #131519;
  transition: transform 0.18s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}
.nav__cta:hover { background: var(--hover); color: #fff; }
.nav__cta:active { transform: translateY(1px) scale(0.99); }

.nav.is-solid {
  color: var(--ink);
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  /* Тени нет: пятно 32px/10% под плашкой пачкало белое полотно прямо под
     шапкой. От страницы её отделяет тонкая линия, а не затемнение. */
  border: 1px solid var(--line);
}
.nav.is-solid .nav__cta { background: var(--ink); color: var(--bg); }
/* Ховер нужен и в «залипшем» состоянии: .nav.is-solid .nav__cta сильнее по
   специфичности, чем .nav__cta:hover, и перебивал его. */
.nav.is-solid .nav__cta:hover { background: var(--hover); color: #fff; }
@media (prefers-reduced-transparency: reduce) {
  .nav.is-solid { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100dvh; display: flex; align-items: flex-end; overflow: hidden; background: #131519; }
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.32) 0%, rgba(0,0,0,0) 28%),
    linear-gradient(0deg, rgba(0,0,0,0.58) 0%, rgba(0,0,0,0.16) 44%, rgba(0,0,0,0) 68%);
}
.hero__inner { position: relative; z-index: 2; width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad) clamp(36px, 6vh, 68px); }
.hero__title { color: #fff; font-weight: 300; font-size: clamp(2.1rem, 5.2vw, 4.6rem); max-width: 24ch; }
.hero__line { display: block; opacity: 0; transform: translateY(28px); animation: heroline 0.9s var(--ease) forwards; }
.hero__line:nth-child(2) { animation-delay: 0.1s; }
.hero__line:nth-child(3) { animation-delay: 0.22s; }
.hero__line:nth-child(4) { animation-delay: 0.3s; }
.hero__line--soft { color: rgba(255, 255, 255, 0.58); }
@keyframes heroline { to { opacity: 1; transform: none; } }

/* ---------- Sections ---------- */
.section { max-width: var(--wrap); margin: 0 auto; padding: clamp(52px, 6.5vw, 88px) var(--pad) 0; }
.section__head { max-width: 820px; margin-bottom: clamp(20px, 2.6vw, 34px); }
.section__head h2 { font-size: clamp(2.4rem, 5vw, 4rem); }
.section__sub { margin-top: 12px; color: var(--ink-soft); font-size: 1.02rem; max-width: 58ch; }

/* ---------- Cards ---------- */
.card { display: flex; flex-direction: column; }
a.card { cursor: pointer; }
.card__media {
  position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; overflow: hidden;
  border-radius: var(--r-card);
  background: var(--surface-2);
  box-shadow: var(--shadow-card);
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.card__meta { display: flex; flex-direction: column; gap: 2px; padding: 12px 6px 0; }
.card__meta strong { font-family: var(--font-display); font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; transition: color 0.2s var(--ease); }
.card__meta em { font-style: normal; color: var(--ink-soft); font-size: 0.85rem; transition: color 0.2s var(--ease); }
a.card:hover .card__meta strong { color: var(--hover); }
/* Отдельная ссылка под карточкой: карточка сама может быть ссылкой на живой
   сайт, а вложить ссылку в ссылку нельзя. */
.caselink {
  display: inline-flex; align-items: center; gap: 0.3em;
  margin: 10px 6px 0; font-size: 0.85rem; font-weight: 500;
  color: var(--ink-soft);
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--line);
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}
/* Подчёркивание отличает строку кейса от карточки-ссылки: у карточки ховер —
   подъём и цвет заголовка, здесь — цвет и линия. Наводятся независимо. */
.caselink:hover { color: var(--hover); text-decoration-color: var(--hover); }

/* fullscreen-иконка на концептах */
/* Иконка «раскрыть» (lucide:maximize-2) без подложки. Превью бывают и белые,
   и чёрные, поэтому цвет не фиксируем: mix-blend-mode: difference инвертирует
   иконку относительно того, что под ней — она читается на любой картинке. */
.fsico {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 20px; height: 20px;
  color: #fff; mix-blend-mode: difference;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  pointer-events: none;
}
.card__media:hover .fsico, .tile:hover .fsico, .tile:focus-visible .fsico { opacity: 1; }

/* ---------- Работы: крупная сетка ---------- */
/* У карточки две независимые ссылки: сама карточка ведёт на живой сайт,
   отдельной строкой ниже — разбор кейса. Поэтому и подсветка раздельная:
   ховер по карточке не трогает строку кейса и наоборот. */
.wgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 20px; }
.wgrid__item { display: flex; flex-direction: column; align-items: flex-start; }
.wgrid__item .card { width: 100%; }
.wgrid__item .card__media { transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease); }
.wgrid__item .card:hover .card__media { box-shadow: var(--shadow-lift); transform: translateY(-4px); }
.wgrid__item .card__meta { transition: transform 0.3s var(--ease); }
.wgrid__item .card:hover .card__meta { transform: translateY(-4px); }

/* ---------- Концепты: карусель ---------- */
.section__head--row { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.carousel__nav { display: flex; gap: 8px; flex: 0 0 auto; }
/* Кнопки листания: тонкий контур вместо заливки, внутри lucide-стрелка (ISC).
   Заливка спорила с превью, поэтому цвет появляется только на ховере. */
.carousel__btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: var(--r-pill);
  background: transparent; border: 1px solid var(--line); color: var(--ink);
  transition: transform 0.18s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), opacity 0.2s var(--ease);
}
.carousel__btn svg { width: 18px; height: 18px; }
.carousel__btn:hover:not(:disabled) { background: var(--hover); border-color: var(--hover); color: #fff; }
.carousel__btn:active:not(:disabled) { transform: scale(0.94); }
.carousel__btn:disabled { opacity: 0.28; cursor: default; }

/* лента режется краем окна, а не отступом секции */
.carousel {
  width: 100vw; margin-left: calc(50% - 50vw);
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}
.carousel::-webkit-scrollbar { display: none; }
/* Пока тащим мышью, прилипание выключено: иначе scroll-snap возвращает ленту
   назад на каждом кадре и она дёргается. На отпускании класс снимается, и
   браузер сам доводит до ближайшего слайда. Курсор на плитках остаётся
   указателем (они открывают лайтбокс), «схваченность» показываем только в драге. */
.carousel.is-dragging, .carousel.is-gliding { scroll-snap-type: none; }
.carousel.is-dragging, .carousel.is-dragging * { cursor: grabbing; user-select: none; }
.carousel:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.carousel__track {
  display: flex; gap: 12px; width: max-content;
  padding: 0 max(var(--pad), calc((100vw - var(--wrap)) / 2 + var(--pad)));
}
.carousel__slide {
  flex: 0 0 auto; width: clamp(260px, 30vw, 440px); aspect-ratio: 1 / 1;
  scroll-snap-align: start;
}

/* ---------- ИИ-скилы: бенто ----------
   10 плиток = 2 банда по 5. Банд: крупная 2x2 + четыре 1x1 квадратом.
   Второй банд зеркальный, поэтому ритм чередуется. */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: auto;
  gap: 12px;
}
/* Квадрат задаётся самой плиткой, а не картинкой: иначе lazy-картинки
   схлопывают ряды в ноль, пока секция за экраном. Крупным плиткам скрипт
   ставит aspect-ratio:auto, так как они растягиваются на два ряда. */
.bento__item { min-width: 0; aspect-ratio: 1 / 1; }
/* банд 1: крупная слева */
.bento__item:nth-child(1) { grid-column: 1 / 3; grid-row: 1 / 3; }
.bento__item:nth-child(2) { grid-column: 3; grid-row: 1; }
.bento__item:nth-child(3) { grid-column: 4; grid-row: 1; }
.bento__item:nth-child(4) { grid-column: 3; grid-row: 2; }
.bento__item:nth-child(5) { grid-column: 4; grid-row: 2; }
/* банд 2: зеркально, крупная справа */
.bento__item:nth-child(6) { grid-column: 1; grid-row: 3; }
.bento__item:nth-child(7) { grid-column: 2; grid-row: 3; }
.bento__item:nth-child(8) { grid-column: 1; grid-row: 4; }
.bento__item:nth-child(9) { grid-column: 2; grid-row: 4; }
.bento__item:nth-child(10) { grid-column: 3 / 5; grid-row: 3 / 5; }

.tile {
  position: relative; display: block; width: 100%; height: 100%; overflow: hidden;
  border-radius: var(--r-card);
  background: var(--surface-2);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.3s var(--ease);
}
.tile:hover { box-shadow: var(--shadow-lift); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; }
.tile canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* Подписей на плитках нет: тёмный градиент снизу пачкал превью. Название
   живёт в aria-label кнопки — для глаза лишнее, для скринридера нужное. */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* Чипсы — строго информационные подписи, а не ссылки: ни ховера, ни перехода.
   Реакция на курсор обещала бы клик, которого нет. */
.chips li { font-size: 0.84rem; font-weight: 500; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 6px 13px; }
/* Чипсы стоят перед сеткой: сначала «чем сделано», потом сами работы. */
.chips--ai { margin-bottom: 28px; }


/* ---------- Обо мне ---------- */
/* Герой в габаритах карточки: видео + текст поверх, но со скруглением и без
   затемнения. Персонаж в кадре стоит по центру, а слева пустой задник —
   там и живёт текст, поэтому он короткий и колонка узкая (до персонажа).
   Задник ~#6E7E92: контраст с белым 4.1:1 — хватает только крупному тексту,
   поэтому размер не опускаем ниже 24px и держим начертание 400, не 300. */
.about {
  position: relative; overflow: hidden;
  border-radius: 24px;
  min-height: clamp(400px, 40vw, 560px);
  padding: clamp(28px, 4vw, 56px);
  display: flex; align-items: flex-start;
  background: var(--surface-2);
  color: #fff;
}
.about__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 26%;
}
/* Текст прижат к верху и держится в левой доле кадра: правее идёт белая
   столешница, на ней светлый текст исчезает, а ниже вступает плечо персонажа.
   Доля, а не пиксели: кадр масштабируется по ширине, значит стол и персонаж
   всегда на одних и тех же процентах, на любом брейкпоинте.
   Замер задника по постеру, в долях ширины блока (объектом считается только
   сплошная светлая полоса от 10px — одиночные пиксели это шум JPEG и дают
   ложную границу):
   y=110 → 48% | y=200 → 42% | y=300 → 43% | y=350 → 34% | y=380 → 27%.
   Отсюда правило: чем НИЖЕ уходит текст, тем УЖЕ должна быть колонка. Текст в
   три строки заканчивается около y=243, где задник тянется до ~42%, поэтому
   37% безопасны — до столешницы остаётся 81px. Четвёртая строка ушла бы за
   y=280, и колонку пришлось бы сужать обратно. */
.about__inner {
  position: relative; z-index: 1;
  max-width: 37%;
  display: flex; flex-direction: column; align-items: flex-start;
  gap: clamp(14px, 1.6vw, 20px);
}
.tag {
  display: inline-flex; align-items: center;
  font-family: var(--font-display); font-weight: 500; font-size: 0.88rem;
  color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 7px 15px;
  white-space: nowrap;
}
/* Белая пилюля поверх видео — как «Резюме» в шапке. Стекло здесь не годится:
   без затемнения полупрозрачный чипс сливается с задником. */
.tag--onvideo { color: var(--ink); background: #fff; border-color: transparent; }
/* Коэффициент vw поднят с 1.95 до 2.25: при 1.95vw на 1440 выходило 28.08px и
   верхняя граница clamp вообще не достигалась — поднимать её одну было бы
   бесполезно. Ниже ~853px размер по-прежнему упирается в минимум 1.2rem,
   поэтому планшет и мобилка не тронуты. */
.about__text { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.2rem, 2.25vw, 2rem); line-height: 1.34; letter-spacing: -0.02em; }

/* ---------- Контакты ---------- */
.section--contact { padding-bottom: 0; }
.contact {
  position: relative; overflow: hidden;
  background: var(--dark); color: var(--dark-ink);
  border-radius: 24px; padding: clamp(28px, 4vw, 56px);
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center;
}
/* Свечение взято с кадра видео «Обо мне», которое стоит прямо над этим блоком:
   задник #8C99AB, глубокий синий штанов #4F5F7B. Изумруд с кобальтом тут спорили
   с холодной сине-серой гаммой ролика. */
.contact__glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(46% 60% at 12% 8%, rgba(140, 153, 171, 0.20), transparent 70%),
    radial-gradient(52% 70% at 88% 92%, rgba(79, 95, 123, 0.46), transparent 72%);
}
.contact__intro { position: relative; z-index: 1; }
.status {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
  color: #dceffd; background: rgba(56, 168, 240, 0.14);
  border: 1px solid rgba(56, 168, 240, 0.38);
  border-radius: var(--r-pill); padding: 8px 16px;
}
.status__dot { position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.status__dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid rgba(56, 168, 240, 0.5);
  animation: pulse 1.9s var(--ease) infinite;
}
@keyframes pulse {
  0% { transform: scale(0.6); opacity: 1; }
  70%, 100% { transform: scale(1.7); opacity: 0; }
}
/* Чуть тише заголовков секций (4rem): это заголовок внутри карточки, а не яруса. */
/* Верхняя граница clamp правит только десктопом (ниже ~1138px размер уже
   диктует 4.5vw), поэтому уменьшение кегля здесь не трогает планшет и мобилку. */
.contact h2 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); margin-top: 18px; }
.contact__meta { color: var(--dark-soft); margin-top: 12px; font-size: 0.96rem; }

.contact__links { position: relative; z-index: 1; display: flex; flex-direction: column; }
.clink {
  display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 16px;
  padding: 18px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  transition: padding-left 0.25s var(--ease), background 0.25s var(--ease);
}
/* Селектор ведём от li: .clink — единственный ребёнок своего li, поэтому
   .clink:first-child ловил ВСЕ строки, и линии удваивались. */
.contact__links li:first-child .clink { border-top: 1px solid rgba(255, 255, 255, 0.12); }
.clink:hover { padding-left: 16px; background: rgba(255, 255, 255, 0.04); }
.clink__label { font-family: var(--font-display); font-weight: 500; font-size: 0.9rem; color: var(--dark-soft); }
/* min-width: 0 обязателен: по умолчанию колонка 1fr не сжимается уже своего
   содержимого, и длинная почта распирала строку за пределы карточки. */
.clink__value { min-width: 0; overflow-wrap: anywhere; font-family: var(--font-display); font-weight: 500; font-size: clamp(1.05rem, 1.6vw, 1.35rem); letter-spacing: -0.01em; transition: color 0.2s var(--ease); }
.clink__arrow { width: 20px; height: 20px; color: var(--dark-soft); transition: color 0.2s var(--ease); }
/* На тёмной карточке — светлый тон: тёмный тут не читается. */
.clink:hover .clink__value, .clink:hover .clink__arrow { color: var(--hover-on-dark); }

/* ---------- Footer ---------- */
.footer { max-width: var(--wrap); margin: 0 auto; padding: clamp(28px, 4vw, 44px) var(--pad) 40px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 20px; }
.footer__brand { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.footer__note { color: var(--ink-soft); font-size: 0.9rem; }
.footer__year { margin-left: auto; color: var(--ink-faint); font-size: 0.9rem; }

/* ---------- Лайтбокс ---------- */
/* Важно: без этого правила display:flex перебивает браузерное [hidden]{display:none},
   и закрытый лайтбокс висит прозрачным слоем поверх страницы, убивая все ховеры и клики. */
.lightbox[hidden] { display: none; }
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 11, 13, 0.88);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: clamp(16px, 4vw, 48px);
  opacity: 0; transition: opacity 0.3s var(--ease);
}
.lightbox.is-open { opacity: 1; }
.lightbox img, .lightbox video { max-width: 100%; max-height: 100%; border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,0.5); }
.lightbox [hidden] { display: none; }
.lightbox__close {
  position: absolute; top: 18px; right: 22px;
  width: 46px; height: 46px; border-radius: 50%;
  font-size: 1.6rem; line-height: 1; color: #fff;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.lightbox__close:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox__close:active { transform: scale(0.94); }

/* ---------- Reveal ---------- */
/* Прячем только при живом JS (класс .js ставит скрипт): если скрипт упадёт,
   контент останется на месте, а не пропадёт навсегда. */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .wgrid { grid-template-columns: repeat(2, 1fr); }
  .contact { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav__links { display: none; }
  .hero__title { font-size: clamp(1.8rem, 7.6vw, 2.5rem); }
  .wgrid { grid-template-columns: 1fr; gap: 26px; }
  /* Бенто на мобилке: 2 колонки. Инлайновые позиции от скрипта здесь не нужны,
     поэтому сбрасываем их; крупные плитки банда (.is-big) занимают всю ширину. */
  .bento { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .bento__item { grid-column: auto !important; grid-row: auto !important; aspect-ratio: 1 / 1 !important; }
  .bento__item.is-big { grid-column: 1 / 3 !important; }
  /* Узкий экран: колонка сбоку от персонажа не помещается, поэтому текст уходит
     под кадр на белое полотно — там он читается без всякого затемнения. */
  /* overflow: visible обязателен: текст заканчивается вровень с низом блока,
     и hidden срезал нижние выносные («р», «у», «д»). Скругление тут задаёт
     само видео, обрезка блоку не нужна. */
  .about { min-height: 0; padding: 0; display: block; background: none; color: var(--ink); overflow: visible; }
  .about__video { position: static; height: clamp(280px, 78vw, 380px); border-radius: 18px; object-position: center 22%; }
  .about__inner { max-width: none; margin-top: 20px; }
  .tag--onvideo { color: var(--ink-soft); background: var(--surface); border-color: var(--line); }
  /* Узкая строка: подпись уходит НАД значением, стрелка держит правый край.
     Иначе почта не влезает в боковую колонку и распирает карточку. */
  .clink { grid-template-columns: 1fr auto; gap: 2px 12px; padding: 16px 6px; }
  .clink__label { grid-column: 1; grid-row: 1; font-size: 0.82rem; }
  .clink__value { grid-column: 1; grid-row: 2; font-size: 1.02rem; }
  .clink__arrow { grid-column: 2; grid-row: 1 / 3; align-self: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* .js .reveal выше по специфичности, поэтому здесь тоже нужен .js — иначе
     правило не перебьёт скрытие и контент останется невидимым. */
  .js .reveal, .reveal { opacity: 1; transform: none; transition: none; }
  .hero__line { animation: none; opacity: 1; transform: none; }
  .status__dot::after { animation: none; opacity: 0; }
  .card__media, .tile, .clink { transition: none; }
}
