/* ==========================================
   ANIMATED IT-LOGO — ITBBX
   ========================================== */
.logo{display:inline-flex;align-items:center;gap:12px;text-decoration:none}
.logo-chip{position:relative;width:38px;height:38px;flex-shrink:0}
.logo-svg{width:100%;height:100%;display:block;overflow:visible}
.logo-word{
    display:inline-flex;
    font-family:'Unbounded',-apple-system,sans-serif;
    font-weight:800;font-size:inherit;letter-spacing:.02em;
    animation:wordIn .8s .25s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes wordIn{
    from{opacity:0;transform:translateY(14px);letter-spacing:.35em}
    to{opacity:1;transform:none;letter-spacing:.02em}
}
.lw{display:inline-block;position:relative;transition:color .2s;transition-delay:calc(.03s * var(--i))}
.logo:hover .lw{
    color:#C6FF4A;
    animation:lwGlitch .35s steps(2) both;
    animation-delay:calc(.04s * var(--i));
}
@keyframes lwGlitch{
    0%{transform:translate(0);text-shadow:none}
    25%{transform:translate(-1.5px,1px);text-shadow:1.5px 0 rgba(198,255,74,.85),-1.5px 0 rgba(123,97,255,.85)}
    50%{transform:translate(1.5px,-1px);text-shadow:-1.5px 0 rgba(0,224,198,.85),1.5px 0 rgba(255,92,122,.85)}
    100%{transform:translate(0);text-shadow:none}
}

/* Чип: контур рисуется при загрузке + пульс свечения */
.chip-body{
    fill:rgba(255,255,255,.03);
    stroke-dasharray:150;stroke-dashoffset:150;
    animation:chipDraw 1.1s ease forwards, chipGlow 3s ease-in-out 1.1s infinite;
}
[data-theme="light"] .chip-body{fill:rgba(16,16,20,.03)}
@keyframes chipDraw{to{stroke-dashoffset:0}}
@keyframes chipGlow{
    0%,100%{filter:drop-shadow(0 0 2px rgba(198,255,74,.25))}
    50%{filter:drop-shadow(0 0 9px rgba(198,255,74,.65))}
}

/* Ножки чипа: бегущий импульс данных */
.chip-pins line{opacity:.3;animation:pinPulse 1.6s ease-in-out infinite}
.chip-pins line:nth-child(4n+1){animation-delay:0s}
.chip-pins line:nth-child(4n+2){animation-delay:.2s}
.chip-pins line:nth-child(4n+3){animation-delay:.4s}
.chip-pins line:nth-child(4n){animation-delay:.6s}
@keyframes pinPulse{0%,100%{opacity:.25}50%{opacity:1}}

/* Дорожки платы: бесконечная прорисовка */
.trace{stroke-dasharray:40;stroke-dashoffset:40;animation:traceDraw 2.6s ease-in-out infinite}
.trace.t2{animation-delay:1.3s}
@keyframes traceDraw{
    0%{stroke-dashoffset:40;opacity:0}
    25%{opacity:1}
    60%{stroke-dashoffset:0;opacity:1}
    100%{stroke-dashoffset:0;opacity:0}
}

/* Терминал: стрелка и мигающий курсор */
.prompt-chevron{animation:chevPulse 2s ease-in-out infinite}
@keyframes chevPulse{
    0%,100%{opacity:.85}
    50%{opacity:1;filter:drop-shadow(0 0 4px rgba(198,255,74,.8))}
}
.prompt-caret{animation:caretBlink 1s steps(1) infinite}
@keyframes caretBlink{50%{opacity:0}}

/* Статичный режим (выключено в админке) */
.logo-static .chip-body,
.logo-static .chip-pins line,
.logo-static .trace,
.logo-static .prompt-chevron,
.logo-static .prompt-caret,
.logo-static .logo-word,
.logo-static .lw{animation:none!important}
.logo-static .chip-body{stroke-dashoffset:0}
.logo-static .trace{stroke-dashoffset:0;opacity:1}
.logo-static:hover .lw{animation:none!important;color:inherit}

/* ============ РАЗМЕРЫ ============ */
.logo-lg{font-size:clamp(26px,6vw,42px)}
.logo-lg .logo-chip{width:92px;height:92px}
.logo-admin{font-size:16px}
.logo-admin .logo-chip{width:34px;height:34px}
.logo-login{font-size:22px;justify-content:center}
.logo-login .logo-chip{width:48px;height:48px}

/* ============ ПРЕЛОАДЕР ============ */
.preloader{
    position:fixed;inset:0;z-index:100000;
    background:var(--bg,#060609);
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:28px;
    transition:opacity .6s ease,visibility .6s;
}
.preloader .logo{flex-direction:column;gap:20px}
.preloader.done{opacity:0;visibility:hidden;pointer-events:none}
.preloader .bar{width:180px;height:3px;border-radius:3px;background:rgba(128,128,128,.15);overflow:hidden}
.preloader .bar i{display:block;height:100%;width:40%;border-radius:3px;background:linear-gradient(90deg,#C6FF4A,#00E0C6,#7B61FF);animation:barLoad 1.1s ease-in-out infinite}
@keyframes barLoad{0%{transform:translateX(-110%)}100%{transform:translateX(360%)}}