/* =====================================================
   Impulse · Detail effects (osmo-style)
   Магнитные кнопки, shine, specular cursor, parallax
   ===================================================== */

/* ---------- Buttons: shine sweep + magnetic offset ---------- */
.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* Магнитное смещение задаём через CSS-переменные из JS */
  transform: translate3d(var(--mag-x, 0px), var(--mag-y, 0px), 0);
  transition: transform .35s cubic-bezier(.2,.7,.3,1.4),
              box-shadow .25s ease,
              background .2s ease,
              color .2s ease,
              border-color .2s ease;
  will-change: transform;
}

/* Sweep highlight */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255,255,255,.28) 48%,
    rgba(255,255,255,.55) 50%,
    rgba(255,255,255,.28) 52%,
    transparent 70%
  );
  transform: translateX(-110%);
  transition: transform .9s cubic-bezier(.2,.7,.2,1);
  pointer-events: none;
  z-index: -1;
  mix-blend-mode: overlay;
}
.btn:hover::before { transform: translateX(110%); }

/* Subtle darker glow ring on press */
.btn:active {
  transform: translate3d(var(--mag-x, 0px), calc(var(--mag-y, 0px) + 1px), 0) scale(.99);
}

/* Arrow slide */
.btn .arr {
  display: inline-block;
  transition: transform .35s cubic-bezier(.2,.7,.3,1.4);
}
.btn:hover .arr { transform: translateX(7px); }

/* Secondary button: animated border instead of fill */
.btn-secondary {
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(120deg, var(--line) 30%, var(--blue) 50%, var(--line) 70%) border-box;
  background-size: 100% 100%, 250% 100%;
  background-position: 0 0, -100% 0;
  border-color: transparent !important;
  transition: background-position .8s cubic-bezier(.2,.7,.2,1),
              color .2s ease,
              transform .35s cubic-bezier(.2,.7,.3,1.4),
              box-shadow .25s ease;
}
.btn-secondary:hover {
  background-position: 0 0, 100% 0;
  color: var(--blue);
}

/* Form submit button (final-cta-form button) gets the same treatment */
.final-cta-form button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: background .2s ease, transform .35s cubic-bezier(.2,.7,.3,1.4);
}
.final-cta-form button::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  transform: translateX(-110%);
  transition: transform .9s cubic-bezier(.2,.7,.2,1);
  z-index: -1;
  pointer-events: none;
}
.final-cta-form button:hover::before { transform: translateX(110%); }

/* ---------- Platform screenshots: lift + specular cursor ---------- */
.pf-shot {
  transition:
    transform .55s cubic-bezier(.2,.7,.2,1),
    box-shadow .55s cubic-bezier(.2,.7,.2,1),
    border-color .3s ease;
  will-change: transform;
  /* Cursor position for specular highlight */
  --mx: 50%;
  --my: 50%;
}
.pf-shot::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle 240px at var(--mx) var(--my),
      rgba(255,255,255,.22),
      transparent 55%);
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
  mix-blend-mode: overlay;
  z-index: 2;
}
.pf-shot:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 60px -20px rgba(15,23,38,.22),
              0 12px 30px -12px rgba(45,116,242,.18);
  border-color: rgba(45,116,242,.18);
}
.pf-shot:hover::after { opacity: 1; }

.pf-shot img {
  transition: transform 1.2s cubic-bezier(.2,.7,.2,1), filter .6s ease;
  will-change: transform;
}
.pf-shot:hover img {
  transform: scale(1.035);
  filter: saturate(1.05) contrast(1.02);
}

/* Chrome dots wake up on hover — colourful, traffic-light style */
.pf-shot .chrome::before,
.pf-shot .chrome::after,
.pf-shot .chrome i {
  transition: background .3s ease, transform .3s ease;
}
.pf-shot:hover .chrome::before {
  background: #FF5F57; /* red */
  transform: scale(1.1);
}
.pf-shot:hover .chrome i {
  background: #FEBC2E; /* amber */
  transform: scale(1.1);
  transition-delay: .05s;
}
.pf-shot:hover .chrome::after {
  background: #28C840; /* green */
  transform: scale(1.1);
  transition-delay: .1s;
}

/* Label pill micro-interaction */
.pf-shot .label-pill {
  transition: transform .4s cubic-bezier(.2,.7,.3,1.4), box-shadow .3s;
}
.pf-shot:hover .label-pill {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15,23,38,.14);
}

/* ---------- Hero accents ---------- */
/* Underline now has shimmering moving gradient */
@keyframes shimmer-bg {
  0% { background-position: 250% 0; }
  100% { background-position: -150% 0; }
}
.hero h1 .underline::after {
  background: linear-gradient(
    90deg,
    var(--teal-soft) 0%,
    var(--blue-soft) 35%,
    var(--teal) 50%,
    var(--blue-soft) 65%,
    var(--teal-soft) 100%
  );
  background-size: 200% 100%;
  animation: shimmer-bg 6s linear infinite;
  border-radius: 4px;
}

/* Big number on hero card — subtle text shimmer */
.hero-card .big {
  background: linear-gradient(
    100deg,
    #fff 0%,
    #fff 30%,
    var(--teal-soft) 50%,
    #fff 70%,
    #fff 100%
  );
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shimmer-bg 7s linear infinite;
}
.hero-card .big small {
  -webkit-text-fill-color: var(--ink-muted);
  background: none;
}

/* Pulsing accent ring on the hero glow */
@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: .75; }
}
.hero-card .glow {
  animation: pulse-glow 6s ease-in-out infinite;
}

/* ---------- Cards (problem, principle, mentor, case, step, stats) ---------- */
.problem, .principle, .mentor, .case-card, .step, .stats .cell {
  transition: transform .35s cubic-bezier(.2,.7,.2,1),
              border-color .25s ease,
              box-shadow .35s ease;
}
.problem:hover, .case-card:hover {
  box-shadow: 0 16px 40px -20px rgba(15,23,38,.18);
}
.mentor:hover {
  border-color: var(--blue-soft);
  transform: translateY(-3px);
}

/* Hover state for individual principle tile */
.principle {
  position: relative;
  overflow: hidden;
}
.principle::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
  transform: translateX(-100%);
  transition: transform .8s cubic-bezier(.2,.7,.2,1);
}
.principle:hover::after { transform: translateX(100%); }

/* ---------- Numerical counters ---------- */
[data-count] {
  font-variant-numeric: tabular-nums;
  display: inline-block;
}

/* ---------- Marquee (chip strip under platform block) ---------- */
.marquee-wrap {
  position: relative;
  overflow: hidden;
  margin-top: 36px;
  padding: 12px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}
.marquee-track {
  display: flex;
  gap: 14px;
  width: max-content;
  animation: marquee 38s linear infinite;
}
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee-chip {
  flex: 0 0 auto;
  padding: 10px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--ink-3);
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
}
.marquee-chip::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
}
.marquee-chip.accent {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.marquee-chip.accent::before { background: var(--teal-soft); }

/* ---------- Section reveal — staggered fade ---------- */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1);
}
.reveal-stagger.in > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.in > *:nth-child(2) { transition-delay: .06s; }
.reveal-stagger.in > *:nth-child(3) { transition-delay: .12s; }
.reveal-stagger.in > *:nth-child(4) { transition-delay: .18s; }
.reveal-stagger.in > *:nth-child(5) { transition-delay: .24s; }
.reveal-stagger.in > *:nth-child(6) { transition-delay: .3s; }
.reveal-stagger.in > * {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Final CTA: rotating glow ---------- */
@keyframes rotate-glow {
  to { transform: rotate(1turn); }
}
.final-cta::before {
  animation: rotate-glow 24s linear infinite;
  transform-origin: 60% 60%;
}

/* ---------- Eyebrow dot — slightly enhanced ---------- */
.eyebrow .dot {
  animation: pulse-dot 2.4s ease-in-out infinite, dot-shift 8s ease-in-out infinite;
}
@keyframes dot-shift {
  0%, 100% { background: var(--teal); }
  50% { background: var(--blue); box-shadow: 0 0 0 4px rgba(45,116,242,.18); }
}

/* ---------- Respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    transition-duration: .001s !important;
  }
  .marquee-track { animation: none; }
}
