body {
    background-color: #050505;
    color: #E5E5E5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.menu-open {
    overflow: hidden;
}

body.modal-open {
    overflow: hidden;
}

.stretch-font {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    transform: scale(0.85, 1.4);
    transform-origin: left center;
    letter-spacing: -0.05em;
    font-weight: 700;
    display: inline-block;
}

.stretch-font-extreme {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    transform: scale(0.7, 1.8);
    transform-origin: center;
    letter-spacing: -0.08em;
    font-weight: 900;
}

.stretch-menu {
    transform: scale(0.9, 1.2);
    transform-origin: left;
}

.bg-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='1'/%3E%3C/svg%3E");
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #333; }
::-webkit-scrollbar-thumb:hover { background: #CCFF00; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.icon-svg {
    width: 18px;
    height: 18px;
    filter: brightness(0) saturate(100%) invert(69%) sepia(0%) saturate(0%) hue-rotate(160deg) brightness(94%) contrast(89%);
    transition: all 0.2s ease;
}

.icon-btn:hover {
    border: 1px solid #CCFF00;
    transform: scale(1.1);
}

.icon-btn:hover .icon-svg, 
a:hover .icon-svg {
    filter: brightness(0) saturate(100%) invert(86%) sepia(28%) saturate(1083%) hue-rotate(27deg) brightness(106%) contrast(104%);
}

.marquee-container {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

/* Pauza animacji pod kursorem — linki są celem ruchomym, pauza ułatwia kliknięcie */
.marquee-content:hover,
.marquee-content:focus-within {
    animation-play-state: paused;
}

.marquee-link {
    cursor: pointer;
}

/* Marquee leży na acid tle, więc standardowy acid focus-ring byłby niewidoczny */
.marquee-link:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
}

.marquee-content {
    display: inline-block;
    /* Domyślnie (mobile) szybciej - 10 sekund */
    animation: marquee 10s linear infinite, marquee-glitch 8s steps(1) infinite;
    will-change: transform, filter;
}

/* Dla ekranów większych niż tablet (desktop) - wolniej, 20 sekund */
@media (min-width: 768px) {
    .marquee-content {
        animation: marquee 20s linear infinite, marquee-glitch 8s steps(1) infinite;
    }
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Subtelny "glitch" co ~8s: krótkie przebłyski inwersji/skali.
   Tylko filter i letter-spacing zmieniamy — transform zostaje dla scrolla. */
@keyframes marquee-glitch {
    0%, 93.9%, 100% {
        filter: none;
        letter-spacing: 0.3em;
    }
    94% {
        filter: invert(1) hue-rotate(90deg);
        letter-spacing: 0.25em;
    }
    94.6% {
        filter: none;
        letter-spacing: 0.3em;
    }
    95.2% {
        filter: invert(1) hue-rotate(180deg);
        letter-spacing: 0.32em;
    }
    95.8% {
        filter: none;
        letter-spacing: 0.3em;
    }
}

.stroke-text-white { -webkit-text-stroke: 2px #E5E5E5; }
.stroke-text-none { -webkit-text-stroke: 0; }

button, a {
    touch-action: manipulation;
}

.custom-scrollbar::-webkit-scrollbar {
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #1a1a1a;
    border: 1px solid #333;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #666;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #CCFF00; /* Kolor ACID */
}

/* Scroll-reveal: domyślnie schowane, po wejściu w viewport pojawiają się */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}
.reveal.is-visible {
    opacity: 1;
    transform: none;
}
.reveal-stagger > * {
    transition-delay: calc(var(--reveal-i, 0) * 70ms);
}

/* Terminalowy kursor blink (dopisywany jako ::after) */
.cursor-blink::after {
    content: '_';
    display: inline-block;
    margin-left: 0.3em;
    color: #CCFF00;
    font-weight: 400;
    animation: terminal-blink 1.1s steps(1) infinite;
}
@keyframes terminal-blink {
    0%, 49.99% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Diagonalny divider dla sekcji BIO — lab "kartka" nachylona nad void tłem */
#bio {
    clip-path: polygon(0 22px, 100% 0, 100% calc(100% - 22px), 0 100%);
}
@media (min-width: 768px) {
    #bio {
        clip-path: polygon(0 48px, 100% 0, 100% calc(100% - 48px), 0 100%);
    }
}

/* Spójne focus-visible dla użytkowników klawiatury */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid #CCFF00;
    outline-offset: 2px;
}

/* Szacunek dla użytkowników z włączoną preferencją redukcji ruchu */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .marquee-content {
        animation: none;
        transform: none;
        filter: none !important;
    }
    .animate-spin-slow {
        animation: none !important;
    }
    .cursor-blink::after {
        animation: none;
        opacity: 1;
    }
    .reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}