/* ════════════════════════════════════════════════════════════════
   v6 — POLISH PASS
   • re-enables scroll reveals (keyframe-based, no transition conflict)
   • staggered hero load-in
   • animated aurora + breathing monogram
   • refined micro-interactions (nav underline, tag draw, dots)
   Layered last; only adds / overrides for motion + finish.
   ════════════════════════════════════════════════════════════════ */

/* ────────────────────────────────────────────────────────────────
   1 · SCROLL REVEALS — back to life
   The old rule killed these (opacity:1 / transform:none) because a
   transition-based reveal fought the card hover transitions and the
   grain layer. We use a one-shot keyframe instead: it animates
   transform only DURING playback (no fill-forward), so once it ends
   the element returns to its natural transform and hover lifts work.
   ──────────────────────────────────────────────────────────────── */
/* Scroll reveal — one-shot keyframe (no fill-forward so card hover lifts work) */
.reveal { opacity: 0; }
.reveal.in {
  opacity: 1;
  animation: ddc-rise 0.75s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
@keyframes ddc-rise {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.in {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}

/* ────────────────────────────────────────────────────────────────
   2 · HERO LOAD-IN
   The hero is above the fold so its reveals fire on mount — we make
   that entrance feel choreographed: monogram fades up behind, the
   terminal slides in from the right, badge/headline/desc/cta rise.
   ──────────────────────────────────────────────────────────────── */

/* Terminal: slide in from the right + settle, then idle float */
.hero-side.reveal.in,
.hero-side .reveal.in {
  opacity: 1;
  transform: none;
  animation: lt-enter 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes lt-enter {
  from { opacity: 0; transform: translateX(48px) scale(.96); }
  to   { opacity: 1; transform: translateX(0)    scale(1);   }
}
.lt-shell {
  animation: lt-float 9s ease-in-out 1.2s infinite;
}
@keyframes lt-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* Monogram: fade up on load + slow breathing drift */
.hero-monogram {
  animation: mono-in 1.6s var(--ease-out-expo) both, mono-drift 16s ease-in-out 1.6s infinite;
}
@keyframes mono-in {
  from { opacity: 0; transform: translate(-50%, -42%) scale(1.06); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes mono-drift {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -53%) scale(1.015); }
}

/* ────────────────────────────────────────────────────────────────
   3 · AURORA — soft drifting glow behind the hero
   Painted onto .hero-gradient (already a full-width bottom layer).
   Two large radial blooms slowly orbit; pure GPU transform.
   ──────────────────────────────────────────────────────────────── */
.hero-gradient {
  height: 100%; top: 0; bottom: auto;
  background:
    radial-gradient(46% 38% at 22% 30%, rgba(42,186,171,0.16), transparent 70%),
    radial-gradient(40% 36% at 80% 24%, rgba(255,187,52,0.07), transparent 70%),
    var(--grad-hero-fade);
  background-repeat: no-repeat;
  animation: aurora 18s ease-in-out infinite alternate;
  will-change: background-position, opacity;
}
@keyframes aurora {
  0%   { background-position: 0% 0%, 0% 0%, 0 0; opacity: .9; }
  50%  { background-position: 8% 6%, -6% 4%, 0 0; opacity: 1; }
  100% { background-position: -4% 8%, 6% -4%, 0 0; opacity: .85; }
}

/* ────────────────────────────────────────────────────────────────
   4 · NAV — animated active underline + hover sweep
   ──────────────────────────────────────────────────────────────── */
.nav-link { position: relative; }
.nav-link::after {
  content: '';
  position: absolute; left: 15px; right: 15px; bottom: 4px; height: 1.5px;
  background: linear-gradient(90deg, var(--ddc-teal), #5FE3D2);
  border-radius: 2px;
  transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease-out-expo);
}
.nav-link:hover::after { transform: scaleX(.5); transform-origin: left; }
.nav-link.active::after { transform: scaleX(1); }

/* ────────────────────────────────────────────────────────────────
   5 · SECTION TAG — the little leading line draws itself in
   ──────────────────────────────────────────────────────────────── */
.reveal.in .section-tag::before,
.in-view .section-tag::before,
.reveal.in .section-tag::after,
.in-view .section-tag::after {
  animation: tag-draw 0.7s var(--ease-out-expo) 0.15s both;
}
@keyframes tag-draw {
  from { width: 0; opacity: 0; }
  to   { width: 28px; opacity: 1; }
}

/* ────────────────────────────────────────────────────────────────
   6 · SERVICE CARDS — gentle entrance scale + brighter icon pop
   The card icon gets a subtle hover spring (handled by transform on
   :hover; transition kept short so it stays snappy).
   ──────────────────────────────────────────────────────────────── */
.service-card .card-icon {
  transition: background var(--dur), box-shadow var(--dur), transform .45s var(--ease-out-expo);
}
.service-card:hover .card-icon {
  transform: translateY(-2px) rotate(-3deg) scale(1.06);
}

/* arrow in "Подробнее" nudges further on hover */
.card-more svg { transition: transform .35s var(--ease-out-expo); }
.service-card:hover .card-more svg { transform: translateX(4px); }

/* ────────────────────────────────────────────────────────────────
   7 · KPI — value lifts + glows when the strip enters view
   ──────────────────────────────────────────────────────────────── */
.kpi-item .kpi-value {
  transition: text-shadow .6s var(--ease-out-expo), transform .6s var(--ease-out-expo);
}
.kpi-item:hover .kpi-value {
  text-shadow: 0 0 60px rgba(42,186,171,0.6);
  transform: translateY(-2px);
}

/* ────────────────────────────────────────────────────────────────
   8 · TIMELINE — rail draws downward, dots pop with a ring
   ──────────────────────────────────────────────────────────────── */
.timeline-section.in-view .timeline-rail {
  animation: rail-draw 1.4s var(--ease-out-expo) both;
  transform-origin: top;
}
@keyframes rail-draw {
  from { transform: translateX(-50%) scaleY(0); }
  to   { transform: translateX(-50%) scaleY(1); }
}
.tl-dot::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 1px solid rgba(42,186,171,0.5);
  animation: tl-ring 3s ease-out infinite;
}
@keyframes tl-ring {
  0%   { transform: scale(.6); opacity: .8; }
  70%  { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ────────────────────────────────────────────────────────────────
   9 · NEWS — featured image breathes its inner glow
   ──────────────────────────────────────────────────────────────── */
.news-media-img { animation: none; }
@keyframes news-glow {
  0%   { opacity: .7;  transform: scale(1); }
  100% { opacity: 1;   transform: scale(1.04); }
}

/* ────────────────────────────────────────────────────────────────
   10 · BUTTONS — primary gets a soft idle pulse-ring on the hero
   ──────────────────────────────────────────────────────────────── */
.hero-cta .btn-primary { position: relative; }
.hero-cta .btn-primary::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(42,186,171,0.45);
  animation: btn-pulse 3.4s ease-out infinite;
  pointer-events: none;
}
@keyframes btn-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(42,186,171,0.40); }
  70%  { box-shadow: 0 0 0 16px rgba(42,186,171,0); }
  100% { box-shadow: 0 0 0 0 rgba(42,186,171,0); }
}

/* ────────────────────────────────────────────────────────────────
   11 · FLOATING NAV — active pip gets a soft halo ring
   ──────────────────────────────────────────────────────────────── */
.fn-dot.active .fn-pip::after {
  content: ''; position: absolute; inset: -5px; border-radius: 50%;
  border: 1px solid rgba(42,186,171,0.6);
  animation: tl-ring 2.6s ease-out infinite;
}
.fn-pip { position: relative; }

/* ────────────────────────────────────────────────────────────────
   12 · SCROLLBAR + selection finish
   ──────────────────────────────────────────────────────────────── */
::selection { background: rgba(42,186,171,0.32); color: #fff; }

/* ────────────────────────────────────────────────────────────────
   13 · REDUCED MOTION — disable all decorative animations
   ──────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hero-monogram,
  .lt-shell,
  .hero-side .reveal.in,
  .hero-gradient,
  .hero-cta .btn-primary::before,
  .fn-dot.active .fn-pip::after,
  .reveal,
  .reveal.in              { animation: none !important; transition: none !important; }
  .service-modal,
  .service-modal-overlay  { animation: none !important; }
  .kpi-value::after       { animation: none !important; }
}
