/* ==========================================================================
   RESET & BASE STYLES (BRUTALIST ARCHIVE)
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    max-width: 100%;
    overflow-x: clip;
}

body.shorts-body {
    background-color: #000000;
    color: #e0e0e0;
    font-family: 'Space Mono', monospace;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: clip;
}

/* NOISE OVERLAY */
.noise-overlay {
    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="noise"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noise)"/%3E%3C/svg%3E');
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 12px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.main-nav a {
    font-family: 'Space Mono', monospace;
    color: #888;
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: color 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
    color: #fff;
}

.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 15px;
    padding: 3px 9px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.03);
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    user-select: none;
}

.lang-switcher a {
    color: #777;
    text-decoration: none;
    font-size: 0.75rem !important;
    letter-spacing: 1.5px !important;
    padding: 2px 4px;
    transition: color 0.2s ease;
}

.lang-switcher a:hover {
    color: #fff !important;
}

.lang-switcher .lang-active {
    color: #fff !important;
    font-weight: 700;
}

.lang-switcher .lang-sep {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.7rem;
}

/* MOBILE TOGGLE */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 20px;
    width: 44px;
    height: 44px;
    background: rgba(12, 12, 12, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 4px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 3000;
    cursor: pointer;
    padding: 0;
    margin: 0;
    appearance: none;
    outline: none;
    box-sizing: border-box;
    place-content: center;
    gap: 4px;
    touch-action: manipulation;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.mobile-nav-toggle:hover {
    border-color: #ffffff;
    background: rgba(22, 22, 22, 0.98);
}

.nav-toggle-bar {
    width: 20px;
    height: 2px;
    background-color: #ffffff;
    display: block;
    pointer-events: none;
    border-radius: 1px;
    transform-origin: center;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.mobile-nav-toggle.is-active .nav-toggle-bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.mobile-nav-toggle.is-active .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle.is-active .nav-toggle-bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ==========================================================================
   STAGE
   ========================================================================== */
.shorts-stage {
    position: relative;
    z-index: 10;
    max-width: 1280px;
    margin: 0 auto;
    padding: 120px 30px 80px 30px;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   SHORTS GRID
   ========================================================================== */
.shorts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 44px 32px;
    width: 100%;
}

/* KAFELEK (BEZ KWADRATU - SAME OKO I PODPIS) */
.short-card {
    background: transparent;
    border: none;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    position: relative;
    outline: none;
    appearance: none;
    color: inherit;
    font-family: inherit;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.short-card:hover,
.short-card:focus-visible {
    transform: translateY(-5px);
}

/* OKO W KAFELKU */
.short-eye-housing {
    position: relative;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    overflow: hidden;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.95), 0 8px 24px rgba(0, 0, 0, 0.8);
    margin-bottom: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}

.short-eye-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.3) brightness(0.7);
    transition: filter 0.35s ease, transform 0.4s ease;
}

.short-peep-rim {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    background: radial-gradient(circle, transparent 40%, rgba(0,0,0,0.5) 60%, rgba(0,0,0,0.95) 90%);
    pointer-events: none;
}

.short-card:hover .short-eye-housing,
.short-card:focus-visible .short-eye-housing {
    border-color: rgba(255, 255, 255, 0.65);
    transform: scale(1.05);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8), 0 0 28px rgba(255, 255, 255, 0.16);
}

.short-card:hover .short-eye-img,
.short-card:focus-visible .short-eye-img {
    filter: grayscale(100%) contrast(1.35) brightness(1);
    transform: scale(1.08);
}

/* PODPIS (NAZWA ROLKI) */
.short-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: 2.5px;
    color: #e0e0e0;
    line-height: 1.25;
    text-transform: uppercase;
    margin: 0;
    transition: color 0.3s ease, letter-spacing 0.3s ease, text-shadow 0.3s ease;
}

.short-card:hover .short-title,
.short-card:focus-visible .short-title {
    color: #ffffff;
    letter-spacing: 3.5px;
    text-shadow: 0 0 14px rgba(255, 255, 255, 0.45);
}

/* ==========================================================================
   FULLSCREEN MODAL PLAYER
   ========================================================================== */
.shorts-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 24px 30px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
}

.shorts-modal-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* TOP BAR */
.modal-top-bar {
    width: 100%;
    max-width: 1400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding-bottom: 14px;
    flex-shrink: 0;
}

.modal-meta {
    display: flex;
    align-items: center;
    gap: 14px;
}

.modal-counter {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: #888;
    letter-spacing: 2px;
}

.modal-divider {
    color: #444;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
}

.modal-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: 2px;
    color: #fff;
    text-transform: uppercase;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: #888;
    font-family: 'Space Mono', monospace;
    font-size: 1.15rem;
    letter-spacing: 2px;
    cursor: pointer;
    padding: 6px 12px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.modal-close-btn:hover {
    color: #fff;
    transform: scale(1.1);
}

/* PLAYER WRAPPER */
.modal-player-wrapper {
    position: relative;
    width: 100%;
    max-width: 1400px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    min-height: 0;
    padding: 10px 0;
}

/* STRZAŁKI */
.modal-nav-arrow {
    background: rgba(14, 14, 14, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #aaa;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.4rem;
    line-height: 1;
    backdrop-filter: blur(8px);
    transition: all 0.25s ease;
    user-select: none;
}

.modal-nav-arrow:hover {
    color: #fff;
    background: rgba(28, 28, 28, 0.95);
    border-color: #fff;
    transform: scale(1.08);
}

/* KONTENER WIDEO */
.modal-video-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    width: auto;
}

#modal-video {
    max-width: 100%;
    max-height: calc(100vh - 160px);
    max-height: calc(100dvh - 160px);
    width: auto;
    height: auto;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.98);
    display: block;
    outline: none;
}

/* DOLNA PODPOWIEDŹ */
.modal-bottom-hint {
    width: 100%;
    text-align: center;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    font-family: 'Space Mono', monospace;
    font-size: 0.68rem;
    color: #555;
    letter-spacing: 2px;
    flex-shrink: 0;
}

/* ==========================================================================
   RESPONSIVE DESIGN (RWD)
   ========================================================================== */
@media (max-width: 1024px) {
    .shorts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .modal-player-wrapper {
        gap: 15px;
    }

    .modal-nav-arrow {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: grid !important;
    }

    .main-nav {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: rgba(0, 0, 0, 0.97) !important;
        backdrop-filter: blur(15px) !important;
        -webkit-backdrop-filter: blur(15px) !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 18px !important;
        z-index: 2800 !important;
        padding: 80px 20px 40px 20px !important;
        box-sizing: border-box !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: translateY(-8px) !important;
        transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s !important;
    }

    .main-nav.is-open {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: translateY(0) !important;
    }

    .main-nav a {
        font-family: 'Space Mono', monospace !important;
        font-size: 1.1rem !important;
        letter-spacing: 3px !important;
        color: #999 !important;
        text-decoration: none !important;
        text-transform: uppercase !important;
        padding: 6px 12px !important;
        transition: color 0.2s ease !important;
    }

    .main-nav a:hover,
    .main-nav a:active {
        color: #fff !important;
    }

    .main-nav .lang-switcher {
        margin-left: 0 !important;
        margin-top: 15px !important;
        padding: 8px 18px !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
    }

    .main-nav .lang-switcher a,
    .main-nav .lang-switcher .lang-active {
        font-size: 1.1rem !important;
        letter-spacing: 3px !important;
    }

    .shorts-stage {
        padding: 90px 18px 60px 18px;
    }

    .shorts-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .short-card {
        padding: 12px 10px;
    }

    .short-eye-housing {
        width: 140px;
        height: 140px;
        margin-bottom: 14px;
    }

    .short-title {
        font-size: 1.05rem;
        letter-spacing: 2px;
    }

    /* MODAL NA TELEFONIE */
    .shorts-modal-backdrop {
        padding: 12px 12px 14px 12px;
    }

    .modal-player-wrapper {
        gap: 0;
        width: 100%;
    }

    /* Strzałki nawigacji na mobilce stają się pływające po bokach wideo */
    .modal-nav-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
        width: 40px;
        height: 40px;
        font-size: 1rem;
        background: rgba(0, 0, 0, 0.7);
    }

    .modal-prev-btn {
        left: 4px;
    }

    .modal-next-btn {
        right: 4px;
    }

    #modal-video {
        max-height: calc(100vh - 120px);
        max-height: calc(100dvh - 120px);
        max-width: 95vw;
        border-width: 1px;
    }

    .modal-title {
        font-size: 0.95rem;
    }

    .modal-bottom-hint {
        display: none;
    }
}
