/* ═══════════════════════════════════════
   Ray Morel Portfolio — Stylesheet
   ═══════════════════════════════════════ */

/* ── RESET ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    background-color: #eee;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}



/* ── HEADER ── */
.header {
    width: 100%;
    margin: 2rem 0;
    z-index: 1000;
}

.nav {
    font-weight: 500;
    font-size: 16px;
    text-transform: uppercase;
    text-align: center;
}

.nav_link {
    font-weight: 700;
    letter-spacing: 8px;
    display: inline-block;
    vertical-align: top;
    margin: auto 10px;
    position: relative;
    text-decoration: none;
    transition: color .2s ease;
    color: #999;
}

.nav_link:after {
    content: "";
    display: block;
    width: 100%;
    height: 3px;
    background-color: #e62e4c;
    opacity: 0;
    position: absolute;
    top: 120%;
    right: 5px;
    z-index: 1;
    transition: opacity .2s ease;
}

.nav_link:hover {
    color: #666;
}

.nav_link:hover:after,
.nav_link.active:after {
    opacity: 1;
}

.nav_link.active {
    color: #333;
}

.container h1 {
    max-width: 77rem;
    font-weight: 900;
    letter-spacing: 12px;
    text-transform: uppercase;
    margin: auto;
    margin-top: 2rem;
    text-align: end;
    font-size: 36px;
    color: #555;
    transition: color .2s ease;
}

.container h1:hover {
    color: #333;
}

.container {
    width: 100%;
    max-width: 120rem;
    margin: auto;
    padding: 0 1.5rem;
}

.wrapper {
    max-width: 75rem;
    padding: 2rem;
    margin: 0 auto;
}



/* ── GALLERY (auto-flow dense — fills gaps automatically) ── */
.gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 14rem;
    grid-auto-flow: dense;
    gap: .7rem;
}

/* ── CARD REVEAL ANIMATION ── */
.gallery__item,
.project-gallery__item {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .5s ease, transform .5s ease;
}

.gallery__item.revealed,
.project-gallery__item.revealed {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {

    .gallery__item,
    .project-gallery__item {
        opacity: 1;
        transform: none;
        transition: none;
    }
}



/* ── GALLERY LINK ── */
.gallery__link {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    transition: transform .5s cubic-bezier(.25, .8, .25, 1);
    border-radius: 5px;
}

.gallery__link:hover {
    transform: scale(1.02);
}



/* ── GALLERY OVERLAY ── */
.gallery__overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    background: linear-gradient(transparent 40%, rgba(0, 0, 0, .55));
    letter-spacing: 4px;
    font-size: .75rem;
    color: #f5f5f5;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

.gallery__link:hover .gallery__overlay {
    opacity: 1;
}

.gallery__overlay span {
    left: 5%;
    position: relative;
    line-height: 3rem;
}

.gallery__overlay span:before {
    content: '';
    position: absolute;
    height: 2px;
    width: 0;
    background: #e62e4c;
    bottom: .5rem;
    transition: width .35s ease-out .15s;
}

.gallery__link:hover .gallery__overlay span:before {
    width: 20%;
}



/* ── GALLERY IMAGE ── */
.gallery__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s cubic-bezier(.25, .8, .25, 1);
}

.gallery__link:hover .gallery__img {
    transform: scale(1.06);
}



/* ── PROJECT DETAIL PAGE ── */
.project-wrapper {
    max-width: 80rem;
    padding: 1rem;
    margin: 0 auto;
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 14rem;
    grid-auto-flow: dense;
    gap: .7rem;
}

.project-gallery__item {
    border-radius: 5px;
    overflow: hidden;
}



/* ── FOOTER ── */
.footer {
    margin-top: 3rem;
    padding: 2rem 1.5rem;
    background: #ddd;
    border-top: 1px solid #ccc;
}

.footer__inner {
    max-width: 75rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.footer__links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer__link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    text-decoration: none;
    color: #666;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: color .2s ease;
}

.footer__link:hover {
    color: #e62e4c;
}

.footer__link svg {
    transition: transform .2s ease;
}

.footer__link:hover svg {
    transform: scale(1.15);
}

.footer__email a {
    color: #888;
    text-decoration: none;
    font-size: .8rem;
    font-weight: 500;
    letter-spacing: 1px;
    transition: color .2s ease;
}

.footer__email a:hover {
    color: #e62e4c;
}



/* ── RESPONSIVE: LARGE TABLET (≤60rem / 960px) — 3 columns ── */
@media screen and (max-width: 60rem) {
    .container {
        padding: 0;
    }

    .wrapper {
        padding: 0;
    }

    .gallery {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 13rem;
    }

    /* Clamp spans: max 3 cols wide */
    .gallery__item[style*="span 4"] {
        grid-column: span 3 !important;
    }

    .project-gallery {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 13rem;
    }

    .gallery__overlay {
        font-size: 1.25rem;
    }
}



/* ── RESPONSIVE: SMALL TABLET (≤48rem / 768px) — 2 columns ── */
@media screen and (max-width: 48rem) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 12rem;
        gap: .5rem;
    }

    /* Clamp all spans to max 2 */
    .gallery__item {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }

    .project-gallery {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 12rem;
        gap: .5rem;
    }

    .gallery__overlay {
        font-size: 1.1rem;
    }

    .container h1 {
        letter-spacing: 8px;
        font-size: 15px;
    }

    .nav a {
        font-size: 18px;
    }
}



/* ── RESPONSIVE: MOBILE (≤35rem / 560px) — 1 column ── */
@media screen and (max-width: 35rem) {

    .gallery,
    .project-gallery {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: .4rem;
    }

    /* Reset all spans on mobile */
    .gallery__item {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }

    .gallery__item,
    .project-gallery__item {
        margin: 0;
    }

    .gallery__link {
        height: 50vw;
    }

    .gallery__overlay {
        font-size: 1rem;
    }

    .container h1 {
        letter-spacing: 6px;
        text-align: center;
        font-size: 14px;
    }

    .nav a {
        display: block;
        font-size: 20px;
        padding: .3rem;
    }

    .nav_link:after {
        width: 90%;
        height: 2px;
        top: 85%;
        right: 0;
        left: 0;
        margin: auto;
    }

    .footer__links {
        flex-direction: column;
        align-items: center;
        gap: .8rem;
    }
}