/* ============================================
   GLOBAL
   ============================================ */
html {
  scroll-padding-top: 2rem;
  width: 100%;
  overflow-x: hidden;
}

body {
  background: #060a14;
  width: 100%;
  overflow-x: hidden;
  position: relative;
  margin: 0;
  padding: 0;
}

.page-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

canvas {
  max-width: 100%;
  display: block;
}

img, svg, video {
  max-width: 100%;
  height: auto;
}

* {
  min-width: 0;
}

section, header, footer {
  overflow: hidden !important;
  width: 100%;
  max-width: 100%;
  contain: paint;
}

::selection {
  background: rgba(59, 130, 246, 0.3);
  color: white;
}

/* ============================================
   DOT GRID + NOISE OVERLAY
   ============================================ */
.dot-grid {
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 40%, transparent 100%);
}

/* #27 Noise overlay */
.noise-overlay {
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================
   ORBS (with parallax data attr)
   ============================================ */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  pointer-events: none;
  will-change: transform;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, transparent 70%);
  top: -100px;
  left: -100px;
  animation: orbFloat1 20s ease-in-out infinite;
}

.orb-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
  bottom: -150px;
  right: -150px;
  animation: orbFloat2 25s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(80px, 60px) scale(1.1); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-100px, -80px) scale(1.15); }
}

/* ============================================
   3D GLOBE CANVAS
   ============================================ */
.globe-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.85;
}

/* ============================================
   GRADIENT TEXT
   ============================================ */
.gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, #93c5fd 50%, #60a5fa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ============================================
   #1 TYPEWRITER
   ============================================ */
.typewriter {
  display: inline-block;
  border-right: 3px solid rgba(147, 197, 253, 0.8);
  padding-right: 2px;
  white-space: nowrap;
  max-width: 100%;
  animation: caretBlink 0.9s step-end infinite;
}

@media (max-width: 640px) {
  .typewriter {
    white-space: normal;
    border-right: none;
    animation: none;
  }
}

@keyframes caretBlink {
  0%, 100% { border-right-color: rgba(147, 197, 253, 0.8); }
  50% { border-right-color: transparent; }
}

/* ============================================
   #2 MAGNETIC BUTTONS (JS-driven)
   ============================================ */
.magnetic {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

/* ============================================
   #3 MARQUEE
   ============================================ */
.marquee-wrap {
  position: absolute;
  bottom: 80px;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 5;
  pointer-events: none;
}

.marquee-label {
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.5);
  margin-bottom: 0.75rem;
}

.marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 15%, black 85%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 15%, black 85%, transparent);
}

.marquee-track {
  display: flex;
  gap: 2.5rem;
  width: max-content;
  animation: marqueeScroll 40s linear infinite;
}

.marquee-item {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(147, 197, 253, 0.6);
  padding: 0.5rem 1rem;
  border: 1px solid rgba(96, 165, 250, 0.15);
  border-radius: 0.5rem;
  background: rgba(19, 28, 49, 0.3);
  backdrop-filter: blur(8px);
  white-space: nowrap;
  flex-shrink: 0;
}

@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================
   GLASSMORPHISM CARDS
   ============================================ */
.glass-card {
  background: rgba(19, 28, 49, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 1rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

.glass-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-4px);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 0 60px rgba(59, 130, 246, 0.1);
}

.glass-card-red:hover {
  border-color: rgba(248, 113, 113, 0.3);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 0 60px rgba(248, 113, 113, 0.1);
}

.glass-card-green:hover {
  border-color: rgba(74, 222, 128, 0.3);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 0 60px rgba(74, 222, 128, 0.1);
}

/* ============================================
   #9 GLITCH TEXT
   ============================================ */
.glitch {
  position: relative;
  display: inline-block;
  color: #fca5a5;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0.8;
  pointer-events: none;
}

.glitch::before {
  color: #60a5fa;
  animation: glitchShift1 2.4s infinite steps(1);
  clip-path: inset(0 0 60% 0);
}

.glitch::after {
  color: #f87171;
  animation: glitchShift2 2.6s infinite steps(1);
  clip-path: inset(60% 0 0 0);
}

@keyframes glitchShift1 {
  0%, 90%, 100% { transform: translate(0); }
  92% { transform: translate(-2px, 1px); }
  94% { transform: translate(2px, -1px); }
  96% { transform: translate(-1px, -1px); }
}

@keyframes glitchShift2 {
  0%, 88%, 100% { transform: translate(0); }
  90% { transform: translate(2px, -1px); }
  93% { transform: translate(-2px, 1px); }
  97% { transform: translate(1px, 1px); }
}

/* ============================================
   #30 SPEED CHART
   ============================================ */
.speed-chart {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.speed-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
}

.speed-row:last-child {
  margin-bottom: 0;
}

.speed-label {
  color: rgba(148, 163, 184, 0.8);
}

.speed-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 3px;
  overflow: hidden;
}

.speed-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  transition: width 1.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.speed-fill-red {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.speed-fill-gray {
  background: linear-gradient(90deg, #4ade80, #86efac);
}

.speed-value {
  color: rgba(203, 213, 225, 0.7);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ============================================
   #7 LOCK ILLUSTRATION
   ============================================ */
.lock-illustration {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
}

.lock-svg {
  width: 70px;
  height: 84px;
  margin: 0 auto;
  display: block;
}

.lock-shackle {
  transform-origin: 30px 50px;
  animation: lockUnlock 4s ease-in-out infinite;
}

@keyframes lockUnlock {
  0%, 40%, 100% { transform: rotate(0); }
  50%, 90% { transform: rotate(-25deg) translateX(-2px); }
}

.lock-caption {
  font-size: 0.75rem;
  color: rgba(74, 222, 128, 0.7);
  margin-top: 0.5rem;
}

/* ============================================
   #32 DEVICES SVG
   ============================================ */
.devices-svg {
  width: 160px;
  height: 80px;
}

.device-connect {
  stroke-dasharray: 3 3;
  animation: dashFlow 2s linear infinite;
}

@keyframes dashFlow {
  to { stroke-dashoffset: -12; }
}

.pulse-dot {
  animation: dotPulse 1.8s ease-in-out infinite;
}

.pulse-dot-2 {
  animation-delay: 0.9s;
}

@keyframes dotPulse {
  0%, 100% { opacity: 0; r: 1; }
  50% { opacity: 1; r: 2.5; }
}

/* ============================================
   CTA BUTTON
   ============================================ */
.cta-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  position: relative;
  box-shadow:
    0 10px 30px -10px rgba(59, 130, 246, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  text-align: center;
}

.cta-btn::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, #60a5fa, #a78bfa, #60a5fa);
  border-radius: inherit;
  opacity: 0;
  z-index: -1;
  filter: blur(15px);
  transition: opacity 0.5s;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 20px 40px -10px rgba(59, 130, 246, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.cta-btn:hover::before {
  opacity: 0.8;
}

/* #17 CTA pulse */
.cta-pulse {
  animation: ctaPulse 2.5s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 10px 30px -10px rgba(59, 130, 246, 0.5), 0 0 0 0 rgba(96, 165, 250, 0.4); }
  50% { box-shadow: 0 10px 30px -10px rgba(59, 130, 246, 0.7), 0 0 0 12px rgba(96, 165, 250, 0); }
}

/* ============================================
   STEP NUMBERS + DECOR
   ============================================ */
.step-icon-wrap {
  position: relative;
  width: 80px;
  height: 80px;
}

.step-number {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  font-weight: 800;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.15);
}

.step-decor {
  position: absolute;
  inset: 0;
  width: 80px;
  height: 80px;
  pointer-events: none;
}

.step-decor-rotate {
  transform-origin: 40px 40px;
  animation: stepRotate 20s linear infinite;
}

@keyframes stepRotate {
  to { transform: rotate(360deg); }
}

/* #10 Steps connecting line */
.steps-container {
  position: relative;
}

.steps-line {
  position: absolute;
  top: 40px;
  left: 0;
  right: 0;
  width: 100%;
  height: 10px;
  pointer-events: none;
  z-index: 0;
}

.steps-line-path {
  stroke-dashoffset: 0;
  animation: dashFlow2 1.5s linear infinite;
}

@keyframes dashFlow2 {
  to { stroke-dashoffset: -24; }
}

/* ============================================
   #33 TUNNEL ILLUSTRATION
   ============================================ */
.tunnel-illustration {
  margin-top: 4rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
}

.tunnel-illustration svg {
  width: 100%;
  height: auto;
}

.tunnel-path {
  animation: dashFlow 3s linear infinite reverse;
}

/* ============================================
   PLATFORM PILLS
   ============================================ */
.platform-pill {
  font-size: 0.75rem;
  background: rgba(30, 45, 74, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.5rem 0.875rem;
  border-radius: 0.625rem;
  transition: all 0.3s;
  backdrop-filter: blur(8px);
  display: inline-block;
}

.platform-pill:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  transform: translateY(-1px);
}

/* ============================================
   TARIFF CARDS
   ============================================ */
.tariff-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tariff-card:hover {
  transform: translateY(-6px);
}

/* #15 Tilt card (JS-driven) */
.tilt-card {
  transform-style: preserve-3d;
  will-change: transform;
}

.tariff-featured {
  position: relative;
}

.animated-border {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.6),
    rgba(139, 92, 246, 0.6),
    rgba(59, 130, 246, 0.6)
  );
  background-size: 300% 300%;
  animation: borderShine 6s ease infinite;
  position: relative;
  box-shadow:
    0 0 40px rgba(59, 130, 246, 0.2),
    0 20px 60px -20px rgba(59, 130, 246, 0.4);
  transition: box-shadow 0.4s;
}

.tariff-featured:hover .animated-border {
  box-shadow:
    0 0 60px rgba(59, 130, 246, 0.35),
    0 30px 80px -20px rgba(59, 130, 246, 0.5);
}

@keyframes borderShine {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* #16 Shine sweep */
.shine-sweep {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 70%
  );
  animation: shineSweep 5s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes shineSweep {
  0%, 30% { left: -100%; }
  70%, 100% { left: 150%; }
}

/* #14 Draw check SVG */
.draw-check path {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
}

.draw-check.drawn path {
  animation: drawCheck 0.6s ease-out forwards;
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

/* ============================================
   SECTION DIVIDERS
   ============================================ */
.section-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(59, 130, 246, 0.2) 50%,
    transparent 100%
  );
  max-width: 80%;
  margin: 0 auto;
}

/* ============================================
   FAQ + plus/minus morph
   ============================================ */
.faq-item .faq-toggle {
  transition: background 0.3s;
}

.faq-item:hover .faq-toggle {
  background: rgba(59, 130, 246, 0.05);
}

.plus-minus {
  position: relative;
  width: 16px;
  height: 16px;
  display: inline-block;
  flex-shrink: 0;
}

.plus-minus span {
  position: absolute;
  top: 50%;
  left: 0;
  width: 16px;
  height: 2px;
  background: #60a5fa;
  border-radius: 1px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.plus-minus span:nth-child(2) {
  transform: translateY(-50%) rotate(90deg);
}

.plus-minus span:nth-child(1) {
  transform: translateY(-50%);
}

.faq-item.open .plus-minus span:nth-child(2) {
  transform: translateY(-50%) rotate(0deg);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s;
  padding-top: 0;
  padding-bottom: 0;
}

.faq-item.open .faq-content {
  max-height: 300px;
  padding-bottom: 1.5rem;
}

.faq-item.open {
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.1);
}

/* Flags */
.flag {
  display: inline-block;
  width: 18px;
  height: 12px;
  vertical-align: middle;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.flag-ru {
  background: linear-gradient(to bottom, #fff 0 33%, #0039a6 33% 66%, #d52b1e 66% 100%);
}

.flag-us {
  background:
    linear-gradient(to bottom,
      #b22234 0 7.7%, #fff 7.7% 15.4%,
      #b22234 15.4% 23.1%, #fff 23.1% 30.8%,
      #b22234 30.8% 38.5%, #fff 38.5% 46.2%,
      #b22234 46.2% 53.9%);
}

/* ============================================
   REFERRAL
   ============================================ */
.referral-card {
  background: rgba(19, 28, 49, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.referral-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.05) 0%,
    transparent 50%,
    rgba(139, 92, 246, 0.05) 100%
  );
  pointer-events: none;
}

.referral-illustration {
  width: 100%;
  max-width: 320px;
}

.referral-arc {
  stroke-dasharray: 4 4;
  animation: dashFlow3 2s linear infinite;
}

@keyframes dashFlow3 {
  to { stroke-dashoffset: -16; }
}

.bonus-label {
  animation: bonusFloat 2.5s ease-in-out infinite;
}

@keyframes bonusFloat {
  0%, 100% { transform: translateY(0); opacity: 0.9; }
  50% { transform: translateY(-3px); opacity: 1; }
}

/* ============================================
   #25 SCROLL PROGRESS BAR
   ============================================ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, #3b82f6, #a78bfa, #60a5fa);
  z-index: 100;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.6);
}

/* ============================================
   #26 SECTION NAV DOTS
   ============================================ */
.section-nav {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  z-index: 50;
}

.section-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.25);
  border: 1px solid rgba(148, 163, 184, 0.2);
  transition: all 0.3s;
  position: relative;
  display: block;
}

.section-dot::before {
  content: attr(data-label);
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: #93c5fd;
  background: rgba(19, 28, 49, 0.9);
  padding: 0.25rem 0.6rem;
  border-radius: 0.375rem;
  border: 1px solid rgba(59, 130, 246, 0.2);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.section-dot:hover {
  background: rgba(96, 165, 250, 0.8);
  transform: scale(1.3);
}

.section-dot:hover::before {
  opacity: 1;
}

.section-dot.active {
  background: #60a5fa;
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.6);
  transform: scale(1.3);
}

@media (max-width: 900px) {
  .section-nav { display: none; }
}

/* ============================================
   #24 CURSOR TRAIL
   ============================================ */
.cursor-trail {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  width: 100%;
  height: 100%;
}

@media (hover: none), (max-width: 900px) {
  .cursor-trail { display: none; }
}

/* ============================================
   FADE-IN + REVEAL
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-scale {
  transform: translateY(30px) scale(0.96);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-scale.visible {
  transform: translateY(0) scale(1);
}

.reveal-text {
  position: relative;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  .orb-1 { width: 300px; height: 300px; }
  .orb-2 { width: 350px; height: 350px; }
  .dot-grid { background-size: 24px 24px; }
  .marquee-wrap { position: static; margin-top: 3rem; padding-bottom: 2rem; }
  .marquee-item { font-size: 0.75rem; padding: 0.4rem 0.8rem; }
  .marquee-track { gap: 1.5rem; }
  .steps-line { display: none !important; }
  #hero {
    min-height: auto;
    padding-top: 5rem;
    padding-bottom: 3rem;
    display: block;
  }
  #hero .absolute.bottom-4 { display: none; }
  .marquee-wrap { width: 100%; }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .orb, .animated-border, .marquee-track, .lock-shackle,
  .step-decor-rotate, .tunnel-path, .referral-arc,
  .bonus-label, .shine-sweep, .cta-pulse, .glitch::before, .glitch::after,
  .device-connect, .pulse-dot, .steps-line-path, .typewriter {
    animation: none !important;
  }
  .fade-in, .reveal-scale {
    opacity: 1;
    transform: none;
  }
  .typewriter { border-right: none; }
}
