:root {
  --bg: #0b0f17;
  --bg-elevated: #111827;
  --border: #1f2937;
  --accent: #22d3ee;
  --accent-2: #a78bfa;
}

* {
  scrollbar-color: #243044 var(--bg);
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  background-color: var(--bg);
  font-family: 'Inter', system-ui, sans-serif;
}

.font-display {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
}

/* ---------- Hero backdrop ---------- */

.hero-grid {
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 40%, transparent 85%);
}

.hero-glow {
  background: radial-gradient(closest-side, rgba(34, 211, 238, 0.35), transparent);
  filter: blur(60px);
}

.hero-glow-2 {
  background: radial-gradient(closest-side, rgba(167, 139, 250, 0.3), transparent);
  filter: blur(70px);
}

[data-parallax] {
  will-change: transform;
}

/* floating workflow nodes in hero */
.node-float {
  position: relative;
  z-index: 1;
  animation: node-float 6s ease-in-out infinite;
}
.node-float.delay-1 { animation-delay: 0.8s; }
.node-float.delay-2 { animation-delay: 1.6s; }
.node-float.delay-3 { animation-delay: 2.4s; }

@keyframes node-float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-14px); }
}

/* ---------- Hero flow lines (узлы соединены, как на канве Flow Forge) ----------
   Механика 1:1 с приложением (apps/web/src/components/edges/FlowEdge.tsx):
   базовая линия сплошная, поверх неё едет короткий яркий пунктирный сегмент
   (эффект «перетекания» данных между узлами во время выполнения). Пути
   считаются в JS по реальным координатам карточек (js/main.js), поэтому
   переживают любую ширину экрана без искажений. */
.hero-flow-svg {
  overflow: visible;
}
.hero-edge-base {
  fill: none;
  stroke: rgba(148, 163, 184, 0.28);
  stroke-width: 1.5;
}
.hero-edge-glow {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 14 92;
  animation: hero-light-flow 1.6s linear infinite;
}
@keyframes hero-light-flow {
  to { stroke-dashoffset: -106; }
}

/* Пульсирующее кольцо «выполняющегося» узла — то же по сути, что node-pulse
   в приложении (двойной box-shadow, растущий и опадающий). */
.node-pulse {
  animation: node-float 6s ease-in-out infinite, node-pulse-ring 2.4s ease-in-out infinite;
}
.node-pulse.delay-1 { animation-delay: 0.8s, 0.6s; }
.node-pulse.delay-2 { animation-delay: 1.6s, 0.6s; }
.node-pulse.delay-3 { animation-delay: 2.4s, 1.3s; }
@keyframes node-pulse-ring {
  0%, 60%, 100% {
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0), 0 0 0 4px rgba(34, 211, 238, 0);
  }
  15% {
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.7), 0 0 16px 2px rgba(34, 211, 238, 0.35);
  }
}

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Screenshot slider ---------- */

.slider-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}
.slider-slide {
  flex: 0 0 100%;
  max-width: 100%;
  position: relative;
  /* Фикс-пропорция держит высоту слайдера и без картинок (заглушки). */
  aspect-ratio: 16 / 10;
  background: #0d1220;
}

/* Реальный скриншот (img/screen-N.png) поверх заглушки; пока файла нет,
   onerror в index.html прячет <img>, и видна заглушка под ним. */
.slide-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 2px dashed #334155;
  border-radius: 1.5rem;
  margin: 1rem;
  color: #64748b;
}
.slide-placeholder-num {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  font-size: 3rem;
  font-weight: 700;
  color: #334155;
}
.slide-placeholder-file {
  font-family: monospace;
  font-size: 0.85rem;
  color: #94a3b8;
}
.slide-placeholder-size {
  font-size: 0.75rem;
}

.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #334155;
  transition: background 0.25s ease, width 0.25s ease;
}
.slider-dot[aria-current="true"] {
  background: var(--accent);
  width: 22px;
}

/* ---------- Integrations marquee ---------- */

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 26s linear infinite;
}
.marquee-track:hover,
.marquee-track:focus-within {
  animation-play-state: paused;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Accordion ---------- */

.accordion-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}
.accordion-panel > div {
  overflow: hidden;
}
.accordion-item[data-open="true"] .accordion-panel {
  grid-template-rows: 1fr;
}
.accordion-item[data-open="true"] .accordion-chevron {
  transform: rotate(180deg);
}
.accordion-chevron {
  transition: transform 0.25s ease;
}

/* ---------- Misc ---------- */

.gradient-text {
  background: linear-gradient(90deg, #22d3ee, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.card-hover {
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.card-hover:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 20px 40px -20px rgba(34, 211, 238, 0.25);
}

/* Тень под слайдером скриншотов — многослойная (контактная + мягкая
   элевация + едва заметный брендовый оттенок), а не плоское чёрное пятно
   от одного шаблонного shadow-2xl. */
.shot-shadow {
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.5),
    0 30px 60px -24px rgba(0, 0, 0, 0.6),
    0 14px 34px -16px rgba(34, 211, 238, 0.18);
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
