/* ═══════════════════════════════════
   BASE — переменные, сброс, типографика
═══════════════════════════════════ */
:root {
  --r1: #c8956a;
  --r2: #d4a878;
  --r3: #debb8e;
  --r4: #e8cfa6;
  --r5: #f0dfc0;
  --r6: #f6ead4;
  --r7: #faf3e8;
  --bark: #7a4e28;
  --bark-mid: #a06838;
  --cream: #fdf8f0;
  --text: #2a1a0e;
  --text-mid: #6b4a2a;
  --text-soft: #a08060;
  --gold: #c89030;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--cream);
  color: var(--text);
  overflow-x: hidden;
}


/* Прогресс-бар */
.prog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 700;
  background: rgba(122, 78, 40, .1);
}
.prog-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--r1), var(--bark-mid), #5cb878, #6090d8);
  transition: width .1s;
}

/* Reveal-анимация при скролле */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
  transition-delay: 0s;
}

/* Кнопка «наверх» */
.back-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 600;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .4);
  background: rgba(30, 100, 50, .45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, .9);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .3s, transform .3s, background .2s;
}
.back-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-top:hover {
  background: rgba(30, 100, 50, .7);
  border-color: rgba(255, 255, 255, .6);
}

/* Лайтбокс */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .88);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-viewport {
  position: relative;
  overflow: hidden;
  width: 92vw;
  height: 90vh;
  border-radius: 8px;
  box-shadow: 0 8px 48px rgba(0,0,0,.6);
  cursor: grab;
  user-select: none;
  touch-action: none;
  background: #111;
}
.lightbox-viewport.dragging {
  cursor: grabbing;
}
.lightbox-img {
  display: block;
  /* натуральный размер — зум будет показывать реальные пиксели */
  max-width: none;
  max-height: none;
  border-radius: 0;
  transform-origin: 0 0;
  transition: transform .1s ease-out;
  pointer-events: none;
  will-change: transform;
  position: absolute;
  top: 0;
  left: 0;
}
.lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  opacity: .75;
  transition: opacity .2s;
  z-index: 10;
}
.lightbox-close:hover {
  opacity: 1;
}
.lightbox-zoom-hint {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: .78rem;
  padding: .3rem .8rem;
  border-radius: 999px;
  pointer-events: none;
  opacity: 1;
  transition: opacity .5s;
  white-space: nowrap;
}
.lightbox-zoom-hint.hidden {
  opacity: 0;
}
.lightbox-zoom-btns {
  position: absolute;
  bottom: 1rem;
  right: 1.5rem;
  display: flex;
  gap: .4rem;
  z-index: 10;
}
.lightbox-zoom-btns button {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background .2s;
}
.lightbox-zoom-btns button:hover {
  background: rgba(255,255,255,.3);
}
[data-lightbox] {
  cursor: zoom-in;
}

