/* ==========================================================================
   DYWE REDESIGN LAYER
   Подключается ПОСЛЕ styles.css и только дополняет его.
   Откат: удалить <link href="css/redesign.css"> и <script src="js/fx.js"> из index.html.
   ========================================================================== */

@property --ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

:root{
  --accent2:#7c5cff;
  --glow:rgba(194,138,255,.55);
  --ease:cubic-bezier(.2,.8,.2,1);
}

html{ scroll-padding-top:72px; }
::selection{ background:rgba(194,138,255,.35); color:#fff; }

/* ---------- scroll progress + nav ---------- */
.fx-progress{
  position:fixed; top:0; left:0; right:0; height:2px; z-index:70;
  background:linear-gradient(90deg,var(--accent2),var(--accent),#ffd3f8);
  transform-origin:0 50%; transform:scaleX(0);
  box-shadow:0 0 12px var(--glow);
  pointer-events:none;
}
.nav{ transition:background .3s, box-shadow .3s, border-color .3s; }
.nav.scrolled{
  background:rgba(9,7,17,.78);
  border-bottom-color:rgba(194,138,255,.18);
  box-shadow:0 10px 40px -18px rgba(0,0,0,.9);
}
.nav ul a{ position:relative; padding:6px 0; transition:color .2s; }
.nav ul a::after{
  content:""; position:absolute; left:0; right:0; bottom:-2px; height:2px; border-radius:2px;
  background:linear-gradient(90deg,var(--accent2),var(--accent));
  transform:scaleX(0); transform-origin:left; transition:transform .3s var(--ease);
}
.nav ul a:hover::after, .nav ul a.active::after{ transform:scaleX(1); }
.nav ul a.active{ color:var(--text); }
.logo{ transition:opacity .2s; }
.logo:hover{ opacity:.85; }
.logo img{ filter:drop-shadow(0 0 10px rgba(194,138,255,.55)); }

/* ---------- buttons ---------- */
.btn{ position:relative; overflow:hidden; transition:transform .2s var(--ease), box-shadow .25s, background .2s, border-color .2s, color .2s; }
.btn-primary{
  background:linear-gradient(135deg,#dcb4ff 0%,#b47bff 55%,#8f66ff 100%);
  color:#14082a;
  box-shadow:0 10px 30px -10px rgba(168,110,255,.85), inset 0 1px 0 rgba(255,255,255,.45);
}
.btn-primary:hover{
  background:linear-gradient(135deg,#e6c4ff 0%,#bf8bff 55%,#9a74ff 100%);
  transform:translateY(-2px);
  box-shadow:0 16px 40px -10px rgba(168,110,255,.95), inset 0 1px 0 rgba(255,255,255,.5);
}
.btn-primary::after{
  content:""; position:absolute; top:0; bottom:0; width:60%; left:-80%;
  background:linear-gradient(100deg,transparent,rgba(255,255,255,.55),transparent);
  transform:skewX(-20deg); transition:left .6s var(--ease); pointer-events:none;
}
.btn-primary:hover::after{ left:130%; }
.btn-ghost{ background:rgba(255,255,255,.02); }
.btn-ghost:hover{ background:var(--accent-soft); border-color:var(--accent); transform:translateY(-2px); }
.btn:active{ transform:translateY(0); }

/* ---------- headings ---------- */
.h2, .final h2{
  background:linear-gradient(180deg,#ffffff 20%,#b9a8ea 100%);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  padding-bottom:.08em;
}
.eyebrow{ display:inline-flex; align-items:center; gap:12px; }
.eyebrow::before{
  content:""; width:28px; height:1px; background:linear-gradient(90deg,transparent,var(--accent));
}
#faq .eyebrow{ font-size:13px; font-weight:500; }
.lead{ line-height:1.65; }

/* ---------- hero ---------- */
.hero{ overflow:hidden; isolation:isolate; }
.hero::before{
  content:""; position:absolute; inset:-20% -10% auto -10%; height:140%; z-index:0; pointer-events:none;
  background:
    radial-gradient(34% 40% at 18% 18%, rgba(124,92,255,.34), transparent 70%),
    radial-gradient(30% 36% at 82% 30%, rgba(194,138,255,.26), transparent 70%),
    radial-gradient(26% 30% at 60% 90%, rgba(255,120,200,.14), transparent 70%);
  filter:blur(30px);
  animation:aurora 16s ease-in-out infinite alternate;
}
@keyframes aurora{
  0%{ transform:translate3d(0,0,0) scale(1); }
  50%{ transform:translate3d(3%,4%,0) scale(1.08); }
  100%{ transform:translate3d(-3%,-2%,0) scale(1.03); }
}
.hero h1{
  background:linear-gradient(180deg,#fff 30%,#c9bdf0 100%);
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.hero h1 em{
  background:linear-gradient(100deg,#7c5cff,#c28aff 40%,#ffd3f8 60%,#c28aff 80%,#7c5cff);
  background-size:220% 100%;
  -webkit-background-clip:text; background-clip:text; color:transparent;
  animation:shimmer 6s linear infinite;
  filter:drop-shadow(0 0 22px rgba(194,138,255,.35));
}
@keyframes shimmer{ to{ background-position:-220% 0; } }
.hero-meta span{
  padding:6px 12px; border:1px solid var(--line2); border-radius:99px; background:rgba(17,14,30,.6);
  backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
}
.hero-meta span::before{ box-shadow:0 0 8px var(--buy); animation:blink 2.4s ease-in-out infinite; }
@keyframes blink{ 50%{ opacity:.35; } }

/* terminal with a travelling light border */
.term{
  --ang:0deg;
  border:1px solid transparent;
  background:
    linear-gradient(var(--panel),var(--panel)) padding-box,
    conic-gradient(from var(--ang), rgba(53,43,87,.9) 0 55%, var(--accent) 78%, #ffd3f8 85%, rgba(53,43,87,.9) 100%) border-box;
  animation:spin 7s linear infinite;
  box-shadow:0 40px 90px -30px rgba(0,0,0,.9), 0 0 80px -20px rgba(124,92,255,.45);
  transition:transform .2s ease-out;
  will-change:transform;
}
@keyframes spin{ to{ --ang:360deg; } }
.term-head{ background:linear-gradient(180deg,rgba(255,255,255,.03),transparent); }
.term-head .tag{ background:rgba(194,138,255,.08); border-color:rgba(194,138,255,.3); color:var(--accent); }
.ob-mid{ background:linear-gradient(90deg,transparent,var(--accent-soft),transparent); }

/* ---------- strip ---------- */
.strip li{
  border:1px solid var(--line2); border-radius:99px; padding:6px 16px;
  background:rgba(25,21,41,.5); transition:border-color .2s, color .2s, transform .2s;
}
.strip li:hover{ border-color:var(--accent); color:var(--text); transform:translateY(-2px); }

/* ---------- spotlight cards (cursor-follow glow) ---------- */
.card,.aud,.ph,.step,.viz,.num,.build,.diagram{
  --mx:-300px; --my:-300px;
  background-image:radial-gradient(380px circle at var(--mx) var(--my), rgba(194,138,255,.13), transparent 60%);
  background-color:var(--panel);
  transition:border-color .3s, transform .35s var(--ease), box-shadow .35s;
}
.card:hover,.aud:hover,.ph:hover{
  border-color:rgba(194,138,255,.5);
  transform:translateY(-4px);
  box-shadow:0 24px 50px -24px rgba(124,92,255,.55);
}
.ph.now{ box-shadow:0 0 0 1px rgba(194,138,255,.25), 0 24px 60px -28px rgba(124,92,255,.8); }
.ph.now .when span:first-child::before{
  content:""; display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--buy);
  margin-right:8px; box-shadow:0 0 0 0 rgba(47,208,138,.6); animation:pulse 2s infinite;
}
@keyframes pulse{ 70%{ box-shadow:0 0 0 9px rgba(47,208,138,0); } 100%{ box-shadow:0 0 0 0 rgba(47,208,138,0); } }
.stat, .num b{
  background:linear-gradient(180deg,#fff,#cdbdf5);
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.stat small{ -webkit-text-fill-color:var(--sell); }
.pipe, .nums, .vs{ box-shadow:0 30px 70px -40px rgba(0,0,0,.9); }
.step:hover{ background-image:radial-gradient(380px circle at var(--mx) var(--my), rgba(194,138,255,.16), transparent 60%); }
.step .n{ font-weight:500; }

/* ---------- latency bars ---------- */
.bar-row .t i{
  background:linear-gradient(90deg,var(--accent2),var(--accent));
  box-shadow:0 0 14px rgba(194,138,255,.6);
}

/* ---------- tabs ---------- */
.tab{ transition:color .2s, border-color .2s, background .2s; border-radius:8px 8px 0 0; }
.tab:hover{ background:rgba(194,138,255,.06); }
.tab[aria-selected="true"]{ background:linear-gradient(180deg,transparent,rgba(194,138,255,.08)); }
.panel.on{ animation:panelIn .45s var(--ease); }
@keyframes panelIn{ from{ opacity:0; transform:translateY(10px); } to{ opacity:1; transform:none; } }
.viz{ box-shadow:0 24px 60px -34px rgba(0,0,0,.9); }
.vault{ transition:padding .2s, background .2s; }
.vault:hover{ background:linear-gradient(90deg,var(--accent-soft),transparent); padding-left:10px; }
.points li::before{ box-shadow:0 0 10px var(--glow); }

/* ---------- comparison ---------- */
.vs-r{ transition:background .25s; }
.vs-r:hover{ background:rgba(194,138,255,.04); }
.vs-r b{ text-shadow:0 0 14px var(--glow); }

/* ---------- security ---------- */
.stage{ position:relative; }
.stage::before{
  content:""; position:absolute; inset:10% 5%; z-index:0; pointer-events:none;
  background:radial-gradient(closest-side,rgba(124,92,255,.28),transparent 75%); filter:blur(20px);
}
.v3d{ position:relative; z-index:1; }
.slab{ backdrop-filter:blur(2px); }

/* ---------- FAQ ---------- */
.faq{ margin:40px auto 0; }
.faq details{ transition:background .25s; }
.faq details[open]{ background:linear-gradient(90deg,rgba(194,138,255,.05),transparent); }
.faq summary{ transition:color .2s; }
.faq summary:hover, .faq details[open] summary{ color:#fff; }
.faq details[open] summary{ color:var(--accent); }
.faq details p{ animation:panelIn .35s var(--ease); }

/* ---------- final CTA ---------- */
.final{ position:relative; overflow:hidden; isolation:isolate; background:
  radial-gradient(60% 90% at 50% 110%, rgba(194,138,255,.28), transparent 70%),
  radial-gradient(40% 60% at 15% 0%, rgba(124,92,255,.18), transparent 70%),
  var(--bg); }
.final::before{
  content:""; position:absolute; inset:0; z-index:-1;
  background:
    linear-gradient(var(--line) 1px,transparent 1px) 0 0/100% 56px,
    linear-gradient(90deg,var(--line) 1px,transparent 1px) 0 0/56px 100%;
  -webkit-mask-image:radial-gradient(60% 70% at 50% 100%,#000,transparent 80%);
          mask-image:radial-gradient(60% 70% at 50% 100%,#000,transparent 80%);
  opacity:.7;
}

/* ---------- follow strip, footer, modal ---------- */
.social-btn{ border-radius:10px; }
dialog{ box-shadow:0 40px 120px -20px rgba(0,0,0,.95), 0 0 0 1px rgba(194,138,255,.18), 0 0 80px -30px rgba(124,92,255,.6); }
dialog[open]{ animation:dlgIn .35s var(--ease); }
@keyframes dlgIn{ from{ opacity:0; transform:translateY(14px) scale(.98); } to{ opacity:1; transform:none; } }
input:hover,select:hover{ border-color:rgba(194,138,255,.5); }

/* ---------- reveal on scroll (только если сработал JS) ---------- */
.js-fx .rv{
  opacity:0; transform:translateY(26px);
  transition:opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay:var(--d,0ms);
}
.js-fx .rv.in{ opacity:1; transform:none; }
/* hover-transform карточек не должен конфликтовать с reveal */
.js-fx .card.rv.in:hover,.js-fx .aud.rv.in:hover,.js-fx .ph.rv.in:hover{ transform:translateY(-4px); transition-delay:0ms; }

/* hero load-in */
.js-fx .hero .eyebrow,.js-fx .hero h1,.js-fx .hero .lead,.js-fx .hero .cta-row,.js-fx .hero-meta,.js-fx .hero .term{
  animation:heroIn .9s var(--ease) both;
}
.js-fx .hero h1{ animation-delay:.08s; }
.js-fx .hero .lead{ animation-delay:.16s; }
.js-fx .hero .cta-row{ animation-delay:.24s; }
.js-fx .hero-meta{ animation-delay:.32s; }
.js-fx .hero .term{ animation:heroIn .9s var(--ease) .2s both, spin 7s linear infinite; }
@keyframes heroIn{ from{ opacity:0; transform:translateY(22px); } to{ opacity:1; transform:none; } }

@media(max-width:860px){
  .hero::before{ filter:blur(20px); }
  .hero-meta span{ font-size:12px; }
}

@media(prefers-reduced-motion:reduce){
  .js-fx .rv{ opacity:1; transform:none; }
  .hero::before,.hero h1 em,.term,.hero-meta span::before,.ph.now .when span:first-child::before{ animation:none!important; }
  .fx-progress{ display:none; }
}

/* ---------- nav fit fix ---------- */
.nav .wrap{ gap:20px; }
.nav ul{ gap:18px; margin-left:4px; }
.nav ul a{ white-space:nowrap; font-size:13.5px; }
.hero-meta{ gap:10px 12px; }

/* ---------- numbers row: no wrapping ---------- */
.num b{ font-size:clamp(18px,1.85vw,26px); white-space:nowrap; letter-spacing:-.04em; }
@media(max-width:900px){ .num b{ font-size:clamp(18px,5vw,26px); } }

/* mobile comparison: arrow sits inline with the text */
@media(max-width:700px){ .vs-r p:last-child{ display:block; } }
.strip .wrap{ row-gap:12px; }
