/* ── Движок ArchDaily (общий) — синхронизирован с заметкой «Архдэйли» ──
   Подключают: balaklava, plex, katsiveli, zolotye-peski.
   Правила движка: галерея = 5 квадратов на всю ширину без щелей, подписи —
   плавным наведением поверх (без места под подпись), НИКАКИХ лишних обводок
   и подчёркиваний. Per-page: --hero-pos (object-position героя). */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: #ffffff; color: #1a1828; font-family: 'Josefin Sans', sans-serif; font-weight: 300; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }

.nav { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 2rem; }
.nav-brand { font-size: 0.75rem; letter-spacing: 0.3em; text-transform: uppercase; font-weight: 200; }
.nav-back { font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; color: #5a5870; transition: color 0.2s; }
.nav-back:hover { color: #1a1828; }

.hero { width: 100%; max-height: 85vh; overflow: hidden; display: block; }
.hero img { width: 100%; height: 100%; max-height: 85vh; object-fit: cover; object-position: var(--hero-pos, center 45%); display: block; }

.project-title { max-width: 1400px; width: 100%; margin: 0 auto; padding: 2.75rem 2rem 0.5rem;
                 font-size: clamp(1.15rem, 2.3vw, 1.6rem); font-weight: 200; letter-spacing: 0.06em; line-height: 1.4; color: #1a1828; }
.project-title em { font-style: normal; font-weight: 100; color: #6a6880; }

/* ТЭП — без обводок/подчёркиваний (движок); по ширине столбца (7e7668) */
.tep { max-width: 1024px; width: 100%; margin: 1.1rem auto 0; padding: 0 2rem;
       display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem 2rem; }
.tep-row { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.3rem 0; }
.tep-label { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.58rem; color: #9a98b0; }
.tep-val { color: #1a1828; font-size: 0.8rem; }
@media (max-width: 899px) { .tep { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .tep { grid-template-columns: 1fr; } }

/* ── Поток: абзацы промеж изображений ── */
.flow { max-width: 1400px; width: 100%; margin: 2.2rem auto 0; padding: 0 2rem; }

.flow-h { max-width: 820px; margin: 1.2rem auto -0.4rem; font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; color: #9a98b0; font-weight: 400; }
.flow-text { max-width: 820px; margin: 0 auto; font-size: clamp(0.82rem, 1.05vw, 0.96rem); line-height: 1.95; color: #3a3848; }
.flow-text p { margin-bottom: 1.15em; }
.flow-text strong { font-weight: 400; color: #1a1828; }
.flow-fig { margin: 2.4rem auto; max-width: 960px; cursor: zoom-in; position: relative; }  /* один центральный столбец: дальше не растём */
.flow-fig img { width: 100%; height: auto; display: block; }            /* в пределах столбца — на всю ширину */
.flow-fig.is-portrait img { width: auto; max-width: calc(100% - 40px); margin: 0 auto; }  /* вертикальные — отступ 20px */
/* подпись — поверх изображения, появляется только при наведении (не светится по умолчанию) */
.flow-cap { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 1.2rem 0.9rem 0.6rem;
  background: linear-gradient(to top, rgba(10,10,10,0.6), transparent);
  font-size: 0.58rem; letter-spacing: 0.16em; text-transform: uppercase; color: #f0eee8;
  opacity: 0; transition: opacity 0.8s ease; pointer-events: none; }
.flow-fig:hover .flow-cap { opacity: 1; }

/* ── Project gallery: 5 квадратов на всю ширину, равные зазоры, подпись по наведению ── */
.gallery-head { max-width: 1024px; margin: 3.2rem auto 0; padding: 0 2rem; font-size: 0.6rem; letter-spacing: 0.24em; text-transform: uppercase; color: #9a98b0; }
/* галерея — по ширине столбца (как поток текста/изображений): 4 в ряд */
.card--wide { grid-column: span 2; }
.card--wide .card-img { aspect-ratio: 21 / 9; }
@media (max-width:560px){ .card--wide { grid-column: span 2; } }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-flow: dense; gap: 3px; max-width: 1024px; width: 100%; margin: 0.9rem auto 0; padding: 0 2rem; }
.card { position: relative; overflow: hidden; cursor: zoom-in; aspect-ratio: 1 / 1; background: #fff; }
.card-img-wrap { width: 100%; height: 100%; }
.card-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.7s ease; }
.card:hover .card-img { transform: scale(1.05); }
/* ── Движковое правило: чертежи/схемы вписываются с РАВНОМЕРНОЙ рамкой.
   padding в % считается от ширины ячейки для всех 4 сторон → у квадратной
   ячейки рамка сверху/снизу = боковой. Квадратное изображение уменьшается
   в столбце с одинаковой широкой рамкой со всех сторон. ── */
/* Сетка БЕЗ серых полей (7e7668): чертёж заполняет квадрат по высоте,
   обрезается справа/слева. Длинные — в card--wide (2:1, тоже cover). */
.card--doc .card-img { object-fit: cover; }
/* КВ-исключение (по пометке): изображение 70% ширины столбца, по центру,
   равные отступы со всех сторон (книжные те же), без обводки и подписей. */
.card--kv { background: #f4f3ef; }
.card--kv .card-img-wrap { padding: 15%; box-sizing: border-box; }
.card--kv .card-img { object-fit: contain; }
.card--kv .card-caption { display: none; }
/* подпись поверх, появляется ОЧЕНЬ плавно при наведении; места под себя не занимает */
.card-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.2rem 0.7rem 0.55rem;
  background: linear-gradient(to top, rgba(10,10,10,0.62), transparent);
  color: #f4f3f0; font-size: 0.56rem; letter-spacing: 0.14em; text-transform: uppercase;
  opacity: 0; transition: opacity 1.1s ease; pointer-events: none; }
.card:hover .card-caption { opacity: 1; }
.grid-divider { grid-column: 1 / -1; padding: 1.8rem 0 0.7rem; font-size: 0.58rem; letter-spacing: 0.22em; text-transform: uppercase; color: #9a98b0; }
/* ── Карты/широкие схемы: двойная по горизонтали ячейка (2:1), заполняется без серых полей ── */
.grid--maps { grid-template-columns: repeat(3, 1fr); margin-top: 3px; }
.grid--maps .card { aspect-ratio: 2 / 1; }
.grid--maps .card .card-img { object-fit: cover; background: none; }
@media (max-width: 899px) { .grid { gap: 2px; } .grid--maps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } .grid--maps { grid-template-columns: 1fr; } }
@media (max-width: 400px) { .nav, .project-title, .flow { padding-left: 1rem; padding-right: 1rem; } }

/* ── Lightbox (движок): подпись всплывает снизу на тёмном; края — выход ── */
.lb { position: fixed; inset: 0; z-index: 9000; background: rgba(8,8,8,.95); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
.lb.lb--open { opacity: 1; pointer-events: auto; }
.lb-img { max-width: 94vw; max-height: 90vh; object-fit: contain; display: block; }
.lb-btn { position: absolute; top: 0; bottom: 0; width: 18%; min-width: 64px; background: none; border: none; cursor: pointer; color: #fff; font-size: 1.8rem; opacity: 0.4; transition: opacity 0.15s; font-family: 'Josefin Sans', sans-serif; display: flex; align-items: center; }
.lb-btn:hover { opacity: 0.95; }
.lb-prev { left: 0; justify-content: flex-start; padding-left: 1.4rem; }
.lb-next { right: 0; justify-content: flex-end; padding-right: 1.4rem; }
.lb-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.4rem 1.5rem 1.4rem; text-align: center;
  background: linear-gradient(to top, rgba(8,8,8,0.9), transparent);
  color: #e8e6e0; font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase;
  opacity: 0; transition: opacity 0.9s ease; pointer-events: none; }
.lb.lb--open .lb-cap.show { opacity: 1; }
.lb-counter { position: absolute; top: 1.1rem; left: 50%; transform: translateX(-50%); font-size: 0.6rem; letter-spacing: 0.2em; color: rgba(255,255,255,.35); }

/* ── About ── */
#about { background: #0a0a0a; margin-top: 3rem; }
.about-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 0 3.75%; align-items: stretch; }
.about-photo { position: relative; }
.about-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; filter: grayscale(15%) contrast(1.05); opacity: 0; transition: opacity 1.8s ease-in-out; }
.about-slide--active { opacity: 1; }
.about-content { padding: 3.75% 3.75% 3.75% 0; display: flex; flex-direction: column; gap: 1.25rem; }
.about-header { padding-top: 2.5rem; }
.about-name { font-size: clamp(1rem, 1.75vw, 2.1rem); font-weight: 200; letter-spacing: 0.12em; color: #e8e6e0; line-height: 1.05; margin-bottom: 0.4rem; }
.about-role-tag { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: #6a6870; }
.about-bio { font-size: clamp(0.88rem, 1.15vw, 1.05rem); line-height: 1.85; color: #a8a6a0; }
.about-cv { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 0.5rem; }
.about-cv-col { padding: 1.25rem 1.25rem 2.25rem 1.25rem; }
.about-cv-col--right { display: flex; flex-direction: column; gap: 0.6rem; }
.about-cv-sub + .about-cv-sub { padding-top: 0.6rem; }
.about-cv-title { font-size: 0.58rem; letter-spacing: 0.18em; text-transform: uppercase; color: #e8e6e0; font-weight: 600; margin-bottom: 0.85rem; }
.about-cv-list { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; }
.about-cv-list li { font-size: 0.8rem; line-height: 1.3; color: #6a6870; display: flex; flex-direction: column; gap: 0.05rem; }
.about-cv-year { font-size: 0.68rem; letter-spacing: 0.06em; color: #4a4a6a; }
.about-cv-org { font-size: 0.8rem; color: #a8a6a0; font-weight: 400; }
.about-cv-desc { font-size: 0.75rem; color: #5a5870; line-height: 1.35; }
.about-cv-tools { font-size: 0.8rem; font-weight: 400; line-height: 1.35; color: #a8a6a0; }
.about-contact { display: flex; flex-direction: column; gap: 0.75rem; padding-top: 0.75rem; }
.about-contact-label { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: #6a6870; }
.about-qr-wrap { display: flex; align-items: flex-start; gap: 5rem; }
.about-qr-item { display: flex; flex-direction: column; align-items: center; }
.about-qr-link { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; opacity: 0.85; transition: opacity 0.2s; }
.about-qr-link:hover { opacity: 1; }
.about-qr { width: 140px; height: auto; display: block; border-radius: 6px; }
.about-qr-label { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: #a8a6a0; }
.about-back-link { opacity: 0.85; transition: opacity 0.2s, color 0.2s; }
.about-back-link:hover { opacity: 1; color: #e8e6e0; }
.about-tap-links { display: none; }
.about-tap-btn { display: flex; align-items: center; gap: 0.55rem; padding: 0.9rem 1.25rem; border: 1px solid #2a2a38; color: #a8a6a0; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; transition: border-color 0.25s, color 0.25s; }
.about-tap-btn:hover { border-color: #5a5870; color: #e8e6e0; }
@media (max-width: 768px) {
  .about-inner { grid-template-columns: 1fr; padding: 3rem 6%; gap: 2rem 0; }
  .about-photo { position: relative; height: auto; aspect-ratio: 4/5; width: 70%; margin: 0 auto; }
  .about-cv { grid-template-columns: 1fr; }
  .about-qr-item { display: none; }
  .about-tap-links { display: flex; flex-direction: column; gap: 0.5rem; width: 100%; }
  .about-tap-btn { justify-content: center; }
}
