/* EXTEND BOOTSTRAP */

:root {
    --bs-body-bg: #F5F1EE;
    --navbar-height: 0px;
    --footer-height: 0px;
}

/* Font Sizes */

@media (min-width: 768px) {
    .fs-md-3 {
        font-size: calc(1.3rem + 0.6vw) !important;
    }
    .fs-md-4 {
        font-size: calc(1.275rem + 0.3vw) !important;
    }
    .fs-md-5 {
        font-size: 1.25rem !important;
    }
}
@media (min-width: 1199.96px) {
    .fs-xl-6 {
        font-size: 1rem !important;
    }
}
@media (min-width: 1399.96px) {
    .fs-xxl-5 {
        font-size: 1.25rem !important;
    }
}

.accordion {
    --bs-accordion-bg: #F5F1EE;
    --bs-accordion-active-color: #212529;
    --bs-accordion-active-bg: #F5F1EE;
    --bs-accordion-btn-focus-border-color: #212529;
    --bs-accordion-btn-focus-box-shadow: none;
}
.accordion-button::after {
    content: "+";
    background-image: none !important;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    transform: none !important;
    transition: none;
}
.accordion-button:not(.collapsed)::after {
    content: "-";
    background-image: none !important;
    transform: none !important;
}

.hidden {
    display: none !important;
}

/* ---------------------------------------- */

/* Global HTML and Body Styling */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
}

/* Scroll Padding for Fixed Navbar */

html {
    scroll-padding-top: calc(var(--navbar-height) + 12px);
}
@media (max-width: 767.98px) {
    html {
        scroll-padding-top: calc(var(--navbar-height) - 15px);
    }
}
section[id] {
    scroll-margin-top: calc(var(--navbar-height) + 12px);
}
@media (max-width: 767.98px) {
    section[id] {
        scroll-margin-top: calc(var(--navbar-height) - 15px);
    }
}

/* Extra Large Container Styling */

@media (min-width: 1400px) {
    .container:not(
        nav .container,
        footer .container,
        ) {
            padding: 3rem 5rem;
            max-width: 2000px;
        }
        header .container,
        #skills .container {
            border-left: 2px solid #e5e5e5;
    }
    #about .container {
        border-right: 2px solid #e5e5e5;
    }
}

/* Navbar, Footer, and General Text Styling */

.navbar-brand,
.navbar-brand h1,
.nav-item,
footer a,
.section-header,
.accordion-button {
    text-transform: uppercase;
    letter-spacing: 2px;
}

footer a,
#contact a {
    color: #484437;
    transition: color 0.2s ease-in-out;
}
footer a:hover,
#contact a:hover {
    color: black;
}

.navbar {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    z-index: 1050;
    background-color: var(--bs-body-bg);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Header and Hero Image Styling */

header,
#category-detail {
    min-height: calc(100vh - var(--navbar-height) - var(--footer-height));
    margin-top: var(--navbar-height);
    margin-bottom: var(--footer-height);
}
.hero-image-wrap {
    overflow-x: clip;
}
.hero-image {
    display: block;
    max-width: 100%;
    height: auto;
}
@media (max-width: 767.98px) {
    .hero-image {
        width: clamp(24rem, 122vw, 30rem);
        max-width: none;
        position: relative;
        left: 50%;
        transform: translateX(-50%);
    }
}
@media (min-width: 768px) {
    .hero-image {
        width: 100%;
        max-width: 100%;
        position: static;
        transform: none;
    }
}
@media (min-width: 1200px) {
    .hero-image {
        width: clamp(105%, 7vw, 112%);
        max-width: none;
    }
    .hero-image-wrap {
        overflow: visible;
    }
}

/* Category Thumbnails */

.thumbnail {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    container-type: inline-size;
}
.thumbnail img {
    position: absolute;
    height: 100%;
    width: auto;
    max-width: none;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    transition: transform 0.3s ease-in-out;
    object-fit: cover;
}
.thumbnail:hover img {
    transform: translateX(-50%) scale(1.05);
}
.caption {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    z-index: 1;
    color: white;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    transform: scaleY(1.2);
    font-size: 7cqw;
    transition: font-weight 0.3s ease-in-out, transform 0.3s ease-in-out, letter-spacing 0.3s ease-in-out;
}
.thumbnail:hover .caption {
    font-weight: 600;
    transform: scaleY(1.2) scale(1.05);
    letter-spacing: 0.25em;
}

#contact {
    margin-bottom: var(--footer-height);
}

/* Category Project Cards */

.category-tab a {
    display: inline-block;
    font-weight: 400;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease-in-out, font-weight 0.2s ease-in-out;
}
.category-tab div:hover a,
.category-tab a.is-active {
    font-weight: 700;
    transform: scale(1.05);
}

/* Category Detail */

#project-cards {
    --bs-gutter-x: 0.5rem;
    --bs-gutter-y: 0.5rem;
}
#project-cards .thumbnail {
    aspect-ratio: 1 / 1;
    margin: 0;
    border: none;
}
#project-cards .card {
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
#project-cards .card.hovered {
    transform: translateY(-4px);
    box-shadow: 0 0.85rem 1.8rem rgba(35, 29, 25, 0.18);
}
#project-cards .card-img-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto auto;
    background: rgba(0, 0, 0, 0.65);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
#project-cards .card.hovered .card-img-overlay {
    opacity: 1;
    visibility: visible;
}

#project-cards .card-title {
    position: absolute;
    bottom: 0;
    font-size: 1.25rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

/* Project Detail */

#project-detail {
    margin-top: var(--navbar-height);
    margin-bottom: var(--footer-height);
}

#project-detail .splide {
    height: 50vh;
    margin-top: 3rem;
    text-align: center;
}

#main-carousel .splide__track,
#main-carousel .splide__list,
#main-carousel .splide__slide,
#main-carousel .splide__slide img {
    height: 100%;
}
#main-carousel .splide__slide img {
    display: block;
    width: 100%;
    object-fit: contain;
}
.project-thumbnail {
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(72, 68, 55, 0.2);
    border-radius: 0.375rem;
    background: transparent;
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.project-thumbnail img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.project-thumbnail:hover {
    transform: translateY(-2px);
    border-color: rgba(72, 68, 55, 0.55);
    box-shadow: 0 0.35rem 0.8rem rgba(35, 29, 25, 0.14);
}
.project-thumbnail:hover img {
    transform: scale(1.04);
}
.project-thumbnail:focus-visible {
    outline: 2px solid #484437;
    outline-offset: 3px;
}

/* Motion details */

@media (prefers-reduced-motion: no-preference) {
    @keyframes navbar-arrive {
        from {
            opacity: 0;
            transform: translateY(-8px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .navbar {
        animation: navbar-arrive 0.55s ease-out both;
    }

    .has-scroll-reveal .reveal-on-scroll {
        opacity: 0;
        transform: translateY(16px);
        transition: opacity 0.65s ease var(--reveal-delay, 0ms),
            transform 0.65s cubic-bezier(0.2, 0.7, 0.2, 1) var(--reveal-delay, 0ms);
    }

    .has-scroll-reveal .reveal-on-scroll.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

    @keyframes category-card-arrive {
        from {
            opacity: 0;
            transform: translateY(14px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    #project-cards > .category-slide-in {
        animation: category-card-arrive 0.48s cubic-bezier(0.2, 0.7, 0.2, 1)
            var(--category-slide-delay, 0ms) both;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll,
    #project-cards > .category-slide-in,
    #project-cards .card,
    #project-cards .card-img-overlay,
    .thumbnail img,
    .caption,
    .category-tab a,
    .project-thumbnail,
    .project-thumbnail img {
        transition: none;
        animation: none;
    }

    .reveal-on-scroll {
        opacity: 1;
    }

    #project-cards .card,
    #project-cards .card.hovered,
    .project-thumbnail,
    .project-thumbnail:hover img {
        transform: none;
    }

    .thumbnail:hover img {
        transform: translateX(-50%);
    }

    .thumbnail:hover .caption {
        transform: scaleY(1.2);
    }

    .category-tab div:hover a,
    .category-tab a.is-active {
        transform: none;
    }
}

/* Footer */

footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--bs-body-bg);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}