/* ============ SIMPLE MODE (no animations, for comparison) ============ */
html.no-anim #preloader,
html.no-anim #reveal-curtain,
html.no-anim #page-curtain,
html.no-anim #cursor-dot,
html.no-anim #cursor-ring,
html.no-anim #scroll-progress { display: none !important; }

html.no-anim, html.no-anim body { cursor: auto !important; }
html.no-anim * { cursor: auto !important; }

html.no-anim .anim-reveal,
html.no-anim .anim-mask > *,
html.no-anim .anim-mask-wrap > * {
  opacity: 1 !important; transform: none !important; animation: none !important;
}
html.no-anim .anim-mask::before,
html.no-anim .anim-mask-wrap::after { display: none !important; }

html.no-anim .hero h1 .word .inner,
html.no-anim .hero-inner h1 .word .inner {
  transform: none !important; opacity: 1 !important; animation: none !important;
}
html.no-anim .hero-eyebrow,
html.no-anim .hero-desc,
html.no-anim .hero-actions,
html.no-anim .hero-scroll,
html.no-anim .hero-inner .breadcrumbs,
html.no-anim .hero-inner .lead {
  opacity: 1 !important; transform: none !important; animation: none !important;
}

html.no-anim .direction { transform: none !important; perspective: none; }
html.no-anim .btn-primary,
html.no-anim .btn-secondary,
html.no-anim .btn-green { transform: none !important; }

html.no-anim .hero::before,
html.no-anim .hero-inner::before {
  transform: none !important; --parallax-shift: 0;
}

/* ============ ANIMATIONS (iteration 1) ============ */

/* === PRELOADER === */
#preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--green-deep);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 24px;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#preloader.hidden { opacity: 0; visibility: hidden; }
#preloader .logo-mark {
  width: 96px; height: 96px;
  opacity: 0; transform: scale(0.85);
  animation: preLogo 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
#preloader .logo-mark img { width: 100%; height: 100%; display: block; }
#preloader .counter {
  font-family: 'Instrument Serif', serif; font-size: 56px;
  color: var(--white); font-weight: 400; letter-spacing: -0.01em;
  opacity: 0; animation: preFade 0.5s ease 0.3s forwards;
  line-height: 1;
}
#preloader .label {
  font-size: 10px; letter-spacing: 4px; text-transform: uppercase;
  color: rgba(255,255,255,0.5); font-weight: 400;
  opacity: 0; animation: preFade 0.5s ease 0.5s forwards;
}
#preloader .progress-bar {
  position: absolute; bottom: 0; left: 0; height: 2px;
  background: var(--gold); width: 0%; transition: width 0.3s ease;
}
@keyframes preLogo { to { opacity: 1; transform: scale(1); } }
@keyframes preFade { to { opacity: 1; } }

#reveal-curtain {
  position: fixed; inset: 0; z-index: 9998;
  background: var(--green-deep);
  transform: translateY(0); pointer-events: none;
  transition: transform 1.1s cubic-bezier(0.76, 0, 0.24, 1);
}
#reveal-curtain.lifted { transform: translateY(-100%); }

/* === HERO TYPOGRAPHY WORD ANIMATION === */
.hero h1 .word { display: inline-block; overflow: hidden; vertical-align: baseline; line-height: 1; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.hero h1 .word .inner {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  animation: wordUp 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero h1 .word:nth-child(1) .inner { animation-delay: 1.3s; }
.hero h1 .word:nth-child(2) .inner { animation-delay: 1.45s; }
.hero h1 .word:nth-child(3) .inner { animation-delay: 1.6s; }
.hero h1 .word:nth-child(4) .inner { animation-delay: 1.75s; }
.hero h1 .word:nth-child(5) .inner { animation-delay: 1.9s; }
.hero h1 .word:nth-child(6) .inner { animation-delay: 2.05s; }
@keyframes wordUp { to { transform: translateY(0); opacity: 1; } }

.hero-eyebrow,
.hero-desc,
.hero-actions,
.hero-scroll {
  opacity: 0;
}
.hero-eyebrow { animation: fadeUp 1s cubic-bezier(0.22, 1, 0.36, 1) 1.1s forwards; }
.hero-desc { animation: fadeUp 1s cubic-bezier(0.22, 1, 0.36, 1) 2.3s forwards; }
.hero-actions { animation: fadeUp 1s cubic-bezier(0.22, 1, 0.36, 1) 2.5s forwards; }
.hero-scroll { animation: fadeUp 1s cubic-bezier(0.22, 1, 0.36, 1) 2.8s forwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* Inner page hero animation */
.hero-inner h1 .word { display: inline-block; overflow: hidden; vertical-align: baseline; line-height: 1; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.hero-inner h1 .word .inner {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  animation: wordUp 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-inner h1 .word:nth-child(1) .inner { animation-delay: 1.0s; }
.hero-inner h1 .word:nth-child(2) .inner { animation-delay: 1.15s; }
.hero-inner h1 .word:nth-child(3) .inner { animation-delay: 1.3s; }
.hero-inner h1 .word:nth-child(4) .inner { animation-delay: 1.45s; }

.hero-inner .breadcrumbs,
.hero-inner .lead {
  opacity: 0;
}
.hero-inner .breadcrumbs { animation: fadeUp 1s cubic-bezier(0.22, 1, 0.36, 1) 0.8s forwards; }
.hero-inner .lead { animation: fadeUp 1s cubic-bezier(0.22, 1, 0.36, 1) 1.8s forwards; }

/* === HERO PARALLAX (background shift via CSS var) === */
.hero::before, .hero-inner::before {
  transform: translateY(var(--parallax-shift, 0));
  will-change: transform;
}

/* === SMOOTH SCROLL (LENIS) === */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* === CUSTOM CURSOR === */
@media (hover: hover) and (pointer: fine) {
  html, body { cursor: none; }
  a, button, label, [data-cursor] { cursor: none !important; }
  input, textarea, select { cursor: text; }
  button, [role="button"] { cursor: pointer !important; }
  html, body { cursor: none !important; }
  #cursor-dot {
    position: fixed; top: 0; left: 0; z-index: 10000;
    width: 6px; height: 6px; border-radius: 50%;
    background: #FFFFFF; pointer-events: none;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease, background 0.2s ease;
    mix-blend-mode: difference;
  }
  #cursor-ring {
    position: fixed; top: 0; left: 0; z-index: 10000;
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid #FFFFFF;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                height 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.3s ease,
                background 0.3s ease,
                backdrop-filter 0.3s ease;
    mix-blend-mode: difference;
    display: flex; align-items: center; justify-content: center;
  }
  #cursor-ring::after {
    content: ''; font-size: 11px; letter-spacing: 2px; font-weight: 500;
    color: var(--green-deep); opacity: 0;
    font-family: 'Inter', sans-serif;
    transition: opacity 0.3s ease;
  }
  #cursor-ring.hover-link {
    width: 60px; height: 60px;
    background: rgba(255,255,255,0.15);
    border-color: #FFFFFF;
  }
  #cursor-ring.hover-image {
    width: 110px; height: 110px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    mix-blend-mode: normal;
  }
  #cursor-ring.hover-image::after {
    content: 'ВІДКРИТИ'; opacity: 1; color: #FFFFFF;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
  }
  body.cursor-hidden #cursor-dot,
  body.cursor-hidden #cursor-ring { opacity: 0; }
}
@media (max-width: 768px) {
  #cursor-dot, #cursor-ring { display: none !important; }
  html, body, a, button { cursor: auto !important; }
}

/* === SCROLL REVEAL === */
.anim-reveal { opacity: 0; transform: translateY(50px); will-change: opacity, transform; }
.anim-reveal.in {
  opacity: 1; transform: translateY(0);
  transition: opacity 1.1s cubic-bezier(0.22, 1, 0.36, 1), transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Stagger via nth-child inside grid containers */
.anim-stagger > *:nth-child(1).anim-reveal.in { transition-delay: 0.05s; }
.anim-stagger > *:nth-child(2).anim-reveal.in { transition-delay: 0.12s; }
.anim-stagger > *:nth-child(3).anim-reveal.in { transition-delay: 0.19s; }
.anim-stagger > *:nth-child(4).anim-reveal.in { transition-delay: 0.26s; }
.anim-stagger > *:nth-child(5).anim-reveal.in { transition-delay: 0.33s; }
.anim-stagger > *:nth-child(6).anim-reveal.in { transition-delay: 0.40s; }
.anim-stagger > *:nth-child(7).anim-reveal.in { transition-delay: 0.47s; }
.anim-stagger > *:nth-child(8).anim-reveal.in { transition-delay: 0.54s; }
.anim-stagger > *:nth-child(9).anim-reveal.in { transition-delay: 0.61s; }
.anim-stagger > *:nth-child(10).anim-reveal.in { transition-delay: 0.68s; }
.anim-stagger > *:nth-child(11).anim-reveal.in { transition-delay: 0.75s; }
.anim-stagger > *:nth-child(12).anim-reveal.in { transition-delay: 0.82s; }

/* === IMAGE MASK REVEAL (split-image, direction img) === */
.anim-mask-wrap { position: relative; overflow: hidden; }
.anim-mask-wrap::after {
  content: ''; position: absolute; inset: 0;
  background: var(--green-deep);
  transform-origin: top;
  transform: scaleY(1);
  transition: transform 1.2s cubic-bezier(0.76, 0, 0.24, 1);
  z-index: 2; pointer-events: none;
}
.anim-mask-wrap.in::after { transform: scaleY(0); transform-origin: bottom; }
.anim-mask-wrap > :not(::after) { transform: scale(1.1); transition: transform 1.4s cubic-bezier(0.22, 1, 0.36, 1); }
.anim-mask-wrap.in > * { transform: scale(1); }

/* === 3D TILT TILES === */
.direction {
  transform-style: preserve-3d; perspective: 1000px;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.direction .num,
.direction h3,
.direction p,
.direction .arrow {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), color 0.3s ease;
}
.direction:hover .num { transform: translateZ(40px); color: var(--gold); }
.direction:hover h3 { transform: translateZ(50px); }
.direction:hover p { transform: translateZ(30px); }
.direction:hover .arrow { transform: translateZ(70px) translateX(12px); }

/* === MAGNETIC BUTTONS === */
.btn-primary, .btn-secondary, .btn-green {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  will-change: transform;
}

/* === PAGE TRANSITION CURTAIN === */
#page-curtain {
  position: fixed; inset: 0; z-index: 9997;
  background: var(--green-deep);
  transform: translateY(100%); pointer-events: none;
  transition: transform 0.9s cubic-bezier(0.76, 0, 0.24, 1);
  display: flex; align-items: center; justify-content: center;
}
#page-curtain .mark {
  width: 72px; height: 72px;
  opacity: 0; transform: scale(0.8);
  transition: opacity 0.5s ease 0.3s, transform 0.5s ease 0.3s;
}
#page-curtain .mark img { width: 100%; height: 100%; }
#page-curtain.in {
  transform: translateY(0);
}
#page-curtain.in .mark { opacity: 1; transform: scale(1); }
#page-curtain.out {
  transform: translateY(-100%);
}

/* === SCROLL PROGRESS === */
#scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px;
  background: var(--gold); z-index: 10001;
  width: 0%; pointer-events: none;
  transition: width 0.1s ease;
}

/* === MASK REVEAL для split-image, about-image === */
.anim-mask { position: relative; overflow: hidden; }
.anim-mask::before {
  content: ''; position: absolute; inset: 0;
  background: var(--green-deep); z-index: 3;
  transform-origin: left center;
  transform: scaleX(1);
  transition: transform 1.1s cubic-bezier(0.76, 0, 0.24, 1);
}
.anim-mask.in::before { transform: scaleX(0); transform-origin: right center; }

/* === LETTER HOVER (CTA) === */
.btn-primary, .btn-secondary, .btn-green {
  position: relative; overflow: hidden;
}
.btn-primary .char, .btn-secondary .char, .btn-green .char {
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.btn-primary:hover .char, .btn-secondary:hover .char, .btn-green:hover .char {
  transform: translateY(-100%);
}
.btn-primary .char-dup, .btn-secondary .char-dup, .btn-green .char-dup {
  position: absolute;
  display: inline-block;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.btn-primary:hover .char-dup, .btn-secondary:hover .char-dup, .btn-green:hover .char-dup {
  transform: translateY(0);
}

/* === IMAGE PARALLAX ON SCROLL (direction tiles) === */
.direction .img {
  will-change: transform;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Prevent flash of unstyled curtain */
body:not(.loaded) .anim-reveal { opacity: 0 !important; }
