/* --- Responsive Styles --- */

/* Medium screens (e.g., tablets) */
@media (max-width: 1200px) {

    section.hero {
        justify-content: end;
        padding-bottom: 48px;
    }

    #intro-hero-video {
        position: absolute;
        width: 100%;
        overflow: hidden;
    }

    #hero-scrim {
        position: absolute;
        bottom: 0;
        height: 40%; /* Adjust height for the effect */
        background: linear-gradient(to top, var(--bg-color), transparent);
        width: 100%;

        /* Apply a blur to the content behind the element */
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);

        /* Use a mask to create a gradient for the blur effect */
        -webkit-mask-image: linear-gradient(to top, black 50%, transparent 100%);
        mask-image: linear-gradient(to top, black 50%, transparent 100%);
    }

    .work-grid .work-item {
        grid-template-columns: 1fr; /* Stack on medium screens */
        gap: 1.5rem;
    }

    .work-item-text {
        padding-top: 0;
    }

    .work-grid {
        gap: 8rem;
    }

    /* Reset column spans from desktop view */
    .work-grid .work-item:nth-child(odd) .work-item-image,
    .work-grid .work-item:nth-child(odd) .work-item-text,
    .work-grid .work-item:nth-child(even) .work-item-image,
    .work-grid .work-item:nth-child(even) .work-item-text {
        grid-column: auto;
        grid-row: auto;
    }

    .more-works-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .bio {
        grid-column: 2 / 8;
    }

    .site-footer-main {
        padding: 8rem 0 4rem;
    }

    .experience-row h2 {
        font-size: 20px;
    }
    .experience-date {
        width: 100px;
    }
    .experience-location {
        width: 150px;
    }
    .experience-description {
        width: calc(100% - 250px);
    }
    .experience-row {
        margin-top: 48px;
    }
    .experience {
        grid-column: 1 / 9;
    }
    .job {
        font-size: 1.25rem;
    }
    .dynamic-letter-container {
        width: 12vw;
        height: 12vw;
    }
    #ytsymbols-hero {
        background-size: 2vw 2vw;
    }
}

/* Small screens (e.g., mobile phones) */
@media (max-width: 780px) {
    /* restore the normal cursor */
    #custom-cursor {
        display: none;
    }
    * {
        cursor: auto !important;
    }

    /* Show mobile nav, hide desktop nav */
    .nav-right {
        /* Repurpose .nav-right as the mobile menu overlay */
       padding: 0;
        border-radius: 0;
        z-index: 0;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: var(--bg-color);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3rem;

        /* Hide by default, fade in on 'open' */
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 99; /* Below the mobile nav button, but above page content */
    }

    .nav-links a {
        font-size: 3rem;
    }

    #intro-hero-video video {
        transform: translateX(-50%);
    }

    .theme-switcher {
        display: none;
    }

    /* When the mobile menu is open, make the overlay visible */
    body.mobile-nav-open .nav-right {
        opacity: 1;
        pointer-events: auto;
    }

    /* Adjust nav links for vertical layout */
    .nav-right .nav-links {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    .mobile-nav {
        display: block;
    }

    .about-grid {
        padding: 4rem 5%;
        gap: 2rem;
    }

    .bio {
        grid-column: 1 / 9;
    }

    #footer {
        padding-bottom: 0;
        text-align: center;
    }
    .footer-bottom {
        justify-content: center;
    }
    .more-works-grid {
        grid-template-columns: 1fr;
    }

    .work-item-text {
        padding-top: 0;
    }

    #work-experience {
        padding: 0;
    }
    
    .about_me {
        font-size: 2.5rem;
        text-indent: 0;
        margin-top: 120px;
    }

    span.wave-emoji {
        width: 2.5rem;
        height: 2.5rem;
    }

    .grid-intro {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 4rem 5%;
    }
    .title-meta, .description {
        grid-column: 1 / -1;
    }

    .grid-2col,
    .grid-3col {
      grid-template-columns: 1fr;
    }

    .experience {
        grid-column: 1 / 9;
    }

    .experience-location {
        display: none;
    }
    .experience-description {
        width: calc(100% - 100px);
    }
    p.large {
        font-size: 20px;
    }

    .footer-wave-image {
        position: relative;
        width: 100%;
        height: auto;
        margin-top: 4rem;
        margin: 0 auto;
        max-width: 420px;
    }
    .location {
        display: none;
    }
    p.footer-contact-email {
        font-size: 1.25rem;
    }
    #ytsymbols-hero {
        background-size: 4vw 4vw;
    }
}

/* Extra samll screens (e.g., mobile phones) */
@media (max-width: 420px) {
    .job {
        font-size: 1rem;
    }
    #ytsymbols-hero {
        background-size: 7vw 7vw;
    }
}