/* Эффекты интерфейса: «жидкие» переходы (SVG gooey-фильтр), бегущая рамка, блик на кнопках,
   параллакс-колонки на экране входа. Своя реализация на CSS и чистом JS. */

/* ---------- Бегущая светящаяся рамка ---------- */
@property --beam-a {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
.hero-rec::after,
.composer::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--beam-a), transparent 0 64%, rgba(160, 140, 255, .9) 78%, rgba(91, 149, 255, .95) 86%, transparent 96%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: beam-spin 7s linear infinite;
  pointer-events: none;
}
.composer { position: sticky; }
.composer::after { opacity: 0; transition: opacity .3s; animation-duration: 3.5s; }
.composer:focus-within::after { opacity: 1; }
@keyframes beam-spin { to { --beam-a: 360deg; } }

/* ---------- Блик на основных кнопках ---------- */
.btn.primary { position: relative; overflow: hidden; isolation: isolate; }
.btn.primary::after {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, .38) 50%, transparent 68%);
  transform: translateX(-130%);
  transition: transform .7s cubic-bezier(.22, .8, .24, 1);
  pointer-events: none;
}
.btn.primary:hover::after, .btn.primary:focus-visible::after { transform: translateX(130%); }

/* ---------- Вкладки с перетекающим бегунком ---------- */
.segmented { position: relative; isolation: isolate; }
.segmented button { position: relative; z-index: 1; transition: color .25s; }
.segmented button.active { background: transparent; }
.goo-layer { position: absolute; inset: 0; z-index: 0; filter: url(#mt-goo); pointer-events: none; }
.goo-layer .blob { position: absolute; left: 0; top: 0; border-radius: 9px; background: #312e4a; }
.goo-layer .blob.a { transition: transform .55s cubic-bezier(.65, 0, .25, 1), width .55s cubic-bezier(.65, 0, .25, 1); }
.goo-layer .blob.b { transition: transform .3s cubic-bezier(.3, 0, .1, 1), width .3s cubic-bezier(.3, 0, .1, 1); }

/* ---------- Капли вокруг кнопки записи ---------- */
.orb-wrap { --s: 148px; position: relative; display: grid; place-items: center; width: var(--s); height: var(--s); }
.orb-wrap .orb { position: relative; z-index: 1; }
.orb-wrap .orb::after { display: none; }
.orb-goo { position: absolute; inset: -46px; filter: url(#mt-goo-soft); pointer-events: none; }
.orb-goo i { position: absolute; left: 50%; top: 50%; border-radius: 50%; background: linear-gradient(135deg, #a08cff, #5b95ff); }
.orb-goo .core { width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); }
.orb-goo .drop { --r: calc(var(--s) / 2 + 4px); width: 26px; height: 26px; margin: -13px 0 0 -13px; animation: orb-orbit 10s linear infinite; }
.orb-goo .d2 { --r: calc(var(--s) / 2 + 12px); width: 18px; height: 18px; margin: -9px 0 0 -9px; animation-duration: 14s; animation-direction: reverse; }
.orb-goo .d3 { --r: calc(var(--s) / 2 - 2px); width: 34px; height: 34px; margin: -17px 0 0 -17px; animation-duration: 19s; animation-delay: -6s; }
@keyframes orb-orbit {
  from { transform: rotate(0deg) translateX(var(--r)); }
  to { transform: rotate(360deg) translateX(var(--r)); }
}
@media (max-width: 880px) { .orb-wrap { --s: 124px; } }

/* ---------- Кнопки записи вытекают из центральной ---------- */
.rec-controls.emerge { filter: url(#mt-goo-soft); }
.rec-controls.emerge .control-label { color: transparent; }
.rec-controls.emerge .control-label:first-child .round { animation: emerge-left .8s cubic-bezier(.5, 0, .2, 1) both; }
.rec-controls.emerge .control-label:last-child .round { animation: emerge-right .8s cubic-bezier(.5, 0, .2, 1) both; }
.rec-controls .control-label { transition: color .4s .1s; }
@keyframes emerge-left { from { transform: translateX(82px) scale(.4); } }
@keyframes emerge-right { from { transform: translateX(-82px) scale(.4); } }

/* ---------- Параллакс на экране входа ---------- */
.auth-side::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to bottom, var(--bg) 0 7%, rgba(24, 25, 30, 0) 18%),
    linear-gradient(to top, var(--bg) 0 42%, rgba(24, 25, 30, .6) 66%, rgba(24, 25, 30, .15));
  pointer-events: none;
}
.auth-side > *:not(.parallax) { z-index: 2; }
.parallax {
  position: absolute; inset: 0; z-index: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px; padding: 0 24px; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
}
.px-col { position: relative; min-width: 0; }
.px-track { display: flex; flex-direction: column; gap: 14px; will-change: transform; }
.px-card {
  padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; line-height: 1.45;
}
.px-card p { color: #e1e1e8; }
.px-kind { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.px-kind i { width: 7px; height: 7px; border-radius: 50%; background: var(--k); }
.px-time { color: var(--blue); font-size: 12px; font-variant-numeric: tabular-nums; }
@media (max-width: 880px) {
  .parallax { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 16px; }
  .parallax .px-col:nth-child(3) { display: none; }
}

/* ---------- Браузеры без поддержки SVG-фильтров и сниженная анимация ---------- */
.no-goo .goo-layer, .no-goo .orb-goo, .no-goo .rec-controls.emerge { filter: none; }
.no-goo .goo-layer .blob.b, .no-goo .orb-goo { display: none; }
.no-goo .orb-wrap .orb::after { display: block; }
@media (prefers-reduced-motion: reduce) {
  .hero-rec::after, .composer::after { animation: none; }
  .orb-goo .drop { animation: none; display: none; }
}

/* ================== Вторая волна: фон, кнопки, навигация ================== */

/* ---------- Сияние на фоне и зерно ---------- */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(38% 32% at 18% 12%, rgba(154, 134, 255, .24), transparent 70%),
    radial-gradient(34% 30% at 88% 22%, rgba(91, 149, 255, .2), transparent 70%),
    radial-gradient(44% 38% at 58% 98%, rgba(124, 92, 255, .16), transparent 70%);
  animation: aurora 28s ease-in-out infinite alternate;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@keyframes aurora {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(5%, -4%, 0) scale(1.1); }
  100% { transform: translate3d(-4%, 5%, 0) scale(1.04); }
}
#shell, #auth { position: relative; z-index: 1; }
.rail { background: rgba(24, 25, 30, .55); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.auth-main { position: relative; z-index: 1; }

/* ---------- Заголовки ---------- */
.view-head h1 {
  background: linear-gradient(92deg, #ffffff 0%, #e6e0ff 55%, #bccfff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Основные кнопки: переливающийся градиент, блик и свечение ---------- */
.btn.primary {
  background: linear-gradient(110deg, #8f7bff 0%, #5b95ff 45%, #a08cff 90%);
  background-size: 220% 100%;
  animation: grad-move 7s ease-in-out infinite alternate;
  box-shadow: 0 10px 30px -8px rgba(110, 120, 255, .65), inset 0 1px 0 rgba(255, 255, 255, .28);
  transition: transform .2s, box-shadow .25s, filter .2s;
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 16px 40px -8px rgba(110, 120, 255, .8), inset 0 1px 0 rgba(255, 255, 255, .3); filter: none; }
.btn.primary:active { transform: translateY(0) scale(.98); }
.btn.primary::after { animation: shimmer 4.2s ease-in-out infinite; transition: none; }
.btn.primary:disabled { animation: none; box-shadow: none; }
.btn.primary:disabled::after { display: none; }
@keyframes grad-move { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@keyframes shimmer { 0%, 62% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }

/* ---------- Второстепенные кнопки: стеклянные, с градиентной рамкой ---------- */
.btn:not(.primary):not(.danger):not(.solid-danger) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: rgba(39, 40, 48, .55);
  border-color: transparent;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn:not(.primary):not(.danger):not(.solid-danger)::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, .05) 45%, rgba(154, 134, 255, .4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: background .3s;
}
.btn:not(.primary):not(.danger):not(.solid-danger):hover { background: rgba(49, 46, 74, .65); }
.btn:not(.primary):not(.danger):not(.solid-danger):hover::before { background: linear-gradient(135deg, #a08cff, rgba(255, 255, 255, .1) 50%, #5b95ff); }
.btn.danger, .btn.solid-danger { position: relative; overflow: hidden; }

/* ---------- Волна при нажатии ---------- */
.round, .chip, .prompt, .icon-btn, .tabbar a, .rail-nav a { position: relative; overflow: hidden; }
.ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 70%);
  transform: scale(0);
  animation: ripple .65s cubic-bezier(.22, .8, .24, 1) forwards;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* ---------- Фильтры-чипы ---------- */
.chip { background: rgba(39, 40, 48, .5); transition: color .2s, border-color .2s, background .2s, box-shadow .2s; }
.chip.active {
  background: linear-gradient(120deg, #8f7bff, #5b95ff);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 20px -6px rgba(110, 120, 255, .7);
}

/* ---------- Карточки: стекло и подсветка под курсором ---------- */
.panel, .goal, .figures, .suggest, .prompt, .modal, .empty, .player, .composer {
  background-color: rgba(31, 32, 38, .62);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.hero-rec { background-color: rgba(31, 32, 38, .55); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.spot {
  background-image: radial-gradient(420px circle at var(--mx, -999px) var(--my, -999px), rgba(154, 134, 255, .14), transparent 55%);
  transition: border-color .25s, transform .25s;
}
.spot:hover { border-color: rgba(154, 134, 255, .32); }
.goal.spot:hover, .prompt.spot:hover { transform: translateY(-2px); }
.figure b { background: linear-gradient(180deg, #fff, #c9c0ff); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Кнопки записи ---------- */
.round { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); background: rgba(39, 40, 48, .6); }
.round.stop { animation: stop-glow 2.4s ease-in-out infinite; }
@keyframes stop-glow {
  0%, 100% { box-shadow: 0 12px 34px rgba(91, 149, 255, .35), 0 0 0 0 rgba(154, 134, 255, .35); }
  50% { box-shadow: 0 12px 40px rgba(91, 149, 255, .5), 0 0 0 14px rgba(154, 134, 255, 0); }
}
.orb:active { transform: scale(.96); }
.wave { background: rgba(31, 32, 38, .6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* ---------- «Жидкий» индикатор в навигации ---------- */
.rail-nav, .tabbar { isolation: isolate; }
.rail-nav { position: relative; }
.rail-nav a.active { background: transparent; }
.rail-nav a, .tabbar a { z-index: 1; }
.nav-goo { position: absolute; inset: 0; z-index: 0; filter: url(#mt-goo); pointer-events: none; }
.nav-goo .blob { position: absolute; left: 0; top: 0; border-radius: 10px; background: #312e4a; }
.nav-goo .blob.a { transition: transform .6s cubic-bezier(.65, 0, .25, 1), width .6s, height .6s; }
.nav-goo .blob.b { transition: transform .32s cubic-bezier(.3, 0, .1, 1), width .32s, height .32s; }
.tabbar .nav-goo .blob { border-radius: 16px; background: #34305a; }
.no-goo .nav-goo { filter: none; }
.no-goo .nav-goo .blob.b { display: none; }

/* ---------- Центральная кнопка «+»: меню из капель ---------- */
.fab-menu { position: fixed; inset: 0; z-index: 55; }
.fab-backdrop { position: absolute; inset: 0; background: rgba(12, 12, 18, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity .3s; }
.fab-menu.open .fab-backdrop { opacity: 1; }
.fab-goo { position: absolute; inset: 0; filter: url(#mt-goo-soft); pointer-events: none; }
.fab-goo i, .fab-opt, .fab-close {
  position: absolute; left: var(--fx); top: var(--fy); width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%;
}
.fab-goo i { background: linear-gradient(135deg, #a08cff, #5b95ff); transition: transform .55s cubic-bezier(.5, -0.3, .2, 1.3); }
.fab-goo .fab-core { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
.fab-menu.open .fab-goo .b1 { transform: translate(-78px, -96px); }
.fab-menu.open .fab-goo .b2 { transform: translate(78px, -96px); }
.fab-opt {
  border: 0; background: transparent; color: #fff; cursor: pointer; display: grid; place-items: center;
  opacity: 0; transform: translate(0, 0) scale(.6); transition: opacity .25s, transform .55s cubic-bezier(.5, -0.3, .2, 1.3);
}
.fab-opt .i { width: 24px; height: 24px; }
.fab-opt span {
  position: absolute; top: 64px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 13px; font-weight: 500;
  color: var(--text); text-shadow: 0 1px 8px rgba(0, 0, 0, .6);
}
.fab-menu.open .o1 { opacity: 1; transform: translate(-78px, -96px); transition-delay: .12s, 0s; }
.fab-menu.open .o2 { opacity: 1; transform: translate(78px, -96px); transition-delay: .12s, 0s; }
.fab-close {
  width: 52px; height: 52px; margin: -26px 0 0 -26px; border: 0; color: #fff; display: grid; place-items: center; cursor: pointer;
  background: linear-gradient(135deg, #a08cff, #5b95ff); transition: transform .4s cubic-bezier(.5, -0.3, .2, 1.3);
}
.fab-close .i { width: 22px; height: 22px; }
.fab-menu.open .fab-close { transform: rotate(90deg); }

/* ---------- Появление экрана ---------- */
.rise { animation: rise .55s cubic-bezier(.22, .8, .24, 1) both; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

@media (prefers-reduced-motion: reduce) {
  body::before, .btn.primary, .btn.primary::after, .round.stop { animation: none; }
  .rise { animation: none; }
}
@media (max-width: 520px) {
  .figure { flex-wrap: wrap; }
  .figure small { flex-basis: 100%; padding-left: 68px; margin-top: -4px; }
}

/* =====================================================================
   Компоненты с примеров. Перенесены с React/Tailwind на чистый CSS:
   Shimmer Button, Rainbow Button, Interactive Hover Button, Shine Border,
   Border Beam, Pulsating Button — Magic UI (MIT, magicui.design);
   Gooey SVG filter, gooey-меню и gooey-вкладки — Fancy Components (MIT, fancycomponents.dev);
   параллакс-галерея — по схеме Skiper30 / Olivier Larose.
   ===================================================================== */

/* ---------- Shimmer Button: все основные кнопки ---------- */
.btn.primary {
  --spread: 90deg;
  --shimmer-color: #e2dbff;
  --speed: 3s;
  --cut: .07em;
  --sbg: linear-gradient(135deg, #2c2560 0%, #1b2c66 100%);
  background: var(--sbg);
  background-size: auto;
  animation: none;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
  z-index: 0;
  box-shadow: 0 10px 30px -12px rgba(120, 110, 255, .7);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 16px 36px -12px rgba(120, 110, 255, .85); }
.btn.primary::after { display: none; }
.sh-spark-wrap { position: absolute; inset: 0; z-index: -3; filter: blur(2px); overflow: visible; container-type: size; pointer-events: none; }
.sh-spark { position: absolute; inset: 0 auto auto 0; height: 100cqh; aspect-ratio: 1; animation: shimmer-slide var(--speed) ease-in-out infinite alternate; }
.sh-spark i {
  position: absolute; inset: -100%;
  background: conic-gradient(from calc(270deg - (var(--spread) * .5)), transparent 0, var(--shimmer-color) var(--spread), transparent var(--spread));
  animation: spin-around calc(var(--speed) * 2) infinite linear;
}
.sh-backdrop { position: absolute; inset: var(--cut); z-index: -2; border-radius: inherit; background: var(--sbg); pointer-events: none; }
.sh-highlight { position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 -8px 10px rgba(255, 255, 255, .12); transition: box-shadow .3s; pointer-events: none; }
.btn.primary:hover .sh-highlight { box-shadow: inset 0 -6px 10px rgba(255, 255, 255, .25); }
.btn.primary:active .sh-highlight { box-shadow: inset 0 -10px 10px rgba(255, 255, 255, .25); }
.btn.primary:disabled .sh-spark-wrap { display: none; }
@keyframes shimmer-slide { to { transform: translate(calc(100cqw - 100%), 0); } }
@keyframes spin-around {
  0% { transform: translateZ(0) rotate(0); }
  15%, 35% { transform: translateZ(0) rotate(90deg); }
  65%, 85% { transform: translateZ(0) rotate(270deg); }
  100% { transform: translateZ(0) rotate(360deg); }
}

/* ---------- Rainbow Button: главная кнопка на главной и на экране записи ---------- */
.hero-rec .btn.primary, .consent .btn.primary.lg {
  --c1: #ff7ab6; --c2: #9a86ff; --c3: #5b95ff; --c4: #5fd3f5; --c5: #b6f27a;
  background:
    linear-gradient(#fff, #fff),
    linear-gradient(#fff 50%, rgba(255, 255, 255, .6) 80%, rgba(0, 0, 0, 0)),
    linear-gradient(90deg, var(--c1), var(--c5), var(--c3), var(--c4), var(--c2));
  background-size: 200%;
  background-clip: padding-box, border-box, border-box;
  background-origin: border-box;
  border: 2px solid transparent;
  border-radius: 14px;
  color: #121213;
  overflow: visible;
  box-shadow: none;
  animation: rainbow 2.4s infinite linear;
}
.hero-rec .btn.primary .i, .consent .btn.primary.lg .i { stroke: #121213; }
.hero-rec .btn.primary::before, .consent .btn.primary.lg::before {
  content: ""; position: absolute; left: 50%; bottom: -20%; z-index: -1; width: 60%; height: 20%; transform: translateX(-50%);
  background: linear-gradient(90deg, var(--c1), var(--c5), var(--c3), var(--c4), var(--c2));
  background-size: 200%; filter: blur(.75rem); animation: rainbow 2.4s infinite linear; pointer-events: none;
}
.hero-rec .btn.primary > .sh-spark-wrap, .hero-rec .btn.primary > .sh-backdrop, .hero-rec .btn.primary > .sh-highlight,
.consent .btn.primary.lg > .sh-spark-wrap, .consent .btn.primary.lg > .sh-backdrop, .consent .btn.primary.lg > .sh-highlight { display: none; }
.consent .btn.primary.lg:disabled { animation: none; opacity: .45; }
.consent .btn.primary.lg:disabled::before { display: none; }
@keyframes rainbow { 0% { background-position: 0%; } 100% { background-position: 200%; } }

/* ---------- Interactive Hover Button: второстепенные кнопки ---------- */
.btn.ih { border-radius: 999px; border: 1px solid var(--line); overflow: hidden; }
.btn.ih::before { display: none; }
.ih-row { display: inline-flex; align-items: center; gap: 10px; }
.ih-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: linear-gradient(135deg, #a08cff, #5b95ff); transition: transform .3s; }
.ih-text { display: inline-flex; align-items: center; gap: 8px; transition: transform .3s, opacity .3s; }
.ih-hover {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff;
  transform: translateX(48px); opacity: 0; transition: transform .3s, opacity .3s; pointer-events: none;
}
.ih-hover .i { width: 18px; height: 18px; }
@media (hover: hover) {
  .btn.ih:hover .ih-dot { transform: scale(100.8); }
  .btn.ih:hover .ih-text { transform: translateX(48px); opacity: 0; }
  .btn.ih:hover .ih-hover { transform: translateX(-12px); opacity: 1; }
}

/* ---------- Shine Border: рамка на карточках ---------- */
.panel, .goal, .figures, .suggest, .modal { position: relative; }
.panel::after, .goal::after, .figures::after, .suggest::after, .modal::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background-image: radial-gradient(transparent, transparent, #a08cff, #5b95ff, #ff8ad8, transparent, transparent);
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: shine 14s infinite linear;
  will-change: background-position;
}
@keyframes shine { 0% { background-position: 0% 0%; } 50% { background-position: 100% 100%; } to { background-position: 0% 0%; } }

/* ---------- Border Beam: луч по краю главных блоков ---------- */
.hero-rec::after, .composer::after { display: none; }
.bb {
  position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none; z-index: 3;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.bb i {
  position: absolute; aspect-ratio: 1; width: var(--bb-size, 140px);
  background: linear-gradient(to left, var(--bb-from, #ffaa40), var(--bb-to, #9c40ff), transparent);
  offset-path: rect(0 auto auto 0 round var(--bb-size, 140px));
  animation: bb-move var(--bb-dur, 8s) linear infinite;
}
.bb i + i { --bb-from: #5fd3f5; --bb-to: #5b95ff; animation-delay: calc(var(--bb-dur, 8s) / -2); }
.composer .bb { opacity: 0; transition: opacity .3s; }
.composer:focus-within .bb { opacity: 1; }
@keyframes bb-move { from { offset-distance: 0%; } to { offset-distance: 100%; } }
@supports not (offset-path: rect(0 auto auto 0)) { .bb { display: none; } .hero-rec::after { display: block; } }

/* ---------- Pulsating Button: кнопка «Сохранить» во время записи ---------- */
.round.stop { --pulse: rgba(154, 134, 255, .55); animation: pulse-ripple 1.6s cubic-bezier(.16, 1, .3, 1) infinite; }
@keyframes pulse-ripple { 0% { box-shadow: 0 12px 34px rgba(91, 149, 255, .35), 0 0 0 0 var(--pulse); } 100% { box-shadow: 0 12px 34px rgba(91, 149, 255, .35), 0 0 0 18px rgba(154, 134, 255, 0); } }

/* ---------- Gooey-вкладки, сросшиеся с панелью (Fancy Components) ---------- */
.goo-tabs { position: relative; isolation: isolate; margin-bottom: 8px; }
.goo-tabs > .segmented { display: flex; width: 100%; padding: 0; border: 0; background: transparent; border-radius: 0; margin: 0 !important; backdrop-filter: none; -webkit-backdrop-filter: none; }
.goo-tabs > .segmented > .goo-layer { display: none; }
.goo-tabs > .segmented button { flex: 1; height: 48px; border-radius: 0; font-size: 15px; background: transparent !important; }
.goo-tabs > .segmented button.active { color: var(--text); }
.goo-tabs > section { position: relative; z-index: 1; padding: 26px 24px 28px; }
.goo-tabs-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.goo-tabs-bg .goo-part { position: absolute; inset: 0 0 auto 0; height: 120px; filter: url(#mt-goo-tabs); }
.goo-tabs-bg .tab-blob { position: absolute; top: 0; left: 0; height: 60px; background: #262539; transition: transform .45s cubic-bezier(.4, 0, .1, 1), width .45s cubic-bezier(.4, 0, .1, 1); }
.goo-tabs-bg .panel-top { position: absolute; left: 0; right: 0; top: 48px; height: 72px; background: #262539; }
.goo-tabs-bg .panel-rest { position: absolute; left: 0; right: 0; top: 96px; bottom: 0; background: #262539; border-radius: 0 0 22px 22px; }
.no-goo .goo-tabs-bg .goo-part { filter: none; }
.no-goo .goo-tabs-bg .tab-blob { border-radius: 14px 14px 0 0; }
@media (max-width: 560px) { .goo-tabs > section { padding: 20px 14px 22px; } }

/* ---------- Параллакс-галерея (схема Skiper30) ---------- */
.px-gallery-wrap { position: relative; }
.px-gallery {
  position: relative; height: 820px; display: flex; gap: 2vw; padding: 2vw; overflow: hidden;
  border-radius: 28px; background: rgba(20, 20, 26, .6); border: 1px solid var(--line-soft);
}
.px-gallery .gcol { position: relative; height: 165%; width: 25%; min-width: 0; display: flex; flex-direction: column; gap: 2vw; will-change: transform; }
.px-gallery .gcol:nth-child(1) { top: -45%; }
.px-gallery .gcol:nth-child(2) { top: -95%; }
.px-gallery .gcol:nth-child(3) { top: -45%; }
.px-gallery .gcol:nth-child(4) { top: -75%; }
.gtile {
  position: relative; flex: 1 1 0; min-height: 0; width: 100%; border-radius: 1.4vw; overflow: hidden;
  padding: 22px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; color: #fff; text-decoration: none;
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--k) 70%, transparent), transparent 60%),
    radial-gradient(90% 80% at 100% 100%, rgba(91, 149, 255, .55), transparent 60%),
    linear-gradient(160deg, #2a2747, #161724);
}
.gtile::before {
  content: ""; position: absolute; inset: 0; opacity: .18; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.gtile > * { position: relative; }
.gtile .gk { font-size: 12.5px; color: rgba(255, 255, 255, .78); display: flex; align-items: center; gap: 8px; }
.gtile .gk i { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.gtile p { font-size: clamp(15px, 1.35vw, 20px); font-weight: 600; line-height: 1.3; text-wrap: balance; }
.gtile .gs { font-size: 12.5px; color: rgba(255, 255, 255, .65); }
@media (max-width: 880px) {
  .px-gallery { height: 560px; gap: 10px; padding: 10px; }
  .px-gallery .gcol { width: 50%; gap: 10px; }
  .px-gallery .gcol:nth-child(n+3) { display: none; }
  .gtile { border-radius: 16px; padding: 16px; }
  .gtile p { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .sh-spark, .sh-spark i, .hero-rec .btn.primary, .hero-rec .btn.primary::before, .bb i, .round.stop,
  .panel::after, .goal::after, .figures::after, .suggest::after, .modal::after { animation: none; }
}
