:root {
  color-scheme: dark;
  --bg: #000000;
  --bg-soft: #0b0b0b;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-strong: rgba(255, 255, 255, 0.1);
  --text: #f8f8f8;
  --muted: rgba(255, 255, 255, 0.72);
  --yellow: #f7c600;
  --yellow-soft: rgba(247, 198, 0, 0.2);
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
  --radius: 28px;
  --container: min(1180px, calc(100% - 32px));
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(247, 198, 0, 0.12), transparent 30%),
    radial-gradient(circle at 15% 18%, rgba(255, 255, 255, 0.03), transparent 26%),
    linear-gradient(180deg, #020202 0%, #000000 100%);
  background-color: #000000;
  overflow-x: hidden;
}

body.light-theme {
  color-scheme: light;
  --bg: #f4f1e8;
  --bg-soft: #ffffff;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --text: #171717;
  --muted: rgba(23, 23, 23, 0.72);
  --yellow: #f2b400;
  --yellow-soft: rgba(242, 180, 0, 0.18);
  --line: rgba(23, 23, 23, 0.12);
  --shadow: 0 26px 60px rgba(30, 24, 8, 0.14);
  background:
    radial-gradient(circle at top, rgba(242, 180, 0, 0.18), transparent 28%),
    radial-gradient(circle at 15% 18%, rgba(255, 255, 255, 0.7), transparent 22%),
    linear-gradient(180deg, #faf7ef 0%, #efe8d8 100%);
  background-color: #f4f1e8;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: #000000;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}

body.light-theme::before {
  background: #f4f1e8;
}

body.has-page-loader::before {
  opacity: 1;
}

body.has-page-loader.is-loaded::before {
  opacity: 0;
}

body.menu-open,
body.lightbox-open {
  overflow: hidden;
}

body.lightbox-open .scroll-top {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(14px) scale(0.96) !important;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

button,
input,
textarea,
select {
  font: inherit;
}

.container {
  width: var(--container);
  margin: 0 auto;
}

.menu-toggle,
.theme-toggle {
  position: fixed;
  top: calc(16px + var(--safe-top));
  left: auto;
  bottom: auto;
  z-index: 220;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.menu-toggle {
  right: calc(16px + var(--safe-right));
  width: 60px;
  min-width: 60px;
  height: 60px;
  min-height: 60px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border-radius: 22px;
}

/* Баг-фикс: скрывать menu-toggle при открытом меню */
body.menu-open .menu-toggle {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}

.theme-toggle {
  right: calc(88px + var(--safe-right));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  max-width: calc(100vw - 104px - var(--safe-left) - var(--safe-right));
  min-height: 60px;
  padding: 0 12px;
  border-radius: 22px;
  white-space: nowrap;
  overflow: hidden;
}

body.menu-open .theme-toggle {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}

.theme-toggle__icon {
  font-size: 1.05rem;
  line-height: 1;
}

.theme-toggle__label {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-toggle__lines {
  display: inline-grid;
  gap: 6px;
}

.menu-toggle__lines span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.liquid-button,
.chip-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 16px 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 8px 24px rgba(0, 0, 0, 0.32);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
  isolation: isolate;
}

@supports (backdrop-filter: blur(1px)) {
  .liquid-button,
  .chip-link {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(4px) saturate(130%);
    -webkit-backdrop-filter: blur(4px) saturate(130%);
  }
}

.liquid-button::before,
.chip-link::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: transparent;
  opacity: 0;
  pointer-events: none;
}

.liquid-button::after,
.chip-link::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  display: none;
}

.liquid-button > *,
.chip-link > * {
  position: relative;
  z-index: 1;
}

.liquid-button:hover,
.liquid-button:focus-visible,
.chip-link:hover,
.chip-link:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 14px 36px rgba(0, 0, 0, 0.38),
    0 0 22px rgba(247, 198, 0, 0.18);
}

.liquid-button--primary {
  color: #111111;
  background:
    radial-gradient(130% 160% at 10% -35%, rgba(255, 255, 255, 0.5), transparent 56%),
    linear-gradient(150deg, rgba(255, 247, 200, 0.92), rgba(247, 198, 0, 0.80));
  background-color: rgba(247, 198, 0, 0.65);
  border-color: rgba(255, 236, 100, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(200, 160, 0, 0.4),
    0 14px 34px rgba(0, 0, 0, 0.28),
    0 0 28px rgba(247, 198, 0, 0.32);
  font-weight: 800;
}

.liquid-button--primary:hover,
.liquid-button--primary:focus-visible {
  background:
    radial-gradient(130% 160% at 10% -35%, rgba(255, 255, 255, 0.6), transparent 56%),
    linear-gradient(150deg, rgba(255, 250, 220, 0.98), rgba(247, 198, 0, 0.92));
  border-color: rgba(255, 240, 80, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(200, 160, 0, 0.5),
    0 16px 40px rgba(0, 0, 0, 0.32),
    0 0 40px rgba(247, 198, 0, 0.48);
}

body.light-theme .liquid-button,
body.light-theme .chip-link,
body.light-theme .scroll-top {
  border-color: rgba(23, 23, 23, 0.14);
  background: rgba(23, 23, 23, 0.05);
  color: #2a2a2a;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 6px 16px rgba(0, 0, 0, 0.07);
}

body.light-theme .liquid-button:hover,
body.light-theme .liquid-button:focus-visible,
body.light-theme .chip-link:hover,
body.light-theme .chip-link:focus-visible {
  border-color: rgba(23, 23, 23, 0.22);
  background: rgba(23, 23, 23, 0.08);
  color: #111111;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 10px 24px rgba(0, 0, 0, 0.1),
    0 0 14px rgba(247, 198, 0, 0.12);
}

body.light-theme .liquid-button--primary {
  color: #2a1800;
  background:
    radial-gradient(130% 160% at 10% -35%, rgba(255, 255, 255, 0.6), transparent 56%),
    linear-gradient(150deg, rgba(255, 248, 200, 0.98), rgba(242, 180, 0, 0.85));
  border-color: rgba(200, 155, 0, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 12px 28px rgba(100, 70, 0, 0.18),
    0 0 22px rgba(200, 155, 0, 0.28);
}

body.light-theme .liquid-button::before,
body.light-theme .chip-link::before {
  background: transparent;
}

.menu-toggle.liquid-button {
  position: fixed;
  top: calc(16px + var(--safe-top));
  right: calc(16px + var(--safe-right));
  left: auto;
  bottom: auto;
  z-index: 220;
  display: grid;
  place-items: center;
  width: 60px;
  min-width: 60px;
  height: 60px;
  min-height: 60px;
  margin: 0;
  padding: 0;
  border-radius: 22px;
}

.theme-toggle.liquid-button {
  position: fixed;
  top: calc(16px + var(--safe-top));
  right: calc(88px + var(--safe-right));
  left: auto;
  bottom: auto;
  z-index: 219;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  max-width: calc(100vw - 104px - var(--safe-left) - var(--safe-right));
  min-width: 0;
  min-height: 60px;
  padding: 0 12px;
  border-radius: 22px;
  white-space: nowrap;
  overflow: hidden;
}

.side-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 133;
}

@supports (backdrop-filter: blur(1px)) {
  .side-menu-backdrop {
    background: rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
}

.side-menu-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.side-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 92vw);
  height: 100vh;
  padding: calc(18px + var(--safe-top)) calc(18px + var(--safe-right)) calc(18px + var(--safe-bottom)) calc(18px + var(--safe-left));
  background:
    radial-gradient(circle at top right, rgba(247, 198, 0, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(14, 12, 2, 0.97), rgba(5, 4, 0, 0.98));
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.55);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 134;
  overflow: auto;
  isolation: isolate;
}

@supports (backdrop-filter: blur(1px)) {
  .side-menu {
    background:
      radial-gradient(circle at top right, rgba(247, 198, 0, 0.16), transparent 30%),
      linear-gradient(180deg, rgba(14, 12, 2, 0.78), rgba(5, 4, 0, 0.86));
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
  }
}

.side-menu.is-open {
  transform: translateX(0);
}

body.light-theme .side-menu {
  border-left-color: rgba(23, 23, 23, 0.12);
  background:
    radial-gradient(circle at top right, rgba(242, 180, 0, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(252, 248, 235, 0.97), rgba(244, 241, 232, 0.98));
  box-shadow: -24px 0 60px rgba(46, 36, 12, 0.16);
}

@supports (backdrop-filter: blur(1px)) {
  body.light-theme .side-menu {
    background:
      radial-gradient(circle at top right, rgba(242, 180, 0, 0.14), transparent 30%),
      linear-gradient(180deg, rgba(255, 252, 240, 0.82), rgba(244, 241, 232, 0.88));
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
  }
}

body.menu-open .scroll-top {
  opacity: 0 !important;
  pointer-events: none !important;
}

.side-menu__top {
  position: absolute;
  top: calc(16px + var(--safe-top));
  right: calc(16px + var(--safe-right));
  left: calc(16px + var(--safe-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.side-menu__title {
  margin: 0;
  font-size: 1.05rem;
  color: var(--yellow);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-menu__close {
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  cursor: pointer;
}

body.light-theme .side-menu__close {
  border-color: rgba(23, 23, 23, 0.14);
  background: rgba(23, 23, 23, 0.05);
  color: #171717;
}

.side-menu__inner {
  display: grid;
  gap: 18px;
  padding-top: 60px;
}

.side-menu__lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.side-menu__nav {
  display: grid;
  gap: 12px;
}

.side-menu__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  font-weight: 600;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.side-menu__link::after {
  content: "›";
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--yellow);
  font-size: 1.2rem;
  line-height: 1;
}

body.light-theme .side-menu__link {
  border-color: rgba(23, 23, 23, 0.08);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 224, 0.88)),
    rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 14px 26px rgba(46, 36, 12, 0.1);
  color: #171717;
}

.side-menu__link:hover,
.side-menu__link:focus-visible {
  transform: translateX(-2px);
}

.side-menu__cta {
  width: 100%;
}

.detail-main {
  padding: calc(104px + var(--safe-top)) 0 calc(34px + var(--safe-bottom));
}

.detail-hero {
  position: relative;
  padding: 28px 0 20px;
}

.detail-hero::before,
.detail-hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(36px);
  opacity: 0.5;
  pointer-events: none;
}

.detail-hero::before {
  top: -10px;
  right: 5%;
  width: 260px;
  height: 260px;
  background: rgba(247, 198, 0, 0.18);
}

.detail-hero::after {
  left: -60px;
  bottom: 0;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.08);
}

body.light-theme .detail-hero::after {
  background: rgba(255, 255, 255, 0.34);
}

.detail-hero__shell,
.content-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
    var(--panel);
  box-shadow: var(--shadow);
}

@supports (backdrop-filter: blur(1px)) {
  .detail-hero__shell,
  .content-panel {
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
  }
}

/* Визуальный акцент: жёлтая полоса слева у главного блока */
.detail-hero__shell::before {
  content: "";
  position: absolute;
  top: 24px;
  left: 0;
  width: 3px;
  height: calc(100% - 48px);
  background: linear-gradient(180deg, transparent, rgba(247, 198, 0, 0.7), transparent);
  border-radius: 0 2px 2px 0;
  pointer-events: none;
}

.detail-hero__shell {
  padding: 32px;
  overflow: hidden;
}

.detail-hero__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Бейдж всегда посередине при 3 элементах */
.detail-hero__nav .detail-badge {
  order: 2;
  margin: 0 auto;
}

.detail-hero__nav .chip-link {
  min-height: 44px;
  padding: 10px 18px;
  font-size: 0.88rem;
}

.detail-hero__nav .chip-link:first-child {
  order: 1;
}

.detail-hero__nav .chip-link:last-child {
  order: 3;
}

.detail-badge,
.section__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(247, 198, 0, 0.24);
  background: var(--yellow-soft);
  color: var(--yellow);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: badge-pulse 3s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(247, 198, 0, 0); }
  50% { box-shadow: 0 0 0 4px rgba(247, 198, 0, 0.12); }
}

.detail-title {
  margin: 22px 0 14px;
  max-width: 780px;
  font-size: clamp(2.2rem, 6vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.detail-lead {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.76;
}

.detail-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.detail-fact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  cursor: default;
}

.detail-fact:hover {
  border-color: rgba(247, 198, 0, 0.24);
  background: rgba(247, 198, 0, 0.06);
  transform: translateY(-1px);
}

.section {
  padding: 22px 0;
}

.section__header {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.section__title {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.section__hint {
  margin: 0;
  max-width: 620px;
  color: var(--muted);
  line-height: 1.7;
}

.content-panel {
  padding: 24px;
}

.copy-stack {
  display: grid;
  gap: 16px;
}

.copy-stack p {
  margin: 0;
  color: var(--muted);
  line-height: 1.82;
}

.info-grid {
  display: grid;
  gap: 16px;
}

.info-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.info-card:hover {
  border-color: rgba(247, 198, 0, 0.22);
  background: rgba(247, 198, 0, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), 0 0 16px rgba(247, 198, 0, 0.08);
}

body.light-theme .info-card:hover {
  border-color: rgba(242, 180, 0, 0.3);
  background: rgba(242, 180, 0, 0.06);
  box-shadow: 0 8px 20px rgba(46, 36, 12, 0.1);
}

.info-card strong {
  display: block;
  margin-bottom: 10px;
  color: var(--yellow);
  font-size: 1rem;
}

.info-card p,
.info-card li {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.info-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.gallery-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
  transition: border-color 0.28s ease, box-shadow 0.28s ease, transform 0.28s ease;
}

.gallery-card:hover,
.gallery-card:focus-within {
  border-color: rgba(247, 198, 0, 0.28);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 28px rgba(247, 198, 0, 0.14);
  transform: translateY(-2px);
}

body.light-theme .gallery-card:hover,
body.light-theme .gallery-card:focus-within {
  border-color: rgba(242, 180, 0, 0.3);
  box-shadow: 0 12px 36px rgba(46, 36, 12, 0.14), 0 0 20px rgba(242, 180, 0, 0.12);
}

.gallery-card img {
  aspect-ratio: 16 / 11;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform 0.32s ease, filter 0.32s ease;
}

.gallery-card:hover img,
.gallery-card:focus-within img {
  transform: scale(1.04);
  filter: saturate(1.08) brightness(1.03);
}

.gallery-card img:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: -2px;
}

.gallery-card figcaption {
  padding: 14px 16px 16px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding:
    calc(18px + var(--safe-top))
    calc(18px + var(--safe-right))
    calc(18px + var(--safe-bottom))
    calc(18px + var(--safe-left));
  background: rgba(0, 0, 0, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

@supports (backdrop-filter: blur(1px)) {
  .gallery-lightbox {
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
  }
}

.gallery-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

body.light-theme .gallery-lightbox {
  background: rgba(244, 241, 232, 0.84);
}

.gallery-lightbox__dialog {
  width: min(1120px, 100%);
  display: grid;
  gap: 14px;
}

.gallery-lightbox__toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.gallery-lightbox__action,
.gallery-lightbox__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.05)),
    rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

body.light-theme .gallery-lightbox__action,
body.light-theme .gallery-lightbox__close {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.74)),
    rgba(255, 255, 255, 0.78);
}

.gallery-lightbox__action:hover,
.gallery-lightbox__action:focus-visible,
.gallery-lightbox__close:hover,
.gallery-lightbox__close:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(247, 198, 0, 0.32);
}

.gallery-lightbox__action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.gallery-lightbox__zoom-level {
  min-width: 74px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  text-align: center;
  font-weight: 600;
}

.gallery-lightbox__viewport {
  width: min(1120px, 100%);
  max-height: calc(100vh - 190px - var(--safe-top) - var(--safe-bottom));
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(0, 0, 0, 0.18);
  box-shadow: var(--shadow);
}

.gallery-lightbox__stage {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-width: 100%;
  min-height: 100%;
  padding: 18px;
}

.gallery-lightbox__image {
  display: block;
  max-width: none;
  width: auto;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
}

.gallery-lightbox__caption {
  margin: 0;
  padding: 0 8px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.section__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.footer {
  padding: 0 0 36px;
  color: rgba(255, 255, 255, 0.48);
  text-align: center;
  font-size: 0.92rem;
}

body.light-theme .footer {
  color: rgba(23, 23, 23, 0.8);
}

/* ====== Reveal animation for sections ====== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1), transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Кастомный скроллбар */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(247, 198, 0, 0.28);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(247, 198, 0, 0.48);
}

.scroll-top {
  position: fixed;
  right: calc(14px + var(--safe-right));
  bottom: calc(8px + var(--safe-bottom));
  z-index: 168;
  display: grid;
  place-items: center;
  width: 58px;
  min-height: 58px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: rgba(18, 16, 2, 0.92);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 12px 30px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(0.96);
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  isolation: isolate;
}

@supports (backdrop-filter: blur(1px)) {
  .scroll-top {
    background: rgba(14, 12, 2, 0.6);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
  }
}

body.light-theme .scroll-top {
  border-color: rgba(23, 23, 23, 0.14);
  background: rgba(250, 246, 230, 0.95);
  color: #1c1c1e;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 10px 24px rgba(0, 0, 0, 0.1);
}

@supports (backdrop-filter: blur(1px)) {
  body.light-theme .scroll-top {
    background: rgba(255, 251, 235, 0.72);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
  }
}

.scroll-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.scroll-top.is-visible:hover,
.scroll-top.is-visible:focus-visible {
  transform: translateY(-2px) scale(1);
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

body.light-theme .scroll-top.is-visible:hover,
body.light-theme .scroll-top.is-visible:focus-visible {
  border-color: rgba(23, 23, 23, 0.24);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.scroll-top__icon {
  font-size: 1.18rem;
  line-height: 1;
}

@media (min-width: 900px) {
  .info-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .info-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .detail-main {
    padding-top: calc(96px + var(--safe-top));
  }

  .detail-hero__shell,
  .content-panel {
    padding: 22px;
  }

  .detail-hero__nav {
    align-items: flex-start;
  }

  .gallery-lightbox__viewport {
    max-height: calc(100vh - 220px - var(--safe-top) - var(--safe-bottom));
  }
}

@media (max-width: 599px) {
  .menu-toggle,
  .menu-toggle.liquid-button {
    top: calc(12px + var(--safe-top));
    right: calc(12px + var(--safe-right));
    width: 54px;
    min-width: 54px;
    height: 54px;
    min-height: 54px;
    border-radius: 18px;
  }

  .theme-toggle,
  .theme-toggle.liquid-button {
    top: calc(12px + var(--safe-top));
    right: calc(74px + var(--safe-right));
    left: auto;
    width: auto;
    max-width: calc(100vw - 82px - var(--safe-left) - var(--safe-right));
    min-width: 0;
    min-height: 54px;
    padding: 0 10px;
    border-radius: 18px;
  }

  .theme-toggle__label {
    font-size: 0.88rem;
  }

  .menu-toggle__lines span {
    width: 20px;
  }

  .gallery-lightbox {
    padding:
      calc(12px + var(--safe-top))
      calc(12px + var(--safe-right))
      calc(12px + var(--safe-bottom))
      calc(12px + var(--safe-left));
  }

  .gallery-lightbox__toolbar {
    gap: 8px;
  }

  .gallery-lightbox__action,
  .gallery-lightbox__close {
    min-width: 46px;
    min-height: 46px;
    border-radius: 16px;
  }

  .gallery-lightbox__zoom-level {
    min-width: 66px;
    padding: 9px 10px;
    font-size: 0.92rem;
  }

  .gallery-lightbox__stage {
    padding: 12px;
  }
}

@media (max-width: 520px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .theme-toggle,
  .theme-toggle.liquid-button {
    width: 56px;
    min-width: 56px;
    max-width: 56px;
    padding: 0;
  }

  .theme-toggle__label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
