/* ==========================================================================
   SCROLLYTELLING & PARALLAX ENGINE STYLES (NO-COLLISION CLEAN ARCHITECTURE)
   Специфические стили кинематографического скролл-параллакса
   ========================================================================== */

.scrolly-section {
  position: relative;
  /* Desktop scenes; compact devices get a single introductory panel. */
  height: 350vh;
  background-color: #080B10;
}

/* Фиксированный вьюпорт */
.scrolly-sticky-viewport {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 75px; /* Защитный отступ от фиксированной шапки */
}

/* Стек фоновых картинок */
.scrolly-bg-stack {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.scrolly-bg-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.06);
  transition: opacity 0.7s cubic-bezier(0.25, 1, 0.5, 1),
              transform 1s cubic-bezier(0.25, 1, 0.5, 1),
              visibility 0.7s;
}

.scrolly-bg-slide.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.scrolly-bg-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Атмосферный темный градиент */
.scrolly-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(circle at 65% 45%, rgba(8, 11, 16, 0.4) 0%, rgba(8, 11, 16, 0.88) 85%),
              linear-gradient(180deg, rgba(8, 11, 16, 0.85) 0%, transparent 25%, rgba(8, 11, 16, 0.95) 100%);
  pointer-events: none;
}

/* Пространственная фоновая типографика (Dimensional Layering) */
.scrolly-dimensional-type {
  position: absolute;
  top: 18%;
  left: 2%;
  font-size: clamp(3rem, 7.5vw, 7rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: rgba(255, 255, 255, 0.04);
  text-transform: uppercase;
  pointer-events: none;
  z-index: 2;
  line-height: 0.92;
  white-space: nowrap;
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Индустриальная микро-атмосфера */
.scrolly-atmosphere {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background-image: radial-gradient(1.5px 1.5px at 25% 35%, rgba(255, 255, 255, 0.2), transparent),
                    radial-gradient(1px 1px at 70% 65%, rgba(255, 255, 255, 0.18), transparent),
                    radial-gradient(1.5px 1.5px at 85% 25%, rgba(245, 158, 11, 0.25), transparent),
                    radial-gradient(1.5px 1.5px at 45% 80%, rgba(255, 255, 255, 0.15), transparent);
  opacity: 0.7;
}

/* ==========================================================================
   Инженерный нижний статус-бар (БЕЗ наложения на шапку)
   ========================================================================== */
.hud-telemetry-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 3;
  pointer-events: none;
}

.hud-bottom-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 32px;
  background: linear-gradient(180deg, transparent 0%, rgba(8, 11, 16, 0.9) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: var(--text-dark);
}

.hud-bottom-strip .hud-live-coords {
  color: var(--accent-amber);
  font-weight: 700;
}

.hud-bottom-strip .hud-status {
  color: var(--accent-cyan);
}

/* ==========================================================================
   Контентные карточки скролла (Левая колонка, исключающая наложение)
   ========================================================================== */
.scrolly-content-container {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 1280px;
  padding: 0 24px;
  height: calc(100vh - 90px);
  display: flex;
  align-items: center;
}

.scrolly-slide-card {
  position: absolute;
  left: 24px;
  max-width: 580px;
  width: calc(100% - 48px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(30px);
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.45s;
  pointer-events: none;
}

.scrolly-slide-card.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* ==========================================================================
   Hero Stage Layout (Dual-Wing Architecture)
   ========================================================================== */
.scrolly-slide-card.scrolly-slide-hero {
  max-width: 1220px;
  width: calc(100% - 48px);
}

.hero-stage-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: stretch;
  width: 100%;
}

.hero-main-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Инженерно-диспетчерский пульт завода */
.hero-telemetry-console {
  background: rgba(10, 14, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: 18px;
  padding: 24px 26px;
  box-shadow: 0 25px 50px -10px rgba(0, 0, 0, 0.85),
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
  position: relative;
  overflow: hidden;
}

.hero-telemetry-console::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 70%);
  pointer-events: none;
}

.telemetry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.telemetry-live-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #10b981;
  text-transform: uppercase;
}

.telemetry-beacon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: beaconPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes beaconPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

.telemetry-clock-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.telemetry-tz {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.telemetry-subhead {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}

.telemetry-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.telemetry-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.telemetry-card:hover, .telemetry-card:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-amber);
  transform: translateY(-2px);
  outline: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.t-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.t-card-num {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent-amber);
}

.t-card-tag {
  font-size: 0.64rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.t-card-tag.cyan {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}

.t-card-arrow {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.telemetry-card:hover .t-card-arrow {
  transform: translate(2px, -2px);
  color: var(--accent-amber);
}

.t-card-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 3px;
  line-height: 1.25;
}

.t-card-detail {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.telemetry-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.t-foot-sep {
  color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Hero Ticker Bar
   ========================================================================== */
.hero-ticker-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 38px;
  background: rgba(6, 9, 13, 0.94);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  z-index: 6;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.hero-ticker-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: 20px;
  animation: tickerScroll 40s linear infinite;
  will-change: transform;
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ticker-badge {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.6px;
}

.ticker-sep {
  color: rgba(255, 255, 255, 0.2);
  font-weight: 300;
}

.scrolly-glass-panel {
  background: rgba(10, 14, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 18px;
  padding: 34px 36px;
  box-shadow: 0 25px 50px -10px rgba(0, 0, 0, 0.85),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.scrolly-glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #FFFFFF, #64748B);
}

.slide-number-indicator {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent-amber);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.slide-number-indicator::after {
  content: '';
  height: 1px;
  width: 28px;
  background: var(--accent-amber);
  opacity: 0.5;
}

.slide-heading {
  font-size: 2.35rem;
  font-weight: 900;
  line-height: 1.18;
  margin-bottom: 14px;
  letter-spacing: -0.5px;
}

.slide-heading span.highlight {
  color: var(--accent-amber);
  text-shadow: 0 0 25px rgba(255, 255, 255, 0.35);
}

.slide-heading span.cyan {
  color: var(--accent-cyan);
  text-shadow: 0 0 20px rgba(203, 213, 225, 0.25);
}

.slide-description {
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 22px;
}

.slide-meta-row {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.meta-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.meta-chip .chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-amber);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.meta-chip.cyan .chip-dot {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(203, 213, 225, 0.5);
}

.slide-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Компактный боковой трекер глав (Ультратонкий pill + плавающие тултипы слева)
   ========================================================================== */
.scrolly-nav-tracker {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: rgba(11, 16, 25, 0.75);
  backdrop-filter: blur(12px);
  padding: 12px 6px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  width: 44px;
}

.nav-dot-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
}

.nav-dot-circle {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  transition: transform .25s ease, background-color .25s ease;
}

.nav-dot-label {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: rgba(11, 16, 25, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: transform .2s ease, opacity .2s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

.nav-dot-item:hover .nav-dot-label,
.nav-dot-item.active .nav-dot-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
  color: var(--accent-amber);
  border-color: rgba(255, 255, 255, 0.35);
}

.nav-dot-item.active .nav-dot-circle {
  background: var(--accent-amber);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
  transform: scale(1.4);
}

/* Подсказка скролла */
.scroll-hint-indicator {
  position: absolute;
  bottom: 45px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
}

.scroll-hint-mouse {
  width: 20px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  position: relative;
}

.scroll-hint-mouse::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 6px;
  background: var(--accent-amber);
  border-radius: 2px;
  animation: wheelScroll 1.8s infinite;
}

@keyframes wheelScroll {
  0% { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, 12px); opacity: 0; }
}

@keyframes bounceSlow {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

/* ==========================================================================
   Адаптивность (Responsive)
   ========================================================================== */
@media (max-width: 1024px) {
  .scrolly-slide-card {
    max-width: 500px;
  }
  .scrolly-slide-card.scrolly-slide-hero {
    max-width: 600px;
  }
  .hero-stage-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .hero-telemetry-console {
    padding: 20px;
  }
  .slide-heading {
    font-size: 2rem;
  }
  .nav-dot-label {
    display: none;
  }
}

@media (max-width: 768px) {
  .scrolly-sticky-viewport {
    padding-top: 60px;
  }
  .scrolly-slide-card {
    left: 16px;
    width: calc(100% - 32px);
  }
  .scrolly-glass-panel {
    padding: 24px 20px;
  }
  .hero-ticker-bar {
    display: none;
  }
  .telemetry-cards-grid {
    grid-template-columns: 1fr;
  }
  .slide-heading {
    font-size: 1.65rem;
  }
  .slide-description {
    font-size: 0.9rem;
  }
  .hud-bottom-strip {
    display: none;
  }
  .scrolly-nav-tracker {
    display: none;
  }
}

/* ==========================================================================
   3D Cursor Tracking & Dimensional Tilt Engine
   ========================================================================== */
.scrolly-sticky-viewport {
  perspective: 1200px;
}

.scrolly-content-container {
  perspective: 1200px;
}

.hero-main-panel,
.hero-telemetry-console,
.scrolly-glass-panel,
.telemetry-card,
.category-tile,
.product-card,
.case-card,
.galv-simulator-card {
  transform-style: preserve-3d;
  will-change: transform;
}

.telemetry-card {
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.category-tile,
.product-card,
.case-card,
.galv-simulator-card {
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.scrolly-glass-panel { backdrop-filter: none; -webkit-backdrop-filter: none; }
@media (max-width: 768px), (max-height: 600px), (prefers-reduced-motion: reduce) {
  .scrolly-section { height: auto; padding: 100px 0 60px; }
  .scrolly-sticky-viewport { position: relative; height: auto; min-height: auto; padding: 0; }
  .scrolly-content-container { height: auto; padding: 0 16px; display: flex; flex-direction: column; gap: 24px; }
  .scrolly-slide-card { display: block; position: relative; left: auto; width: 100%; max-width: 620px; opacity: 1; visibility: visible; transform: none; pointer-events: auto; margin: 0 auto; }
  .scrolly-bg-stack { position: fixed; inset: 0; z-index: 0; opacity: 0.28; }
  .scrolly-bg-slide { display: none; }
  .scrolly-bg-slide.active, .scrolly-bg-slide:first-child { display: block; opacity: 1; visibility: visible; transform: none; }
  .scrolly-nav-tracker { display: none !important; }
  .scrolly-glass-panel { padding: 26px 20px; }
  .slide-heading { font-size: clamp(1.5rem, 5.5vw, 2rem); }
  .slide-meta-row { gap: 8px; margin-bottom: 20px; }
  .meta-chip { white-space: normal; font-size: .76rem; padding: 6px 9px; }
  .slide-buttons { align-items: stretch; }
  .slide-buttons .btn { flex: 1 1 180px; }
  .scrolly-dimensional-type { display: none; }
}

/* Long Russian names and calls to action must fit 320px screens. */
.btn { max-width: 100%; min-width: 0; overflow-wrap: anywhere; }
.slide-heading, .section-title, .product-card-title { overflow-wrap: anywhere; }
@media (max-width: 360px) {
  .scrolly-glass-panel { padding: 24px 16px; }
  .slide-heading { font-size: 1.4rem; }
}
