/* ============================================
   LUNAVERA TRATTORIA — Анимации
   ============================================ */

/* ── Базовые keyframes ── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes bounceDown {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.04); }
}

/* ── Scroll-triggered анимации (overridden by animations.js) ── */
.reveal {
  opacity: 0;
  transform: translateY(48px);
  transition:
    opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.75s ease;
  filter: blur(4px);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0px);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-48px);
  transition:
    opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.75s ease;
  filter: blur(4px);
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
  filter: blur(0px);
}

.reveal-right {
  opacity: 0;
  transform: translateX(48px);
  transition:
    opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.75s ease;
  filter: blur(4px);
}
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
  filter: blur(0px);
}

/* ── Typewriter cursor ── */
.tw-cursor {
  display: inline-block;
  color: var(--gold-light);
  font-weight: 300;
  animation: tw-blink 0.75s step-end infinite;
  margin-left: 2px;
}
.tw-cursor-hide {
  animation: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

@keyframes tw-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Magnetic button: preserve non-transform transitions ── */
.btn-primary,
.btn-secondary,
.btn-nav,
.menu-nav-btn,
.gallery-filter-btn {
  will-change: transform;
}

/* задержки */
.delay-1 { transition-delay: 0.1s !important; }
.delay-2 { transition-delay: 0.2s !important; }
.delay-3 { transition-delay: 0.3s !important; }
.delay-4 { transition-delay: 0.4s !important; }
.delay-5 { transition-delay: 0.5s !important; }

/* ── Карточки меню — эффект появления ── */
.menu-card {
  transition: transform 0.35s ease, box-shadow 0.35s ease, opacity 0.4s ease;
}

.menu-card.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
}

/* ── Золотое мерцание для акцентов ── */
.gold-shimmer {
  background: linear-gradient(
    90deg,
    #e8a820 0%,
    #f5d06e 40%,
    #e8a820 60%,
    #c47f10 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* ── Hover эффект на навигации ── */
.nav-links a::after {
  content: '';
  display: block;
  height: 1px;
  width: 0;
  background: var(--gold-light);
  transition: width 0.3s ease;
  margin-top: 2px;
}

.nav-links a:hover::after {
  width: 100%;
}

/* ── Линия-разделитель с анимацией ── */
.divider-line {
  width: 0;
  height: 2px;
  background: linear-gradient(to right, var(--gold), var(--terra));
  margin: 24px auto;
  transition: width 0.8s ease;
}

.divider-line.visible {
  width: 80px;
}

/* ── Число-счётчик (stat items) ── */
.stat-item .num {
  transition: color 0.3s ease;
}

/* ── Cursor spotlight ── */
.cursor-spotlight {
  position: fixed;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  translate: -50% -50%;
  background: radial-gradient(
    circle,
    rgba(232, 168, 32, 0.10) 0%,
    rgba(232, 168, 32, 0.04) 40%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  mix-blend-mode: screen;
}

/* ── Heading word-by-word reveal ── */
.section-title .word-reveal {
  display: inline-block;
  clip-path: inset(0 100% 0 0);
  transition:
    clip-path 0.6s cubic-bezier(0.16, 1, 0.3, 1) calc(var(--wi, 0) * 0.08s);
}
.heading-visible .word-reveal {
  clip-path: inset(0 0% 0 0);
}

/* ── Фоновый параллакс (лёгкий) ── */
.hero-bg {
  transition: transform 0.1s linear;
}

/* ── Плавное появление секций ── */
section {
  animation: fadeIn 0.5s ease both;
}
