/* ===== ОСНОВНЫЕ ПЕРЕМЕННЫЕ И СТИЛИ ===== */

/* Подключаем шрифты */
@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@400;500;700&family=Golos+Text:wght@400;500;700&family=Lora:ital,wght@0,400;0,700;1,400&family=JetBrains+Mono:wght@300;400;500&display=swap');

:root {
  /* ЦВЕТОВАЯ СХЕМА - Теплый нео-архив */
  --c-accent-teal: #1E9CB0; 
  --c-bg: #F9F7F2;          /* Цвет старой плотной бумаги / Слоновая кость */
  --c-text: #2A2A2A;        /* Глубокий антрацит */
  --c-logo-maroon: #781e07;  /* Цвет советского знамени в тени / Окисленная медь */
  --c-amber: #D4A373;       /* Янтарный / Цвет лакированного дерева */
  --c-sage: #6B705C;        /* Технический зеленый / Цвет старой формы */
  --c-border: rgba(42, 42, 42, 0.15); /* Тонкие линии сеток */
  --c-card-bg: #F0EDE4;     /* Фон карточек - чуть темнее основного */
  --c-shadow: rgba(42, 42, 42, 0.08); /* Тени */
  
  /* ШРИФТЫ */
  --font-heading: 'Unbounded', sans-serif;   /* Заголовки */
  --font-subhead: 'Golos Text', sans-serif;  /* Подзаголовки */
  --font-body: 'Lora', serif;               /* Основной текст */
  --font-mono: 'JetBrains Mono', monospace;  /* Техническая информация */
  
  /* ТЕКСТУРЫ */
  --texture-paper: url("data:image/svg+xml,%3Csvg width='200' height='200' viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  --texture-sepia: linear-gradient(rgba(212, 163, 115, 0.03), rgba(212, 163, 115, 0.03));
}

/* Базовые стили */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  line-height: 1.6;
  background-image: var(--texture-paper), var(--texture-sepia);
  background-attachment: fixed;
  position: relative;
  min-height: 100vh;
}

/* Плавные переходы включены только когда у body есть класс .page-fade */
body.page-fade {
  opacity: 0;
  transition: opacity 0.4s ease;
}

body.page-fade.page-loaded {
  opacity: 1;
}

body.page-fade.page-fade-out {
  opacity: 0;
}

/* Типографика */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--c-text);
  margin-bottom: 1.5rem;
}

h1 {
  font-size: 3.5rem;
  line-height: 1.1;
}

h2 {
  font-size: 2.5rem;
  position: relative;
  padding-bottom: 1rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--c-accent-red);
}

h3 {
  font-size: 1.75rem;
  color: var(--c-sage);
}

p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  line-height: 1.8;
}

a {
  color: var(--c-accent-red);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--c-amber);
  text-decoration: underline;
}

/* Утилиты */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.page-section {
  padding: 5rem 0;
  position: relative;
}

.section-divider {
  height: 1px;
  background: linear-gradient(to right, 
    transparent 0%, 
    var(--c-border) 20%, 
    var(--c-border) 80%, 
    transparent 100%);
  margin: 2rem 0;
}

.double-divider {
  height: 2px;
  background: 
    linear-gradient(to right, transparent 0%, var(--c-border) 50%, transparent 100%),
    linear-gradient(to right, transparent 0%, var(--c-border) 50%, transparent 100%);
  background-position: 0 0, 0 4px;
  background-repeat: no-repeat;
  background-size: 100% 1px;
  margin: 3rem 0;
}

/* ===== КОМПОНЕНТЫ ===== */

/* Кнопки */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  background: var(--c-text);
  color: var(--c-bg);
  border: none;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  border: 2px solid var(--c-text);
  position: relative;
  overflow: hidden;
}

.btn:hover {
  background: var(--c-bg);
  color: var(--c-text);
  text-decoration: none;
}

.btn-secondary {
  background: transparent;
  color: var(--c-text);
  border-color: var(--c-border);
}

.btn-secondary:hover {
  background: var(--c-text);
  color: var(--c-bg);
  border-color: var(--c-text);
}

/* Карточки */
.card {
  background: var(--c-card-bg);
  border: 1px solid var(--c-border);
  padding: 2rem;
  transition: all 0.3s ease;
  position: relative;
}

.card:hover {
  box-shadow: 0 5px 20px var(--c-shadow);
  transform: translateY(-3px);
}

/* Инвентарная карточка */
.inventory-card {
  background: var(--c-card-bg);
  border: 1px solid var(--c-border);
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  position: relative;
}

.inventory-card::before {
  content: 'ИНВ.';
  position: absolute;
  top: -10px;
  left: 1rem;
  background: var(--c-card-bg);
  padding: 0 0.5rem;
  font-size: 0.8rem;
  color: var(--c-sage);
}

/* Старая фотография */
.old-photo {
  filter: contrast(1.1) saturate(0.7) sepia(0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.old-photo::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 95%, rgba(212, 163, 115, 0.1) 100%);
  pointer-events: none;
}

/* ===== ШАПКА ===== */
.main-header {
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background-color: rgba(249, 247, 242, 0.95);
}

.header-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 3rem;
  padding: 1.5rem 0;
}

/* Логотип */
.logo-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.logo-image {
  width: 120px;
  aspect-ratio: 1 / 1;      /* Сохраняем квадрат */
  height: auto;
  object-fit: contain;      /* contain лучше для прозрачных PNG, чтобы не обрезать края */
  
  /* УБИРАЕМ РАМКУ И ОТСТУПЫ */
  border: none !important;
  padding: 0 !important;
  background: transparent !important;
  
  display: block;
  transition: transform 0.3s ease;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-main {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--c-text);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1;
}

.logo-sub {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--c-sage);
  letter-spacing: 0.05em;
}

/* Навигация */
.main-nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  font-family: var(--font-subhead);
  font-weight: 500;
  color: var(--c-text);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  padding: 0.5rem 0;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--c-accent-red);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ===== ГЛАВНАЯ СТРАНИЦА ===== */

/* Баннер */
.hero-banner {
  width: 100%;
  height: 450px;           /* Оптимальная высота для панорамы */
  position: relative;
  overflow: hidden;        /* Чтобы картинка не вылезала при увеличении */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Сама картинка с эффектом плавного приближения */
.banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;       /* Заполняет всё пространство от края до края */
  display: block;
  filter: grayscale(0.2) contrast(1.1);
  
  /* Анимация плавного увеличения на ~15px (scale 1.03) */
  animation: imageZoom 10s ease-out forwards;
}

@keyframes imageZoom {
  from { transform: scale(1); }
  to { transform: scale(1.05); } /* Легкое приближение */
}


.banner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(120, 30, 7, 0.4); /* Бордовая тонировка как у логотипа */
  mix-blend-mode: multiply;          /* Эффект глубокого наложения */
  z-index: 1;
}

/* Текст ровно по центру */
.hero-title {
  position: absolute;
  z-index: 2;
  text-align: center;
  width: 100%;
}

.hero-stamp {
  font-family: var(--font-heading);
  /* Размер меньше на 5px (был 4rem, стал calc(4rem - 5px)) */
  font-size: calc(4rem - 5px); 
  color: var(--c-bg);         /* Цвет слоновой кости */
  text-transform: uppercase;
  letter-spacing: 0.25em;     /* Растягиваем надпись для солидности */
  
  /* Полная очистка от старых стилей */
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 0;
  margin: 0;

  /* Тень для читаемости */
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);

  /* Анимация появления текста */
  animation: textFade 2.5s ease-out forwards;
}

@keyframes textFade {
  from { opacity: 0; transform: translateY(10px); filter: blur(3px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* Цитата с анимированной тарелкой */
.quote-section {
  position: relative;
  padding: 4rem 0;
  background: linear-gradient(90deg, transparent 30%, var(--c-card-bg) 30%);
}

.plate-container {
  position: absolute;
  left: 5%;
  top: 50%;
  transform: translateY(-30%);
  width: 350px;
  height: 350px;
  z-index: 1;
}

.plate-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(0.3) sepia(0.1) contrast(1.1);
  animation: float 8s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  33% {
    transform: translateY(-10px) rotate(2deg);
  }
  66% {
    transform: translateY(5px) rotate(-1deg);
  }
}

.quote-wrapper {
  position: relative;
  z-index: 2;
  max-width: 600px;
  margin-left: 30%;
}

.quote-text {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.8rem;
  color: var(--c-text);
  line-height: 1.4;
  position: relative;
  padding: 2rem 0;
}

.quote-text::before,
.quote-text::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 2px;
  background: var(--c-amber);
}

.quote-text::before {
  top: 0;
  left: 0;
}

.quote-text::after {
  bottom: 0;
  right: 0;
}

/* О музее */
.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-text {
  font-size: 1.1rem;
}

.stats-box {
  background: var(--c-card-bg);
  border: 1px solid var(--c-border);
  padding: 2rem;
  font-family: var(--font-mono);
}

.stats-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--c-accent-red);
  text-transform: uppercase;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

/* Плитки с изображениями */
.image-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.image-tile {
  height: 150px;
  border: 1px solid var(--c-border);
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}

.image-tile:nth-child(1) { background-color: var(--c-amber); }
.image-tile:nth-child(2) { background-color: var(--c-sage); }
.image-tile:nth-child(3) { background-color: var(--c-accent-red); }
.image-tile:nth-child(4) { background-color: var(--c-text); }
.image-tile:nth-child(5) { background-color: var(--c-amber); opacity: 0.8; }
.image-tile:nth-child(6) { background-color: var(--c-sage); opacity: 0.8; }

/* Поиск */
.search-box {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.search-form {
  display: flex;
  gap: 0;
}

.search-input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: 1px solid var(--c-border);
  border-right: none;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--c-bg);
  color: var(--c-text);
}

.search-input:focus {
  outline: none;
  border-color: var(--c-amber);
}

.search-btn {
  padding: 1rem 2rem;
  background: var(--c-text);
  color: var(--c-bg);
  border: 1px solid var(--c-text);
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-btn:hover {
  background: var(--c-amber);
  border-color: var(--c-amber);
}



/* Экспонаты */
.exhibits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.exhibit-card {
  background: var(--c-card-bg);
  border: 1px solid var(--c-border);
  position: relative;
  transition: all 0.3s ease;
}

.exhibit-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px var(--c-shadow);
}

.exhibit-image {
  height: 200px;
  background: linear-gradient(45deg, var(--c-border), transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  color: var(--c-sage);
  font-style: italic;
  position: relative;
  overflow: hidden;
}

.exhibit-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 70%, rgba(42, 42, 42, 0.1) 100%);
}

.exhibit-info {
  padding: 1.5rem;
}

.exhibit-title {
  font-family: var(--font-subhead);
  font-size: 1.2rem;
  color: var(--c-text);
  margin-bottom: 0.5rem;
}

.exhibit-meta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--c-sage);
  margin-bottom: 1rem;
}

.exhibit-number {
    background: var(--c-accent-teal); /* Бирюзовый вместо красного */
    color: white;
    font-family: var(--font-mono);
}

/* Проекты */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.project-card {
  background: var(--c-card-bg);
  border: 1px solid var(--c-border);
  padding: 2rem;
  position: relative;
  transition: all 0.3s ease;
}

.project-card:hover {
  border-color: var(--c-amber);
}

.project-number {
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--c-border);
  margin-bottom: 1rem;
  font-weight: 300;
}

/* Партнеры */
.partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.partner-logo {
  height: 120px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  transition: all 0.3s ease;
}

.partner-logo:hover {
  border-color: var(--c-accent-red);
  background: var(--c-card-bg);
}

/* Поддержка */
.support-section {
  background: linear-gradient(45deg, var(--c-card-bg), var(--c-bg));
  padding: 4rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.support-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--c-border), transparent);
}

.support-text {
  font-size: 1.3rem;
  max-width: 800px;
  margin: 0 auto 2rem;
  color: var(--c-text);
}

/* Магазин "Березка" */
.berezka-shop {
  background: var(--c-text);
  color: var(--c-bg);
  padding: 4rem 0;
  text-align: center;
}

.berezka-title {
  font-family: var(--font-heading);
  font-size: 3rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-bg);
  margin-bottom: 1rem;
}

/* Документы */
.documents-list {
  max-width: 800px;
  margin: 0 auto;
}

.doc-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--c-border);
}

.doc-item:last-child {
  border-bottom: none;
}

.doc-info {
  flex: 1;
}

.doc-title {
  font-family: var(--font-subhead);
  font-size: 1.1rem;
  color: var(--c-text);
  margin-bottom: 0.25rem;
}

.doc-meta {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--c-sage);
}

/* События */
.events-timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding-left: 1.5rem;
}

/* Вертикальная полоса слева */
.events-timeline::before {
  content: '';
  position: absolute;
  left: 0.25rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--c-border);
}

/* Один элемент таймлайна */
.event-item {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 3rem;
}
.event-item::before {
  content: '';
  position: absolute;
  left: -0.1rem;
  top: 0.75rem;
  width: 10px;
  height: 10px;
  background: var(--c-logo-maroon);
  border: 2px solid var(--c-bg);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--c-border);
}

/* Линия-ответвление вправо от точки к карточке */
.event-connector {
  position: absolute;
  left: 0.5rem;
  top: 0.95rem;
  width: 1.5rem;
  border-top: 1px solid var(--c-border);
}

/* Карточка события */
.event-card {
  background: var(--c-card-bg);
  border: 1px solid var(--c-border);
  box-shadow: 0 4px 16px var(--c-shadow);
  padding: 1.25rem 1.5rem;
}

/* Мета-информация (дата, место) */
.event-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.event-date {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--c-sage);
}

.event-place {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--c-sage);
}

/* Заголовок и описание */
.event-title {
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
  color: var(--c-text);
}

.event-description {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

/* Фото мероприятия */
.event-image img {
  width: 100%;
  aspect-ratio: 7 / 4;          /* Визуальное «окно» 7:4 */
  height: auto;
  object-fit: cover;            /* Заполняем окно, не меняя пропорцию */
  border: 1px solid var(--c-border);
  display: block;
}
/* Нижняя часть карточки (кнопки) */
.event-footer {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
/* История */
.history-preview {
  background: var(--c-card-bg);
  border: 1px solid var(--c-border);
  padding: 3rem;
  position: relative;
  margin-top: 2rem;
}

.history-preview::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border: 1px solid var(--c-border);
  pointer-events: none;
}

.history-quote {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.6rem;
  color: var(--c-text);
  text-align: center;
  margin-bottom: 2rem;
  line-height: 1.4;
}

/* ===== ПОДВАЛ ===== */
.main-footer {
  background: var(--c-card-bg);
  border-top: 1px solid var(--c-border);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text);
  margin-bottom: 1.5rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--c-sage);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--c-accent-red);
  text-decoration: none;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--c-border);
  text-align: center;
}

.copyright {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--c-sage);
}

.inventory-number {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--c-sage);
  margin-top: 0.5rem;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1024px) {
  .header-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }
  
  .main-nav ul {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .quote-wrapper {
    margin-left: 0;
    max-width: 100%;
  }
  
  .plate-container {
    position: relative;
    left: 0;
    top: 0;
    transform: none;
    width: 150px;
    height: 150px;
    margin: 0 auto 2rem;
  }
  
  .quote-section {
    background: var(--c-card-bg);
  }
  
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }
  
  h2 {
    font-size: 2rem;
  }
  
  .hero-stamp {
    font-size: 2.5rem;
    padding: 0.75rem 1.5rem;
  }
  
  .exhibits-grid,
  .projects-grid,
  .partners-grid {
    grid-template-columns: 1fr;
  }
  
  .image-tiles {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .search-form {
    flex-direction: column;
  }
  
  .search-input {
    border-right: 1px solid var(--c-border);
    border-bottom: none;
  }
}

/* ===== СТИЛИ ДЛЯ ТЕХНИЧЕСКИХ СТРАНИЦ И ФОРМ ===== */

/* Темный фон для "технических" страниц */
body.tech-page {
  background-color: #2A2A2A; /* --c-text */
  color: var(--c-bg);
  background-image: var(--texture-paper); /* Оставляем текстуру бумаги */
}

.tech-page h2 {
  color: var(--c-bg);
}

.tech-page h2::after {
  background: var(--c-amber);
}

/* Стилизация формы под "бюрократический формуляр" */
.form-container {
  max-width: 800px;
  margin: 2rem auto;
  background-color: var(--c-bg);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  padding: 3rem;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.form-group {
  margin-bottom: 2rem;
  border-bottom: 1px dotted var(--c-border);
  padding-bottom: 1.5rem;
}

.form-group:last-child {
  border-bottom: none;
}

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--c-sage);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control,
.form-select,
textarea.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1.1rem;
  background-color: #FDFBF6; /* Чуть светлее фона */
  border: 1px solid var(--c-border);
  color: var(--c-text);
  transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
  outline: none;
  border-color: var(--c-amber);
  background-color: #fff;
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* Чекбокс в стиле "галочка в квадратике" */
.form-check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-subhead);
}

.form-check-input {
  width: 20px;
  height: 20px;
  accent-color: var(--c-accent-red);
}

/* ===== СТИЛИ ДЛЯ ПРОСМОТРА ИЗОБРАЖЕНИЙ (ЛАЙТБОКС) ===== */

.image-viewer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(8px);
}

.image-viewer-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.image-viewer-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto; /* Для очень больших изображений */
}

.image-viewer-content img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
  cursor: zoom-in;
}

.image-viewer-content img.zoomed {
  transform: scale(2);
  cursor: zoom-out;
}

.image-viewer-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 3rem;
  color: white;
  text-decoration: none;
  font-family: sans-serif;
  line-height: 1;
  cursor: pointer;
}

/* Кнопка-иконка поверх фото */
.fullscreen-icon-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.8) url('/static/img/ico1.png') no-repeat center;
    background-size: 25px;
    border: 1px solid var(--c-text);
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}
.fullscreen-icon-btn:hover {
    background-color: #fff;
    transform: scale(1.1);
}
.old-photo { position: relative; } /* Нужно для позиционирования иконки */


/* Кнопка применения фильтров в каталоге */
.btn-filter-apply {
  padding: 0.8rem 2.4rem;      /* Чуть больше отступов по сторонам */
  font-size: 0.85rem;
  white-space: nowrap;         /* Не переносить текст */
  text-align: center;          /* Центрируем текст явно */
  display: inline-block;
}

/* ===== ПАРТНЕРЫ: ПОЛАРОИД-КАРТОЧКИ ===== */

.partner-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;

  background: var(--c-bg);
  border: 1px solid var(--c-border);
  padding: 1.2rem 1rem 1.4rem;
  text-decoration: none;
  color: var(--c-text);

  box-shadow: 0 6px 18px var(--c-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.partner-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px var(--c-shadow);
  border-color: var(--c-accent-red);
}

.partner-card-logo {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 1 / 1;             /* КВАДРАТ 1×1 */
  background: #f7f3ec;
  border: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.partner-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;              /* Логотип не режем, вписываем внутрь квадрата */
}

.partner-card-placeholder {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--c-sage);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.partner-card-name {
  margin-top: 0.9rem;
  font-family: var(--font-subhead);
  font-weight: 500;
  font-size: 0.95rem;
  text-align: center;
  line-height: 1.4;
}

/* ===== СТРАНИЦА ПРОЕКТОВ ===== */

.projects-intro {
  max-width: 800px;
  margin-top: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Тёмный блок с плавным затемнением */
.projects-dark-section {
  margin-top: 4rem;
  padding: 4rem 0 5rem;
  background: linear-gradient(to bottom,
    rgba(26, 26, 26, 0) 0%,
    #1a1a1a 35%,
    #1a1a1a 100%);
  color: var(--c-bg);
}

/* Подзаголовок в стиле "Annabelle" */
.projects-subtitle {
  font-family: 'Annabelle', 'Lora', serif;
  font-size: 2.4rem;
  text-align: center;
  margin-bottom: 3rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.projects-subtitle.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Лента проектов */
.project-timeline {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.project-timeline-item {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.project-timeline-item.right {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
}

.project-timeline-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.project-timeline-text h3 {
  margin-bottom: 0.5rem;
}

.project-timeline-text p {
  margin-bottom: 1rem;
}

.project-timeline-image {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.project-timeline-image img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--c-border);
}

/* Чередование лево/право на десктопе */
@media (min-width: 769px) {
  .project-timeline-item.right .project-timeline-text {
    order: 2;
  }
  .project-timeline-item.right .project-timeline-image {
    order: 1;
  }
}

/* На мобильных — обычная колонка */
@media (max-width: 768px) {
  .project-timeline-item,
  .project-timeline-item.right {
    grid-template-columns: 1fr;
    transform: translateX(0);
  }
}

/* ===== СТРАНИЦА ПРОЕКТОВ ===== */

.projects-page {
  padding-bottom: 0;
}

.projects-intro {
  max-width: 800px;
  margin-top: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Переход в чёрный: человек листает — экран плавно темнеет */
.projects-transition {
  height: 450px; /* ~400px до полного затемнения + небольшой запас */
  background: linear-gradient(to bottom,
    rgba(249, 247, 242, 1) 0%,
    rgba(249, 247, 242, 0.0) 30%,
    #1a1a1a 100%);
}

/* Тёмная зона с проектами */
.projects-dark {
  background-color: #1a1a1a;
  color: var(--c-bg);
  padding: 4rem 0 0; /* низ закрывает .projects-dark-tail */
}

/* Подзаголовок: "здесь пульс времени..." */
.projects-subtitle {
  font-family: 'Lora', serif;    /* мягкий рукописный/классический */
  font-style: italic;
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 3rem;
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.projects-subtitle.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Лента проектов */

.project-timeline {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.project-timeline-item {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2.25rem;
  align-items: center;
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.project-timeline-item.right {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  transform: translateX(60px);
}

.project-timeline-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.project-timeline-text h3 {
  margin-bottom: 0.5rem;
}

.project-timeline-text p {
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.6;
}

.project-timeline-image {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.project-timeline-image img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--c-border);
}

/* Чередование на десктопе */
@media (min-width: 769px) {
  .project-timeline-item.right .project-timeline-text {
    order: 2;
  }
  .project-timeline-item.right .project-timeline-image {
    order: 1;
  }
}

/* Мобильная версия */
@media (max-width: 768px) {
  .project-timeline-item,
  .project-timeline-item.right {
    grid-template-columns: 1fr;
    transform: translateX(0);
  }
}

/* Цитата и кнопка "Сотрудничать" внизу */

.projects-cta {
  margin-top: 4rem;
  text-align: center;
}

.projects-cta-text {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
}

/* Красные кнопки для проектов и "Сотрудничать" */

.btn-project {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 2px solid var(--c-logo-maroon);      /* #781e07 */
  color: var(--c-logo-maroon);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
}

.btn-project:hover {
  background: var(--c-logo-maroon);            /* #781e07 */
  color: var(--c-amber);                       /* #D4A373 */
  text-decoration: none;
}

/* Можно слегка выделить CTA-кнопку */
.btn-project-cta {
  margin-top: 0.5rem;
}

/* Чёрный "хвост" перед подвалом */
.projects-dark-tail {
  height: 100px;           /* ~100 пикселей чистого чёрного перед подвалом */
  background-color: #000;  /* резкий переход к подвалу */
  margin-top: 3rem;
}

/* ===== СТРАНИЦА ПРОЕКТОВ (ТЁПЛЫЙ СТИЛЬ) ===== */

.projects-page-warm {
    padding-top: 2rem;
    padding-bottom: 0;
}

.projects-page-warm + .main-footer {
  margin-top: 0;
}

/* Описание страницы под заголовком */
.projects-intro {
  max-width: 800px;
  margin-top: 1.5rem;
  font-size: 1.4rem;
  line-height: 1.8;
}

/* Тёплый блок проектов */
.projects-warm-section {
  background-color: #f8f1e6; /* чуть теплее, чем --c-card-bg */
  padding: 3rem 0 3.5rem;
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
}

/* Подзаголовок "здесь пульс..." */
.projects-subtitle-warm {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 2.2rem;
  text-align: center;
  color: var(--c-logo-maroon);
  margin-bottom: 2.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.projects-subtitle-warm.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Сетка проектов */
.projects-cards-warm {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* Одна карточка проекта */
.project-card-warm {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
  gap: 2rem;
  align-items: center;
  background: var(--c-card-bg);
  border: 1px solid var(--c-border);
  box-shadow: 0 6px 18px var(--c-shadow);
  padding: 1.5rem 1.8rem;
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.project-card-warm.right {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr);
  transform: translateX(60px);
}

.project-card-warm.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Фото проекта */
.project-card-image {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.project-card-image img {
  width: 100%;
  height: auto;
  border: 1px solid var(--c-border);
}

/* Текст проекта */
.project-card-text h3 {
  margin-bottom: 0.5rem;
  color: var(--c-logo-maroon);
}

.project-card-text p {
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--c-text);
}

/* На десктопе — чередуем лево/право */
@media (min-width: 769px) {
  .project-card-warm.right .project-card-text {
    order: 2;
  }
  .project-card-warm.right .project-card-image {
    order: 1;
  }
}

/* На мобильных — одна колонка */
@media (max-width: 768px) {
  .project-card-warm,
  .project-card-warm.right {
    grid-template-columns: 1fr;
    transform: translateX(0);
  }
}

/* Цитата и кнопка "Сотрудничать" */
.projects-cta-warm {
  margin-top: 3rem;
  text-align: center;
}

.projects-cta-text {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--c-text);
}

.projects-bottom-gap {
  height: 100px; /* чистое пространство перед подвалом */
}

/* Красные кнопки для проектов и CTA */

.btn-project {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 2px solid var(--c-logo-maroon);   /* #781e07 */
  color: var(--c-logo-maroon);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
}

.btn-project:hover {
  background: var(--c-logo-maroon);         /* #781e07 */
  color: var(--c-amber);                    /* #D4A373 */
  text-decoration: none;
}

.btn-project-cta {
  margin-top: 0.5rem;
}


.exhibit-likes {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--c-sage);
}

.like-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 2.2rem;
  line-height: 1;
  color: var(--c-border);
  transition: color 0.2s ease, transform 0.1s ease;
}

.like-btn:hover {
  color: var(--c-logo-maroon);
  transform: translateY(-1px);
}

.like-btn.liked {
  color: var(--c-logo-maroon);
}


.text-toolbar {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
    background: #f0ede4;
    padding: 5px;
    border: 1px solid var(--c-border);
}

.text-toolbar button {
    background: white;
    border: 1px solid var(--c-border);
    cursor: pointer;
    padding: 2px 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: bold;
}

.text-toolbar button:hover {
    background: var(--c-amber);
    color: white;
}

.rich-editor {
    min-height: 150px;
    border: 1px solid var(--c-border);
    padding: 1rem;
    background: white;
    font-family: var(--font-body);
    line-height: 1.6;
}

.rich-editor:focus {
    outline: none;
    border-color: var(--c-amber);
}

/* Контейнер для заголовка каталога */
.catalog-header-wrap {
    position: relative;
    display: inline-block;
    padding-left: 80px; /* Пространство для ракеты */
    margin-bottom: 2rem;
}

/* Стили самой ракеты */
.rocket-anim {
    position: absolute;
    left: 0;
    top: 0;
    width: 150px; /* Настройте ширину под ваше изображение */
    height: auto;
    z-index: 5;
    pointer-events: none; /* Чтобы не мешала кликать */
    
    /* Начальное состояние: за левым краем, повернута на 90 градусов вправо */
    opacity: 0;
    transform: translateX(-100px) rotate(90deg);
    
    /* Плавность всех изменений */
    transition: none; 
}
/* Контейнер для полета - теперь он не занимает места в потоке, чтобы ничего не сдвигать */
.rocket-corridor {
    position: absolute;      /* Абсолют относительно ближайшего родителя с position:relative (обычно это body или main) */
    top: 100px;              /* Расстояние от верха (сразу под шапкой) */
    left: 0;
    width: 100%;
    height: 150px;           /* Большой запас высоты */
    pointer-events: none;    /* Чтобы не мешала нажимать на кнопки */
    z-index: 9999;           /* Максимальный приоритет - поверх всего */
    overflow: hidden;        /* Чтобы не было боковой прокрутки */
}

.rocket-transit {
    position: absolute;
    width: 200px;            /* Размер */
    height: auto;
    top: 50px;               /* Положение внутри коридора */
    left: -200px;            /* Старт за экраном */
    opacity: 0;
    
    /* Если картинка вертикальная, кладем её на бок */
    transform: rotate(90deg); 
    
    /* Улучшенное сглаживание для анимации */
    backface-visibility: hidden;
    -webkit-font-smoothing: subpixel-antialiased;
}

/* Анимация */
body.page-loaded .rocket-transit {
    animation: smoothTransit 8s linear forwards;
    animation-delay: 0.5s;
}

@keyframes smoothTransit {
    0% {
        left: -200px;
        top: 50px;
        opacity: 0;
    }
    10% {
        opacity: 1; /* Полностью видимая */
    }
    25% {
        top: 40px;  /* Покачивание вверх */
    }
    50% {
        top: 60px;  /* Покачивание вниз */
    }
    75% {
        top: 40px;
    }
    90% {
        opacity: 1;
    }
    100% {
        left: 100%; /* Улетает за правый край */
        top: 50px;
        opacity: 0;
    }
}

/* Добавить внутрь <style> в history.html */

.history-content a {
    color: var(--c-logo-maroon);
    text-decoration: none;
    border-bottom: 1px solid var(--c-amber);
    transition: all 0.3s ease;
    font-weight: 500;
}

.history-content a:hover {
    color: var(--c-amber);
    border-bottom-color: var(--c-logo-maroon);
    background: rgba(212, 163, 115, 0.1);
}

        /* Стили для панели статусов */
.admin-status-panel {
    background: #fff; border: 2px dashed var(--dc-black); padding: 15px;
    margin-bottom: 20px; display: inline-block;
}
.admin-btn-start {
    background: #28a745; color: white; border: none; padding: 10px 20px;
    font-family: '7DB'; cursor: pointer; font-size: 1.2rem;
}
.admin-btn-stop {
    background: #dc3545; color: white; border: none; padding: 10px 20px;
    font-family: '7DB'; cursor: pointer; font-size: 1.2rem;
}
.status-message-box {
    border: 4px solid var(--dc-black);
    padding: 2rem;
    display: inline-block;
    max-width: 600px;
    background: #f0f0f0;
}

.about-text a {
    color: var(--c-accent-teal);
    border-bottom: 1px solid var(--c-accent-teal);
}

.about-text a:hover {
    color: var(--c-logo-maroon);
    border-bottom-color: var(--c-logo-maroon);
}

/* Стили для ссылок, созданных автоматически фильтром */
.news-full-text a, .news-info a {
    color: var(--c-accent-teal); /* Тот самый бирюзовый из логотипа */
    text-decoration: none;
    border-bottom: 1px solid rgba(30, 156, 176, 0.3);
    transition: all 0.2s ease;
}

.news-full-text a:hover, .news-info a:hover {
    border-bottom-color: var(--c-accent-teal);
    background: rgba(30, 156, 176, 0.05);
}

/* 1. Скрытие/Появление шапки при скролле */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: transform 0.4s ease, background 0.3s ease;
    background: var(--c-bg); /* Цвет бумаги */
    border-bottom: 1px solid var(--c-border);
}

/* Класс, который будет добавлять JS при скролле вниз */
.header-hidden {
    transform: translateY(-100%);
}

/* 2. Адаптивность элементов */
@media (max-width: 1024px) {
    .header-grid {
        grid-template-columns: auto auto; /* Лого и Утилиты */
        justify-content: space-between;
        padding: 0.5rem 0;
    }

    /* Прячем основное меню */
    .main-nav {
        display: none; 
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--c-bg);
        border-bottom: 2px solid var(--c-logo-maroon);
        padding: 1rem 0;
        flex-direction: column;
        z-index: 999;
    }

    /* Когда меню открыто */
    .main-nav.active {
        display: block;
        animation: slideDown 0.3s ease forwards;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }

    .main-nav ul li a {
        display: block;
        padding: 1rem 2rem;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }

    /* Уменьшаем логотип на мобильных */
    .logo-image {
        height: 40px;
    }
    .logo-main { font-size: 1rem; }
    .logo-sub { font-size: 0.6rem; }

    /* Бургер-кнопка */
    .burger-menu {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
    }

    .burger-menu span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: var(--c-logo-maroon);
        transition: 0.3s;
    }
    
    /* Скрываем текст юзера, оставляем только иконку/кнопку если нужно */
    .user-name { display: none; }
    .header-utils .btn { padding: 0.5rem 1rem; font-size: 0.7rem; }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}