/* ===== Шрифты ===== */
@font-face {
  font-family: "Commissioner";
  src: url("../fonts/commissioner-cyrillic.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Commissioner";
  src: url("../fonts/commissioner-latin.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Molodo Web";
  src: url("../fonts/molodo.otf");
  font-display: swap;
}

/* ===== Цвета и размеры из макета ===== */
:root {
  --bg: #1e2733;
  --bg-deep: #12171f;
  --wave: #181f29;
  --surface: #29323f;
  --surface-2: #343e4a;
  --line: #343e4a;
  --text: #e8eaed;
  --muted: #a9b6c4;
  --gold: #f7d8a0;
  --radius: 8px;
  --side: 48px;
  --gap: 24px;
  --wrap: 1344px;
  --font: "Commissioner", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-slav: "Molodo Web", "Commissioner", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 104px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.375 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: calc(var(--wrap) + var(--side) * 2); margin: 0 auto; padding-inline: var(--side); }

/* Подписи разделов шрифтом в «уставном» стиле */
.eyebrow {
  margin: 0 0 24px;
  font: 400 24px/1 var(--font-slav);
  color: var(--gold);
}
.h2 { margin: 0; font-weight: 500; font-size: 48px; line-height: 1; }
.muted { color: var(--muted); }

/* ===== Шапка ===== */
.nav {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 40px;
  font-weight: 500;
  color: var(--muted);
  line-height: 20px;
}
.nav__group { display: flex; gap: 25px; }
.nav a { transition: color .2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav__brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  line-height: 0;
  padding: 3px 6px;   /* надпись 228×34 + поля = блок 240×40 из макета */
}
.nav__logo-line, .tabbar { display: none; }

.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding-bottom: 40px;
}
.hero { padding-top: 64px; }
/* Логотип из двух частей — знак и надпись: при переходе на другие страницы
   надпись перелетает в шапку, а знак уходит вверх (см. «Переходы между страницами»). */
.hero__logo { position: relative; width: 280px; height: 280px; margin: 0 auto; }
.hero__mark { position: absolute; left: 0; top: .5px; width: 280px; height: 231.5px; }
.hero__word { position: absolute; left: 7.5px; top: 237.5px; width: 265.5px; height: 39px; }
.hero__title {
  max-width: 900px;
  margin: 32px auto 0;
  font: 400 88px/91.7px var(--font-slav);
  color: var(--gold);
}
.hero__city { margin: 17px 0 0; font-size: 20px; line-height: 1.2; color: var(--muted); }

/* Звёзды. Координаты из макета 1440×640 пересчитаны в доли свободного места:
   --x = x / (ширина шапки − ширина звезды), --y = y / (высота шапки − высота звезды).
   Так звезда при любой ширине экрана остаётся целиком внутри шапки. */
.stars {
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: min(100%, 1600px);
  transform: translateX(-50%);
  pointer-events: none;
}
.star {
  position: absolute;
  width: var(--w);
  height: var(--h);
  left: calc(var(--x) * (100% - var(--w)));
  top: calc(var(--y) * (100% - var(--h)));
}
.star:nth-child(1) { --x: .7164; --y: .1809; --w: 65px; --h: 65px; }
.star:nth-child(2) { --x: .1187; --y: .2482; --w: 84px; --h: 84px; }
.star:nth-child(3) { --x: .8693; --y: .9726; --w: 55px; --h: 55px; }
.star:nth-child(4) { --x: .8466; --y: .3285; --w: 91px; --h: 86px; }
.star:nth-child(5) { --x: .3590; --y: .0974; --w: 36px; --h: 34px; }
.star:nth-child(6) { --x: .1577; --y: .4459; --w: 51px; --h: 48px; }
.star:nth-child(7) { --x: .9646; --y: .8085; --w: 27px; --h: 29px; }
.star:nth-child(8) { --x: .8868; --y: .2724; --w: 35px; --h: 38px; }
.star:nth-child(9) { --x: .0589; --y: .9078; --w: 81px; --h: 76px; }
/* на десктопе с мышью звёздами управляет скрипт (initStars): разгораются у курсора и чуть смещаются за ним */
.stars.is-live .star { will-change: transform, filter; }
@media (prefers-reduced-motion: reduce) {
  .fish { animation: none; }
  .tabbar, .topbar .nav__brand { transition: none !important; }
  .tile--compare .tile__before, .tile--compare .tile__label > span { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ===== Галерея на главной ===== */
.gallery { padding-top: 40px; }

/* ===== Фильтры ===== */
.tags { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin: 0 0 40px; padding: 0; list-style: none; }
.tag {
  display: inline-block;
  padding: 8px 23px;   /* + рамка 1px = 24px, как в макете */
  border: 1px solid var(--muted);
  border-radius: 40px;
  line-height: 20px;
  color: var(--text);
  transition: background-color .2s, color .2s, border-color .2s;
}
.tag:hover { border-color: var(--text); }
.tag[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 500; }

/* ===== Галерея-«кирпичики» на главной ===== */
.masonry { display: flex; gap: var(--gap); align-items: flex-start; }
.masonry__col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.tile {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-2);
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease, opacity .4s;
}
.tile:hover img { transform: scale(1.03); }
.tile img.is-loading { opacity: 0; }
.tile.is-loaded { background: none; }

/* Реставрация на главной: одна плитка «до / после». Показано «после»; «до» проступает при наведении,
   на сенсорных экранах фото сами сменяются по очереди. В углу — подпись, что сейчас на фото. */
.tile__before { position: absolute; inset: 0; opacity: 0; }
.tile img.tile__before { transition: transform .5s ease, opacity .6s ease; }
.tile--compare:hover .tile__before,
.tile--compare:focus-visible .tile__before { opacity: 1; }
.tile__label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: grid;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(24, 31, 41, .72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 13px;
  line-height: 18px;
  pointer-events: none;
}
.tile__label > span { grid-area: 1 / 1; text-align: center; transition: opacity .4s ease; }
.tile__label-before { opacity: 0; }
.tile--compare:hover .tile__label-after,
.tile--compare:focus-visible .tile__label-after { opacity: 0; }
.tile--compare:hover .tile__label-before,
.tile--compare:focus-visible .tile__label-before { opacity: 1; }
@media (hover: none) {
  .tile--compare .tile__before,
  .tile--compare .tile__label-before { animation: compare-in 8s ease-in-out infinite; }
  .tile--compare .tile__label-after { animation: compare-out 8s ease-in-out infinite; }
}
@keyframes compare-in { 0%, 40% { opacity: 0; } 50%, 90% { opacity: 1; } 100% { opacity: 0; } }
@keyframes compare-out { 0%, 40% { opacity: 1; } 50%, 90% { opacity: 0; } 100% { opacity: 1; } }

.btn-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 40px;
  min-height: 60px;
  padding: 16px 32px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 20px;
  transition: color .2s, background-color .2s;
}
.btn-more:hover { color: var(--text); background: #2f3947; }
.btn-more svg { flex: none; }

/* ===== О мастерской ===== */
.about { padding-top: 120px; }
.about__intro { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: start; padding-bottom: 48px; }
.about__lead { margin: 0; padding-top: 48px;   /* по верху заголовка: подпись 24px + отступ 24px */ color: var(--muted); max-width: 660px; }
.about__photo { width: 100%; height: 480px; object-fit: cover; background: #2a313b; filter: grayscale(1); }
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); padding-block: 48px 0; }
.services h3 { margin: 0 0 16px; font-size: 20px; line-height: 28px; font-weight: 500; }
.services p { margin: 0 0 8px; color: var(--muted); }
.services p:last-child { margin-bottom: 0; }

/* ===== Плавное появление блоков при прокрутке =====
   Класс reveal ставит скрипт (initReveal) — без него всё просто видно.
   Сдвиг задан свойством translate, а не transform, и анимация не остаётся «висеть» после конца —
   поэтому она не мешает собственным эффектам элементов (наведение на фото и т. п.). */
.reveal:not(.is-visible) { opacity: 0; }
.reveal.is-visible { animation: reveal-in .8s cubic-bezier(.2, .7, .3, 1) backwards; }
@keyframes reveal-in { from { opacity: 0; translate: 0 28px; } }

/* ===== Вопрос-ответ ===== */
.faq { display: grid; grid-template-columns: 1fr 888px; gap: var(--gap); padding-top: 120px; }
.faq__list { border-bottom: 1px solid var(--line); }
.faq details { border-top: 1px solid var(--line); }
.faq summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 8px 19px 24px;
  font-size: 20px;
  line-height: 24px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  transition: color .3s;
  -webkit-tap-highlight-color: transparent;
}
.faq summary::-webkit-details-marker { display: none; }
/* Значок «+»: ::after — горизонтальная черта (она же держит место 40×40 справа),
   ::before — вертикальная; при открытии вертикальная поворачивается и ложится на горизонтальную → «−» */
.faq summary::after,
.faq summary::before {
  content: "";
  background-color: var(--text);
  border-radius: 1px;
  transition: background-color .3s, transform .4s cubic-bezier(.4, 0, .2, 1);
}
.faq summary::after { flex: none; width: 12px; height: 1.5px; margin-inline: 14px; }
.faq summary::before { position: absolute; right: 27.25px; top: 50%; width: 1.5px; height: 12px; margin-top: -6px; }
.faq details[open] summary::after,
.faq details[open] summary::before { background-color: var(--gold); }
.faq details[open] summary::before { transform: rotate(90deg); }
/* во время сворачивания значок уже показывает «+» */
.faq details.is-closing summary::after,
.faq details.is-closing summary::before { background-color: var(--text); }
.faq details.is-closing summary::before { transform: none; }
.faq summary:hover { color: #fff; }
.faq__answer { margin: -4px 0 0; padding: 0 64px 24px 24px; line-height: 19.56px; color: var(--muted); overflow: hidden; }
.faq__answer p { margin: 0; }
.faq__answer p + p { margin-top: 10px; }

/* ===== Контакты / подвал ===== */
.footer {
  position: relative;
  margin-top: 120px;
  padding-top: 20px;
  /* сверху 20px прозрачно — там гребни волны */
  background: linear-gradient(transparent 20px, var(--bg-deep) 20px);
}
/* Волнистый край как в макете: гребень светлой обводки (#181f29, 24px) — по верхнему краю подвала,
   тёмная волна — на 24px ниже. Шаг 93.7px, фаза 47.2px (+20 периодов, чтобы стык картинки ушёл за край экрана). */
.footer::before,
.footer::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  pointer-events: none;
}
.footer::before {
  top: 0;
  height: 44px;
  background:
    repeat-x 1920.96px 0 / auto 20px url("../assets/wave-light.svg"),
    no-repeat 0 19px / 100% 25px linear-gradient(var(--wave), var(--wave));
}
.footer::after {
  top: 24px;
  height: 20px;
  background: repeat-x 1920.96px 0 / auto 20px url("../assets/wave-dark.svg");
}
.contacts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); padding-block: 69px 123px; }
.contacts__info { display: grid; grid-template-columns: 1fr auto; gap: var(--gap); margin-top: 48px; font-size: 20px; line-height: 24px; color: var(--muted); }
.contacts__info a:hover { color: var(--text); }
.contacts__lines { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.contacts__address { margin: 0; max-width: 320px; line-height: 28px; font-style: normal; }
.contacts__address a { transition: color .2s; }
.socials { display: flex; gap: 10px; margin-top: 24px; }
.socials a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #a0adba;
  transition: color .2s, border-color .2s;
}
.socials a:hover { color: var(--text); border-color: var(--muted); }
/* Рыбки медленно плавают: проплывают влево, разворачиваются и возвращаются.
   Они под текстом (z-index) и не ловят клики, амплитуда — в --swim (её же берёт initFish). */
.contacts > * { position: relative; z-index: 1; }
.fish {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  --swim: -56px;
  animation: swim 30s ease-in-out infinite, bob 5s ease-in-out infinite;
}
.fish--2 { --swim: 80px;   /* серая смотрит вправо — плывёт сначала вправо */ animation-duration: 21s, 4s; animation-delay: -8s, -2s;   /* маленькая — шустрее */ }
/* рыбками управляет скрипт (initFish): плавают сами, а спугнутые курсором или касанием гуляют по всему подвалу */
.fish.is-live { animation: none; will-change: transform; }
@keyframes swim {
  0%   { translate: 0 0; scale: 1 1; }
  22%  { translate: calc(var(--swim) * .5) -3px; }
  44%  { translate: var(--swim) 0; scale: 1 1; }
  50%  { translate: var(--swim) 2px; scale: -1 1; }
  72%  { translate: calc(var(--swim) * .5) -2px; }
  94%  { translate: 0 0; scale: -1 1; }
  100% { translate: 0 0; scale: 1 1; }
}
@keyframes bob {
  0%, 100% { rotate: -2deg; }
  50%      { rotate: 2deg; }
}
.fish--1 { width: 125px; left: calc(50% - 296px); top: 221px; }
.fish--2 { width: 91px;  left: calc(50% - 365px); top: 272px; }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 0 40px;
  color: rgba(169, 182, 196, .4);
}
.footer__bottom p { margin: 0; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
/* ссылки внизу — тонкое полупрозрачное подчёркивание, чтобы их было видно и без наведения */
.footer__bottom a { text-decoration: underline 1px color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 3px; transition: color .2s; }
.footer__bottom a:hover { color: var(--muted); }

/* ===== Политика конфиденциальности ===== */
.policy { max-width: calc(800px + var(--side) * 2); margin-inline: 0; padding-top: 28px; color: var(--muted); }
.policy h1 { margin-bottom: 12px; font-size: 40px; line-height: 44px; color: var(--text); }
.policy__date { margin: 0 0 48px; }
.policy h2 { margin: 40px 0 16px; font-size: 20px; line-height: 28px; font-weight: 500; color: var(--text); }
.policy p, .policy li { margin: 0 0 12px; }
.policy ul { margin: 0 0 12px; padding-left: 20px; }
.policy a { color: var(--gold); }
.policy a:hover { text-decoration: underline; }
.policy mark { background: rgba(247, 216, 160, .15); color: var(--gold); padding: 0 4px; border-radius: 4px; }

/* ===== Уведомление о cookie ===== */
.cookie {
  position: fixed;
  left: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 560px;
  padding: 16px 16px 16px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  transform: translateY(16px);
  opacity: 0;
  transition: opacity .3s, transform .3s;
}
.cookie.is-shown { opacity: 1; transform: none; }
.cookie p { margin: 0; }
.cookie a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.cookie a:hover { color: var(--gold); }
.cookie .tag { flex: none; background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 500; }
.cookie .tag:hover { background: #fff; }

/* ===== Страница «Работы» ===== */
.page-head { padding-top: 28px; }
.page-head h1 { margin: 0 0 32px; font-size: 40px; line-height: 40px; }
.page-head .tags { justify-content: flex-start; margin-bottom: 48px; }

.cards { display: flex; gap: var(--gap); align-items: flex-start; }
.cards__col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.card { padding: 16px; border-radius: var(--radius); background: var(--surface); }
.card__photos { display: grid; gap: 8px; }
.card__photos--2 { grid-template-columns: 1fr 1fr; }
.card__photos--many { grid-template-columns: repeat(3, 1fr); }
.card__photos--many .tile:first-child { grid-column: 1 / -1; }
.card__photos--many .tile:not(:first-child) { aspect-ratio: 1; }
.card__more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(30, 39, 51, .6);
  font-size: 20px;
  font-weight: 500;
}
.card__title { margin: 16px 0 0; font-size: 16px; font-weight: 500; line-height: 22px; }
.card__place { margin: 0; color: var(--muted); line-height: 22px; }
.empty { padding: 40px 0; color: var(--muted); text-align: center; }

/* Шапка внутренней страницы прилипает при прокрутке */
/* Верхнее меню закреплено на всех страницах; фон появляется, когда страницу прокрутили */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  transition: background-color .3s, box-shadow .3s;
}
.topbar.is-stuck {
  background: rgba(30, 39, 51, .92);
  box-shadow: 0 1px 0 var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
/* на главной панель лежит поверх шапки со звёздами, а надпись в ней
   появляется, только когда большой логотип ушёл за край экрана */
.topbar--home { margin-bottom: -88px; }
.topbar--home .nav__brand { opacity: 0; visibility: hidden; transform: translate(-50%, -6px); transition: opacity .3s, transform .3s, visibility .3s; }
.topbar--home.show-brand .nav__brand { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ===== Переходы между страницами (View Transitions API) =====
   Работают в Chrome, Edge и Safari 18.2+; в остальных браузерах страницы просто открываются как обычно.
   Надпись логотипа («brand») перелетает между главной и шапкой других страниц,
   знак («brand-mark») уходит вверх, уменьшается и срезается. */
@view-transition { navigation: auto; }
.hero__word,
.topbar:not(.topbar--home) .nav__brand img,
html.brand-in-bar .topbar--home .nav__brand img { view-transition-name: brand; }
.hero__mark { view-transition-name: brand-mark; }
html.brand-in-bar .hero__word,
html.brand-in-bar .hero__mark { view-transition-name: none; }
.nav__logo-line img { view-transition-name: brand-line; }

::view-transition-group(brand) { animation-duration: .65s; animation-timing-function: cubic-bezier(.45, 0, .2, 1); }
::view-transition-old(brand),
::view-transition-new(brand) { height: 100%; animation-duration: .65s; }
::view-transition-old(brand-mark) { animation: mark-away .55s cubic-bezier(.45, 0, .2, 1) both; }
::view-transition-new(brand-mark) { animation: mark-away .55s cubic-bezier(.45, 0, .2, 1) reverse both; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: .4s; }
@keyframes mark-away {
  to { transform: translateY(-70px) scale(.75); clip-path: inset(100% 0 0 0); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
.topbar .nav { padding-block: 34px; }   /* панель 88px */

/* ===== Просмотр фото ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  padding: 32px 130px 16px;
  background: rgba(24, 31, 41, .9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .25s;
}
.lightbox.is-open { opacity: 1; }
.lightbox__stage { position: relative; display: grid; place-items: center; min-height: 0; }
.lightbox__img {
  display: block;
  border-radius: var(--radius);
  object-fit: cover;   /* размеры задаёт скрипт ровно по пропорциям фото */
  box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
  user-select: none;
  -webkit-user-drag: none;
}
.lightbox__caption { margin: 0; padding-top: 18px; text-align: center; font-weight: 500; line-height: 20px; min-height: 38px; }
.lightbox__caption span { color: var(--muted); font-weight: 400; }
.lightbox__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--muted);
  border-radius: 50%;
  transition: color .2s, background-color .2s;
}
.lightbox__btn:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.lightbox__close { top: 24px; right: 82px; }
.lightbox__prev { left: 44px; top: calc(50% - 59px); transform: translateY(-50%) scaleX(-1); }
.lightbox__next { right: 44px; top: calc(50% - 59px); transform: translateY(-50%); }
.lightbox__thumbs {
  position: relative;
  display: flex;
  gap: 4px;
  margin: 8px -130px 0;
  padding-inline: calc(50% - 44px);   /* любую миниатюру можно поставить по центру */
  overflow-x: auto;
  scrollbar-width: none;
}
.lightbox__thumbs::-webkit-scrollbar { display: none; }
.lightbox__thumb {
  flex: none;
  width: 88px;
  height: 88px;
  overflow: hidden;
  border-radius: var(--radius);
  opacity: .55;
  transition: opacity .2s;
}
.lightbox__thumb img { width: 100%; height: 100%; object-fit: cover; }
.lightbox__thumb:hover { opacity: .85; }
/* обводка рисуется поверх фото, без рамки и фона, которые выглядывали бы по краям */
.lightbox__thumb[aria-current="true"] { opacity: 1; outline: 1px solid var(--muted); outline-offset: -1px; }
body.no-scroll { overflow: hidden; }

/* ===== Планшет ===== */
@media (max-width: 1100px) {
  :root { --side: 32px; }
  .hero__title { font-size: 68px; line-height: 1.04; }
  .faq { grid-template-columns: 1fr; gap: 32px; }
  .contacts { grid-template-columns: 1fr; }
  .fish--1 { left: auto; right: 150px; }
  .fish--2 { left: auto; right: 220px; }
  .lightbox { padding-inline: 90px; }
  .lightbox__thumbs { margin-inline: -90px; }
  .lightbox__close { right: 24px; }
  .lightbox__prev { left: 20px; }
  .lightbox__next { right: 20px; }
}

/* ===== Мобильная версия (макет 393px) ===== */
@media (max-width: 760px) {
  :root { --side: 20px; --gap: 9px; }
  body { font-size: 16px; }
  .eyebrow { font-size: 16px; margin-bottom: 8px; }
  .h2 { font-size: 24px; line-height: 1; }
  .br-desk { display: none; }

  .nav { padding-top: 4px; }
  .nav__group { display: none; }
  .nav__logo-line { display: block; width: 260px; max-width: 100%; }

  .hero { padding-top: 0; padding-bottom: 65px; }
  .hero__logo { display: none; }
  .hero__title { margin-top: 136px; font-size: 48px; line-height: 50px; max-width: 360px; }
  .hero__city { font-size: 16px; margin-top: 16px; }
  /* звёзды мобильного макета, шапка 393×386 */
  .star:nth-child(1) { display: none; }
  .star:nth-child(2) { --x: .8933; --y: .4946; --w: 18px; --h: 18px; }
  .star:nth-child(3) { --x: .0557; --y: .8097; --w: 34px; --h: 34px; }
  .star:nth-child(4) { --x: .9366; --y: .8830; --w: 46px; --h: 44px; }
  .star:nth-child(5) { --x: .0435; --y: .2702; --w: 25px; --h: 27px; }
  .star:nth-child(6) { --x: .9864; --y: .2810; --w: 24px; --h: 23px; }
  .star:nth-child(7) { --x: .7500; --y: .2392; --w: 13px; --h: 14px; }
  .star:nth-child(8) { --x: .1243; --y: .5935; --w: 15px; --h: 17px; }
  .star:nth-child(9) { --x: .3128; --y: .9375; --w: 19px; --h: 18px; }

  .tags { justify-content: flex-start; gap: 8px; margin-bottom: 24px; }
  .tag { padding: 8px 15px; font-size: 16px; }
  .gallery { padding-top: 0; }
  .gallery.wrap, .works.wrap { padding-inline: 10px; }
  .btn-more { margin-top: 16px; }

  .about { padding-top: 64px; }
  .about__intro { grid-template-columns: 1fr; gap: 24px; padding-bottom: 24px; }
  .about__lead { padding-top: 0; }
  .about__photo { width: calc(100% - 20px); height: 180px; margin-inline: 10px; border-radius: var(--radius); }
  .services { grid-template-columns: 1fr; gap: 24px; padding-top: 32px; }
  .services h3 { margin-bottom: 8px; }

  .faq { padding-top: 64px; gap: 24px; }
  .faq__list { margin-inline: -10px; }
  .faq summary { padding: 16px 0 16px 10px; font-size: 16px; line-height: 19px; }
  .faq summary::after { margin-inline: 12px; }
  .faq summary::before { right: 17.25px; }
  .faq__answer { padding: 0 44px 16px 10px; margin-top: -8px; line-height: 22px; }

  .footer { margin-top: 64px; }
  .contacts { padding-block: 60px 80px; gap: 24px; }
  .contacts__info { grid-template-columns: 1fr; gap: 24px; margin-top: 0; font-size: 16px; line-height: 19px; }
  .contacts__lines { gap: 8px; }
  .socials { margin-top: 16px; }
  .contacts__address { line-height: 19px; max-width: 260px; }
  .contacts { position: static; }
  /* рыбки — справа от телефона, почты и значков, где пусто */
  .fish--1 { width: 125px; right: 8px; top: 196px; left: auto; }
  .fish--2 { width: 91px; right: 40px; top: 146px; left: auto; }
  .fish { --swim: -40px; }
  .fish--2 { --swim: -60px; }
  /* снизу — место под плавающее меню */
  .footer__bottom { flex-direction: column; gap: 10px; font-size: 14px; line-height: 16px; padding-bottom: calc(116px + env(safe-area-inset-bottom, 0px)); }
  .footer__links { flex-direction: column; gap: 10px; }
  .policy { padding-top: 28px; }
  .policy__date { margin-bottom: 32px; }
  .policy h2 { margin-top: 32px; font-size: 18px; line-height: 24px; }
  .cookie { left: 10px; right: 10px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; }
  .cookie .tag { text-align: center; }

  .topbar .nav { padding-block: 4px; }
  .topbar--home { margin-bottom: -88px; }
  html { scroll-padding-top: 72px; }   /* место под плашку с названием */
  /* шапка с полным логотипом не закрепляется — уезжает вместе со страницей (вместо неё — плашка, см. ниже) */
  .topbar { position: relative; }
  .topbar.is-stuck { background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .page-head { padding-top: 28px; }
  .page-head h1 { margin-bottom: 20px; font-size: 32px; line-height: 32px; }
  .page-head .tags { margin-bottom: 24px; }
  .policy h1 { font-size: 28px; line-height: 32px; }
  .cards { gap: 8px; }
  .cards__col { gap: 8px; }
  .card { padding: 6px; }
  .card__photos { gap: 4px; }
  .card__more { font-size: 16px; }
  .card__title { margin: 8px 2px 0; font-size: 13px; line-height: 17px; }
  .card__place { margin: 2px 2px 2px; font-size: 12px; line-height: 16px; }

  .lightbox { padding: 64px 0 12px; }
  .lightbox__thumbs { margin-inline: 0; padding-inline: calc(50% - 28px); }
  .lightbox__thumb { width: 56px; height: 56px; }
  .lightbox__img { border-radius: 0; }
  .lightbox__prev, .lightbox__next { top: calc(50% - 40px); transform: translateY(-50%); background: rgba(24, 31, 41, .5); }
  .lightbox__prev { left: 8px; transform: translateY(-50%) scaleX(-1); }
  .lightbox__next { right: 8px; }
  .lightbox__close { top: 8px; right: 8px; }
  .lightbox__caption { padding: 14px 20px 0; font-size: 15px; }
}

/* ===== Телефон: плашка с названием сверху и панель меню снизу ===== */
@media (max-width: 760px) {
  /* Плашка с названием: выезжает сверху, когда шапка с полным логотипом ушла за край (initTopbar) */
  .topbar .nav__brand {
    position: fixed;
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: 50%;
    display: block;
    padding: 9px 18px;
    border: 1px solid rgba(232, 234, 237, .1);
    border-radius: 999px;
    background: rgba(41, 50, 63, .78);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
    box-shadow: 0 10px 30px rgba(12, 16, 22, .45), 0 1px 2px rgba(12, 16, 22, .3);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -16px) scale(.96);
    transition: opacity .45s ease, transform .6s cubic-bezier(.32, .72, 0, 1), visibility 0s .6s;
  }
  .topbar.show-brand .nav__brand {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition: opacity .45s ease, transform .6s cubic-bezier(.32, .72, 0, 1), visibility 0s;
  }
  .topbar .nav__brand img { width: auto; height: 20px; }   /* самый мелкий размер, где уставной шрифт ещё читается */

  /* Панель меню: при прокрутке вниз мягко уходит за край, при прокрутке вверх возвращается (initTabbar) */
  .tabbar {
    position: fixed;
    left: 50%;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 40;            /* над страницей и шапкой, под плашкой cookie и просмотром фото */
    display: flex;
    gap: 2px;
    max-width: calc(100vw - 20px);
    padding: 5px;
    border: 1px solid rgba(232, 234, 237, .1);
    border-radius: 999px;
    background: rgba(41, 50, 63, .78);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
    box-shadow: 0 10px 30px rgba(12, 16, 22, .45), 0 1px 2px rgba(12, 16, 22, .3);
    transform: translateX(-50%);
    white-space: nowrap;
    transition: transform .6s cubic-bezier(.32, .72, 0, 1), opacity .4s ease;
  }
  /* уходит медленнее, чем возвращается, и гаснет уже на ходу — без рывка */
  .tabbar.is-hidden {
    transform: translate(-50%, calc(100% + 24px + env(safe-area-inset-bottom, 0px)));
    opacity: 0;
    transition: transform .8s cubic-bezier(.32, .72, 0, 1), opacity .6s ease .15s;
  }
  body.no-scroll .tabbar { opacity: 0; pointer-events: none; }   /* открыт просмотр фото */
  .tabbar__item {
    display: inline-flex;
    align-items: center;
    height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 500;
    color: var(--muted);
    -webkit-tap-highlight-color: transparent;
    transition: background-color .25s, color .25s, transform .15s;
  }
  .tabbar__item:active { transform: scale(.95); }
  .tabbar__item[aria-current] { background: var(--text); color: var(--bg); }
  .tabbar__item:focus-visible { outline-offset: -2px; border-radius: 999px; }
  .tabbar__short { display: none; }
}
@media (max-width: 479px) {
  .tabbar__item { padding: 0 12px; }
  .tabbar__long { display: none; }
  .tabbar__short { display: inline; }
}
@media (max-width: 359px) {
  .tabbar__item { padding: 0 9px; font-size: 14px; }
}

.nowrap { white-space: nowrap; }
