/* ═══ INTRO SPLASH SCREEN ═══ */

#introOverlay {
    /* ZMIENNE MOTYWU - Edytujesz tylko tutaj */
    --clr-bg: #050810;
    --clr-primary: #00b4ff;
    --clr-primary-rgb: 0, 180, 255;
    --clr-secondary-rgb: 0, 120, 255;
    --font-heading: 'Orbitron', sans-serif;
    --font-text: 'Rajdhani', sans-serif;

    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--clr-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
}

#introOverlay.fade-out {
    animation: introFadeOut 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes introFadeOut {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.08); pointer-events: none; }
}

/* Particle canvas */
#introCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Scanline overlay */
.intro-scan {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px,
            rgba(var(--clr-primary-rgb), 0.015) 2px, rgba(var(--clr-primary-rgb), 0.015) 4px);
    pointer-events: none;
    animation: introScanMove 8s linear infinite;
}

@keyframes introScanMove {
    0% { background-position: 0 0; }
    100% { background-position: 0 200px; }
}

/* Glow pulse behind logo */
.intro-glow {
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--clr-secondary-rgb), 0.3) 0%, transparent 70%);
    filter: blur(60px);
    animation: introGlowPulse 2.5s ease-in-out infinite alternate;
}

@keyframes introGlowPulse {
    0% { transform: scale(0.7); opacity: 0.3; }
    100% { transform: scale(1.4); opacity: 0.9; }
}

/* Logo container */
.intro-logo-wrap {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

/* Glitch light bar (moved up for DOM logical grouping) */
.intro-logo-wrap::before {
    content: '';
    position: absolute;
    inset: -20px;
    background: linear-gradient(90deg,
            transparent 0%, rgba(var(--clr-primary-rgb), 0.03) 40%,
            rgba(var(--clr-primary-rgb), 0.08) 50%, rgba(var(--clr-primary-rgb), 0.03) 60%,
            transparent 100%);
    animation: introGlitchBar 3s ease-in-out infinite;
}

@keyframes introGlitchBar {
    0%, 100% { transform: translateX(-100%); opacity: 0; }
    45%, 55% { transform: translateX(100%); opacity: 1; }
}

/* Logo image */
.intro-logo-img {
    width: 145px;
    height: 145px;
    object-fit: contain;
    opacity: 0;
    filter: drop-shadow(0 0 20px rgba(var(--clr-secondary-rgb), 0.6)) drop-shadow(0 0 60px rgba(var(--clr-primary-rgb), 0.3));
    animation: introLogoIn 1s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards;
}

@keyframes introLogoIn {
    0% { opacity: 0; transform: scale(0.4) translateY(30px); filter: blur(12px); }
    100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0) drop-shadow(0 0 20px rgba(var(--clr-secondary-rgb), 0.6)) drop-shadow(0 0 60px rgba(var(--clr-primary-rgb), 0.3)); }
}

/* Title text */
.intro-title {
    font-family: var(--font-heading);
    font-size: 4.35rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    color: #fff;
    opacity: 0;
    text-shadow: 0 0 30px rgba(0, 150, 255, 0.5), 0 0 60px rgba(100, 150, 255, 0.2);
    animation: introTitleIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.8s forwards;
}

.intro-title span {
    color: var(--clr-primary);
}

@keyframes introTitleIn {
    0% { opacity: 0; transform: translateY(15px); letter-spacing: 0.5em; }
    100% { opacity: 1; transform: translateY(0); letter-spacing: 0.15em; }
}

/* Tagline */
.intro-tag {
    font-family: var(--font-text);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(var(--clr-primary-rgb), 0.5);
    opacity: 0;
    animation: introTagIn 0.7s ease 1.3s forwards;
}

@keyframes introTagIn {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Corner brackets */
.intro-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 2px solid rgba(var(--clr-secondary-rgb), 0.2);
    opacity: 0;
    animation: introCornerIn 0.6s ease 1s forwards;
}

.intro-corner.tl { top: 25%; left: 30%; border-right: 0; border-bottom: 0; }
.intro-corner.tr { top: 25%; right: 30%; border-left: 0; border-bottom: 0; }
.intro-corner.bl { bottom: 25%; left: 30%; border-right: 0; border-top: 0; }
.intro-corner.br { bottom: 25%; right: 30%; border-left: 0; border-top: 0; }

@keyframes introCornerIn {
    0% { opacity: 0; transform: scale(1.5); }
    100% { opacity: 1; transform: scale(1); }
}

/* ═══ LOADING BAR ═══ */
.intro-loader {
    position: relative;
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 3;
    opacity: 0;
    animation: introTagIn 0.5s ease 1.5s forwards; /* Reusing existing keyframe */
}

/* Track */
.intro-bar-track {
    width: 406px;
    height: 9px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    border: 1px solid rgba(var(--clr-secondary-rgb), 0.1);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Fill bar */
.intro-bar-fill {
    height: 100%;
    width: 0;
    border-radius: 10px;
    background: linear-gradient(90deg, #0050cc, #00a0ff, var(--clr-primary));
    box-shadow: 0 0 12px rgba(var(--clr-primary-rgb), 0.5), 0 0 30px rgba(var(--clr-secondary-rgb), 0.2);
    position: relative;
    animation: introBarFill 3s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.6s forwards;
}

/* Shimmer moving across bar */
.intro-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -40%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: introBarShimmer 1.2s ease-in-out 2s infinite;
}

@keyframes introBarShimmer {
    0% { left: -40%; }
    100% { left: 140%; }
}

@keyframes introBarFill {
    0% { width: 0; }
    15% { width: 12%; }
    35% { width: 28%; }
    50% { width: 55%; }
    70% { width: 72%; }
    85% { width: 88%; }
    100% { width: 100%; }
}

/* Segmented notches on track */
.intro-bar-notches {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: stretch;
    z-index: 2;
    pointer-events: none;
}

.intro-bar-notch {
    flex: 1;
    border-right: 1px solid rgba(0, 0, 0, 0.3);
}

.intro-bar-notch:last-child {
    border-right: none;
}

/* Percentage counter */
.intro-bar-pct {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(var(--clr-primary-rgb), 0.6);
    letter-spacing: 0.12em;
    min-width: 40px;
    text-align: center;
}

/* Status text */
.intro-bar-status {
    font-family: var(--font-text);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(var(--clr-primary-rgb), 0.3);
    animation: introBlink 1s step-end infinite;
}

/* Click to continue prompt */
.intro-click-prompt {
    font-family: var(--font-text);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(var(--clr-primary-rgb), 0.6);
    margin-top: 8px;
    opacity: 0;
    display: none;
}

.intro-click-prompt.visible {
    display: block;
    animation: introPromptPulse 1.8s ease-in-out infinite;
}

@keyframes introPromptPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

@keyframes introBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Fun fact section */
.intro-fact-wrap {
    position: absolute;
    bottom: 50px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0 40px;
    text-align: center;
    opacity: 0;
    animation: introTagIn 0.8s ease 1.8s forwards; /* Reusing existing keyframe */
}

.intro-fact-label {
    font-family: var(--font-text);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--clr-primary);
    opacity: 0.6;
}

.intro-fact-text {
    font-family: var(--font-text);
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    line-height: 1.4;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* ── RWD / Mobile ── */
@media (max-width: 600px) {
    .intro-title {
        font-size: 2.5rem;
    }

    .intro-logo-img {
        width: 90px;
        height: 90px;
    }

    .intro-corner {
        display: none;
    }

    .intro-bar-track {
        width: 280px;
    }

    .intro-fact-text {
        font-size: 0.8rem;
    }
}