/* ============================================
   NAZARS.RU — ANIMATIONS CSS
   ============================================ */

/* ── Parallax Hero ── */
.hero-parallax {
  will-change: transform;
  transition: transform 0.05s linear;
}

/* ── Typewriter Effect ── */
@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}
@keyframes blink {
  50% { border-color: transparent; }
}
.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--accent);
  animation: typewriter 2.5s steps(40) forwards, blink 0.75s step-end infinite;
}

/* ── Fade In Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.anim-fade-up { animation: fadeInUp 0.8s ease forwards; }
.anim-fade-down { animation: fadeInDown 0.8s ease forwards; }
.anim-fade-left { animation: fadeInLeft 0.8s ease forwards; }
.anim-fade-right { animation: fadeInRight 0.8s ease forwards; }
.anim-fade { animation: fadeIn 0.8s ease forwards; }
.anim-scale { animation: scaleIn 0.6s ease forwards; }

.anim-delay-1 { animation-delay: 0.1s; opacity: 0; }
.anim-delay-2 { animation-delay: 0.2s; opacity: 0; }
.anim-delay-3 { animation-delay: 0.3s; opacity: 0; }
.anim-delay-4 { animation-delay: 0.4s; opacity: 0; }
.anim-delay-5 { animation-delay: 0.5s; opacity: 0; }
.anim-delay-6 { animation-delay: 0.6s; opacity: 0; }
.anim-delay-7 { animation-delay: 0.7s; opacity: 0; }
.anim-delay-8 { animation-delay: 0.8s; opacity: 0; }

/* ── Hero Entrance ── */
.hero-content .hero-tag {
  animation: fadeInLeft 0.8s ease 0.3s both;
}
.hero-content h1 {
  animation: fadeInUp 1s ease 0.5s both;
}
.hero-content .hero-sub {
  animation: fadeInUp 0.8s ease 0.7s both;
}
.hero-content .hero-btns {
  animation: fadeInUp 0.8s ease 0.9s both;
}
.hero-stats {
  animation: fadeIn 1s ease 1.2s both;
}
.scroll-indicator {
  animation: fadeIn 1s ease 1.4s both;
}

/* ── Number Counter ── */
@keyframes countUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.counter { animation: countUp 0.6s ease forwards; }

/* ── Gold Shimmer ── */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.shimmer-text {
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 25%, #fff8e7 50%, var(--accent-2) 75%, var(--accent) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* ── Pulse Animation ── */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 169, 110, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(200, 169, 110, 0); }
}
.pulse-accent { animation: pulse 2s ease-in-out infinite; }

/* ── Floating Animation ── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.float { animation: float 4s ease-in-out infinite; }

/* ── Spin (loader) ── */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spin { animation: spin 1s linear infinite; }

/* ── Gold Line Draw ── */
@keyframes drawLine {
  from { width: 0; }
  to { width: 100%; }
}
.draw-line {
  height: 1px;
  background: var(--accent);
  animation: drawLine 1.2s ease forwards;
}

/* ── Card Hover Lift ── */
.hover-lift {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

/* ── Image Zoom Hover ── */
.img-zoom {
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.img-zoom img {
  transition: transform 0.8s ease;
}
.img-zoom:hover img {
  transform: scale(1.08);
}

/* ── Gold Border Glow ── */
@keyframes borderGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(200,169,110,0.2); }
  50% { box-shadow: 0 0 25px rgba(200,169,110,0.5), 0 0 50px rgba(200,169,110,0.2); }
}
.border-glow { animation: borderGlow 3s ease-in-out infinite; }

/* ── Stagger Children ── */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.stagger-children.visible > *:nth-child(1) { opacity: 1; transform: none; transition-delay: 0s; }
.stagger-children.visible > *:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(4) { opacity: 1; transform: none; transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(5) { opacity: 1; transform: none; transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(6) { opacity: 1; transform: none; transition-delay: 0.5s; }

/* ── Page Transition ── */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9000;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.5s cubic-bezier(0.76, 0, 0.24, 1);
}
.page-transition.active { transform: scaleY(1); transform-origin: top; }

/* ── Noise Texture Overlay ── */
.noise::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.05;
  pointer-events: none;
  z-index: 1;
}

/* ── Checkmark Animation ── */
@keyframes drawCheck {
  0% { stroke-dashoffset: 100; }
  100% { stroke-dashoffset: 0; }
}
.check-svg circle {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: drawCheck 0.8s ease 0.2s forwards;
}
.check-svg path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: drawCheck 0.5s ease 0.8s forwards;
}

/* ── Skeleton Loading ── */
@keyframes skeleton {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}

/* ── Accordion ── */
.faq-item .faq-answer {
  will-change: max-height;
}

/* ── Carousel ── */
.reviews-track {
  will-change: transform;
}

/* ── Form Focus ── */
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  box-shadow: 0 0 0 3px rgba(200, 169, 110, 0.15);
}

/* ── Mobile Menu Transition ── */
.mobile-menu a {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}
.mobile-menu.active a { opacity: 1; transform: translateY(0); }
.mobile-menu.active a:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.active a:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.active a:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.active a:nth-child(4) { transition-delay: 0.25s; }
.mobile-menu.active a:nth-child(5) { transition-delay: 0.3s; }
.mobile-menu.active a:nth-child(6) { transition-delay: 0.35s; }

/* ── Urgency bar marquee ── */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee-track {
  display: flex;
  animation: marquee 20s linear infinite;
  white-space: nowrap;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   E1 — HERO-MORPH (Lenis + GSAP + flubber)
   Изолированный namespace .hero-morph чтобы
   не конфликтовать с прежним .hero
   ============================================ */

/* 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: clip; }

.hero-morph {
  position: relative;
  height: 500vh;
  margin: 0;
  padding: 0;
}
.hero-morph-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--bg);
}
.hero-morph-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(800px 400px at 30% 20%, rgba(200,169,110,.08), transparent 60%),
    radial-gradient(600px 600px at 80% 90%, rgba(200,169,110,.05), transparent 70%),
    var(--bg);
  z-index: 0;
}
.hero-morph-grain {
  position: absolute; inset: 0;
  opacity: .06; pointer-events: none; z-index: 1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.5'/></svg>");
}
.hero-morph-wrap {
  position: relative;
  width: min(60vw, 560px);
  aspect-ratio: 1 / 1;
  display: grid; place-items: center;
  z-index: 2;
}
.hero-morph-svg {
  width: 100%; height: 100%;
  overflow: visible;
}
.hero-morph-shape {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 32px rgba(200,169,110,.25));
}
.hero-aperture-blade {
  fill: rgba(200,169,110,.1);
  stroke: var(--accent);
  stroke-width: 1.2;
  transform-origin: center;
  transform-box: fill-box;
}
.hero-morph-frame {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  pointer-events: none;
  opacity: 0;
  z-index: 2;
}
.hero-morph-frame-img {
  width: min(60vw, 560px);
  aspect-ratio: 4 / 3;
  background: url('../assets/portfolio/web/frame-48.jpg') center / cover no-repeat;
  border: 1px solid rgba(200,169,110,.4);
  position: relative; overflow: hidden;
}
.hero-morph-frame-img::before {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(115deg, rgba(200,169,110,0) 0%, rgba(200,169,110,.2) 45%, rgba(200,169,110,0) 60%),
    radial-gradient(120% 80% at 30% 30%, rgba(200,169,110,.18), transparent 50%);
  mix-blend-mode: screen;
}
.hero-morph-frame-img::after {
  content: 'NAZARS · 4:3 · ƒ/2.8';
  position: absolute; left: 16px; bottom: 14px;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: .3em;
  color: var(--accent); opacity: .8;
}

.hero-morph-text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: min(880px, 90vw);
  z-index: 5;
  pointer-events: none;
}
.hero-morph-text .btn { pointer-events: auto; }
.hero-morph-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .4em;
  color: var(--accent);
  text-transform: uppercase;
  opacity: .8;
  margin-bottom: 18px;
}
.hero-morph-h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(40px, 7vw, 96px);
  line-height: .95;
  letter-spacing: -.01em;
  color: var(--text);
  margin: 0;
}
.hero-morph-h1 em {
  font-style: italic;
  color: var(--accent);
}
.hero-morph-sub {
  margin-top: 20px;
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(240,237,232,.6);
}
.hero-morph-sub .dot {
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  margin: 0 12px;
  vertical-align: middle;
}
.hero-morph-btns {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 36px;
}

.hero-morph-scroll {
  position: absolute;
  bottom: 32px; left: 50%;
  right: auto;
  transform: translateX(-50%);
  z-index: 5;
}

/* split-text reveal init state — gsap уберёт opacity */
.hero-morph-h1[data-split] .hero-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(.45em);
  will-change: transform, opacity;
}

/* ── Hero Scroll Phrases ── */
.hero-phrases {
  position: absolute;
  bottom: 22%;
  left: 0;
  right: 0;
  z-index: 6;
  pointer-events: none;
  text-align: center;
}
.hero-phrase {
  position: absolute;
  left: 0;
  right: 0;
  opacity: 0;
  font-family: var(--font-display);
  font-size: clamp(18px, 3.2vw, 44px);
  font-style: italic;
  font-weight: 300;
  color: #fff;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 40px rgba(0,0,0,0.7), 0 0 80px rgba(200,169,110,0.25);
  padding: 0 24px;
  will-change: opacity, transform;
}
@media (max-width: 768px) {
  .hero-phrases { bottom: 18%; }
  .hero-phrase { font-size: clamp(14px, 4.5vw, 28px); }
}

/* Fallback: если JS отключён или либы не загрузились */
.hero-morph[data-fallback="1"] {
  height: 100vh;
}
.hero-morph[data-fallback="1"] .hero-morph-stage {
  position: relative;
}
.hero-morph[data-fallback="1"] #aperture,
.hero-morph[data-fallback="1"] #lensTicks {
  display: none;
}

@media (max-width: 768px) {
  .hero-morph { height: 100vh; }
  .hero-morph-stage { position: relative; }
  .hero-morph-wrap { width: min(72vw, 360px); }
  .hero-morph-btns { margin-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-morph { height: 100vh; }
  .hero-morph-stage { position: relative; }
}

/* ══════════════════════════════════════
   E2 — Scroll Progress Bar
══════════════════════════════════════ */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: var(--accent, #C8A96E);
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 9999;
  pointer-events: none;
}

/* ══════════════════════════════════════
   E2 — Stats Bar
══════════════════════════════════════ */
.stats-bar {
  padding: 64px 0;
  background: linear-gradient(135deg, #0f0d09 0%, #1a1505 50%, #0f0d09 100%);
  border-top: 1px solid rgba(200,169,110,.1);
  border-bottom: 1px solid rgba(200,169,110,.1);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
.stat-item {
  padding: 24px 16px;
  position: relative;
}
.stat-item::after {
  content: '';
  position: absolute;
  right: 0; top: 20%; bottom: 20%;
  width: 1px;
  background: rgba(200,169,110,.15);
}
.stat-item:last-child::after { display: none; }
.stat-num {
  display: inline;
  font-family: var(--font-display, 'Cormorant Garamond', serif);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 600;
  color: var(--accent, #C8A96E);
  line-height: 1;
}
.stat-sfx {
  display: inline;
  font-family: var(--font-display, 'Cormorant Garamond', serif);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 400;
  color: var(--accent, #C8A96E);
  line-height: 1;
  opacity: .8;
}
.stat-label {
  display: block;
  margin-top: 8px;
  font-family: var(--font-body, 'Jost', sans-serif);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(240,237,232,.5);
}

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-item::after {
    right: auto; top: auto;
    left: 20%; right: 20%;
    bottom: 0; width: auto; height: 1px;
  }
  .stat-item:nth-child(2)::after,
  .stat-item:last-child::after { display: none; }
}

/* ══════════════════════════════════════
   E2 — Process Timeline Line
══════════════════════════════════════ */
.process-timeline {
  position: relative;
}
.process-line {
  position: absolute;
  top: 28px; left: 0; right: 0;
  height: 2px;
  background: rgba(200,169,110,.12);
  z-index: 0;
  border-radius: 2px;
  overflow: hidden;
}
.process-line-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent, #C8A96E), rgba(200,169,110,.4));
  transform-origin: left center;
  transform: scaleX(0);
  border-radius: 2px;
}
.process-step {
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  .process-line { display: none; }
}

/* ══════════════════════════════════════
   Portfolio real images
══════════════════════════════════════ */
.portfolio-item img {
  width: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.8s ease;
}
.portfolio-item.aspect-45 img { aspect-ratio: 4/5; }
.portfolio-item.aspect-11 img { aspect-ratio: 1/1; }
.portfolio-item.aspect-32 img { aspect-ratio: 3/2; }
.portfolio-item.aspect-916 img { aspect-ratio: 9/16; }
.portfolio-item:hover img { transform: scale(1.05); }

/* ══════════════════════════════════════
   E2 — Reviews Marquee
══════════════════════════════════════ */
.reviews-carousel {
  overflow: hidden;
}
.reviews-track {
  width: max-content;
  display: flex;
  gap: 24px;
  will-change: transform;
}
.reviews-track .review-card {
  flex-shrink: 0;
}
