:root {
  --bg: #272422;
  --reality-bg: #0F0F0D;
  --facade-bg: #F0EAD6;
  --facade-text: #0E0C0A;
  --reality-text: #DDD5C5;
  --axis: #B5651D;
  --axis-dim: rgba(181,101,29,0.25);
  --name: #E85D04;
  --rad-warn: #A69554;
  --timestamp: #C4741F;
  --date-text: #F0EAD6;
  --silence: #2A2620;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--reality-text);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  /* Блокируем браузерный свайп назад/вперёд по краям вкладки,
     чтобы не конфликтовал с горизонтальными свайпами слайдера. */
  overscroll-behavior-x: none;
}

a { color: inherit; text-decoration: underline; text-decoration-color: rgba(255,255,255,0.2); }

/* ─── HERO ─── */
/*
  ПЛЕЙСХОЛДЕР hero-фото: положить файл в images/hero.jpg (рекомендуемый размер 2400×1600,
  тёмный, низкоконтрастный кадр АЭС/Припяти). Если файла нет — hero просто останется
  на чёрном фоне с лёгкой виньеткой, вёрстка не ломается.
*/
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 2rem 6vw 10vh;
  position: relative;
  overflow: hidden;
  background-color: #0A0908;
  background-image:
    linear-gradient(to bottom, rgba(10,9,8,0.55) 0%, rgba(10,9,8,0.85) 70%, #0A0908 100%),
    url('images/1_kostin_chernobyl_1986.jpg');
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 30% 60%, rgba(181,101,29,0.08) 0%, transparent 70%),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.012) 2px, rgba(255,255,255,0.012) 4px);
  pointer-events: none;
}

.hero-year {
  font-family: 'IBM Plex Sans Condensed', sans-serif;
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--axis);
  margin: -0.9rem 0 2.4rem;
  text-transform: uppercase;
}

.hero h1 {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: clamp(2.2rem, 6vw, 5.5rem);
  letter-spacing: 0.05em;
  color: #FFFAF0;
  line-height: 1.05;
  max-width: 900px;
  margin-top: auto;
  margin-bottom: 2rem;
}

.hero-sub {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 300;
  font-size: clamp(1.5rem, 2.7vw, 1.875rem);
  color: #B4A894;
  max-width: 600px;
  line-height: 1.6;
}

.hero-scroll {
  position: absolute;
  bottom: 3rem;
  right: 6vw;
  font-family: 'IBM Plex Sans Condensed', sans-serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: #6A5A4A;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

/* ─── HERO NAV (logo + lang switcher row) ─── */
.hero-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-shrink: 0;
}

/* ─── LANG SWITCHER ─── */
.lang-nav {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.lang-btn {
  font-family: 'IBM Plex Sans Condensed', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #6A5A4A;
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 0.25rem 0;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease;
  line-height: 1;
}

.lang-btn:hover {
  color: #B4A894;
}

.lang-btn.lang-active {
  color: var(--axis);
  border-bottom-color: var(--axis);
}

.lang-sep {
  font-size: 9px;
  color: #3A3028;
  user-select: none;
  pointer-events: none;
  line-height: 1;
}
.site-logo {
  height: 38px;
  width: auto;
  display: block;
  text-decoration: none;
  opacity: 0.88;
}
.site-logo:hover { opacity: 1; }
.site-logo img { height: 100%; width: auto; display: block; }

/* ─── HERO-NAV RIGHT GROUP ─── */
.hero-nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ─── DONATE BUTTON ─── */
.donate-btn {
  display: inline-block;
  font-family: 'IBM Plex Sans Condensed', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--facade-bg);
  border: 1px solid rgba(240,234,214,0.4);
  padding: 5px 11px;
  border-radius: 2px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s;
}
.donate-btn:hover {
  border-color: rgba(240,234,214,0.75);
  color: #FFFAF0;
  text-decoration: none;
}
.donate-short { display: none; }

/* ─── INTRO ─── */
.intro {
  max-width: 640px;
  margin: 0 auto;
  padding: 8vh 2rem 6vh;
  text-align: center;
}

.intro p {
  font-size: 1.575rem;
  color: #B4A894;
  line-height: 1.8;
  font-weight: 300;
}

.intro strong {
  color: var(--facade-bg);
  font-weight: 400;
}

/* ─── COLUMN LABELS ─── */
.col-labels {
  display: grid;
  grid-template-columns: 1fr 120px 1fr;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 4vw 3rem;
  align-items: center;
}

.col-label-reality {
  font-family: 'IBM Plex Sans Condensed', sans-serif;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #786860;
  text-align: right;
  padding-right: 3rem;
}

.col-label-facade {
  font-family: 'IBM Plex Sans Condensed', sans-serif;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #8A7A60;
  text-align: left;
  padding-left: 3rem;
}

.col-label-center {
  text-align: center;
  font-family: 'IBM Plex Sans Condensed', sans-serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--axis);
}

/* ─── TIMELINE ─── */
.timeline {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 4vw;
}

/* Continuous vertical line */
.timeline::before {
  content: '';
  position: absolute;
  left: calc(50% + 4vw * 0.5 - 60px);
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--axis-dim) 5%, var(--axis-dim) 95%, transparent);
  left: 50%;
  transform: translateX(-50%);
}

/* ─── TIMELINE BLOCK ─── */
.tblock {
  display: grid;
  grid-template-columns: 1fr 120px 1fr;
  margin-bottom: 0;
  position: relative;
}

.tblock + .tblock {
  border-top: 1px solid rgba(181,101,29,0.12);
}

/* ─── AXIS ─── */
.axis {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 10;
}

.date-node {
  position: sticky;
  top: 42vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 4rem;
}

/* Горизонтальная засечка на оси времени у каждой даты */
.date-node::before {
  content: '';
  position: absolute;
  top: 6px;
  left: -36px;
  right: -36px;
  height: 1px;
  background: var(--axis-dim);
  z-index: -1;
}

/* Маленький знак радиационной опасности над ромбом */
.rad-sign {
  width: 14px;
  height: 12px;
  margin-bottom: 6px;
  opacity: 0.55;
  flex-shrink: 0;
  display: block;
}

.rad-sign polygon { fill: var(--rad-warn); }

.date-diamond {
  width: 10px;
  height: 10px;
  background: var(--axis);
  transform: rotate(45deg);
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.date-text {
  font-family: 'IBM Plex Sans Condensed', sans-serif;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--axis);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  white-space: nowrap;
}

/* ─── REALITY COLUMN ─── */
.reality {
  background: var(--reality-bg);
  padding: 4rem 3.5rem 4rem 2rem;
  border-right: 1px solid rgba(181,101,29,0.15);
}

.col-head {
  font-family: 'IBM Plex Sans Condensed', sans-serif;
  font-size: 15px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.reality .col-head { color: #686460; }
.facade .col-head { color: #5A4C38; }

.reality p {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--reality-text);
  margin-bottom: 1.2em;
  font-weight: 300;
}

.timestamp {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: var(--timestamp);
  display: block;
  margin: 1.8rem 0 0.6rem;
  letter-spacing: 0.05em;
}

.timestamp:first-of-type { margin-top: 0; }

/* ─── FACADE COLUMN ─── */
.facade {
  background: var(--facade-bg);
  padding: 4rem 2rem 4rem 3.5rem;
  border-left: 1px solid rgba(181,101,29,0.15);
}

.facade p {
  font-family: 'PT Serif', serif;
  font-size: 0.95rem;
  color: var(--facade-text);
  margin-bottom: 1.2em;
  line-height: 1.75;
}

.facade blockquote {
  font-family: 'PT Serif', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: #2E2010;
  border-left: 2px solid rgba(181,101,29,0.4);
  padding-left: 1.2rem;
  margin: 1.5rem 0;
  line-height: 1.7;
}

/* Блоки молчания — фасад выглядит как обычный фасад (светлый фон, тот же шрифт) */
.facade .silence-note {
  font-family: 'PT Serif', serif;
  font-size: 0.95rem;
  color: var(--facade-text);
  margin-bottom: 1.2em;
  line-height: 1.75;
  font-style: italic;
}

/* ─── HERO NAMES ─── */
.name {
  color: var(--name);
  font-weight: 500;
}

/* ─── EPILOGUE ─── */
.epilogue {
  background: #161412;
  padding: 10vh 6vw 12vh;
  margin-top: 6rem;
  border-top: 1px solid rgba(181,101,29,0.2);
}

.epilogue-title {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 300;
  font-size: clamp(1.3rem, 3vw, 2.2rem);
  color: #8E8070;
  text-align: center;
  letter-spacing: 0.08em;
  margin-bottom: 8vh;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5rem 3rem;
  max-width: 1100px;
  margin: 0 auto 8vh;
}

/* 3 колонки: два полных ряда для шести блоков */
@media (min-width: 820px) and (max-width: 1199px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 980px;
  }
}

/* 4 колонки: висящий нижний ряд центрируем по горизонтали */
@media (min-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .stats-grid .stat:nth-child(5):nth-last-child(2) {
    grid-column: 2;
  }
}

.stat {
  text-align: center;
  container-type: inline-size;
}

.stat-number {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 300;
  /* фолбэк для браузеров без контейнерных запросов */
  font-size: clamp(1.6rem, 7vw, 4.5rem);
  color: var(--axis);
  line-height: 1;
  display: block;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* число всегда умещается в свой блок — масштабируем по ширине контейнера */
@supports (container-type: inline-size) {
  .stat-number {
    font-size: clamp(1.4rem, 18cqw, 4.5rem);
  }
}

.stat-label {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.95rem;
  color: #7A6A5A;
  line-height: 1.6;
  max-width: 220px;
  margin: 0 auto;
  font-weight: 300;
}

.epilogue-divider {
  width: 40px;
  height: 1px;
  background: var(--axis-dim);
  margin: 6vh auto;
}

.epilogue-body {
  max-width: 700px;
  margin: 0 auto;
}

.epilogue-body p {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.95rem;
  color: #8E8070;
  margin-bottom: 1.4em;
  line-height: 1.8;
  font-weight: 300;
}

.epilogue-body h3 {
  font-family: 'IBM Plex Sans Condensed', sans-serif;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--axis);
  margin: 4rem 0 1.5rem;
}

.epilogue-final {
  text-align: center;
  margin-top: 8vh;
  padding: 6vh 0;
  border-top: 1px solid rgba(181,101,29,0.1);
}

.epilogue-final p {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 300;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: #9A8A78;
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto;
}

.epilogue-final strong {
  color: var(--reality-text);
  font-weight: 400;
}

/* ─── MOBILE (слайдер реальность/фасад внутри каждого блока) ─── */
@media (max-width: 800px) {
  body {
    transition: background-color 300ms ease;
  }
  body.facade-active {
    background-color: #201E1A;
  }

  .site-logo {
    height: 28px;
  }

  .timeline { padding: 0; }
  .timeline::before { display: none; }
  .col-labels { display: none; }
  .hero-bottom {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
  }
  .hero-bottom .hero-sub {
    flex: 1;
    min-width: 0;
    font-size: clamp(1.1rem, 4.2vw, 1.5rem);
  }
  .hero-scroll {
    position: static;
    flex-shrink: 0;
    writing-mode: vertical-rl;
  }

  .tblock {
    display: block;
    grid-template-columns: none;
    border-top: 1px solid rgba(181,101,29,0.15);
    padding: 0;
  }
  .tblock + .tblock { border-top: 1px solid rgba(181,101,29,0.15); }

  /* прячем десктопную ось (даты выводятся заголовком над слайдером) */
  .axis { display: none; }
  /* заголовки колонок прячем: роль даты играет .mobile-date-header */
  .tblock .col-head { display: none; }

  /* заголовок даты над слайдером — добавляется JS */
  .mobile-date-header {
    font-family: 'IBM Plex Sans Condensed', sans-serif;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--axis);
    padding: 1.6rem 1.5rem 1rem;
    background: transparent;
  }

  /* вьюпорт = полная ширина экрана, слайды — 12px уже */
  .slider-viewport {
    overflow: hidden;
    width: 100vw;
    position: relative;
  }

  .slider-track {
    display: flex;
    transition: transform 300ms ease-out;
    will-change: transform;
    /* Браузер обрабатывает только вертикальный скролл; горизонтальные жесты — наши. */
    touch-action: pan-y;
  }
  .slider-track.no-transition { transition: none; }

  /* слайд = 100vw − 12px; сдвиг на слайд = 100vw − 24px:
     на слайде 0 справа видны 12px фасада, на слайде 1 слева видны 12px реальности */
  .slider-track > .reality,
  .slider-track > .facade {
    flex: 0 0 calc(100vw - 12px);
    width: calc(100vw - 12px);
    padding: 2rem 1.5rem 2.5rem;
    border: none;
    box-sizing: border-box;
  }

  /* индикатор из двух точек под слайдером */
  .dots-indicator {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 1.2rem 0 1.8rem;
  }
  .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3A3028;
    transition: background 200ms;
    cursor: pointer;
    border: none;
    padding: 0;
  }
  .dot.active { background: var(--axis); }

  /* фиксированная подсказка "Свайп →" */
  .swipe-hint {
    position: fixed;
    right: 16px;
    bottom: 32px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(240, 234, 214, 0.82);
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 600ms ease, transform 600ms ease;
    pointer-events: none;
  }
  .swipe-hint.visible {
    opacity: 1;
    transform: translateX(0);
  }
  .swipe-hint.hidden {
    opacity: 0;
    transition: opacity 400ms ease;
  }
  .swipe-hint-text {
    font-family: 'IBM Plex Sans Condensed', sans-serif;
    font-size: 13px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #D4751E;
  }
  .swipe-hint-arrow {
    width: 28px;
    height: 28px;
    stroke: #D4751E;
    fill: none;
    animation: swipe-pulse 1.4s ease-in-out infinite;
  }
  @keyframes swipe-pulse {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(6px); }
  }

  /* анимация первого входа блока в видимость */
  @keyframes slider-entry {
    0%   { transform: translateX(0); }
    50%  { transform: translateX(-40px); }
    100% { transform: translateX(0); }
  }
  .slider-track.entry-animate {
    animation: slider-entry 400ms ease-in-out;
  }

  /* заголовки колонок внутри слайдов — показываем на мобиле */
  .slider-track .col-head {
    display: block;
    font-size: 11px;
    letter-spacing: 0.25em;
    margin-bottom: 1.2rem;
  }

  /* эпилог: обычный вертикальный скролл, без слайдов */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem 2rem;
  }
  .epilogue { padding: 8vh 1.5rem 10vh; }
  .epilogue-body .epilogue-photo {
    width: calc(100vw - 3rem);
  }

  /* ─── Кнопка «Следующий день» ─── */
  .mobile-next-day {
    display: block;
    width: fit-content;
    margin: 2rem auto 0;
    padding: 0.45rem 1.1rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
    transition: border-color 150ms, color 150ms;
  }
  .mobile-next-day--reality {
    background: transparent;
    border: 1px solid rgba(221, 213, 197, 0.25);
    color: rgba(221, 213, 197, 0.45);
  }
  .mobile-next-day--reality:active {
    border-color: rgba(221, 213, 197, 0.55);
    color: rgba(221, 213, 197, 0.75);
  }
  .mobile-next-day--facade {
    background: transparent;
    border: 1px solid rgba(14, 12, 10, 0.3);
    color: rgba(14, 12, 10, 0.45);
  }
  .mobile-next-day--facade:active {
    border-color: rgba(14, 12, 10, 0.6);
    color: rgba(14, 12, 10, 0.7);
  }
}

/* ─── HERO-SUB мельче на очень узких экранах ─── */
@media (max-width: 400px) {
  .hero-bottom .hero-sub {
    font-size: clamp(0.9rem, 3.8vw, 1.1rem);
  }
  .site-logo { height: 16px; }
  .lang-btn { font-size: 9px; letter-spacing: 0.12em; }
  .lang-sep { font-size: 8px; }
  .hero-nav-right { gap: 0.55rem; }
  .donate-btn { font-size: 9px; padding: 4px 7px; letter-spacing: 0.1em; }
  .donate-full { display: none; }
  .donate-short { display: inline; }
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #0A0908; }
::-webkit-scrollbar-thumb { background: #3A3028; border-radius: 2px; }

/* ─── PHOTO BLOCKS ─── */
.photo-block {
  margin: 1.5em 0;
  width: 100%;
}
.photo-block img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
  cursor: zoom-in;
}
.photo-caption {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.78rem;
  line-height: 1.5;
  margin-top: 0.5em;
  font-weight: 300;
  color: #AFA391;
}
.reality .photo-caption { color: #AFA391; }
.facade .photo-caption  { color: #493D2D; }
.intro-photo { margin-bottom: 2.5rem; max-width: 700px; margin-left: auto; margin-right: auto; }
.intro-photo .photo-caption { color: #A99B89; text-align: center; }
.epilogue-photo {
  margin: 2.5rem auto;
  width: min(100%, 1100px);
  max-width: none;
}
.epilogue-body .epilogue-photo {
  width: min(calc(100vw - 12vw), 1100px);
  margin-left: 50%;
  transform: translateX(-50%);
}
.epilogue-photo .photo-caption { color: #AFA391; text-align: center; }

/* ─── LIGHTBOX ─── */
.lb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.88);
  align-items: center;
  justify-content: center;
  padding: 2rem;
  box-sizing: border-box;
}
.lb-overlay.open { display: flex; }
.lb-box {
  position: relative;
  max-width: min(90vw, 1200px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lb-box img {
  max-width: 100%;
  max-height: calc(90vh - 4rem);
  object-fit: contain;
  display: block;
  border-radius: 2px;
  cursor: default;
}
.lb-caption {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.78rem;
  line-height: 1.5;
  font-weight: 300;
  color: #9A8A78;
  margin-top: 0.75rem;
  text-align: center;
  max-width: 700px;
}
.lb-close {
  position: fixed;
  top: 1.2rem;
  right: 1.4rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  line-height: 1;
  color: #9A8A78;
  font-size: 1.8rem;
}
.lb-close:hover { color: #F0EAD6; }
