*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #f8fafc;
  touch-action: none;
}

/* Холст с физикой */
#physics-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: block;
  cursor: grab;
}

#physics-canvas:active {
  cursor: grabbing;
}

/* Центральный блок контента */
.hero-container {
  position: fixed;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  pointer-events: none;
  text-align: center;
  width: 90vw;
  max-width: 950px;
}

.text-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 
   Инверсия текста:
   mix-blend-mode: difference:
   Черный (#000000) текст на светлом фоне виден черным.
   На синей фигуре моментально становится чисто белым (#ffffff)!
   Шрифт: ИСХОДНЫЙ Plus Jakarta Sans (вариативный 200..800)!
*/
.hero-title {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  font-size: clamp(2.8rem, 6.8vw, 5.8rem);
  letter-spacing: -0.04em;
  color: #000000;
  mix-blend-mode: difference;
  line-height: 1.05;
  cursor: default;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.char {
  display: inline-block;
  font-weight: 300;
  will-change: font-weight;
}

/* Подтекст: ИСКЛЮЧИТЕЛЬНО шрифтом Google Sans (Product Sans) */
.hero-subtitle {
  margin-top: 14px;
  font-size: clamp(0.95rem, 2vw, 1.22rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: #000000;
  mix-blend-mode: difference;
  line-height: 1.4;
  max-width: 600px;
  font-family: 'Product Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Кнопка: СТРОГО зафиксирована, БЕЗ прыжков, БЕЗ сужения */
.cta-wrapper {
  margin-top: 36px;
  pointer-events: auto;
}

.glow-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 9999px;
  cursor: pointer;
  mix-blend-mode: difference;
  box-shadow: none;
  outline: none;
  border: none;
  background: transparent;
  padding: 0;
  transform: none !important;
}

/* 
   Анимация пульсации одного синего цвета:
   меняется яркость от насыщенного до светло-голубого
*/
@keyframes bluePulseGlow {
  0% {
    background-color: #2563eb;
    border-color: #2563eb;
  }
  50% {
    background-color: #60a5fa;
    border-color: #60a5fa;
  }
  100% {
    background-color: #2563eb;
    border-color: #2563eb;
  }
}

/* Внешняя светящаяся синяя обводка без зазоров */
.btn-border-glow {
  position: absolute;
  inset: -3px;
  border-radius: 9999px;
  animation: bluePulseGlow 3s ease-in-out infinite;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 1;
  pointer-events: none;
}

.glow-btn:hover .btn-border-glow {
  opacity: 1;
}

/* 
   Тело кнопки:
   - В обычном состоянии: чистый черный #000000, текст белый
   - При наведении: черный мгновенно меняется на цвет заливки, 
     никаких черных ободков или зазоров не остается!
*/
.btn-inner {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 32px;
  border-radius: 9999px;
  background-color: #000000;
  color: #ffffff;
  font-size: clamp(0.92rem, 1.7vw, 1.05rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  font-family: 'Product Sans', sans-serif;
  overflow: hidden;
  box-shadow: none;
  border: none;
  transition: background-color 0.25s ease;
}

/* При наведении базовый фон кнопки сразу становится пульсирующим синим */
.glow-btn:hover .btn-inner {
  animation: bluePulseGlow 3s ease-in-out infinite;
}

/* Заполнение из центра до краев */
.btn-inner::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: bluePulseGlow 3s ease-in-out infinite;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}

.glow-btn:hover .btn-inner::before {
  width: 400px;
  height: 400px;
}

.btn-text {
  position: relative;
  z-index: 3;
}
