:root {
  /* Фирменные цвета */
  --orange: rgb(231, 91, 18);      /* #E75B12 */
  --orange-soft: rgba(231, 91, 18, 0.1);
  --blue: rgb(55, 107, 140);       /* #376B8C */
  --blue-soft: rgba(55, 107, 140, 0.1);
  --navy: #142b3b;

  --bg: #f5f7f9;
  --surface: #ffffff;
  --text: #1b2630;
  --muted: #5d6b77;
  --line: #dfe5ea;

  --radius: 18px;
  --shadow: 0 1px 2px rgba(20, 43, 59, 0.06), 0 8px 24px rgba(20, 43, 59, 0.06);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Unbounded', var(--font);
  --header-h: 76px;

  /* ===== Настройки для экспериментов ===== */
  --page-bg: var(--orange);  /* фон страницы за карточками */
  --catalog-gap: 14px;       /* расстояние между карточками в каталоге-оглавлении */
  --exhibit-gap: 32px;       /* расстояние между большими карточками экспонатов */
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 6px; }

.container { width: min(1200px, 100% - 32px); margin-inline: auto; }

/* ---------- Шапка ---------- */
.header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header__inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand__logo { width: 56px; height: 56px; flex: none; transform: scale(1.35); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--blue); }
.brand__tagline { font-size: 13px; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 8px; }
.nav a { text-decoration: none; font-weight: 600; padding: 8px 14px; border-radius: 999px; }
.nav a:hover { background: var(--blue-soft); }
.nav .nav__cta { background: var(--orange); color: #fff; }
.nav .nav__cta:hover { background: #cf4f0c; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(1200px 600px at 85% 20%, #2a5a78 0%, transparent 60%), linear-gradient(135deg, var(--navy) 0%, #1d4058 100%);
  color: #fff;
  padding: 88px 0 96px;
}
.hero__inner { position: relative; z-index: 1; }
.hero__eyebrow { margin: 0 0 16px; font-weight: 600; color: #f6a77c; letter-spacing: 0.04em; text-transform: uppercase; font-size: 13px; }
.hero__title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 5vw, 56px); line-height: 1.12; max-width: 14em; }
.hero__title span { color: var(--orange); }
.hero__lead { max-width: 36em; margin: 24px 0 0; font-size: 18px; color: #cfdbe4; }
.hero__stats { display: flex; flex-wrap: wrap; gap: 40px; margin: 40px 0 36px; }
.hero__stats div { display: flex; align-items: center; gap: 12px; }
.hero__stats b { font-family: var(--font-display); font-size: 40px; color: var(--orange); line-height: 1; }
.hero__stats span { font-size: 14px; color: #cfdbe4; line-height: 1.3; }
.hero__orbits { position: absolute; right: -120px; top: 50%; width: 640px; transform: translateY(-50%); pointer-events: none; }
.hero__orbits .ring { fill: none; stroke: #f0a26e; stroke-width: 3.5; opacity: 0.55; }
.hero__orbits .dot { fill: var(--orange); }
.hero__orbits .orbit { transform-box: view-box; transform-origin: 300px 300px; }
.hero__orbits .orbit--outer { animation: spin 60s linear infinite; }
.hero__orbits .orbit--middle { animation: spin 45s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hero__orbits .orbit { animation: none !important; } html { scroll-behavior: auto; } }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--orange); color: #fff; text-decoration: none; font-weight: 700;
  padding: 14px 26px; border-radius: 999px; border: 0;
  transition: background 0.2s, transform 0.2s;
}
.btn:hover { background: #cf4f0c; transform: translateY(-1px); }

/* ---------- Каталог (оглавление) ---------- */
.catalog-index { padding: 72px 0 24px; }
.section-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 3vw, 34px); margin: 0 0 28px; color: #fff; }
.index-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--catalog-gap); }
.index-card {
  display: flex; flex-direction: column; height: 100%;
  background: var(--surface); border-radius: 14px; overflow: hidden; text-decoration: none;
  box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s;
}
.index-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(20, 43, 59, 0.14); }
.index-card__img { aspect-ratio: 4 / 3; background: #eef2f5; overflow: hidden; }
.index-card__img img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.index-card__img img.is-drawing { object-fit: contain; padding: 8px; }
.index-card__body { padding: 10px 12px 12px; display: flex; gap: 8px; align-items: baseline; }
.index-card__num { font-family: var(--font-display); font-size: 12px; color: var(--orange); }
.index-card__title { font-weight: 700; font-size: 14px; line-height: 1.3; }

/* ---------- Экспонат ---------- */
#exhibits { display: grid; gap: var(--exhibit-gap); padding: 48px 0; }
.exhibit__card {
  background: var(--surface); border-radius: calc(var(--radius) + 6px); box-shadow: var(--shadow);
  padding: 32px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px;
}
.exhibit:nth-child(even) .exhibit__gallery { order: 2; }

.exhibit__head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.exhibit__num { font-family: var(--font-display); font-weight: 700; font-size: 44px; line-height: 1; color: var(--orange); }
.exhibit__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.2; margin: 0; color: var(--navy); }
.exhibit__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tag { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); }
.tag--article { background: var(--orange-soft); color: #b8460b; }

/* Галерея */
.gallery__main {
  position: relative; width: 100%;
  aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; background: #eef2f5;
}
.gallery__open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.gallery__main img, .gallery__main video { width: 100%; height: 100%; object-fit: cover; }
.gallery__main video { background: #000; object-fit: contain; }
.gallery__main img.is-drawing { object-fit: contain; padding: 16px; background: #fff; }
.gallery__zoom {
  position: absolute; right: 12px; bottom: 12px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,255,255,0.9); color: var(--navy); font-size: 18px;
  box-shadow: var(--shadow); pointer-events: none;
}
.gallery__badge {
  position: absolute; left: 12px; top: 12px; font-size: 12px; font-weight: 700;
  background: var(--navy); color: #fff; padding: 4px 10px; border-radius: 999px;
}
.gallery__thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.thumb {
  position: relative; width: 72px; height: 72px; padding: 0; border-radius: 12px; overflow: hidden;
  border: 2px solid transparent; background: #eef2f5;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.is-active { border-color: var(--orange); }
.thumb--video::after {
  content: '▶'; position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; background: rgba(20, 43, 59, 0.45); font-size: 20px;
}

/* Описание */
.exhibit__desc p { margin: 0 0 12px; color: #33414d; }
.exhibit__desc.is-collapsed p:last-of-type::after { content: '…'; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none;
  color: var(--blue); font-weight: 700; border-bottom: 2px solid currentColor;
}
.link-btn:hover { color: var(--orange); }
.link-btn__arrow { transition: transform 0.2s; }
.link-btn[aria-expanded="true"] .link-btn__arrow { transform: rotate(180deg); }

/* Габариты */
.dims { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.dims__title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 14px; }
.dims__values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dim { background: var(--bg); border-radius: 14px; padding: 12px 14px; }
.dim__label { font-size: 12px; color: var(--muted); }
.dim__value { font-family: var(--font-display); font-weight: 500; font-size: 20px; color: var(--navy); white-space: nowrap; }
.dim__value small { font-family: var(--font); font-size: 12px; color: var(--muted); margin-left: 2px; }
.dims__zone { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.dims__zone b { color: var(--text); }
.dims__drawings { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
.drawing {
  display: flex; flex-direction: column; padding: 0; border: 1px solid var(--line); border-radius: 14px;
  background: #fff; overflow: hidden; text-align: left; transition: border-color 0.2s;
}
.drawing:hover { border-color: var(--blue); }
.drawing img { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; padding: 10px; }
.drawing span { font-size: 13px; font-weight: 600; padding: 8px 12px; border-top: 1px solid var(--line); color: var(--muted); }

/* ---------- Подвал ---------- */
.footer { background: var(--navy); color: #cfdbe4; padding: 40px 0; margin-top: 48px; }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.footer .brand__name { color: #fff; }
.footer .brand__tagline { color: #9fb2c0; }
.footer__contacts { display: flex; flex-direction: column; gap: 4px; }
.footer__contacts a { text-decoration: none; font-weight: 600; color: #fff; }
.footer__contacts a:hover { color: var(--orange); }
.footer__copy { margin: 0; font-size: 14px; width: 100%; color: #8ea3b2; }

/* ---------- Лайтбокс ---------- */
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 24px;
  border: 0; background: rgba(10, 22, 31, 0.94); color: #fff; overflow: hidden;
}
.lightbox[open] { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; grid-template-rows: minmax(0, 1fr); align-items: center; gap: 12px; }
.lightbox::backdrop { background: transparent; }
.lightbox__figure { margin: 0; height: 100%; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
/* Область просмотра: картинка вписывается в неё целиком, а при зуме обрезается её краями */
.lightbox__media { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; user-select: none; }
.lightbox__media img, .lightbox__media video {
  position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%;
  border-radius: 8px; transform-origin: 0 0; will-change: transform;
}
.lightbox__media img { cursor: zoom-in; -webkit-user-drag: none; }
.lightbox__media.is-zoomed img { cursor: grab; }
.lightbox__media.is-dragging img { cursor: grabbing; }
.lightbox__media.is-animated img { transition: transform 0.2s ease; }
.lightbox__media img.is-drawing { background: #fff; padding: 16px; }
.lightbox__tools { display: flex; align-items: center; justify-content: center; gap: 6px; }
.lightbox__tools[hidden] { display: none; }
.lightbox__tools button {
  min-width: 40px; height: 40px; padding: 0 12px; border: 0; border-radius: 999px;
  background: rgba(255,255,255,0.1); color: #fff; font-size: 20px; line-height: 1;
}
.lightbox__tools .lightbox__fit { font-size: 14px; font-weight: 600; }
.lightbox__tools button:hover { background: var(--orange); }
.lightbox__tools button:disabled { opacity: 0.35; background: rgba(255,255,255,0.1); cursor: default; }
.lightbox__zoom { min-width: 56px; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; color: #cfdbe4; }
.lightbox__figure figcaption { font-size: 14px; color: #cfdbe4; text-align: center; }
.lightbox__nav, .lightbox__close {
  border: 0; background: rgba(255,255,255,0.1); color: #fff; border-radius: 50%;
  width: 52px; height: 52px; font-size: 30px; line-height: 1;
}
.lightbox__nav:hover, .lightbox__close:hover { background: var(--orange); }
.lightbox__close { position: absolute; top: 16px; right: 16px; z-index: 1; }

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .exhibit__card { grid-template-columns: 1fr; padding: 20px; gap: 24px; }
  .exhibit:nth-child(even) .exhibit__gallery { order: 0; }
  .gallery__main { aspect-ratio: 4 / 3; }
  .gallery__main img { object-position: center 35%; }
  .hero__orbits { opacity: 0.5; right: -260px; }
}
@media (max-width: 600px) {
  :root { --header-h: 64px; --exhibit-gap: 24px; }
  .brand__logo { width: 44px; height: 44px; }
  .brand__name { font-size: 18px; }
  .brand__tagline { display: none; }
  .nav a:not(.nav__cta) { display: none; }
  .hero { padding: 56px 0 64px; }
  .hero__lead { font-size: 16px; }
  .exhibit__num { font-size: 32px; }
  .dims__values { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .dim { padding: 10px; }
  .dim__value { font-size: 16px; }
  .dims__drawings { grid-template-columns: 1fr; }
  .lightbox { padding: 8px; }
  .lightbox[open] { grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 4px; }
  .lightbox__nav { width: 40px; height: 40px; font-size: 24px; }
}
