:root {
    --primary-color: #333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: white;
}
/* ============================================
   DESKTOP BACKGROUND GIF
   ============================================ */

/* Desktop only */
@media (min-width: 801px) {

    body {
        position: relative;
        background-color: transparent; /* remove white background */
    }

    body::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;

        background-image: url("images/filmglitch.gif");
        background-size: cover;          /* fills entire screen */
        background-position: center;
        background-repeat: no-repeat;

        z-index: -1;                     /* sit behind everything */
    }

    /* Optional: slightly darken for readability */
    body::after {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(255, 255, 255, 0.05); /* subtle wash */
        z-index: -1;
    }
}

/* Header Section */
.header {
    width: 100%;
    height: 250px;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
}

.header-tags {
    position: absolute;
    top: 20px;
    display: flex;
    gap: 70px;
    font-size: 18px;
    color: var(--primary-color);
}

.logo {
    font-size: 88px;
    color: var(--primary-color);
    letter-spacing: 0;
    line-height: 1;
}

.logo-thin {
    font-weight: 100;
}

.logo-bold {
    font-weight: 600;
}

/* Navigation Bar */
.nav {
    width: 100%;
    height: 50px;
    background-color: red;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 70px;
}

.nav-links li a {
    color: white;
    font-size: 18px;
    text-decoration: none;
    position: relative;
    padding-bottom: 12px;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: white;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-links li a:hover::after {
    transform: scaleX(1);
}

/* Hamburger menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: red;
    padding: 15px;
    border-radius: 0px;
    width: 55px;
    height: 55px;
    align-items: center;
    justify-content: center;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 0px;
    transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Main Body Area */
.main-body {
    width: 100%;
    min-height: 1400px;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 100px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(3, 400px);
    grid-template-rows: repeat(5, 400px);
    gap: 20px;
    width: fit-content;
}

.grid-item {
    overflow: hidden;
    position: relative;
    border-radius: 20px;
}

.grid-item a {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    border-radius: 20px;
}

.grid-item a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}

.grid-item a:hover::before {
    opacity: 0.25;
}

.grid-item img {
    width: 110%;
    height: 110%;
    object-fit: cover;

    position: absolute;
    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%);
    will-change: transform;
}

.grid-item img.transitioning {
    transition: all 0.6s ease;
}

.item-large-1 {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
}

.item-large-2 {
    grid-column: 2 / 4;
    grid-row: 4 / 6;
}

/* Footer */
.footer {
    width: 100%;
    height: 50px;
    background-color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer p {
    color: white;
    font-size: 14px;
}



/* Responsive Design - Between 800px and 1440px */
@media (max-width: 1440px) and (min-width: 801px) {
    .header {
        height: calc(250px * (100vw / 1440));
    }

    .logo {
        font-size: calc(88px * (100vw / 1440));
    }

    .header-tags {
        font-size: calc(18px * (100vw / 1440));
        gap: calc(70px * (100vw / 1440));
    }

    .main-body {
        padding: 50px;
        min-height: auto;
    }

    .image-grid {
        grid-template-columns: repeat(3, calc((100vw - 140px) / 4 - 15px));
        grid-template-rows: repeat(5, calc((100vw - 140px) / 5 - 15px));
        gap: 20px;
    }
}

/* Mobile View - Below 800px */
@media (max-width: 800px) {
    .header {
        height: 200px;
    }

    .logo {
        font-size: 48px;
    }

    .header-tags {
        font-size: 14px;
        gap: 30px;
    }

    .nav {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: transparent;
        pointer-events: none;
        z-index: 50;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: red;
        flex-direction: column;
        gap: 0;
        padding: 100px 0;
        justify-content: flex-start;
        transform: translateX(100%);
        transition: all 0.3s ease;
        pointer-events: auto;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-links li {
        text-align: center;
        padding: 20px 0;
    }

    .nav-links li a {
        font-size: 24px;
    }

    .nav-links li a::after {
        display: none;
    }

    .main-body {
        height: auto;
        padding: 50px;
        min-height: auto;
    }

    .image-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        gap: 20px;
        width: 100%;
        max-width: 500px;
    }

    .grid-item {
        aspect-ratio: 1 / 1;
    }

    .grid-item a {
        width: 100%;
        height: 100%;
    }

    .grid-item img {
        width: 120%;
        height: 120%;
    }

    .item-large-1 {
        grid-column: 1 / 3;
        grid-row: 1 / 3;
    }

    .item-small:nth-of-type(2) {
        grid-column: 1;
        grid-row: 3;
    }

    .item-small:nth-of-type(3) {
        grid-column: 2;
        grid-row: 3;
    }

    .item-large-2 {
        grid-column: 1 / 3;
        grid-row: 7 / 9;
    }

    .item-small:nth-of-type(4) {
        grid-column: 1;
        grid-row: 4;
    }

    .item-small:nth-of-type(5) {
        grid-column: 2;
        grid-row: 4;
    }

    .item-small:nth-of-type(6) {
        grid-column: 1;
        grid-row: 5;
    }

    .item-small:nth-of-type(7) {
        grid-column: 2;
        grid-row: 5;
    }

    .item-small:nth-of-type(8) {
        grid-column: 1;
        grid-row: 9;
    }

    .item-small:nth-of-type(9) {
        grid-column: 2;
        grid-row: 9;
    }


}

/* Rollover text container */
.rollover-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-align: center;
    padding: 20px;
}

/* Show rollover text on hover */
.grid-item a:hover .rollover-text {
    opacity: 1;
}

/* Rollover text headline */
.rollover-text h3 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Rollover text category */
.rollover-text p {
    color: white;
    font-size: 12px;
    font-weight: 300;
    margin: 0;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Increase overlay darkness when hovering to improve text readability */
.grid-item a:hover::before {
    opacity: 0.5;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

/* Tablet view - adjust font sizes */
@media (max-width: 1440px) and (min-width: 801px) {
    .rollover-text h3 {
        font-size: calc(16px * (100vw / 1440));
    }

    .rollover-text p {
        font-size: calc(12px * (100vw / 1440));
    }
}

/* Mobile view - always show rollover text on touch devices */
@media (max-width: 800px) {
    .rollover-text {
        opacity: 1;
        position: absolute;
        bottom: 10px;            /* last line 10px from bottom */
        left: 0;
        width: 100%;
        height: auto;

        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;

        padding: 0;              /* remove horizontal drift */
        text-align: center;
        pointer-events: none;
    }

    .rollover-text h3 {
        font-size: 16px;
        margin-bottom: 4px;
    }

    .rollover-text p {
        font-size: 12px;
        margin: 0;
    }

    .grid-item a::before {
        opacity: 0.25;
    }
}
