* {
    box-sizing: border-box;
}

.work-page {
    background: #f7f1ea;
    color: #1c1713;
}

.work-hero {
    min-height: 510px;
    display: flex;
    padding: 145px 0 78px;
    color: #fff;
    background: linear-gradient(90deg, rgba(10, 7, 5, .8), rgba(10, 7, 5, .2)), url('../assets/img/TOMA%206%20FRENTE%20CASA%20FINAL.webp') center / cover;
}

.work-hero .wrap {
    max-width: 860px;
    margin-left: 0;
    padding-left: clamp(20px, 5vw, 75px);
}

.work-hero h1 {
    max-width: 720px;
    margin: 12px 0 16px;
    font-family: Fraunces, serif;
    font-size: clamp(2.8rem, 5vw, 5rem);
    line-height: 1.02;
}

.work-hero p {
    max-width: 550px;
    color: rgba(255, 255, 255, .78);
    font-size: 1.05rem;
}

.work-hero .eyebrow {
    color: #d8ae67;
}

.work-gallery {
    padding: 95px 0;
}

.work-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 38px;
}

.work-toolbar h2 {
    font-family: Fraunces, serif;
    font-size: clamp(2rem, 3vw, 3.2rem);
}

.work-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    padding: 10px 16px;
    border: 1px solid #d9c4ad;
    border-radius: 999px;
    color: #6b4528;
    background: transparent;
    font: inherit;
    font-size: .8rem;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.filter-btn:hover,
.filter-btn.is-active {
    color: #fff;
    background: #6b4528;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.work-card {
    min-width: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 14px 30px rgba(18, 11, 9, .08);
    transition: transform .25s ease, opacity .25s ease;
}

.work-card.is-hidden {
    display: none;
}

.work-card:hover {
    transform: translateY(-5px);
}

.work-card__open {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    text-align: left;
    cursor: pointer;
    background: #fff;
}

.work-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    transition: transform .5s ease;
}

.work-card:hover img {
    transform: scale(1.04);
}

.work-card__overlay {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    padding: 48px 20px 18px;
    color: #fff;
    background: linear-gradient(transparent, rgba(18, 11, 9, .86));
}

.work-card__overlay b {
    font-family: Fraunces, serif;
    font-size: 1.3rem;
}

.work-card__overlay small {
    color: #dec59f;
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.work-cta {
    padding: 68px 0;
    text-align: center;
    background: #1b120f;
    color: #fff;
}

.work-cta h2 {
    margin-bottom: 22px;
    font-family: Fraunces, serif;
    font-size: clamp(2rem, 3vw, 3rem);
}

.work-modal {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: none;
    place-items: center;
    padding: 22px;
}

.work-modal.is-open {
    display: grid;
}

.work-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 6, 4, .78);
    backdrop-filter: blur(6px);
}

.work-modal__box {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    width: min(900px, 100%);
    max-height: calc(100vh - 44px);
    overflow: auto;
    background: #fffdfa;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}

.work-modal__box img {
    width: 100%;
    height: 100%;
    min-height: 320px;
    object-fit: cover;
}

.work-modal__box>div {
    align-self: center;
    padding: 42px 34px;
}

.work-modal__box h2 {
    margin: 10px 0 14px;
    font-family: Fraunces, serif;
    font-size: 2.2rem;
}

.work-modal__box p {
    margin-bottom: 24px;
    color: #5d4a40;
    line-height: 1.7;
}

.work-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    color: #1c1713;
    background: rgba(255, 255, 255, .86);
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 850px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .work-toolbar {
        align-items: start;
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .work-modal__box {
        grid-template-columns: 1fr;
    }

    .work-modal__box img {
        min-height: 220px;
        max-height: 42vh;
    }

    .work-modal__box>div {
        padding: 26px 22px;
    }
}

/* VIDEOS */
.work-videos {
    padding: 80px 0 60px;
    background: #fff;
    border-top: 1px solid rgba(28, 23, 19, .06);
}

.work-videos .section-head {
    max-width: 760px;
    margin: 0 auto 36px;
    text-align: center;
}

.work-videos .section-head h2 {
    font-family: Fraunces, serif;
    font-size: clamp(1.9rem, 2.8vw, 2.6rem);
    margin-bottom: 10px;
}

.work-videos .section-head p {
    color: #5d4a40;
    max-width: 560px;
    margin: 0 auto;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.video-card {
    background: #fffdfa;
    border: 1px solid rgba(28, 23, 19, .06);
    border-radius: 14px;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 32px rgba(18, 11, 9, .1);
}

.video-thumb {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #000;
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .92;
    transition: transform .5s ease;
    display: block;
}

.video-card:hover .video-thumb img {
    transform: scale(1.04);
}

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    border: 1.5px solid rgba(255, 255, 255, .9);
    backdrop-filter: blur(4px);
    display: grid;
    place-items: center;
    color: #fff;
    transition: transform .2s ease, background .2s ease;
}

.video-card:hover .play-btn {
    transform: translate(-50%, -50%) scale(1.08);
    background: rgba(107, 69, 40, .88);
}

.play-btn svg {
    width: 20px;
    height: 20px;
    margin-left: 2px;
}

.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(18, 11, 9, .78);
    color: #fff;
    font-size: .72rem;
    padding: 4px 8px;
    border-radius: 999px;
}

.video-info {
    padding: 14px 16px 16px;
}

.video-tag {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #6B4528;
    background: rgba(199, 165, 122, .16);
    padding: 4px 8px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.video-info h4 {
    font-family: Fraunces, serif;
    font-size: .98rem;
    line-height: 1.35;
    margin-bottom: 6px;
    color: #1c1713;
}

.video-duration-label {
    font-size: .72rem;
    color: #5d4a40;
}

.videos-cta {
    text-align: center;
    margin-top: 28px;
}

/* FEATURED VIDEO */
.work-featured-video {
    padding: 36px 0 0;
    background: #fff;
}

.featured-video__card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 16/9;
    max-width: 960px;
    margin: 0 auto;
    background: #000;
    box-shadow: 0 24px 48px rgba(18, 11, 9, .18);
    cursor: pointer;
}

.featured-video__el {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.featured-video__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 8px;
    padding: 32px;
    background: linear-gradient(transparent 38%, rgba(18, 11, 9, .78) 78%, rgba(18, 11, 9, .92) 100%);
    color: #fff;
}

.featured-video__overlay h2 {
    font-family: Fraunces, serif;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    line-height: 1.1;
    margin: 0;
    max-width: 560px;
}

.featured-video__overlay p {
    color: rgba(255, 255, 255, .82);
    max-width: 560px;
    line-height: 1.6;
}

.featured-video__overlay .eyebrow {
    color: #d8ae67;
}

.featured-video__play {
    margin-top: 12px;
}

.featured-video__big-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    border: 2px solid #fff;
    color: #fff;
    display: grid;
    place-items: center;
    backdrop-filter: blur(8px);
    transition: transform .2s ease, background .2s ease;
}

.featured-video__card:hover .featured-video__big-play {
    transform: translate(-50%, -50%) scale(1.08);
    background: rgba(107, 69, 40, .88);
    border-color: #fff;
}

.featured-video__big-play svg {
    width: 26px;
    height: 26px;
    margin-left: 3px;
}

/* VIDEO MODAL */
.video-modal {
    position: fixed;
    inset: 0;
    z-index: 2002;
    display: none;
    place-items: center;
    padding: 20px;
}

.video-modal.is-open {
    display: grid;
}

.video-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 6, 4, .82);
    backdrop-filter: blur(8px);
}

.video-modal__box {
    position: relative;
    z-index: 1;
    width: min(900px, 100%);
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0, 0, 0, .5);
}

.video-modal__frame {
    width: 100%;
    height: 100%;
}

.video-modal__frame iframe,
.video-modal__frame video {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    background: #000;
    object-fit: contain;
}

.video-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    display: grid;
    place-items: center;
}

@media (max-width: 980px) {
    .videos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .videos-grid {
        grid-template-columns: 1fr;
    }

    .work-videos {
        padding: 60px 0 40px;
    }
}