html, body {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

footer {
    flex-shrink: 0;
    background: white;
}

/* Screen Reader Only Utility for Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.main {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#portfolio {
    width: 100vw;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
}

hgroup {
    margin-top: 5vh;
    margin-bottom: 2vh;
}

.slider-wrapper {
    position: relative;
    width: 100vw;
}

.slider-arrow {
    position: absolute;
    top: 45%;
    transform: translateY(-50%);
    background: #000;
    color: #fff;
    border: 0.15vw solid transparent;
    border-radius: 50%;
    width: 3vw;
    height: 3vw;
    font-size: 1.5vw;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0.2vw 0.2vw 0 rgba(0,0,0,0.5);
}

.slider-arrow:hover {
    background: #fff;
    color: #000;
    border-color: #000;
    transform: translateY(-50%) scale(1.1);
}

.slider-arrow.left {
    left: 1.5vw;
}

.slider-arrow.right {
    right: 1.5vw;
}

.portfolio-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 2vw;
    padding: 1vw 6vw 4vw 6vw;
    width: 100vw;
    box-sizing: border-box;
    /* Hide scrollbar for a cleaner look */
    -ms-overflow-style: none;
    scrollbar-width: none;
    scroll-behavior: smooth;
    align-items: center;
}

.portfolio-slider::-webkit-scrollbar {
    display: none;
}

.portfolio-slider > .project {
    flex: 0 0 20.5vw; /* Fit 4 items: (20.5*4 = 82) + (3 gaps*2 = 6) + side padding = ~100vw */
    height: 65vh; /* Lock height relative to screen */
    scroll-snap-align: center;
    background-color: rgba(255, 255, 255, 0.95);
    border: 0.15vw solid black;
    border-radius: 1vw;
    display: flex;
    flex-direction: column;
    padding: 1.5vw;
    box-sizing: border-box;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    box-shadow: 0.5vw 0.5vw 0 rgba(0,0,0,1);
}

.portfolio-slider > .project:hover {
    transform: translateY(-1vw) scale(1.02);
    box-shadow: 0.8vw 0.8vw 0 rgba(0,0,0,1);
}

.profile-photo {
    width: 100%;
    height: 40%; /* Relative to the card's 65vh */
    object-fit: cover;
    border-radius: 0.5vw;
    border: 0.15vw solid #000;
    margin-bottom: 1vw;
    display: block;
    overflow: hidden;
}

picture.profile-photo {
    padding: 0;
}

picture.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    border-radius: inherit;
}

.work-badge {
    position: absolute;
    top: 3vw;
    right: 3vw;
    background: #000;
    color: #fff;
    font-size: 0.8vw;
    padding: 0.4vw 1vw;
    border-radius: 2vw;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.1vw;
    z-index: 2;
}

.project h3 {
    font-size: 1.2vw;
    line-height: 1.5vw;
    margin: 0 0 0.8vw 0;
    text-align: left;
    font-weight: 800;
    text-transform: uppercase;
}

.project-desc {
    font-size: 0.9vw;
    line-height: 1.2vw;
    color: #333;
    text-align: left;
    margin-bottom: 1.5vw;
    flex-grow: 1; /* Pushes the button to the bottom */
}

.client-url {
    width: fit-content;
    font-size: 0.8vw;
    padding: 0.6vw 1.2vw;
    background: #000;
    color: #fff;
    text-decoration: none;
    border-radius: 2vw;
    font-weight: bold;
    text-align: center;
    align-self: flex-start;
    transition: background 0.2s, transform 0.2s;
    border: 0.15vw solid transparent;
}

.client-url:hover {
    background: #fff;
    color: #000;
    border-color: #000;
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .slider-arrow {
        width: 8vw;
        height: 8vw;
        font-size: 4vw;
        top: 40%;
    }
    .portfolio-slider {
        padding: 5vw 12vw;
        gap: 5vw;
    }
    .portfolio-slider > .project {
        flex: 0 0 76vw;
        padding: 5vw;
        border-radius: 3vw;
    }
    .profile-photo {
        height: 50vw;
        border-radius: 2vw;
        margin-bottom: 4vw;
    }
    .work-badge {
        font-size: 3vw;
        top: 7vw;
        right: 7vw;
        padding: 1vw 3vw;
    }
    .project h3 {
        font-size: 6vw;
        line-height: 7vw;
        margin-bottom: 3vw;
    }
    .project-desc {
        font-size: 4vw;
        line-height: 6vw;
        margin-bottom: 5vw;
    }
    .client-url {
        font-size: 4vw;
        padding: 3vw 6vw;
    }
}

.custom-radio {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.custom-radio:focus-visible + .custom-radio-label {
    outline: 3px dotted #000000 !important;
    outline-offset: 4px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3) !important;
}

/* Style for the label (checkbox look-alike) */
.custom-radio-label {
    display: inline-block;
    padding: 10px 20px;
    background-color: #f0f0f0;
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

/* Tooltip style */
.custom-radio-label .tooltip {
    text-align: center;
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #000000;
    color: #fff;
    padding: 5px;
    border-radius: 5px;
    font-size: .6vw;
    min-width: 4vw;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Checkbox checked state */
.custom-radio:checked + .custom-radio-label {
    background-color: #000000;
    color: #ffffff;
    transform: scale(1.1);
}

/* Show tooltip on label click */
.custom-radio:checked + .custom-radio-label .tooltip {
    opacity: 1;
}
