* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #111;
    color: #e5e4e2;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    height: 100vh;
    overflow: hidden;
    touch-action: none;
}

#gatekeeper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #000;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #e5e4e2;
    transition: opacity 0.8s ease;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #e5e4e2;
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin: 0 auto 15px auto;
}

#loader-state p {
    font-family: monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #666;
}

#login-state {
    text-align: center;
    width: 300px;
    animation: fadeIn 0.5s ease;
}

#login-state h2 {
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

#login-state p {
    color: #666;
    margin-bottom: 25px;
    font-family: monospace;
}

#login-form input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #444;
    color: #e5e4e2;
    text-align: center;
    font-size: 1.2rem;
    padding: 10px;
    outline: none;
    margin-bottom: 20px;
}

#login-form input:focus {
    border-color: #e5e4e2;
}

#login-form button {
    background: #e5e4e2;
    color: #000;
    border: none;
    padding: 10px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
}

#error-msg {
    color: #ff4444;
    margin-top: 15px;
    font-size: 0.9rem;
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 40px 50px;
    z-index: 1000;
    background-color: transparent;
    pointer-events: none;
    display: grid;
    align-items: start;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "identity counter"
        "contact  counter";
    gap: 15px;
}

.nav-identity,
.nav-contact,
.counter {
    pointer-events: auto;
}

.nav-identity {
    grid-area: identity;
}

.nav-identity h2 {
    text-transform: uppercase;
    font-size: 20px;
    margin: 0;
    padding: 0;
    line-height: 1;
    color: #3d93c8;
}

.title {
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 600;
    margin: 0;
    padding: 0;
    line-height: 1.2;
    margin-top: 5px;
    margin-bottom: 10px;
    color: #f2c94c;
}

.nav-contact {
    grid-area: contact;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.contact {
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 400;
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

.counter {
    grid-area: counter;
    justify-self: end;
    align-self: start;
    font-family: monospace;
    font-size: 1.2rem;
    color: #3d93c8;
}

#current-count {
    color: #f2c94c;
}

.deck-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    perspective: 1000px;
    overflow: hidden;
    touch-action: none;
    overscroll-behavior: none;
}

.card {
    position: absolute;
    bottom: 0;
    width: 80%;
    max-width: 1200px;
    height: 96vh;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 20px 20px 0 0;
    background-color: #000;
    box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    z-index: var(--index);
    transform-origin: bottom center;
    transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
    transform: translateY(100%) scale(1);
}

.poster-visual {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.poster-visual::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    transform: skewY(-30deg);
    mix-blend-mode: multiply;
    pointer-events: none;
}

.card:nth-of-type(1) .poster-visual::after {
    background: linear-gradient(to bottom, rgba(29, 147, 200, 0.7) 0%, rgba(29, 147, 200, 0.5) 40%, rgba(0, 0, 0, 0.9) 100%);
}

.card:nth-of-type(2) .poster-visual::after {
    background: linear-gradient(to bottom, rgba(86, 130, 89, 0.7) 0%, rgba(86, 130, 89, 0.5) 40%, rgba(0, 0, 0, 0.9) 100%);
}

.card:nth-of-type(3) .poster-visual::after {
    background: linear-gradient(to bottom, rgba(242, 201, 76, 0.7) 0%, rgba(242, 201, 76, 0.5) 40%, rgba(0, 0, 0, 0.9) 100%);
}

.card:nth-of-type(4) .poster-visual::after {
    background: linear-gradient(to bottom, rgba(115, 83, 186, 0.7) 0%, rgba(115, 83, 186, 0.5) 40%, rgba(0, 0, 0, 0.9) 100%);
}

.poster-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.9) contrast(1.1);
    transition: transform 1.2s ease;
}

.card:nth-of-type(3) .poster-visual img {
    filter: brightness(0.6) contrast(1.2);
}

.poster-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 0 40px;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease 0.2s;
}

.poster-content h2 {
    font-size: 4vw;
    text-transform: uppercase;
    line-height: 0.9;
    margin-bottom: 15px;
    font-weight: 800;
}

.poster-content p {
    font-size: 1.1rem;
    color: #ccc;
    margin-bottom: 25px;
    max-width: 600px;
    margin: 0 auto 25px auto;
}

.view-project-btn {
    padding: 15px 40px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #e5e4e2;
    border-radius: 10px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.view-project-btn:hover {
    background: #e5e4e2;
    color: #000;
    border-color: #e5e4e2;
}

.project-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1100;
    pointer-events: none;
    overflow: hidden;
}

.project-overlay.is-open {
    pointer-events: auto;
}

#shutter-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    display: flex;
    flex-wrap: wrap;
    pointer-events: none;
}

.shutter-cell {
    position: relative;
    background-color: #050505;
    transform: rotate(45deg) scale(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.shutter-cell.active {
    transform: rotate(45deg) scale(1.5);
}

.overlay-content {
    position: relative;
    z-index: 201;
    width: 100%;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 60px;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-overlay.is-open .overlay-content {
    opacity: 1;
    transition-delay: 0.8s;
}

.col-gallery {
    position: relative;
    width: 100%;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
    margin-left: -40px;
    width: calc(100% + 40px);
}

.project-overlay.is-open .col-gallery {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.7s;
    pointer-events: auto;
}

.gallery-tilt-wrapper {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
    padding: 0;
    transform: rotate(-3deg) scale(1.1);
    transform-origin: center center;
    min-height: 100%;
}

.gallery-col-left,
.gallery-col-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 45%;
    animation: scrollUp linear infinite;
}

.gallery-col-left {
    animation-duration: 45s;
}

.gallery-col-right {
    margin-top: 60px;
    animation-duration: 55s;
}

.gallery-tilt-wrapper:hover .gallery-col-left,
.gallery-tilt-wrapper:hover .gallery-col-right {
    animation-play-state: paused;
}

@keyframes scrollUp {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-50%);
    }
}

.gallery-slide {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    backface-visibility: hidden;
    transform: translateZ(0);
    cursor: zoom-in;
}

.gallery-slide:hover {
    transform: scale(1.02);
    z-index: 2;
}

.col-info {
    text-align: left;
    color: #e5e4e2;
    padding: 40px 0;
    max-width: 100%;
}

.col-info>* {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s ease;
}

.project-overlay.is-open .col-info>*:nth-child(1) {
    transition-delay: 0.8s;
    opacity: 1;
    transform: translateY(0);
}

.project-overlay.is-open .col-info>*:nth-child(2) {
    transition-delay: 0.9s;
    opacity: 1;
    transform: translateY(0);
}

.project-overlay.is-open .col-info>*:nth-child(3) {
    transition-delay: 1.0s;
    opacity: 1;
    transform: translateY(0);
}

#overlay-title {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.overlay-category {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    color: #e5e4e2;
}

.close-overlay {
    position: absolute;
    top: 40px;
    right: 40px;
    z-index: 205;
    width: 60px;
    height: 60px;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0s;
}

.project-overlay.is-open .close-overlay {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s ease 0.5s;
}

.close-overlay .line {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 2px;
    background-color: #e5e4e2;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.close-overlay .line-1 {
    transform: translate(-50%, -50%) rotate(45deg);
}

.close-overlay .line-2 {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.close-overlay:hover .line-1 {
    transform: translate(-55%, -55%) rotate(70deg) scaleX(1.1);
}

.close-overlay:hover .line-2 {
    transform: translate(-45%, -45%) rotate(-10deg) scaleX(1.1);
}

#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

#lightbox-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

#lightbox.active #lightbox-img {
    transform: scale(1);
}

#lightbox-close {
    position: absolute;
    top: 40px;
    right: 40px;
    z-index: 2005;
    width: 60px;
    height: 60px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: block;
}

#lightbox-close .line {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 2px;
    background-color: #e5e4e2;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#lightbox-close .line-1 {
    transform: translate(-50%, -50%) rotate(45deg);
}

#lightbox-close .line-2 {
    transform: translate(-50%, -50%) rotate(-45deg);
}

#lightbox-close:hover .line-1 {
    transform: translate(-55%, -55%) rotate(70deg) scaleX(1.1);
}

#lightbox-close:hover .line-2 {
    transform: translate(-45%, -45%) rotate(-10deg) scaleX(1.1);
}

#overlay-desc {
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 20px;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #e5e4e2;
    padding-bottom: 40px;
}

#overlay-desc::-webkit-scrollbar {
    width: 8px;
}

#overlay-desc::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

#overlay-desc::-webkit-scrollbar-thumb {
    background-color: #555;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#overlay-desc::-webkit-scrollbar-thumb:hover {
    background-color: #3d93c8;
}

#overlay-desc p strong {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    color: #3d93c8;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}

#overlay-desc p:first-of-type strong {
    margin-top: 0;
}

#overlay-desc ul {
    list-style: none;
    padding: 0;
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

#overlay-desc li {
    background: rgba(255, 255, 255, 0.04);
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 5px solid #3d93c8;
    font-size: 0.95rem;
    line-height: 1.6;
    transition: background 0.2s ease;
}

#overlay-desc li:hover {
    background: rgba(255, 255, 255, 0.08);
}

#overlay-desc li strong {
    display: block;
    color: #e5e4e2;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    text-transform: none;
    letter-spacing: normal;
}

#gatekeeper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #050505;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
}

#login-state p {
    display: block;
    color: #555;
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 2rem;
    font-family: 'Courier New', Courier, monospace;
}

#password-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid #333;
    border-radius: 0;
    color: #e5e4e2;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 0.5rem;
    padding: 10px 0;
    width: 280px;
    outline: none;
    transition: all 0.3s ease;
}

#password-input:focus {
    border-bottom-color: #4facfe;
    box-shadow: 0 15px 25px -10px rgba(79, 172, 254, 0.3);
}

#password-input:not(:focus) {
    animation: inputPulse 3s infinite ease-in-out;
}

@keyframes inputPulse {
    0% {
        border-bottom-color: #333;
    }

    50% {
        border-bottom-color: #555;
    }

    100% {
        border-bottom-color: #333;
    }
}

#error-msg {
    color: #ff4b4b;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 1.5rem;
    text-align: center;
    display: none;
}

#loader-state {
    color: #4facfe;
    font-family: monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.9rem;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@media (max-width: 1749px) {
    .top-nav {
        position: relative;
        background-color: #111;
        pointer-events: auto;
        padding: 20px 30px;
        grid-template-columns: 1fr auto 1fr;
        grid-template-areas: "contact identity counter";
        align-items: center;
    }

    .nav-contact {
        text-align: left;
        justify-self: start;
        align-self: center;
    }

    .nav-identity {
        text-align: center;
        justify-self: center;
        align-self: center;
    }

    .counter {
        text-align: right;
        justify-self: end;
        align-self: center;
    }

    .nav-identity h2,
    .title,
    .contact,
    .counter {
        text-shadow: none;
    }

    .card {
        height: calc(100vh - 20px);
    }

    .deck-container {
        min-height: calc(100vh - 20px);
    }
}

@media (max-width: 1024px) {
    .top-nav {
        padding: 15px 20px;
        grid-template-columns: 1fr auto;
        grid-template-areas: "identity counter";
    }

    .nav-contact {
        display: none;
    }

    .nav-identity {
        text-align: left;
        justify-self: start;
    }

    .nav-identity h2 {
        font-size: 1.2rem;
    }

    .title {
        font-size: 0.75rem;
    }

    .counter {
        justify-self: end;
    }

    .card {
        height: calc(100vh - 20px);
    }

    .deck-container {
        min-height: calc(100vh - 20px);
    }
}

@media (max-width: 900px) {
    .overlay-content {
        grid-template-columns: 1fr;
        overflow-y: auto;
        display: block;
        padding-top: 100px;
        padding-bottom: 40px;
    }

    .col-gallery {
        height: 50vh;
        margin-bottom: 40px;
        overflow: hidden;
        margin-left: 0;
        width: 100%;
    }

    .gallery-tilt-wrapper {
        width: 100%;
        transform: rotate(0) scale(1);
        gap: 10px;
    }

    .gallery-col-right {
        margin-top: 20px;
    }

    #overlay-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .top-nav {
        padding: 20px;
    }

    .card {
        width: 95%;
        height: 95vh;
    }

    .poster-content h2 {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .nav-identity h2 {
        font-size: 1rem;
    }

    .counter {
        font-size: 1rem;
    }
}