/* ═══════════════════════════════════════════════════════════
   ssvnauka.com · Phase 1 · Animation + Widget Layer
   Подключается ко всем страницам через <link>
   ═══════════════════════════════════════════════════════════ */

/* ── RESET & GLOBAL SMOOTH ─────────────────────────────────── */
html { scroll-behavior: smooth; }

/* ── REVEAL ANIMATIONS ─────────────────────────────────────── */
.p1-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(.25,.8,.25,1),
              transform 0.65s cubic-bezier(.25,.8,.25,1);
  will-change: opacity, transform;
}
.p1-reveal.p1-in {
  opacity: 1;
  transform: translateY(0);
}

/* Fade in (no Y movement) */
.p1-fade {
  opacity: 0;
  transition: opacity 0.7s ease;
  will-change: opacity;
}
.p1-fade.p1-in { opacity: 1; }

/* Scale in */
.p1-scale {
  opacity: 0;
  transform: scale(0.93);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.34,1.56,.64,1);
  will-change: opacity, transform;
}
.p1-scale.p1-in { opacity: 1; transform: scale(1); }

/* Slide from left */
.p1-slide-left {
  opacity: 0;
  transform: translateX(-28px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.25,.8,.25,1);
}
.p1-slide-left.p1-in { opacity: 1; transform: translateX(0); }

/* Stagger delays */
.p1-d1 { transition-delay: 0.08s !important; }
.p1-d2 { transition-delay: 0.16s !important; }
.p1-d3 { transition-delay: 0.24s !important; }
.p1-d4 { transition-delay: 0.32s !important; }
.p1-d5 { transition-delay: 0.40s !important; }
.p1-d6 { transition-delay: 0.48s !important; }

/* ── NAV SCROLL EFFECT ─────────────────────────────────────── */
.p1-nav-scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,.12) !important;
}

/* ── CARD HOVER ENHANCEMENT ────────────────────────────────── */
.p1-hover {
  transition: transform 0.25s cubic-bezier(.25,.8,.25,1),
              box-shadow 0.25s ease !important;
  cursor: pointer;
}
.p1-hover:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 12px 36px rgba(0,0,0,.13) !important;
}

/* ── BUTTON RIPPLE ─────────────────────────────────────────── */
.p1-ripple { position: relative; overflow: hidden; }
.p1-ripple .p1-ripple-wave {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  transform: scale(0);
  animation: p1RippleAnim 0.6s linear;
  pointer-events: none;
}
@keyframes p1RippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* ── TELEGRAM FLOATING BUTTON ──────────────────────────────── */
.p1-tg-btn {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 9999;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #229ed9, #1a7bbf);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(34,158,217,.45);
  transition: transform 0.2s, box-shadow 0.2s;
}
.p1-tg-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 8px 30px rgba(34,158,217,.6);
  color: #fff;
}
/* Pulse ring */
.p1-tg-btn::before,
.p1-tg-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(34,158,217,.6);
  animation: p1TgPulse 2.2s ease-out infinite;
}
.p1-tg-btn::after { animation-delay: 1.1s; }
@keyframes p1TgPulse {
  0%  { opacity: .9; transform: scale(1); }
  100%{ opacity: 0;  transform: scale(1.7); }
}
/* Tooltip */
.p1-tg-tip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.p1-tg-tip::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: #1e293b;
}
.p1-tg-btn:hover .p1-tg-tip { opacity: 1; }

/* ── STICKY APPOINTMENT BAR ────────────────────────────────── */
.p1-sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9990;
  background: linear-gradient(90deg, #050e1d 0%, #0f2440 50%, #0f766e 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 20px;
  border-top: 1px solid rgba(13,148,136,.4);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(.25,.8,.25,1);
  box-shadow: 0 -4px 24px rgba(0,0,0,.3);
  flex-wrap: wrap;
}
.p1-sticky-bar.p1-bar-visible {
  transform: translateY(0);
}
.p1-bar-text {
  font-size: .88rem;
  opacity: .85;
  font-weight: 500;
}
.p1-bar-text strong { color: #f59e0b; }
.p1-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #0d9488;
  color: #fff;
  font-weight: 700;
  font-size: .88rem;
  padding: 8px 18px;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}
.p1-bar-btn:hover { background: #0f766e; transform: scale(1.03); }
.p1-bar-btn.gold { background: #f59e0b; color: #1e293b; }
.p1-bar-btn.gold:hover { background: #d97706; }
.p1-bar-close {
  margin-left: 8px;
  cursor: pointer;
  opacity: .55;
  font-size: 1.2rem;
  background: none;
  border: none;
  color: #fff;
  line-height: 1;
  padding: 2px 4px;
  transition: opacity 0.2s;
}
.p1-bar-close:hover { opacity: 1; }
/* Offset content above sticky bar */
body.p1-bar-active { padding-bottom: 56px; }

/* ── COUNTER ELEMENT ───────────────────────────────────────── */
.p1-counter-el {
  display: inline-block;
  transition: color 0.3s;
}

/* ── SECTION CHIP ACCENT ───────────────────────────────────── */
.section-chip, .section-label {
  position: relative;
}

/* ── PROGRESS BAR ON SCROLL ────────────────────────────────── */
.p1-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #0d9488, #f59e0b);
  z-index: 10001;
  width: 0%;
  transition: width 0.1s linear;
}

/* ── HERO PARALLAX CONTAINER ───────────────────────────────── */
.p1-parallax-hero {
  background-attachment: fixed;
}

/* ── MOBILE OVERRIDES ──────────────────────────────────────── */
@media (max-width: 600px) {
  .p1-tg-btn { width: 52px; height: 52px; font-size: 1.3rem; bottom: 72px; right: 16px; }
  .p1-sticky-bar { gap: 10px; padding: 10px 14px; }
  .p1-bar-text { font-size: .78rem; }
  .p1-bar-btn { font-size: .78rem; padding: 7px 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .p1-reveal, .p1-fade, .p1-scale, .p1-slide-left {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
