/* RubiLab — Custom styles & scroll reveal */

html {
  scroll-behavior: smooth;
}

/* --- Dynamic background blobs (меняются от продукта) --- */
#bg-blob-1,
#bg-blob-2 {
  transition: background 1s ease, transform 1s ease, opacity 1s ease;
}

/* По умолчанию (hero) */
#bg-blob-1 { background: rgba(193, 18, 61, 0.2); top: 25%; left: -8rem; }
#bg-blob-2 { background: rgba(25, 211, 197, 0.15); bottom: 25%; right: -8rem; }

/* IT — ruby акцент */
body[data-active-product="it"] #bg-blob-1 {
  background: rgba(193, 18, 61, 0.35);
  top: 20%; left: -4rem;
  transform: scale(1.1);
}
body[data-active-product="it"] #bg-blob-2 {
  background: rgba(193, 18, 61, 0.12);
  bottom: 30%; right: -12rem;
}

/* ЭТП — turquoise акцент */
body[data-active-product="etp"] #bg-blob-1 {
  background: rgba(25, 211, 197, 0.2);
  top: 15%; left: -6rem;
}
body[data-active-product="etp"] #bg-blob-2 {
  background: rgba(25, 211, 197, 0.25);
  bottom: 20%; right: -4rem;
  transform: scale(1.15);
}

/* RubiDesk — микс ruby + turq */
body[data-active-product="rubidesk"] #bg-blob-1 {
  background: rgba(193, 18, 61, 0.2);
  top: 30%; left: 10%;
}
body[data-active-product="rubidesk"] #bg-blob-2 {
  background: rgba(25, 211, 197, 0.22);
  bottom: 25%; right: 10%;
  transform: scale(1.05);
}

/* Торговая биржа — ruby акцент */
body[data-active-product="exchange"] #bg-blob-1 {
  background: rgba(193, 18, 61, 0.3);
  top: 25%; left: -2rem;
  transform: scale(1.08);
}
body[data-active-product="exchange"] #bg-blob-2 {
  background: rgba(25, 211, 197, 0.15);
  bottom: 20%; right: -6rem;
}

/* --- Hero background (headerBackgroundLoop.gif) --- */
.hero-bg {
  position: absolute;
  inset: 0;
  background: url(/img/headerBackgroundLoop.gif) center center / cover no-repeat;
  opacity: 0.4;
  transition: opacity 1.2s ease;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(11, 16, 32, 0.85) 0%,
    rgba(11, 16, 32, 0.55) 40%,
    rgba(11, 16, 32, 0.8) 70%,
    #0B1020 100%
  );
  transition: opacity 1s ease;
}

.hero-section:hover .hero-bg {
  opacity: 0.5;
}

/* Плавный переход hero → products: при скролле GIF затухает */
.hero-section.hero-scrolled .hero-bg {
  opacity: 0;
}

/* --- Product cards --- */
.product-card {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 1.5rem;
  transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
}

.product-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* --- Reveal animations (красивый выезд при скролле) --- */
.reveal,
.reveal-left,
.reveal-right,
.reveal-up {
  opacity: 0;
  transform: translateY(50px) scale(0.97);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left {
  transform: translateX(-80px) scale(0.97);
}

.reveal-right {
  transform: translateX(80px) scale(0.97);
}

.reveal-up {
  transform: translateY(50px) scale(0.97);
}

/* Revealed state */
.reveal.revealed,
.reveal-left.revealed,
.reveal-right.revealed,
.reveal-up.revealed {
  opacity: 1;
  transform: translate(0) scale(1);
}

.reveal.revealed { transform: translateY(0) scale(1); }
.reveal-left.revealed { transform: translateX(0) scale(1); }
.reveal-right.revealed { transform: translateX(0) scale(1); }
.reveal-up.revealed { transform: translateY(0) scale(1); }

/* Stagger — задержка по индексу */
.reveal[style*="--i"],
.reveal-left[style*="--i"],
.reveal-right[style*="--i"],
.reveal-up[style*="--i"] {
  transition-delay: calc(var(--i, 0) * 0.12s);
}

/* Product cards — дополнительная выразительность */
.product-card.reveal-left.revealed,
.product-card.reveal-up.revealed,
.product-card.reveal-right.revealed {
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.3s, box-shadow 0.3s;
}

/* --- Buttons --- */
.btn-primary {
  background: linear-gradient(135deg, #C1123D 0%, #a00e33 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.btn-primary:hover {
  box-shadow: 0 0 24px rgba(193, 18, 61, 0.5);
  transform: translateY(-1px);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-secondary {
  color: #fff;
  transition: color 0.2s, border-color 0.2s;
}

.btn-secondary:hover {
  color: #19D3C5;
}

/* --- Cards (glass) --- */
.card-feature,
.card-case,
.card-testimonial,
.card-glass {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 1.5rem;
  transition: background 0.3s, border-color 0.3s, transform 0.2s, box-shadow 0.3s;
}

.card-feature:hover,
.card-case:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(25, 211, 197, 0.4);
  box-shadow: 0 0 20px rgba(25, 211, 197, 0.1);
  transform: translateY(-2px);
}

.card-testimonial {
  padding: 1.75rem;
}

.card-glass {
  padding: 2rem;
}

/* --- Logo placeholders --- */
.logo-placeholder {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.4);
  padding: 0.5rem 1rem;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  min-width: 100px;
  text-align: center;
}

/* --- Timeline (How it works) --- */
.timeline-line {
  position: absolute;
  left: 23px;
  top: 48px;
  bottom: 48px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    rgba(193, 18, 61, 0.5),
    rgba(25, 211, 197, 0.5)
  );
  transform-origin: top;
  transform: scaleY(0);
  transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.timeline-line.revealed {
  transform: scaleY(1);
}

/* --- Product sections (полноэкранные секции направлений) --- */
.product-section {
  transition: opacity 0.6s ease;
}

.product-section__badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 1rem;
}

.product-section__badge--ruby {
  background: rgba(193, 18, 61, 0.25);
  color: #e8456e;
}

.product-section__badge--turq {
  background: rgba(25, 211, 197, 0.2);
  color: #19D3C5;
}

.product-section__scroll-hint {
  display: inline-block;
  margin-top: 2rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
  transition: color 0.3s, transform 0.3s;
}

.product-section__scroll-hint:hover {
  color: #19D3C5;
  transform: translateY(4px);
}

/* Параллакс-подсветка при скролле */
.product-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 50% at 50% 50%,
    rgba(255, 255, 255, 0.02) 0%,
    transparent 70%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.product-section.in-view::before {
  opacity: 1;
}

/* --- Mobile: show hamburger hint or inline nav --- */
@media (max-width: 768px) {
  .logo-placeholder {
    min-width: 80px;
    font-size: 0.75rem;
  }
}
