/* ================================================================
   CINEMA.CSS — Premium cinematic layer for IG Agency landing
   Стек: glassmorphism · glow · scroll-reveal · preloader · hero3d
   ================================================================ */

/* ============ PRELOADER ============ */
#preloader {
  position: fixed;
  inset: 0;
  background: #0E0E10;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#preloader.out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.pl-logo {
  font-family: 'Russo One', sans-serif;
  font-size: 32px;
  letter-spacing: 0.06em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
}
.pl-logo .pl-mark {
  width: 48px; height: 48px;
  background: #F16C4D;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  color: #0E0E10;
  animation: pl-pulse 1.2s ease-in-out infinite;
}
@keyframes pl-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(241,108,77,0.4); }
  50% { box-shadow: 0 0 0 14px rgba(241,108,77,0); }
}
.pl-bar {
  width: 160px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.pl-bar::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, #F16C4D, transparent);
  animation: pl-scan 0.9s ease-in-out infinite;
}
@keyframes pl-scan {
  to { left: 100%; }
}
.pl-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}

/* ============ HERO 3D CANVAS ============ */
#hero-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}
.hero {
  position: relative;
  overflow: hidden;
  /* Fallback gradient when WebGL unavailable */
  background: #0E0E10;
}
.hero::before,
.hero::after {
  z-index: 1; /* bump existing pseudo-elements above canvas */
}
.hero .wrap {
  position: relative;
  z-index: 2;
}
/* WebGL fallback: CSS radial glow */
.hero.no-webgl::before {
  content: '';
  position: absolute;
  top: -15%; right: -25%;
  width: 900px; height: 900px;
  background: radial-gradient(circle, rgba(241,108,77,0.18) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ============ HERO — GLASSMORPHISM SPEC SHEET ============ */
.spec-sheet {
  background: rgba(15, 15, 20, 0.65) !important;
  backdrop-filter: blur(24px) saturate(1.5) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.5) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  box-shadow:
    0 24px 60px rgba(0,0,0,0.5),
    0 0 0 1px rgba(241,108,77,0.12),
    inset 0 1px 0 rgba(255,255,255,0.06) !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.spec-sheet:hover {
  transform: translateY(-4px);
  box-shadow:
    0 32px 80px rgba(0,0,0,0.6),
    0 0 0 1px rgba(241,108,77,0.25),
    0 0 40px rgba(241,108,77,0.08),
    inset 0 1px 0 rgba(255,255,255,0.08) !important;
}

/* ============ STAT NUMBERS GLOW ============ */
.stat-num {
  text-shadow: 0 0 24px rgba(241,108,77,0.4);
  transition: text-shadow 0.3s ease;
}
.hero-stats > div:hover .stat-num {
  text-shadow: 0 0 40px rgba(241,108,77,0.7);
}
.trust-cell .big {
  text-shadow: 0 0 30px rgba(241,108,77,0.35);
}

/* ============ SCROLL REVEAL ============ */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}
/* Stagger delays */
.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.2s; }
.reveal-d3 { transition-delay: 0.3s; }
.reveal-d4 { transition-delay: 0.4s; }
.reveal-d5 { transition-delay: 0.5s; }
.reveal-d6 { transition-delay: 0.6s; }

/* ============ SECTION HEADER — ACCENT LINE ANIMATION ============ */
.section-num {
  position: relative;
  overflow: hidden;
}
.section-num::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible .section-num::after,
.section-header.visible .section-num::after {
  width: 100%;
}

/* ============ ENHANCED CARDS HOVER ============ */
.why-cell {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.why-cell:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.4), 0 0 0 1px rgba(241,108,77,0.2);
}
.pain-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.case-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}
.case-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 30px rgba(241,108,77,0.1);
}

/* ============ MAGNETIC BUTTONS ============ */
.btn-lead,
.btn-cta,
.offer-cta,
.stack-cta {
  position: relative;
  overflow: hidden;
}
.btn-lead::before,
.btn-cta::before,
.offer-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at var(--bx, 50%) var(--by, 50%),
    rgba(255,255,255,0.18) 0%,
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}
.btn-lead:hover::before,
.btn-cta:hover::before,
.offer-cta:hover::before {
  opacity: 1;
}
.btn-lead span,
.btn-lead > *:not(::before) {
  position: relative;
  z-index: 2;
}

/* ============ ANIMATED EYEBROW ============ */
.eyebrow {
  animation: eyebrow-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes eyebrow-in {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ============ HERO TITLE CINEMATIC ENTRANCE ============ */
.hero-left h1.hero-title {
  animation: title-in 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}
.hero-left .hero-sub {
  animation: title-in 1s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}
.hero-left .hero-cta-row {
  animation: title-in 1s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both;
}
.hero-left .hero-stats {
  animation: title-in 1s cubic-bezier(0.16, 1, 0.3, 1) 0.7s both;
}
.hero-right {
  animation: hero-right-in 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}
@keyframes title-in {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes hero-right-in {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============ GLOW ACCENT ELEMENTS ============ */
.brand-mark {
  box-shadow: 0 0 0 0 rgba(241,108,77,0.4);
  animation: brand-glow 3s ease-in-out infinite;
}
@keyframes brand-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(241,108,77,0); }
  50% { box-shadow: 0 0 20px 4px rgba(241,108,77,0.25); }
}

.section-num {
  animation: none; /* controlled by visibility */
}

/* Accent number display glow */
.cost-bigtotal .val,
.stack-final .value,
.offer-totals .row.final .val,
.slot-card .num {
  text-shadow: 0 0 32px rgba(241,108,77,0.5);
  animation: accent-breathe 3s ease-in-out infinite;
}
@keyframes accent-breathe {
  0%, 100% { text-shadow: 0 0 20px rgba(241,108,77,0.3); }
  50% { text-shadow: 0 0 40px rgba(241,108,77,0.6); }
}

/* ============ TIMELINE STEPS — cinematic reveal ============ */
.tl-step {
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.tl-step.reveal { transform: translateX(-20px); }
.tl-step.reveal.visible { transform: translateX(0); }

/* ============ GUARANTEE SECTION — glow left border ============ */
.guarantee::before {
  background: linear-gradient(180deg, #F16C4D 0%, rgba(241,108,77,0.4) 50%, #F16C4D 100%);
  animation: guarantee-border 3s ease-in-out infinite;
}
@keyframes guarantee-border {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ============ NICHE TAGS — scroll marquee feel ============ */
.niches-band {
  animation: none;
}
.niche-tag {
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.niche-tag:hover {
  transform: translateY(-2px);
  border-color: rgba(241,108,77,0.4);
  color: #F16C4D;
}

/* ============ BAR CHART — animated width on scroll ============ */
.bar-fill {
  width: 0 !important;
  transition: width 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}
.bar-chart.bar-animated .bar-fill {
  width: var(--bar-target) !important;
}

/* ============ COUNTER ANIMATION ============ */
.stat-num,
.trust-cell .big {
  transition: text-shadow 0.3s ease;
}

/* ============ CAREER TIMELINE DOTS — stagger ============ */
.career-pt.reveal { transform: translateY(20px); }
.career-pt.reveal.visible { transform: translateY(0); }

/* ============ FLOATING CARDS — parallax hint ============ */
.hero-right .spec-sheet {
  will-change: transform;
}

/* ============ SECTION LIGHT BG — subtle depth ============ */
.section-light {
  background: linear-gradient(180deg, #15151A 0%, #16161E 100%);
}

/* ============ FAQ — enhanced open state ============ */
.faq-item.open .faq-q {
  color: var(--accent);
}
.faq-q {
  transition: color 0.25s ease;
}
.faq-a {
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* ============ COMPARISON TABLE — highlight row on hover ============ */
.compare-row {
  transition: background 0.2s ease;
}
.compare-row:not(.head):hover {
  background: rgba(241,108,77,0.03);
}

/* ============ PROCESS STEP — active glow ============ */
.tl-step.active .tl-dot {
  box-shadow: 0 0 16px rgba(241,108,77,0.5);
}
.tl-step.active .tl-when {
  text-shadow: 0 0 20px rgba(241,108,77,0.4);
}

/* ============ FOOTER TIMES — live indicator pulse ============ */
.footer-times::before {
  animation: live-dot 2.5s ease-in-out infinite;
}
@keyframes live-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(76,175,80,0); opacity: 1; }
  50% { box-shadow: 0 0 8px 4px rgba(76,175,80,0.2); opacity: 0.8; }
}

/* ============ RAIL — subtle glow ============ */
.rail::before {
  box-shadow: 0 0 8px rgba(241,108,77,0.6);
  animation: rail-pulse 3s ease-in-out infinite;
}
@keyframes rail-pulse {
  0%, 100% { opacity: 1; height: 56px; }
  50% { opacity: 0.7; height: 72px; }
}

/* ============ METRIC STRIP — big number pop ============ */
.metric-strip .num {
  animation: num-glow 4s ease-in-out infinite;
}
@keyframes num-glow {
  0%, 100% { text-shadow: 0 0 20px rgba(241,108,77,0.3); }
  50% { text-shadow: 0 0 50px rgba(241,108,77,0.6), 0 0 100px rgba(241,108,77,0.2); }
}

/* ============ MODAL — cinematic open ============ */
.modal-overlay {
  transition: opacity 0.3s ease !important;
  opacity: 0;
}
.modal-overlay.open {
  display: flex !important;
  opacity: 1;
  animation: modal-fade 0.3s ease forwards;
}
@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-overlay.open .modal,
.modal-overlay.open .modal-card {
  animation: modal-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============ HERO PHOTO WRAP — glow ============ */
.hero-photo-wrap {
  box-shadow:
    0 20px 60px rgba(0,0,0,0.5),
    0 0 0 1px rgba(241,108,77,0.15),
    0 0 40px rgba(241,108,77,0.05);
  transition: box-shadow 0.4s ease;
}
.hero-photo-wrap:hover {
  box-shadow:
    0 28px 80px rgba(0,0,0,0.6),
    0 0 0 1px rgba(241,108,77,0.3),
    0 0 60px rgba(241,108,77,0.1);
}

/* ============ STICKY CTA — glass ============ */
.sticky-cta {
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  background: rgba(10,10,14,0.88) !important;
  border-top: 1px solid rgba(255,255,255,0.06) !important;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
}

/* ============ REDUCED MOTION OVERRIDES ============ */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-left,
  .reveal-right,
  .hero-left h1.hero-title,
  .hero-left .hero-sub,
  .hero-left .hero-cta-row,
  .hero-left .hero-stats,
  .hero-right,
  .eyebrow {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .brand-mark,
  .stat-num,
  .trust-cell .big,
  .cost-bigtotal .val,
  .stack-final .value,
  .offer-totals .row.final .val,
  .slot-card .num,
  .metric-strip .num,
  .guarantee::before,
  .rail::before,
  .footer-times::before {
    animation: none !important;
  }
  #hero-canvas { display: none !important; }
  .bar-fill {
    width: var(--bar-target) !important;
    transition: none !important;
  }
}

/* ============ MOBILE CANVAS — disable heavy scene ============ */
@media (max-width: 768px) {
  #hero-canvas {
    opacity: 0.6;
  }
  .spec-sheet {
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
  }
}
