:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --accent: #c8ff00;
    --accent-glow: rgba(200, 255, 0, 0.4);
    --border-dim: #222222;
    --glass-bg: rgba(22, 22, 22, 0.6);
}

html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body {
    background-color: var(--bg-primary);
    color: #f0f0f0;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Noise overlay — GPU-accelerated, contain: strict eliminates repaint during scroll */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 30;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    will-change: transform;
    transform: translateZ(0);
    contain: strict;
}

/* Scanline — uses transform instead of bottom to avoid layout thrashing */
.scanline {
    width: 100%;
    height: 100px;
    z-index: 25;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(200, 255, 0, 0.05) 50%, rgba(0, 0, 0, 0) 100%);
    opacity: 0.1;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    will-change: transform;
    transform: translateY(-100vh);
    animation: scanline 8s linear infinite;
    contain: layout size;
}

@keyframes scanline {
    0% {
        transform: translateY(-100vh);
    }

    100% {
        transform: translateY(200vh);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.text-glow {
    text-shadow: 0 0 20px var(--accent-glow);
}

.box-glow {
    box-shadow: 0 0 30px -10px var(--accent-glow);
}

.cursor-blink {
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.grid-bg {
    background-size: 40px 40px;
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    will-change: transform;
    transform: translateZ(0);
    contain: strict;
}

/* Glass card — backdrop-filter removed (major jank source with many cards on screen) */
.glass-card {
    background: rgba(18, 18, 18, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.glass-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(200, 255, 0, 0.15);
    transform: translateY(-5px);
}

.glass-card:hover .icon-box {
    background-color: var(--accent);
    color: #000;
}

.price-card {
    position: relative;
    overflow: hidden;
}

.price-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.5;
}

.lang-switch-btn {
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Bilingual Toggle Logic - Improved for stability */
html.lang-pl .lang-en {
    display: none !important;
}

html.lang-en .lang-pl {
    display: none !important;
}

/* Stable width for desktop nav links to prevent jumping on language switch */
.hidden.md\:flex a span[class^="lang-"] {
    display: inline-block;
    min-width: 45px;
    text-align: center;
}

/* Universal language button styling */
.lang-switch-btn {
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

html.lang-pl .btn-lang-pl,
html.lang-en .btn-lang-en {
    color: var(--accent) !important;
    border-bottom-color: var(--accent) !important;
    opacity: 1 !important;
}

html.lang-en .btn-lang-pl,
html.lang-pl .btn-lang-en {
    color: #666 !important;
    border-bottom-color: transparent !important;
    opacity: 0.6;
}

/* Tech Separator */
.tech-separator {
    height: 60px;
    width: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='60' viewBox='0 0 100 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 30h30l5-5h30l5 5h30' stroke='rgba(200, 255, 0, 0.1)' stroke-width='1' fill='none'/%3E%3Crect x='32' y='22' width='6' height='6' fill='rgba(200, 255, 0, 0.05)'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-position: center;
    position: relative;
    opacity: 0.5;
}

.tech-separator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(200, 255, 0, 0.2), transparent);
    z-index: 1;
}

.tech-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    width: 120px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(200, 255, 0, 0.6), transparent);
    box-shadow: 0 0 6px rgba(200, 255, 0, 0.3);
    transform: translateY(-50%);
    animation: data-flow 10s ease-in-out infinite;
    z-index: 2;
    opacity: 0.4;
}

@keyframes data-flow {
    0% {
        left: 10%;
    }

    50% {
        left: 75%;
    }

    100% {
        left: 10%;
    }
}

/* Tech Pill — styl dla tagów technologicznych */
.tech-pill {
    display: inline-block;
    padding: 4px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--accent);
    background: rgba(200, 255, 0, 0.06);
    border: 1px solid rgba(200, 255, 0, 0.15);
    border-radius: 4px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tech-pill:hover {
    background: rgba(200, 255, 0, 0.12);
    border-color: rgba(200, 255, 0, 0.4);
    box-shadow: 0 0 12px rgba(200, 255, 0, 0.15);
}

/* Scroll Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Footer */
.mobile-footer {
    display: none;
}

@media (max-width: 767px) {
    .mobile-footer {
        display: block;
        padding: 24px 24px 32px;
        text-align: center;
        font-family: 'JetBrains Mono', monospace;
        font-size: 10px;
        color: #666;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        border-top: 1px solid var(--border-dim);
        background: var(--bg-primary);
    }

    .mobile-footer a {
        color: var(--accent);
        text-decoration: none;
    }
}

/* Shimmer animation */
@keyframes shimmer {
    0% {
        background-position: -200% -200%;
    }

    100% {
        background-position: 200% 200%;
    }
}

/* ===== GLITCH EFFECT for portfolio mockups ===== */
.site-mockup {
    position: relative;
    overflow: hidden;
    background: #0d0d0d;
    border-radius: 8px;
    border: 1px solid var(--border-dim);
    transition: border-color 0.3s ease;
}

.group:hover .site-mockup {
    border-color: var(--accent);
}

/* Browser chrome bar */
.site-mockup .browser-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #161616;
    border-bottom: 1px solid var(--border-dim);
}

.site-mockup .browser-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #333;
}

.site-mockup .browser-dot:nth-child(1) {
    background: #ff5f57;
}

.site-mockup .browser-dot:nth-child(2) {
    background: #febc2e;
}

.site-mockup .browser-dot:nth-child(3) {
    background: #28c840;
}

.site-mockup .browser-url {
    flex-grow: 1;
    margin-left: 8px;
    padding: 3px 10px;
    background: #0a0a0a;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: #555;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Page content area */
.site-mockup .mock-content {
    position: relative;
    height: 140px;
    overflow: hidden;
}

/* Scanline overlay on mock */
.site-mockup .mock-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.12) 2px,
            rgba(0, 0, 0, 0.12) 4px);
    z-index: 5;
    pointer-events: none;
    opacity: 0.5;
}

/* Glitch flash on hover */
.site-mockup .mock-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg,
            transparent 0%,
            rgba(200, 255, 0, 0.04) 25%,
            transparent 50%,
            rgba(255, 0, 100, 0.03) 75%,
            transparent 100%);
    z-index: 6;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.group:hover .site-mockup .mock-content::after {
    opacity: 1;
    animation: glitch-flicker 3s ease-in-out infinite;
}

@keyframes glitch-flicker {

    0%,
    100% {
        opacity: 0;
        transform: translateY(0);
    }

    15% {
        opacity: 0.8;
        transform: translateY(-2px);
    }

    16% {
        opacity: 0;
        transform: translateY(1px);
    }

    46% {
        opacity: 0.6;
        transform: translateX(2px);
    }

    47% {
        opacity: 0;
        transform: translateX(0);
    }

    76% {
        opacity: 0.7;
        transform: translateY(1px) skewX(0.5deg);
    }

    77% {
        opacity: 0;
        transform: none;
    }
}

/* Glitch tear line */
.glitch-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--accent);
    opacity: 0;
    z-index: 7;
    pointer-events: none;
}

.group:hover .glitch-line {
    animation: glitch-tear 3s ease-in-out infinite;
}

.glitch-line.gl-1 {
    top: 25%;
}

.glitch-line.gl-2 {
    top: 55%;
    animation-delay: 0.8s;
}

.glitch-line.gl-3 {
    top: 80%;
    animation-delay: 1.5s;
}

@keyframes glitch-tear {

    0%,
    100% {
        opacity: 0;
        transform: scaleX(0);
    }

    5% {
        opacity: 0.5;
        transform: scaleX(1);
    }

    7% {
        opacity: 0;
        transform: scaleX(0.3) translateX(50%);
    }

    52% {
        opacity: 0.3;
        transform: scaleX(0.8) translateX(-10%);
    }

    54% {
        opacity: 0;
        transform: scaleX(0);
    }
}

/* Process steps */
.process-step {
    padding-left: 16px;
    border-left: 2px solid rgba(200, 255, 0, 0.15);
    transition: border-color 0.3s ease;
}

.process-step:hover {
    border-left-color: var(--accent);
}

@media (min-width: 1024px) {
    .process-step {
        border-left: none;
        padding-left: 0;
        padding-top: 16px;
        border-top: 2px solid rgba(200, 255, 0, 0.15);
    }

    .process-step:hover {
        border-top-color: var(--accent);
    }
}

/* FAQ Accordion Refinement — Global */
.faq-answer {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    background: rgba(0, 0, 0, 0.2);
}

.faq-answer.is-open {
    max-height: 1000px;
    opacity: 1;
    pointer-events: auto;
}

.faq-content {
    padding: 1.5rem;
    transform: translateY(-10px);
    transition: transform 0.5s ease;
}

.faq-answer.is-open .faq-content {
    transform: translateY(0);
}

.faq-toggle.is-open .material-symbols-outlined {
    transform: rotate(45deg);
    color: var(--accent);
}

/* Material Symbols FOIT fix */
.material-symbols-outlined {
    font-display: block;
    width: 24px;
    height: 24px;
    overflow: hidden;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;

}

/* Standardized Floating Widgets (Cart & Chatbot) */
#cart-trigger,
#m44-chat-trigger {
    width: 60px !important;
    height: 60px !important;
    background: rgba(10, 10, 10, 0.9) !important;
    border: 1px solid rgba(200, 255, 0, 0.2) !important;
    color: var(--accent) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 0 15px rgba(200, 255, 0, 0.05) !important;
    backdrop-filter: blur(12px) !important;
    z-index: 9999;
}

#cart-trigger:hover,
#m44-chat-trigger:hover {
    box-shadow: 0 0 25px rgba(200, 255, 0, 0.2) !important;
    transform: scale(1.05) translateY(-2px) !important;
    background: var(--accent) !important;
    color: black !important;
}

#cart-trigger .material-symbols-outlined,
#m44-chat-trigger span {
    font-size: 28px !important;
    width: 28px !important;
    height: 28px !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}