/* ── Шрифты ─────────────────────────────────────────────────────────── */
@font-face {
  font-family: "Days";
  src: url("../fonts/days.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Actay";
  src: url("../fonts/actay-regular.woff2") format("woff2"),
       url("../fonts/actay-regular.otf")   format("opentype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Actay Wide";
  src: url("../fonts/actay-wide-bold.woff2") format("woff2"),
       url("../fonts/actay-wide-bold.otf")   format("opentype");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ── Сброс ───────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box; margin: 0; padding: 0;
  /* Убираем синюю вспышку при тапе на мобиле */
  -webkit-tap-highlight-color: transparent;
}
/* Убираем синюю рамку браузера при клике (focus outline) */
:focus, :focus-visible { outline: none !important; }
html { scroll-behavior: smooth; }
html { background: #0D0921; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: #0D0921;
  color: #fff;
  font-family: "Actay", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overscroll-behavior-y: none;   /* без «резинки» и pull-to-refresh при скролле */
  min-height: 100svh;            /* стабильная высота, не дёргается от адресной строки */
}
img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }

/* ── Lumen-холст — фиксированный фоновый слой, вместе с бабочками (z-index:1) */
/* svh = small viewport height: фиксирован, НЕ меняется при скрытии адресной
   строки (в отличие от % / dvh). Предотвращает прыжок canvas при скролле. */
/* Фирменная рябь поверх люмена (как в приложении) */
#lumenNoise {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1;
  mix-blend-mode: overlay; opacity: 0.16;
}
#lumenCanvas {
  position: fixed !important;
  top: 46svh !important;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
  -webkit-filter: blur(var(--lumen-blur, 12px)) saturate(2.0);
          filter: blur(var(--lumen-blur, 12px)) saturate(2.0);
  will-change: transform;
}
@media (max-width: 640px) {
  #lumenCanvas {
    -webkit-filter: blur(8px) saturate(1.6);
            filter: blur(8px) saturate(1.6);
  }
}

/* ── Бабочки-декорации айдентики ─────────────────────────────────────── */
/* position:fixed — бабочки всегда на одном месте в вьюпорте.           */
/* z-index:3 — над page-body (z-index:2), screen-блендинг делает их     */
/* мягким световым наложением, не перекрывающим контент грубо.          */
.deco-butterfly {
  position: fixed;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  mix-blend-mode: screen;
}
/* Главная — левая: поднята на полразмера, отодвинута левее */
.deco-butterfly--home-l {
  left: -190px; top: calc(18% - 210px);
  width: 420px;
  opacity: 0.42;
  filter: blur(9px);
  transform: rotate(70deg) translateZ(0);
  will-change: transform;
}
/* Главная — правая: отодвинута правее */
.deco-butterfly--home-r {
  right: -110px; top: 58%;
  width: 380px;
  opacity: 0.38;
  filter: blur(8px);
  transform: rotate(-20deg) translateZ(0);
  will-change: transform;
}
/* Мобильная адаптация: значительно меньше, левее/правее */
@media (max-width: 640px) {
  .deco-butterfly--home-l {
    width: 160px; left: -65px; opacity: 0.35;
    top: calc(18% - 80px);
  }
  .deco-butterfly--home-r {
    width: 155px; right: -70px; opacity: 0.30;
  }
}
/* Музей — правая */
.deco-butterfly--museum-r {
  right: -55px; top: 16%;
  width: 370px;
  opacity: 0.40;
  filter: blur(9px);
  transform: rotate(20deg) translateZ(0);
  will-change: transform;
}
/* Логин — левая */
.deco-butterfly--login-l {
  left: -40px; top: 10%;
  width: 340px;
  opacity: 0.52;
  filter: blur(8px);
  transform: rotate(-15deg) translateZ(0);
  will-change: transform;
}
/* Логин — правая */
.deco-butterfly--login-r {
  right: -70px; top: 38%;
  width: 280px;
  opacity: 0.34;
  filter: blur(10px);
  transform: rotate(12deg) translateZ(0);
  will-change: transform;
}

/* ── Страница-обёртка — прозрачный контентный слой (z-index:2) ─────── */
/* body = #0D0921 (тёмный). Люмен и бабочки (z-index:1) просвечивают   */
/* сквозь прозрачный page-body повсюду — в hero, между карточками,       */
/* вокруг ОГБИ. Подвал внутри page-body — тот же контентный слой.       */
.page-body {
  background: transparent;
  position: relative;
  z-index: 2;
}

/* ── Навигация ───────────────────────────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  z-index: 100;
  border-bottom: 3px solid #fff;
  transition: background 0.3s, backdrop-filter 0.3s;
}
.site-nav.scrolled {
  background: rgba(13,9,33,0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Гамбургер */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: none; border: none;
  cursor: pointer; padding: 4px;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.22s, opacity 0.22s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Лого */
.nav-logo {
  display: flex; align-items: center; flex-shrink: 0;
}
.nav-logo img {
  height: 24px; width: auto; max-width: 130px; object-fit: contain;
  display: block;
  /* Лого визуально «высит» при точном центре — занижаем на 2px */
  position: relative; top: 2px;
}

/* Ссылки */
.nav-links {
  display: flex; align-items: center;
  gap: 20px; margin-left: auto; list-style: none;
}
.nav-links a {
  font-size: 14px; font-weight: 500;
  color: rgba(255,255,255,0.70);
  transition: color 0.2s;
}
.nav-links a:hover { color: #fff; }

/* Кнопка входа */
.nav-login {
  display: inline-flex; align-items: center;
  padding: 4px 13px 4px;
  border: 2px solid #fff;
  border-radius: 9999px;
  font-family: "Actay", sans-serif;
  font-size: 12px; font-weight: 500;
  color: #fff; background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.nav-login:hover { border-color: #3DE8C4; background: rgba(61,232,196,0.06); }

/* Мобильное выпадающее меню */
.nav-mobile-menu {
  display: none;
  position: fixed;
  top: 60px; left: 0; right: 0;
  background: rgba(13,9,33,0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  z-index: 99;
}
.nav-mobile-menu.open { display: block; }
.nav-mobile-menu ul { list-style: none; padding: 6px 0; }
.nav-mobile-menu ul li a {
  display: block;
  padding: 13px 24px;
  font-size: 15px;
  color: rgba(255,255,255,0.85);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: color 0.2s;
}
.nav-mobile-menu ul li:last-child a { border-bottom: none; }
.nav-mobile-menu ul li a:hover { color: #3DE8C4; }

@media (max-width: 600px) {
  .nav-hamburger { display: flex; }
  .nav-links     { display: none !important; }
  /* Главная (мобильная): логотип строго по центру панели */
  .site-nav .nav-logo {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    margin-left: 0;
  }
  .nav-login {
    margin-left: auto;
    font-size: 11px;
    padding: 5px 10px 3px;
  }
  /* Кнопка кабинета (после входа) — прижата вправо, как «Вход» */
  .site-nav .inner-nav__cabinet { margin-left: auto; }
}

/* ── Inner-nav (одинаковая панель на всех страницах, кроме главной) ───── */
/* [Назад] слева · логотип по центру · [Вход/Кабинет] справа.
   Отступ от краёв до обеих кнопок одинаков (padding по бокам равный). */
.inner-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;                    /* как на главной: «Назад»=гамбургер, «Вход»=«Вход» */
  z-index: 100;
  border-bottom: 3px solid #fff;
  background: rgba(13,9,33,0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
/* Кнопка «Назад» — круглая, в тон пилюле «Вход» с главной.
   Обводка и высота как у .nav-login, ширина = высоте (круг). */
.inner-nav__back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border: 2px solid #fff;
  border-radius: 11px;               /* квадратная, сильно скруглённая (почти круглая) */
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
}
.inner-nav__back:hover { border-color: #3DE8C4; background: rgba(61,232,196,0.06); }

/* Кнопка «Вход» справа — идентична главной (наследует .nav-login целиком:
   пилюля, padding 4px 13px, шрифт 12px). Никаких переопределений. */

/* Кнопка «Личный кабинет» (после входа) — квадратная почти круглая,
   как «Назад», но с иконкой профиля. Ставится вместо «Вход». */
.inner-nav__cabinet {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border: 2px solid #fff;
  border-radius: 11px;
  color: #fff; background: transparent;
  cursor: pointer; flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
}
.inner-nav__cabinet:hover { border-color: #3DE8C4; background: rgba(61,232,196,0.06); }

/* Логотип строго по центру панели, единый размер, занижен на 2px */
.inner-nav__logo {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
}
.inner-nav__logo img {
  height: 24px; width: auto; max-width: 130px; object-fit: contain;
  position: relative; top: 2px;      /* компенсация оптического завышения */
}
.inner-nav__side { width: 30px; }

/* ── Подвал — внутри page-body, на том же слое что и кнопки ──────────── */
/* Форма подвала: углы «вывернуты» — торчат вверх, центр ниже.           */
/* ::before рисует два угловых выступа (SVG), и выезжает выше подвала.   */
.site-footer {
  --cap-h: clamp(28px, 7.8vw, 150px); /* высота угловых выступов */
  background: linear-gradient(to bottom, #5B35CC 0%, #7B4EFF 100%);
  border-radius: 0;
  text-align: center;
  padding: 40px 24px 32px;
  position: relative;
  margin-top: var(--cap-h);
}

/* Два угловых «уха» подвала. bottom: 100% + 1px гарантирует отсутствие
   субпиксельной щели между выступами и прямоугольником подвала. */
.site-footer::before {
  content: '';
  position: absolute;
  /* calc(100% - 1px): нижний край заезжает 1px внутрь подвала, устраняя щель */
  bottom: calc(100% - 1px);
  left: 0;
  right: 0;
  height: calc(var(--cap-h) + 1px);
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1920 150' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0 C0.352 83.149 65.338 150 145.455 150 H0 V0 Z' fill='%235B35CC'/%3E%3Cpath d='M1920 0 V150 H1774.545 C1854.662 150 1919.648 83.149 1920 0 Z' fill='%235B35CC'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.footer-brand {
  font-family: "Actay Wide", sans-serif;
  font-size: 16px; font-weight: 700;
  color: #fff; margin-bottom: 8px;
}
.footer-sub {
  font-size: 13px; line-height: 1.75;
  color: rgba(255,255,255,0.80);
}
.footer-copy {
  margin-top: 20px;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}

/* ── Кнопки ──────────────────────────────────────────────────────────── */
.btn-teal {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 32px;
  background: linear-gradient(175deg, #52EDD5 0%, #3DE8C4 45%, #28C9A8 100%);
  color: #0D1A16;
  border: none; border-radius: 9999px;
  font-family: "Actay Wide", sans-serif;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.70),
    inset 0 -3px 7px rgba(0,0,0,0.28),
    0 5px 20px rgba(61,232,196,0.25);
  transition: filter 0.2s, transform 0.15s;
}
.btn-teal:hover  { filter: brightness(0.92); }
.btn-teal:active { transform: scale(0.97); }

.btn-pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 28px;
  background: rgba(255,255,255,0.92); color: #1A1040;
  border: none; border-radius: 9999px;
  font-family: "Actay Wide", sans-serif;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  box-shadow:
    inset 0 1.5px 2px rgba(255,255,255,0.90),
    inset 0 -2px 5px rgba(0,0,0,0.15);
  transition: filter 0.2s;
}
.btn-pill:hover { filter: brightness(0.94); }

/* ── Шторка снизу (bottom sheet) ─────────────────────────────────────── */
.sheet {
  position: fixed; inset: 0;
  z-index: 400;
  visibility: hidden;
}
.sheet.open { visibility: visible; }

.sheet__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.sheet.open .sheet__backdrop { opacity: 1; }

.sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 86vh; overflow-y: auto;
  background: linear-gradient(180deg, #1E1246 0%, #150D33 100%);
  border-top: 1px solid rgba(255,255,255,0.10);
  border-radius: 28px 28px 0 0;
  padding: 12px 24px calc(30px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.36s cubic-bezier(0.22, 0.61, 0.36, 1);
  box-shadow: 0 -14px 44px rgba(0,0,0,0.55);
}
.sheet.open .sheet__panel { transform: translateY(0); }

.sheet__handle {
  width: 44px; height: 5px;
  border-radius: 9999px;
  background: rgba(255,255,255,0.25);
  margin: 6px auto 16px;
}
.sheet__close {
  position: absolute; top: 14px; right: 18px;
  background: none; border: none;
  color: rgba(255,255,255,0.55);
  font-size: 30px; line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
}
.sheet__close:hover { color: #fff; }
.sheet__title {
  font-family: "Actay Wide", sans-serif;
  font-size: 22px; color: #fff;
  margin-bottom: 12px;
}
.sheet__body {
  font-size: 15px; line-height: 1.7;
  color: rgba(255,255,255,0.82);
}
.sheet__body p + p { margin-top: 12px; }
.sheet__cta { margin-top: 22px; }

/* ── Cookie: плашка уведомления ───────────────────────────────────────── */
.cookie-bar {
  position: fixed;
  left: 50%; bottom: 16px;
  transform: translateX(-50%) translateY(200%);
  width: min(720px, calc(100% - 24px));
  z-index: 350;
  padding: 16px 20px;
  background: linear-gradient(180deg, #221551 0%, #160D36 100%);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 20px;
  box-shadow: 0 16px 44px rgba(0,0,0,0.50);
  transition: transform 0.42s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.cookie-bar.show { transform: translateX(-50%) translateY(0); }

.cookie-bar__text {
  font-size: 13px; line-height: 1.55;
  color: rgba(255,255,255,0.80);
  margin-bottom: 14px;
}
.cookie-bar__text a { color: #3DE8C4; text-decoration: underline; }

.cookie-bar__actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  align-items: center; justify-content: flex-end;
}
/* «Настройки» — слева, остальные справа */
.cookie-bar__actions .cookie-btn--ghost { margin-right: auto; }

/* ── Cookie: кнопки ──────────────────────────────────────────────────── */
.cookie-btn {
  padding: 9px 22px;
  border-radius: 9999px;
  border: 2px solid transparent;
  font-family: "Actay Wide", sans-serif;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s, border-color 0.2s, color 0.2s, background 0.2s;
}
.cookie-btn--primary {
  background: linear-gradient(175deg, #52EDD5 0%, #3DE8C4 45%, #28C9A8 100%);
  color: #0A2A22;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.60), 0 5px 16px rgba(0,0,0,0.30);
}
.cookie-btn--primary:hover { filter: brightness(0.95); }
.cookie-btn--secondary {
  background: transparent; color: #fff;
  border-color: rgba(255,255,255,0.35);
}
.cookie-btn--secondary:hover { border-color: #3DE8C4; }
.cookie-btn--ghost { background: transparent; color: rgba(255,255,255,0.62); padding-left: 6px; padding-right: 6px; }
.cookie-btn--ghost:hover { color: #fff; }

/* ── Cookie: окно настроек ───────────────────────────────────────────── */
.cookie-modal {
  position: fixed; inset: 0;
  z-index: 360;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.cookie-modal.open { display: flex; }
.cookie-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.62); }
.cookie-modal__panel {
  position: relative;
  width: min(560px, 100%); max-height: 86vh; overflow-y: auto;
  background: linear-gradient(180deg, #1E1246 0%, #150D33 100%);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.60);
}
.cookie-modal__title { font-family: "Actay Wide", sans-serif; font-size: 20px; color: #fff; margin-bottom: 8px; }
.cookie-modal__lead { font-size: 13px; line-height: 1.55; color: rgba(255,255,255,0.70); margin-bottom: 6px; }
.cookie-modal__lead a { color: #3DE8C4; text-decoration: underline; }

.cookie-cat {
  padding: 16px 0;
  border-top: 1px solid rgba(255,255,255,0.10);
  display: flex; gap: 14px; align-items: flex-start; justify-content: space-between;
}
.cookie-cat__name { font-family: "Actay Wide", sans-serif; font-size: 14px; color: #fff; margin-bottom: 4px; }
.cookie-cat__desc { font-size: 12px; line-height: 1.5; color: rgba(255,255,255,0.60); }

/* переключатель */
.cookie-switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; margin-top: 2px; }
.cookie-switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cookie-switch input:disabled { cursor: not-allowed; }
.cookie-switch__track { position: absolute; inset: 0; border-radius: 9999px; background: rgba(255,255,255,0.18); transition: background 0.2s; }
.cookie-switch__track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform 0.2s;
}
.cookie-switch input:checked + .cookie-switch__track { background: #3DE8C4; }
.cookie-switch input:checked + .cookie-switch__track::after { transform: translateX(18px); }
.cookie-switch input:disabled + .cookie-switch__track { opacity: 0.55; }

.cookie-modal__actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 22px; }

@media (max-width: 520px) {
  .cookie-bar__actions { justify-content: stretch; }
  .cookie-bar__actions .cookie-btn { flex: 1 1 auto; }
  .cookie-bar__actions .cookie-btn--ghost { margin-right: 0; order: 3; flex-basis: 100%; }
  .cookie-modal__actions .cookie-btn { flex: 1 1 auto; }
}
