* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
.safari-clip-fix { overflow: hidden; -webkit-transform: translateZ(0); transform: translateZ(0); }
.no-scroll { overflow: hidden; height: 100vh; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.hide-scrollbar::-webkit-scrollbar { display: none; }
.justify-long { text-align: justify; text-justify: inter-character; -webkit-hyphens: none !important; -ms-hyphens: none !important; hyphens: none !important; }

/* Skonsolidowany system nav-light / nav-dark z oryginalnymi kolorami hover */
.nav-logo { transition: filter 0.4s ease-in-out, transform 0.4s ease-in-out; }
.nav-text { transition: color 0.4s ease-in-out, transform 0.4s ease-in-out; }
.nav-light .nav-text { color: #ffffff; }
.nav-light .nav-text-hover:hover { color: #3399ff; }
.nav-light .nav-logo { filter: brightness(0) invert(1); }
.nav-dark .nav-text { color: #000000; }
.nav-dark .nav-text-hover:hover { color: #3399ff; }
.nav-dark .nav-logo { filter: brightness(0); }

.fade-in-scale { opacity: 0; transform: translateY(40px); transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1); will-change: opacity, transform; }
.fade-in-scale.is-visible { opacity: 1; transform: translateY(0); }
noscript .fade-in-scale { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .fade-in-scale { transition: none !important; transform: none !important; opacity: 1 !important; }
    .success-anim-svg * { animation: none !important; transition: none !important; }
}

.success-anim-svg .envelope-group { transform-origin: center; animation: envelopeShrink 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.success-anim-svg .check-group { animation: showCheckGroup 0.1s forwards 0.5s; }
.success-anim-svg .circle-path { animation: drawPath 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.5s; }
.success-anim-svg .check-path { animation: drawPath 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.8s; }
@keyframes envelopeShrink { 0% { transform: scale(1); opacity: 1; stroke-dasharray: 200; stroke-dashoffset: 0; } 50% { transform: scale(0.8); opacity: 1; } 100% { transform: scale(0.5); opacity: 0; stroke-dasharray: 200; stroke-dashoffset: 200; } }
@keyframes showCheckGroup { to { opacity: 1; } }
@keyframes drawPath { to { stroke-dashoffset: 0; } }
.is-success #contactForm, .is-error #contactForm { opacity: 0; pointer-events: none; transform: scale(0.95); }
.is-success #successState { opacity: 1; pointer-events: auto; }
.is-success #successTitle, .is-success #successDesc { transform: scale(1); opacity: 1; }
.is-error #errorState { opacity: 1; pointer-events: auto; }
.is-error #errorTitle, .is-error #errorDesc, .is-error #retryBtn { transform: scale(1); opacity: 1; }
.toc-link.active { color: #0166cc; font-weight: 500; }
.toc-link.active::before { content: '—'; position: absolute; left: -1.5rem; color: #0166cc; }

@media (max-width: 767px) {
    .justify-long {
        text-align: left !important;
        text-justify: auto !important;
        letter-spacing: normal !important;
    }
    .mobile-justify {
        text-align: justify !important;
        text-justify: inter-character !important;
        letter-spacing: 0.015em !important;
    }
    #successDesc, #errorDesc {
        text-align: center !important;
        text-justify: auto !important;
        letter-spacing: normal;
    }
}

.group.is-highlighted > div.bg-white {
    transform: scale(1.02);
    box-shadow: 0 0 0 2px #0166cc; 
}
.group.is-highlighted h3 {
    color: #0166cc;
}
.group.is-highlighted .rounded-full.bg-\[\#0166cc\] {
    transform: scale(1.1);
}

.toc-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}
.toc-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.toc-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.toc-scrollbar::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 4px;
}
.toc-scrollbar:hover::-webkit-scrollbar-thumb {
    background: #d1d5db;
}

/* Smart Sticky Header */
#nav-container {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.4s ease-in-out;
}
.nav-sticky.nav-dark {
    background-color: #ffffff;
}
.nav-sticky.nav-light {
    background-color: #000000;
}