/* global */

body {
    font-family: 'Inter', sans-serif;
    max-width: 1440px;
    padding: 20px;
    margin: 0 auto;
}

section {
    min-height: 100vh;
    z-index: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h2 {
    font-size: calc(32 / 16 * 1rem);
    font-weight: 600;
    margin-bottom: 20px;
}

h3 {
    font-size: calc(26 / 16 * 1rem);
    font-weight: 600;
    margin-bottom: 14px;
}

a {
    text-decoration: none;
    color: black;
    transition: all 0.3s ease;
}

a:not(.cta):hover {
    opacity: .5;
}

button,
.cta {
    background: white;
    border: 1px solid black;
    padding: 10px 20px;
    transition: all 0.3s ease;
    font-size: calc(10 / 16 * 1rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: calc(16 / 16 * 0.1rem);
    cursor: pointer;
}

button:hover
.cta:hover {
    background: black;
    color: white;
}

/* header */
header {
    width: 100%;
    padding-top: 20px;
    padding-bottom: 20px;
    background: white;
    position: fixed;
    text-align: center;
    top: 0;
    left: 0;
    z-index: 3;

    &:after {
        content: '';
        position: absolute;
        bottom: -20px;
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        height: 20px;
        background: #ffffff;
        background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
        transition: width 320ms ease;
    }
}

header > h1 {
    font-size: calc(14 / 16 * 1rem);
    font-weight: 600;
    text-transform: uppercase;
    margin: 0;
    letter-spacing: calc(16 / 16 * 0.1rem);
    z-index: 3;
    pointer-events: none;
    user-select: none;
}

.menu-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 20px;
    height: 15px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    z-index: 2;
}

.menu-toggle:hover {
    opacity: .75;
}

.menu-toggle,
.menu-toggle:before,
.menu-toggle:after,
.menu-toggle i {
    will-change: transform, opacity;
}

.menu-toggle div {
    width: 100%;
    height: .05rem;
    background: black;
    position: absolute;
    left: 0;
    transform-origin: center;
    transition: transform 320ms cubic-bezier(.2,.8,.2,1), opacity 180ms ease;
    overflow: hidden;
}

.menu-toggle div:nth-child(1) {
    top: 0;
}

.menu-toggle div:nth-child(3) {
    top: 100%;
}

.menu-toggle div {
    top: 50%;
    transform: translateY(-50%);
}

.menu-toggle.open div:nth-child(2){
    opacity: 0;
    transition: opacity 180ms ease;
}

.menu-toggle.open div:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.menu-toggle.open div:nth-child(3) {
    top: 50%;
    transform: translateY(-50%) rotate(-45deg);
}

.menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: white;
    display: flex;
    gap: 1rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 320ms ease, pointer-events 320ms ease;
    z-index: -1;

    &.open {
        opacity: 1;
        pointer-events: auto;
    }
}

/* sections */
/* home */
#home {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* work */
/* Work carousel */
.work-carousel {
    position: relative;
    overflow: hidden;
    display: flex;
    gap: 1rem;
    padding: 0 0 2rem 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    pointer-events: grabbing;
    scrollbar-width: none; /* Firefox */
    --webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
}

/* Carousel arrows */
.carousel-arrow {
    position: absolute;
    bottom: -2rem;
    background: white;
    border: 1px solid black;
    padding: 10px 20px;
    transition: all 0.3s ease;
    font-size: calc(10 / 16 * 1rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: calc(16 / 16 * 0.1rem);
    cursor: pointer;
}

.carousel-arrow:hover {
    background: black;
    color: white;
}

.carousel-arrow-prev {
    right: 51%;
}

.carousel-arrow-next {
    left: 51%;
}

/* .work-carousel::-webkit-scrollbar {
    height: 8px;
}
.work-carousel::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
} */

.work-strip {
    display: flex;
    gap: 1rem;
    align-items: stretch;
    will-change: transform;
    transition: none;
}

.work-item {
    flex: 0 0 200px;
    scroll-snap-align: center;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    transition: transform 260ms cubic-bezier(.2,.8,.2,1), opacity 200ms ease;
    cursor: pointer;
}

.work-item img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: all 320ms ease;
    vertical-align: middle;
}

.work-item img:hover {
    transform: scale(1.01);
}

/* Optional: active tab style if tabs are used */
.work-tab div.active {
    font-weight: 700;
    text-decoration: underline;
}

/* work grid */
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    justify-items: center;
}

/* packages */
.package-card {
    height: 100%;
    background: white;
    border: 1px solid black;
}

/* Lightbox / modal styles */
.lightbox {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 240ms ease;
}

.lightbox.open {
    pointer-events: auto;
    opacity: 1;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.lightbox-close {
    width: 20px;
    height: 20px;
    position: absolute;
    top: -20px;
    right: -20px;
    cursor: pointer;
    
    &:before,
    &:after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 100%;
        height: 0.05rem;
        background: white;
        transform-origin: center;
    }

    &:before {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    &:after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }
}

/* mobile */
@media (max-width: 900px) {
    section {
        padding-top: 70px;
    }

    header a {
        margin: 0;
    }

    .carousel-arrow {
        display: none;
    }

    .work-item {
        flex: 0 0 120px;
    }
    
    section {
        min-height: auto;
        padding-bottom: 20px;
    }

    .lightbox-close {
        top: auto;
        bottom: -2rem;
        right: 50%;
        transform: translateX(50%);
    }
}