/* Локальные шрифты: Inter (текст) и Cormorant Garamond (заголовки).
   Файлы лежат в assets/fonts/, поэтому сайт работает без интернета.
   ПРАВКА: чтобы поменять шрифт — см. assets/fonts/fonts.css и README. */
@import url("assets/fonts/fonts.css");

/* ============================================================================
   styles.css — ВСЕ СТИЛИ САЙТА
   ----------------------------------------------------------------------------
   Разделы:
     1.  Токены (:root)          — цвета, шрифты, отступы, ФОНЫ СТРАНИЦ
     2.  Сброс и база
     3.  Типографика
     4.  Верхняя всплывающая плашка (.top-bar) + логотип
     5.  Кнопки и общие элементы
     6.  Футер
     7.  Главная: первый экран целиком (фото, текст, карточки, мероприятия)
     8.  Страницы услуг: один экран, три столбика прайса, маленькие фото справа
     9.  Модальные окна
     10. Портфолио: фильтры, сетка, лайтбокс, админ-режим
     11. Анимации
     12. Адаптив и prefers-reduced-motion
   ========================================================================== */


/* ==========================================================================
   1. ТОКЕНЫ
   ========================================================================== */

:root {
  /* --- Цвета ------------------------------------------------------------- */
  --bg:          #0d0d10;   /* ПРАВКА: основной цвет подложки сайта */
  --bg-elev:     #15161b;   /* приподнятые блоки (шапка, футер, модалка) */
  --surface:     #1a1b21;   /* карточки */
  --line:        rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.22);
  /* ПРАВКА: цвет контура карточек при наведении — тот же тон, только ярче */
  --line-bright: rgba(255, 255, 255, 0.48);
  --text:        #f3f0ea;
  --muted:       #9a958e;

  /* ПРАВКА: акцентный цвет сайта. Меняя только --accent, вы меняете
     цвет кнопок, ссылок, подсветки и линий по всему сайту. */
  --accent:      #e2543a;
  --accent-hover:#f06a51;
  --accent-soft: rgba(226, 84, 58, 0.14);

  /* --- ФОНЫ СТРАНИЦ ------------------------------------------------------
     ПРАВКА: чтобы поменять фон страницы — замените файл в assets/bg/
     или путь в нужной строке ниже. Привязка к странице — в разделе 2. */
  --bg-home:      url("assets/bg/bg-home.jpg");
  --bg-classic:   url("assets/bg/bg-classic.jpg");
  --bg-cosplay:   url("assets/bg/bg-cosplay.jpg");
  --bg-thematic:  url("assets/bg/bg-thematic.jpg");
  --bg-event:     url("assets/bg/bg-event.jpg");
  --bg-portfolio: url("assets/bg/bg-home.jpg");   /* ПРАВКА: фон портфолио (тот же файл, что на главной) */

  /* Затемнение поверх фото фона: чтобы текст оставался читаемым.
     ПРАВКА: яркость фона — это первое число в каждой строке (0.56 / 0.72).
     Чем меньше значение, тем светлее фон. */
  --page-bg-overlay:
    linear-gradient(180deg, rgba(16, 12, 11, 0.56) 0%, rgba(13, 11, 11, 0.72) 55%, var(--bg) 100%),
    radial-gradient(120% 80% at 78% 10%, rgba(226, 84, 58, 0.1) 0%, rgba(226, 84, 58, 0) 62%);
  --page-bg: none;   /* подставляется классом body.page-XXX */

  /* --- Шрифты ------------------------------------------------------------ */
  --font-display: "Cormorant Garamond", "Georgia", "Times New Roman", serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* --- Размеры и ритм ---------------------------------------------------- */
  --wrap: 1280px;
  --pad: clamp(18px, 4vw, 56px);
  --gap: clamp(12px, 1.6vw, 22px);
  --top-bar-h: 64px;
  --radius: 10px;        /* радиус мелких карточек и кнопок */
  --radius-lg: 18px;     /* радиус карточек категорий */
  /* Радиус «от руки»: углы чуть разные — придаёт карточкам поцарапанный вид */
  --radius-grungy: 16px 10px 18px 12px;
  /* Жёсткие тени без размытия — уличный, трафаретный вид.
     ПРАВКА: 6px 6px — сдвиг тени, 0 — размытие (0 = самая «плотная» тень). */
  --shadow-hard: 6px 6px 0 rgba(0, 0, 0, 0.55);
  --shadow-hard-sm: 3px 3px 0 rgba(0, 0, 0, 0.5);

  /* --- Анимации ---------------------------------------------------------- */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --speed: 0.45s;
}


/* ==========================================================================
   2. СБРОС И БАЗА
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: var(--page-bg-overlay), var(--page-bg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center top;
  background-attachment: fixed, fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ПРАВКА: чтобы поменять фон страницы — замените путь у нужной переменной
   в разделе 1. Здесь менять ничего не нужно. */
body.page-home      { --page-bg: var(--bg-home); }
body.page-classic   { --page-bg: var(--bg-classic); }
body.page-cosplay   { --page-bg: var(--bg-cosplay); }
body.page-thematic  { --page-bg: var(--bg-thematic); }
body.page-event     { --page-bg: var(--bg-event); }
body.page-portfolio { --page-bg: var(--bg-portfolio); }

/* Плавное появление страницы (класс ставит script.js) */
body { opacity: 0; transition: opacity 0.5s var(--ease); }
body.is-loaded { opacity: 1; }
body.is-leaving { opacity: 0; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.section { padding: clamp(40px, 6vw, 80px) 0; }
.section--tight { padding: clamp(24px, 3vw, 44px) 0; }

.section-head { max-width: 760px; margin-bottom: clamp(18px, 2.4vw, 32px); }
.section-kicker {
  color: var(--accent);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.8vw, 2.3rem);
  font-weight: 500;
  line-height: 1.1;
  margin: 0 0 8px;
}
/* Короткая акцентная плашка под заголовком — уличная деталь */
.section-title::after {
  content: "";
  display: block;
  width: 46px;
  height: 3px;
  margin-top: 12px;
  background: var(--accent);
}
.section-sub { color: var(--muted); margin: 0; max-width: 62ch; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}


/* ==========================================================================
   3. ТИПОГРАФИКА
   ========================================================================== */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  margin: 0;
  /* Двойная тень: оттиск вниз плюс смещённый акцентный контур —
     как на советской печати с неприводкой. */
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5), -1px 0 0 rgba(226, 84, 58, 0.3);
}

.text-body p { margin: 0 0 0.9em; color: var(--muted); }
.text-body p:last-child { margin-bottom: 0; }
.text-body p:first-child { color: var(--text); }

.hairline {
  height: 1px;
  border: 0;
  margin: 0;
  /* Пунктирная линия вместо ровной — мелкая гранжевая деталь */
  background: repeating-linear-gradient(90deg, var(--line) 0 7px, rgba(0, 0, 0, 0) 7px 14px);
}


/* ==========================================================================
   4. ВЕРХНЯЯ ВСПЛЫВАЮЩАЯ ПЛАШКА
   ========================================================================== */

/* Невидимая зона у верхней кромки: наведение на неё показывает плашку */
#top-hover-zone {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  z-index: 60;
}

.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 70;
  height: var(--top-bar-h);
  display: flex;
  align-items: center;
  background: rgba(13, 13, 16, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
}
.top-bar.is-visible, .top-bar:hover { transform: translateY(0); opacity: 1; }

.top-bar__inner {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.6vw, 28px);
}

/* Логотип: ПРАВКА: картинка меняется в data.js → SITE.brand.logo */
.logo { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.logo__mark {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
.logo__text { display: flex; flex-direction: column; line-height: 1.15; }
.logo__name { font-size: 0.95rem; letter-spacing: 0.04em; }
.logo__tagline { font-size: 0.68rem; color: var(--muted); letter-spacing: 0.06em; }

/* Меню — ПРАВКА: пункты и порядок в data.js → SITE.nav */
.site-nav { display: flex; gap: clamp(8px, 1.2vw, 20px); margin-left: auto; }
.site-nav a {
  position: relative;
  font-size: 0.84rem;
  letter-spacing: 0.03em;
  color: var(--muted);
  padding: 6px 2px;
  transition: color var(--speed) var(--ease);
}
.site-nav a::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }

/* --- Выпадающие подпункты меню (Косплей → Tora → съёмки) ----------------- */
.nav-item { position: relative; display: flex; align-items: center; }
.nav-toggle {
  display: none;
  place-items: center;
  width: 22px; height: 22px;
  margin-left: 2px;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
}
.nav-toggle svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; }
.nav-toggle:hover { color: var(--text); }

.nav-sub {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 80;
  min-width: 190px;
  padding: 8px;
  display: none;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-hard);
}
.nav-sub .nav-sub { top: -8px; left: 100%; }

/* Подменю раскрывается только кнопкой-стрелкой, при наведении ничего не всплывает */
.site-nav .nav-item.is-open > .nav-sub { display: block; }

.nav-sub a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}
.nav-sub a::after { display: none; }
.nav-sub a:hover, .nav-sub a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, 0.05); }

/* На тач-устройствах подменю открывается кнопкой-стрелкой, а не наведением */
@media (hover: none), (pointer: coarse) {
  .nav-toggle { display: inline-grid; }
  .site-nav .nav-item.is-open > .nav-sub { display: block; }
}

/* На узком экране подменю — панель во всю ширину под шапкой */
@media (max-width: 900px) {
  .nav-sub {
    position: fixed;
    top: var(--top-bar-h);
    left: 8px;
    right: 8px;
    min-width: 0;
    max-height: 60vh;
    overflow-y: auto;
  }
  .nav-sub .nav-sub {
    position: static;
    margin: 2px 0 4px 14px;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  .nav-sub .nav-sub a { padding-left: 10px; }
}

.social-list { display: flex; gap: 8px; flex: 0 0 auto; }
.social-link {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.social-link svg { width: 16px; height: 16px; fill: currentColor; }
.social-link:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }


/* ==========================================================================
   5. КНОПКИ
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--accent);
  color: #14100e;
  font-size: 0.8rem;
  /* Капс с широким трекингом + жёсткая тень = уличный вид кнопок */
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 600;
  box-shadow: var(--shadow-hard-sm);
  transition: background 0.3s var(--ease), transform 0.2s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:hover { background: var(--accent-hover); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55); }
.btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5); }

.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { background: var(--accent-soft); border-color: var(--accent); }

.btn--small { padding: 9px 16px; font-size: 0.8rem; }
.btn--block { width: 100%; }

.btn-icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: rgba(13, 13, 16, 0.6);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.btn-icon:hover { background: var(--accent); border-color: var(--accent); }
.btn-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.btn-icon[disabled] { opacity: 0.32; cursor: not-allowed; }


/* ==========================================================================
   6. ФУТЕР
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(13, 13, 16, 0.72);
  padding: clamp(24px, 4vw, 44px) 0 clamp(20px, 3vw, 32px);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.site-footer__text { color: var(--muted); font-size: 0.84rem; margin: 0; }
.site-footer__note { color: var(--muted); font-size: 0.76rem; margin: 8px 0 0; }


/* ==========================================================================
   7. ГЛАВНАЯ — ДВА ЭКРАНА
   ЭКРАН 1 (#home-screen) — про меня: фото на всю высоту, слева текст.
   ЭКРАН 2 (#home-cards)  — направления: три карточки 3:4 и широкая
                            низкая карточка «Мероприятия».
   ========================================================================== */

/* --- ЭКРАН 1 ------------------------------------------------------------
   ПРАВКА: положение текста на первом экране. Левее — отрицательный
   margin-left у #hero-inner, выше — меньше padding-top у #home-screen. */
#home-screen {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: calc(var(--top-bar-h) + 65px) 0 clamp(30px, 6vh, 70px);
  overflow: hidden;
  isolation: isolate;
}

/* --- 7.1 ФОТО НА ВЕСЬ ЭКРАН ------------------------------------------------
   #hero-bg    — контейнер с фото на весь первый экран
   #hero-photo — само фото: резкое, без размытия
   Затемнение слева и снизу — слой #hero-bg::after.
   ПРАВКА: фото меняется в data.js → SITE.home.heroPhoto
   ------------------------------------------------------------------------ */
#hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  /* ПРАВКА: низ фото растворяется в фоне — чёткой линии между первым
     и вторым экраном нет. Меньше 68% — мягче и раньше начинает таять. */
  mask-image: linear-gradient(180deg, #000 0%, #000 66%, rgba(0, 0, 0, 0.3) 86%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 66%, rgba(0, 0, 0, 0.3) 86%, transparent 100%);
}
#hero-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ФОТО ПЕРВОГО ЭКРАНА: одно, резкое, без размытия и без обрезки по краям.
   Затемнение слева и снизу лежит поверх — слоем #hero-bg::after.
   ПРАВКА: цветокор фото — filter ниже (saturate / contrast / sepia / brightness). */
#hero-photo {
  filter: saturate(0.88) contrast(1.14) sepia(0.08) brightness(1.03);
}

/* Затемнение: слева и по центру под текст, снизу под карточки */
#hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(13, 13, 16, 0.95) 0%, rgba(13, 13, 16, 0.9) 32%, rgba(13, 13, 16, 0.56) 62%, rgba(13, 13, 16, 0.2) 100%),
    linear-gradient(180deg, rgba(13, 13, 16, 0.7) 0%, rgba(13, 13, 16, 0.22) 26%, rgba(13, 13, 16, 0.62) 62%, rgba(13, 13, 16, 0.95) 100%);
}

/* Смена фона страницы при наведении на карточку (см. script.js, функция
   initBackgroundSwap). Слой лежит над фоном body, но под содержимым.
   ПРАВКА: плавность — transition ниже (сейчас 0.7s). */
#bg-swap {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.bg-swap__layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.7s var(--ease);
}
.bg-swap__layer.is-visible { opacity: 1; }
/* То же затемнение, что и у обычного фона страницы */
.bg-swap__layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--page-bg-overlay);
}


/* --- 7.2 Текст hero (первый экран) -------------------------------------- */
#hero-inner {
  position: relative;
  z-index: 1;
  /* ПРАВКА: положение текста на первом экране.
     margin-left — сдвиг блока вправо (положительное значение),
     max-width — ширина текстовой колонки; минимум 420px нужен, чтобы
     красная строка сверху (#hero-kicker) помещалась в одну линию,
     text-align — выравнивание строк внутри колонки. */
  margin-left: clamp(0px, 4vw, 60px);
  max-width: clamp(420px, 48vw, 680px);
  padding-left: clamp(0px, 0.5vw, 10px);
  padding-right: clamp(6px, 1.2vw, 24px);
  text-align: left;
}

#hero-kicker {
  color: var(--accent);
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0 0 14px;
}
#hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 4.4vw, 3.8rem);
  line-height: 1.03;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}
#hero-subtitle {
  font-size: clamp(0.92rem, 1.25vw, 1.1rem);
  color: var(--text);
  margin: 0 0 14px;
  /* pre-line = переносы строк из data.js (символ \n) переносятся на экран.
     ПРАВКА: где оборвать строку — задаётся в тексте SITE.home.siteSubtitle. */
  white-space: pre-line;
}
/* Строка «о себе» — ПРАВКА: текст в data.js → SITE.home.about.
   Если строки нет, блок просто не занимает места. */
#hero-about {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 22px;
}
#hero-about:empty { display: none; }
/* Кнопки держатся того же левого края, что и текст */
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-start; }

/* --- 7.3 ЭКРАН 2: направления съёмки ------------------------------------
   Секция занимает ровно один экран. Три карточки 3:4 стоят сверху,
   а широкая карточка «Мероприятия» растягивается на остаток высоты —
   то есть добирает длину до полного экрана. */
#home-cards {
  /* min-height, а не height: если содержимое не помещается в экран,
     страница удлиняется и футер уезжает вниз — ничего не накладывается. */
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 2.6vh, 40px) 0;
}
#home-cards-inner {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
  /* Контейнер для расчёта высоты полосы: 100cqw = ширина этой колонки */
  container-type: inline-size;
}
#home-cards #cards-head { flex: 0 0 auto; margin-bottom: clamp(14px, 2.4vh, 28px); }
#home-cards .section-kicker { font-size: 0.74rem; margin-bottom: 6px; }
#home-cards .section-title { font-size: clamp(1.5rem, 2.8vw, 2.4rem); margin: 0; }
#category-grid { flex: 0 0 auto; }

#category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

/* Карточка направления: формат 3:4, сильно скруглённая.
   ПРАВКА: пропорция карточек — aspect-ratio ниже (3 / 4 = вертикальная). */
.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 3 / 4;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-grungy);
  background-color: var(--surface);
  background-image: var(--card-bg);      /* фото «без наведения» (data.js → photoIdle) */
  background-size: cover;
  background-position: center;
  filter: saturate(0.88) contrast(1.14) sepia(0.08);
  isolation: isolate;
  transition: border-color 0.4s var(--ease), transform 0.45s var(--ease), box-shadow 0.35s var(--ease);
}
/* При наведении контур не меняет цвет на акцентный, а просто становится ярче */
.category-card:hover, .category-card:focus-visible {
  transform: translate(-3px, -3px);
  border-color: var(--line-bright);
}
.category-card::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10, 10, 13, 0.25) 0%, rgba(10, 10, 13, 0.88) 76%);
  z-index: -1;
  transition: opacity 0.5s var(--ease);
}

/* Фото, которое проявляется при наведении (data.js → photoHover).
   z-index ниже, чем у затемняющего слоя ::before, иначе текст перестанет читаться. */
.card-photo {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.05);
  /* ПРАВКА: плёночная цветокоррекция карточек — saturate/contrast ниже */
  filter: saturate(0.92) contrast(1.06);
  transition: opacity 0.6s var(--ease), transform 1.2s var(--ease);
  z-index: -2;
}
.category-card:hover .card-photo,
.category-card:focus-visible .card-photo { opacity: 0.92; transform: scale(1); }

.card-title { font-size: clamp(1.25rem, 1.9vw, 1.7rem); margin: 0 0 5px; }
.card-desc { color: var(--text); font-size: 0.94rem; margin: 0; max-width: 40ch; }

/* Текст всплывает только при наведении — на устройствах с курсором.
   На тач-устройствах он виден сразу. */
@media (hover: hover) {
  .card-desc {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(10px);
    transition: max-height 0.45s var(--ease), opacity 0.35s var(--ease), transform 0.45s var(--ease);
  }
  .category-card:hover .card-desc,
  .category-card:focus-visible .card-desc {
    max-height: 140px;
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- 7.4 ШИРОКАЯ ПОЛОСА «МЕРОПРИЯТИЯ» -----------------------------------
   ПРАВКА: высота полосы. min-height — самая низкая высота,
   max-height — предел, дальше которого полоса не растёт.
   Полоса автоматически добирает второй экран до полного. */
/* ПРАВКА: высота полосы. Она равна половине ширины обычной карточки
   направления: (ширина колонки − два промежутка) / 3 / 2 = / 6.
   Хочешь ниже — увеличь делитель, выше — уменьши.
   aspect-ratio — запасной вариант для браузеров без container queries. */
#event-teaser {
  flex: 0 0 auto;
  aspect-ratio: 6 / 1;
  height: calc((100cqw - 2 * var(--gap)) / 6);
  margin-top: clamp(12px, 1.8vh, 22px);
  display: flex;
}

#card-event {
  position: relative;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: clamp(14px, 3vw, 60px);
  padding: 0 clamp(18px, 2vw, 30px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-grungy);
  background-color: var(--surface);
  background-image: var(--card-bg);
  background-size: cover;
  background-position: center;
  isolation: isolate;
  transition: border-color 0.4s var(--ease), transform 0.45s var(--ease);
}
#card-event::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10, 10, 13, 0.9) 0%, rgba(10, 10, 13, 0.74) 55%, rgba(10, 10, 13, 0.58) 100%);
  z-index: -1;
}
#card-event:hover, #card-event:focus-visible {
  border-color: var(--line-bright);
  transform: translate(-3px, -3px);
}
#card-event:hover .card-photo, #card-event:focus-visible .card-photo { opacity: 0.7; transform: scale(1); }
#card-event .card-title { font-size: clamp(1.15rem, 1.7vw, 1.55rem); margin: 0; white-space: nowrap; }
/* В этой полосе текст-вопрос виден всегда (а не только при наведении),
   иначе низкая полоса осталась бы почти пустой */
#card-event .card-desc {
  justify-self: end;
  text-align: right;
  max-width: none;
  max-height: none;
  opacity: 1;
  transform: none;
  overflow: visible;
  color: var(--text);
  font-size: 0.94rem;
}


/* ==========================================================================
   8. СТРАНИЦЫ УСЛУГ — ОДИН ЭКРАН
   Слева: название, описание, три столбика прайса. Справа: маленькие фото.
   ========================================================================== */

#one-screen {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(14px, 2.2vh, 26px);
  padding: calc(var(--top-bar-h) + 14px) 0 clamp(18px, 3vh, 32px);
}

#page-template {
  display: grid;
  /* ПРАВКА: соотношение колонок «текст / фото». Меняя числа, следите,
     чтобы фото справа оставалось визуально на месте. */
  grid-template-columns: 1.75fr 1fr;
  gap: clamp(22px, 3.8vw, 64px);
  align-items: start;
}
#page-left { min-width: 0; }

.page-kicker {
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
#page-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4.6vw, 3.7rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}
#page-description { max-width: 56ch; margin-bottom: clamp(18px, 2.8vh, 34px); }
#page-description p { font-size: 1.05rem; }

/* --- 8.1 Три столбика прайса -------------------------------------------- */
#prices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2.3vw, 36px);
}
.price-col {
  display: flex;
  flex-direction: column;
  padding: 0 0 0 clamp(12px, 1.4vw, 22px);
  border-left: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.4s var(--ease);
}
.price-col:hover { border-left-color: var(--accent); }

/* Один столбик прайса (сейчас — на странице мероприятий) */
#prices.prices--single {
  grid-template-columns: 1fr;
  max-width: 58ch;
}

.price-col__title {
  font-size: 1.15rem;
  margin: 0 0 12px;
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.price-col__list { display: grid; gap: 6px; margin-bottom: auto; }
.price-col__list li {
  position: relative;
  padding-left: 15px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}
.price-col__list li::before {
  content: "";
  position: absolute; left: 0; top: 0.62em;
  width: 6px; height: 1px;
  background: var(--accent);
}
/* Строка под названием столбика — например, «от 3 человек» */
.price-col__minimum { color: var(--accent); font-size: 0.82rem; margin: 0 0 10px; }

.price-col__note {
  color: var(--accent);
  font-size: 0.82rem;
  margin: 9px 0 0;
}
.price-col__price {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 16px 0 10px;
}
.price-col__value {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 2.7vw, 2.4rem);   /* ПРАВКА: размер цены */
  line-height: 1;
}
.price-col__unit { color: var(--muted); font-size: 0.82rem; }
.price-col__order {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 0.86rem;
  color: var(--text);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

/* --- 8.2 Кнопка заказа под прайсом -------------------------------------- */
#order-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: clamp(18px, 2.8vh, 30px);
}
#order-cta-text { color: var(--muted); font-size: 0.9rem; margin: 0; max-width: 52ch; }

/* --- 8.3 Маленькие фото справа ------------------------------------------ */
/* ПРАВКА: padding-top опускает фото так, чтобы его верхняя грань встала
   на уровень ВИДИМОГО верха букв названия категории (#page-title).
   Слагаемые: строка .page-kicker (0.78rem × 1.6 ≈ 20 px) + отступ снизу 12 px
   + ≈10 px запаса на просвет над буквами крупного заголовка. */
#page-aside {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 42px;
}
#page-gallery-preview { display: grid; gap: 10px; }

.mini-photo {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-grungy);
  background: var(--surface);
  box-shadow: var(--shadow-hard-sm);
  transition: border-color 0.35s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.mini-photo:hover { border-color: var(--accent); transform: translate(-2px, -2px); box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.55); }
/* ПРАВКА: высота фото справа на страницах услуг. */
.mini-photo img {
  width: 100%;
  height: clamp(84px, 13vh, 128px);
  object-fit: cover;
  filter: saturate(0.88) contrast(1.14) sepia(0.08);
  transition: transform 0.9s var(--ease);
}
/* Одно фото справа — формат 3:4, прижато к правому краю колонки.
   ПРАВКА: размер — max-width ниже. 66% = фото в 1,5 раза меньше ширины
   правой колонки. Больше значение — крупнее фото. */
.mini-photo--hero {
  max-width: 66%;
  margin-left: auto;
}
.mini-photo--hero img {
  height: auto;
  aspect-ratio: 3 / 4;
}
/* Страница мероприятий: фото горизонтальное — показываем его в родном формате,
   без обрезки под вертикаль 3:4, и на всю ширину колонки */
body.page-event .mini-photo--hero {
  max-width: 100%;
  margin-left: 0;
}
body.page-event .mini-photo--hero img {
  aspect-ratio: auto;
  height: auto;
}
.mini-photo:hover img { transform: scale(1.04); }

/* Кнопка «Все из категории» — по правому краю фото.
   margin-left: auto и align-self: flex-end вместе гарантируют прижатие вправо
   и в колоночной, и в строчной раскладке. */
#page-aside .btn { align-self: flex-end; margin-left: auto; }


/* ==========================================================================
   9. МОДАЛЬНЫЕ ОКНА (заказ и вход в админку)
   ========================================================================== */

.modal {
  position: fixed; inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 6, 8, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.3s var(--ease);
}
.modal__dialog {
  position: relative;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;          /* без видимой полосы прокрутки */
  -ms-overflow-style: none;
  padding: clamp(22px, 3.4vw, 36px);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hard);
  animation: riseIn 0.4s var(--ease);
}
.modal__dialog::-webkit-scrollbar { width: 0; height: 0; }
.modal__close {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line);
  border-radius: 50%; color: var(--muted);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.modal__close:hover { color: var(--text); border-color: var(--accent); }
.modal__close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }

#order-title, #admin-login-title { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: 0 0 10px; }
#order-intro, #admin-login-intro { color: var(--muted); font-size: 0.86rem; margin: 0 0 20px; }

.field { display: block; margin-bottom: 14px; }
.field__label {
  display: block; font-size: 0.74rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 7px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 12px 13px;
  background: rgba(13, 13, 16, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(13, 13, 16, 0.95);
}
.field textarea { min-height: 88px; resize: vertical; }
.field--invalid input { border-color: var(--accent); }

#order-status, #admin-login-status { font-size: 0.82rem; margin: 12px 0 0; min-height: 1.2em; color: var(--accent); }
/* Пояснение под полем (например, «Здесь продолжим обсуждение») */
.field__hint { display: block; color: var(--muted); font-size: 0.74rem; margin-top: 6px; }

/* Переключатель ВК / ТГ — сразу под полем ника, без подписи между ними */
.field--segmented { margin-top: -8px; }
.segmented { display: inline-flex; gap: 6px; margin-top: 0; }
.segmented__item { display: inline-flex; cursor: pointer; }
.segmented__input {
  position: absolute; width: 1px; height: 1px;
  margin: 0; padding: 0; opacity: 0; pointer-events: none;
}
.segmented__item span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 46px; padding: 6px 11px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.segmented__item:hover span { color: var(--text); border-color: var(--line-strong); }
.segmented__input:checked + span {
  color: var(--text); border-color: var(--accent); background: var(--accent-soft);
}
.segmented__input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.field--invalid .segmented__item span { border-color: var(--accent); }

/* Экран «Заявка успешно отправлена» */
#order-success { text-align: center; padding: clamp(8px, 2.4vh, 22px) 0; }
.order-success__emoji { font-size: clamp(2rem, 5vw, 3rem); line-height: 1; margin: 0 0 12px; }
#order-success-title { font-size: clamp(1.3rem, 2.6vw, 1.85rem); margin: 0 0 10px; }
#order-success-text { color: var(--muted); font-size: 0.9rem; margin: 0 0 24px; }
#order-socials-title { font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; }
#order-socials { display: flex; flex-wrap: wrap; gap: 10px; }
.social-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.social-pill svg { width: 15px; height: 15px; fill: currentColor; }
.social-pill:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

body.modal-open { overflow: hidden; }


/* ==========================================================================
   10. ПОРТФОЛИО
   ========================================================================== */

/* Заголовок страницы портфолио.
   ПРАВКА: padding-top — насколько заголовок опущен от верхней кромки.
   Нужно, чтобы выезжающая верхняя плашка не закрывала надпись:
   сейчас отступ = высота плашки + 96 px. */
.page-head {
  padding: calc(var(--top-bar-h) + 96px) 0 clamp(20px, 3vh, 36px);
}
#portfolio-title {
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(16px, 3vw, 40px);
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.filter-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.filter-group__label {
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin-right: 4px;
}
.filter-btn {
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.filter-btn:hover { color: var(--text); border-color: var(--line-strong); }
.filter-btn[aria-pressed="true"] { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
#filter-result { color: var(--muted); font-size: 0.8rem; margin: 14px 0 0; }

/* Сетка портфолио — «мозаика» на CSS-колонках.
   ПРАВКА: количество колонок — вот это число (сейчас 4).
   Ниже по файлу оно уменьшается на планшете и телефоне. */
.portfolio-grid {
  columns: 4;
  column-gap: var(--gap);
  margin-top: clamp(20px, 2.6vw, 34px);
}
.portfolio-card {
  position: relative;
  overflow: hidden;
  break-inside: avoid;              /* карточка не рвётся между колонками */
  margin: 0 0 var(--gap);
  border: 1px solid var(--line);
  border-radius: var(--radius-grungy);
  background: var(--surface);
  box-shadow: var(--shadow-hard-sm);
  transition: border-color 0.4s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.portfolio-card:hover { border-color: var(--accent); transform: translate(-2px, -2px); box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.55); }
/* Высота фото не задаётся жёстко: каждая фотография встаёт в своей пропорции —
   вертикальные выше, горизонтальные ниже, обрезки и пустых полос нет.
   Можно загружать и те, и другие: сетка подстроится сама. */
.portfolio-card__media { position: relative; overflow: hidden; }
.portfolio-card__media img {
  width: 100%;
  height: auto;
  display: block;
  filter: saturate(0.88) contrast(1.14) sepia(0.08);
  transition: transform 1s var(--ease);
}
.portfolio-card:hover .portfolio-card__media img { transform: scale(1.05); }
.portfolio-card__meta { padding: 12px 14px 14px; }
.portfolio-card__title { font-size: 0.95rem; margin: 0 0 3px; }
.portfolio-card__tags { color: var(--muted); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; margin: 0; }
/* Подписи в сетке не показываем: название, тип, формат и год видны
   только в открытом просмотре, в панели справа. */
.portfolio-card__meta { display: none; }
.portfolio-card__hit { position: absolute; inset: 0; border: 0; padding: 0; background: transparent; }
.portfolio-card__hit:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }

#portfolio-empty { display: none; padding: 44px 0; text-align: center; color: var(--muted); }
#portfolio-empty.is-visible { display: block; }

/* Кнопка «Показать ещё» под сеткой */
#portfolio-more-wrap { display: flex; justify-content: center; margin: clamp(18px, 3vw, 28px) 0 0; }
#portfolio-more { min-width: 220px; }
#portfolio-more[hidden] { display: none; }

/* --- Просмотр фото (лайтбокс) -------------------------------------------
   Слева фото во весь экран, справа панель с описанием и тегами.
   ПРАВКА: ширина панели — grid-template-columns ниже (260–340 px). */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  grid-template-columns: 1fr minmax(260px, 340px);
  align-items: center;
  gap: clamp(16px, 2.4vw, 40px);
  padding: clamp(16px, 3vh, 40px) clamp(16px, 3vw, 44px);
  background: rgba(6, 6, 8, 0.99);
  animation: fadeIn 0.3s var(--ease);
}
#lightbox-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  height: 100%;
  margin: 0;
}
#lightbox-image {
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
#lightbox-counter { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.08em; margin: 0; }

.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: clamp(6px, 1.2vw, 16px); }
.lightbox__nav--next { right: clamp(6px, 1.2vw, 16px); }
.lightbox__nav[disabled] { opacity: 0.25; cursor: not-allowed; }

#lightbox-info {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  min-width: 0;
  border-left: 1px solid var(--line);
  padding-left: clamp(16px, 2vw, 30px);
}
.lightbox__tags { color: var(--accent); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; margin: 0; }
#lightbox-title { font-size: clamp(1.3rem, 2.2vw, 1.9rem); margin: 0; }
.lightbox__description { color: var(--muted); font-size: 0.9rem; margin: 0; }
.lightbox__hint { color: var(--line-strong); font-size: 0.76rem; margin: 8px 0 0; }
#lightbox-close { position: absolute; top: clamp(14px, 2vh, 24px); right: clamp(14px, 2vw, 24px); z-index: 2; }

/* --- Админ-режим ---------------------------------------------------------
   Кнопки входа на странице нет: окно пароля открывается сочетанием
   клавиш Ctrl+Alt+A (см. admin.js). Панель админки видна только после входа. */
.admin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: rgba(21, 22, 27, 0.7);
}
.admin-bar__status { font-size: 0.78rem; color: var(--accent); margin: 0; }
#admin-message { color: var(--accent); font-size: 0.76rem; margin: 6px 0 0; min-height: 1.2em; width: 100%; }

#add-photo-panel {
  margin-top: 14px;
  padding: clamp(16px, 2.6vw, 26px);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  background: rgba(21, 22, 27, 0.92);
}
.add-photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
#photo-preview-wrap { margin: 8px 0 16px; }
#photo-preview {
  width: 100%; max-width: 200px; aspect-ratio: 4 / 5;
  object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(13, 13, 16, 0.6);
}
#photo-file-hint { color: var(--muted); font-size: 0.74rem; margin: 8px 0 0; }
#add-photo-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.delete-photo {
  position: absolute; top: 10px; right: 10px;
  z-index: 2;
  width: 32px; height: 32px;
  display: none;
  place-items: center;
  background: rgba(13, 13, 16, 0.85);
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
}
.delete-photo svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
body.admin-mode .delete-photo { display: grid; }
body.admin-mode .portfolio-card__hit { pointer-events: none; }
.delete-photo.is-confirm { background: var(--accent); color: var(--bg); }

/* Подсказка про горячие клавиши — только для тех, кто знает,
   что искать (в интерфейсе нигде не показывается). */
#admin-shortcut-zone { position: fixed; inset: 0; z-index: -1; pointer-events: none; }


/* ==========================================================================
   11. АТМОСФЕРА: ЗЕРНО, ВИНЬЕТКА, ЦАРАПИНЫ
   ПРАВКА: интенсивность каждого слоя — это свойство opacity.
   Держим значения маленькими, иначе текст перестанет читаться.
   ========================================================================== */

/* Виньетка + тёплый световой засвет слева сверху — как засветка плёнки */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 149;
  pointer-events: none;
  background:
    radial-gradient(125% 100% at 50% 38%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.6) 100%),
    radial-gradient(52% 42% at 6% 2%, rgba(255, 196, 128, 0.12) 0%, rgba(255, 196, 128, 0) 72%);
}

/* Зерно плёнки + редкие царапины + мелкая строчная текстура */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: overlay;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)'/%3E%3C/svg%3E"),
    repeating-linear-gradient(93deg, rgba(255, 255, 255, 0.05) 0 1px, rgba(0, 0, 0, 0) 1px 140px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, rgba(0, 0, 0, 0) 1px 3px);
  background-size: 160px 160px, auto, auto;
  background-repeat: repeat, repeat, repeat;
}


/* ==========================================================================
   12. АНИМАЦИИ
   ========================================================================== */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

#page-fade {
  position: fixed; inset: 0;
  z-index: 500;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s var(--ease);
}
#page-fade.is-active { opacity: 1; }


/* ==========================================================================
   13. АДАПТИВ
   ПК (> 1100px) не меняется вообще: все правила ниже живут в медиазапросах.
   Логика: планшет — перестройка сеток, телефон — одна колонка и крупные
   элементы под палец.
   ========================================================================== */

/* --- 13.1 Тач-устройства: наведения нет, шапку держим на виду ------------ */
@media (hover: none), (pointer: coarse) {
  .top-bar { transform: none; opacity: 1; }
  #top-hover-zone { display: none; }
  .site-nav a { padding-top: 10px; padding-bottom: 10px; }
}

/* --- 13.2 Планшет альбомный: 901–1100 px -------------------------------- */
@media (max-width: 1100px) {
  /* Страницы услуг: фото уходит под текст */
  #page-template { grid-template-columns: 1fr; }
  #page-aside { flex-direction: row; flex-wrap: wrap; align-items: center; padding-top: 0; }
  #page-gallery-preview { grid-template-columns: 1fr; flex: 1 1 100%; }
  #prices { gap: clamp(12px, 2vw, 22px); }
  .mini-photo--hero { max-width: 42%; }

  /* Портфолио: четыре колонки на планшете мелкие */
  .portfolio-grid { columns: 3; }
  .add-photo-grid { grid-template-columns: 1fr 1fr; }
}

/* --- 13.3 Планшет: 701–900 px ------------------------------------------- */
@media (max-width: 900px) {
  /* Главная: карточки в две колонки, полоса «Мероприятия» обычной высоты */
  #home-cards { height: auto; min-height: 0; }
  #category-grid { grid-template-columns: 1fr 1fr; }
  #card-event { grid-template-columns: 1fr; gap: 4px; }
  #card-event .card-title { white-space: normal; }
  #card-event .card-desc { justify-self: start; text-align: left; }
  #event-teaser { aspect-ratio: 4 / 1; height: auto; min-height: 120px; }

  /* Прайс: три узких столбика нечитаемы — ставим друг под другом */
  #prices { grid-template-columns: 1fr; gap: 0; }
  .price-col {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 16px 0 0;
  }
  .price-col + .price-col { margin-top: 16px; }
  .price-col:hover { border-top-color: var(--accent); }

  .portfolio-grid { columns: 2; }

  /* Шапка: пункты меню прокручиваются, подпись у логотипа убираем */
  .logo__tagline { display: none; }
  .site-nav {
    gap: 12px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; }
}

/* --- 13.4 Телефон: до 700 px -------------------------------------------- */
@media (max-width: 700px) {
  :root {
    --top-bar-h: 56px;
    --radius-lg: 16px;
    --pad: 16px;
    --gap: 12px;
  }

  html { -webkit-text-size-adjust: 100%; }
  body { overflow-x: hidden; }

  /* ---------- Шапка ---------- */
  .top-bar__inner { gap: 10px; padding: 0 14px; }
  .logo { gap: 8px; }
  .logo__mark { width: 30px; height: 30px; }
  .logo__name { font-size: 0.88rem; }
  .social-list { display: none; }            /* место дорого, соцсети есть в форме заявки */
  .site-nav { margin-left: 0; flex: 1 1 auto; justify-content: flex-start; }
  .site-nav a { font-size: 0.78rem; padding: 12px 2px; }

  /* ---------- Первый экран ---------- */
  #home-screen {
    min-height: 100svh;
    padding: calc(var(--top-bar-h) + 32px) 0 32px;
  }
  /* Причина «съехавшей» вёрстки: min-width колонки был 420px */
  #hero-inner {
    max-width: 100%;
    margin-left: 0;
    padding-left: 0;
    padding-right: 0;
  }
  #hero-bg::after {
    background:
      linear-gradient(180deg, rgba(13, 13, 16, 0.9) 0%, rgba(13, 13, 16, 0.68) 42%, rgba(13, 13, 16, 0.96) 100%);
  }
  #hero-kicker { font-size: 0.68rem; letter-spacing: 0.16em; margin-bottom: 10px; }
  #hero-title { font-size: clamp(2rem, 9vw, 2.7rem); letter-spacing: 0; }
  #hero-subtitle { font-size: 0.98rem; }
  #hero-about { font-size: 0.9rem; }
  .hero-actions { gap: 10px; }
  .hero-actions .btn { flex: 1 1 100%; min-height: 46px; }

  /* ---------- Второй экран: направления ---------- */
  #home-cards { min-height: 0; height: auto; padding: 24px 0 8px; }
  #home-cards #cards-head { margin-bottom: 16px; }
  #home-cards .section-title { font-size: clamp(1.6rem, 7vw, 2rem); }

  #category-grid { grid-template-columns: 1fr; gap: 12px; }
  #category-grid .category-card { aspect-ratio: 4 / 5; padding: 18px; }
  .card-title { font-size: 1.35rem; }
  .card-desc { font-size: 0.92rem; }

  #event-teaser { aspect-ratio: auto; height: auto; margin-top: 12px; }
  #card-event {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 18px;
    min-height: 132px;
    align-items: end;
  }
  #card-event .card-title { font-size: 1.2rem; white-space: normal; }
  #card-event .card-desc { font-size: 0.9rem; }

  /* ---------- Страницы услуг ---------- */
  #one-screen {
    min-height: 0;
    padding: calc(var(--top-bar-h) + 24px) 0 32px;
    gap: 18px;
  }
  .page-kicker { font-size: 0.7rem; margin-bottom: 8px; }
  #page-title { font-size: clamp(2rem, 8.5vw, 2.6rem); }
  #page-description { margin-bottom: 22px; }
  #page-description p { font-size: 0.98rem; }

  #prices { grid-template-columns: 1fr; gap: 0; }
  .price-col { border-left: 0; border-top: 1px solid var(--line); padding: 16px 0 0; }
  .price-col + .price-col { margin-top: 16px; }
  .price-col__title { font-size: 1.05rem; }
  .price-col__list li { font-size: 0.86rem; }
  .price-col__value { font-size: 2rem; }
  .price-col__order { min-height: 42px; padding: 10px 18px; }

  #order-cta { flex-direction: column; align-items: stretch; gap: 14px; margin-top: 22px; }
  #order-cta .btn { width: 100%; min-height: 46px; }
  #order-cta-text { font-size: 0.88rem; }

  #page-aside { padding-top: 4px; gap: 12px; }
  .mini-photo--hero { max-width: 100%; margin-left: 0; }
  .mini-photo img { height: 110px; }
  #page-aside .btn { align-self: stretch; margin-left: 0; min-height: 44px; }

  /* ---------- Портфолио ---------- */
  .page-head { padding: calc(var(--top-bar-h) + 28px) 0 18px; }
  #portfolio-title { font-size: clamp(2rem, 8.5vw, 2.6rem); }

  .filter-bar { gap: 12px; padding: 12px 0; }
  .filter-group { gap: 6px; }
  .filter-group__label { font-size: 0.64rem; margin-right: 0; width: 100%; }
  .filter-btn { padding: 9px 13px; font-size: 0.78rem; min-height: 40px; }
  #filter-result { font-size: 0.76rem; }

  .portfolio-grid { columns: 2; column-gap: 10px; margin-top: 16px; }
  .portfolio-card { margin-bottom: 10px; }

  /* ---------- Модальное окно: лист снизу ---------- */
  .modal { padding: 0; align-items: end; justify-items: stretch; }
  .modal__dialog {
    width: 100%;
    max-height: 92svh;
    padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
  }
  .modal__close { top: 10px; right: 10px; width: 38px; height: 38px; }
  #order-title, #admin-login-title { font-size: 1.5rem; padding-right: 36px; }

  /* 16px — иначе iOS зумит страницу при фокусе в поле */
  .field input, .field textarea, .field select { font-size: 16px; padding: 13px; }
  .field { margin-bottom: 12px; }
  .segmented__item span { min-width: 54px; padding: 9px 12px; }
  .btn { min-height: 46px; }

  /* ---------- Просмотр фото ---------- */
  #lightbox { padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); gap: 10px; }
  #lightbox-image { max-height: 56svh; }
  #lightbox-info { gap: 8px; padding-top: 12px; }
  #lightbox-title { font-size: 1.25rem; }
  .lightbox__description { font-size: 0.86rem; }
  .lightbox__nav { width: 42px; height: 42px; }

  /* ---------- Футер ---------- */
  .site-footer__inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .add-photo-grid { grid-template-columns: 1fr; }
}

/* --- 13.5 Узкий телефон: до 380 px -------------------------------------- */
@media (max-width: 380px) {
  #hero-title { font-size: 1.85rem; }
  #portfolio-title, #page-title { font-size: 1.85rem; }
  .filter-btn { padding: 8px 11px; font-size: 0.74rem; }
  #card-event { padding: 14px; }
}

/* --- «Меньше движения» -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  body { opacity: 1; }
}

/* --- iOS/Safari: фиксированная подложка работает ненадёжно -------------- */
@supports (-webkit-touch-callout: none) {
  body { background-attachment: scroll, scroll; }
}
