@import url("reset.css");
@import url("global.css");

body {
    background-color: var(--primary-color);
}

body::before {
    content: "";
    background-image: url("../images/spider-man-background.jpg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    width: 100%;
    height: 100%;
    position: absolute;
    opacity: 0.2;
    z-index: -2;
    transition: background-image 1s ease-in-out, opacity 1s ease-in-out;
}

.s-menu ul {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 1rem 0;
}

.s-menu__item {
    display: flex;
    text-transform: uppercase;
}

.s-menu__icon {
    width: 2.5rem;
}

.s-container {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    perspective: 3000px;
}

.s-card {
    width: 100%;
    height: 70vh;
    border: 0.5rem solid #fff;
    position: absolute;
    transition: filter 0.5s ease-in-out;
}

.s-card:nth-child(1) {
    transform: rotateY(0deg) translateZ(50vw);
}

.s-card:nth-child(2) {
    transform: rotateY(120deg) translateZ(50vw);
}

.s-card:nth-child(3) {
    transform: rotateY(240deg) translateZ(50vw);
}

.s-card__background {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    position: absolute;
    transition: opacity 1s ease-in-out;
}

.s-card__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    transition: 1s ease-in-out;
}

.s-card__title {
    width: 100%;
    font-size: 2rem;
    text-transform: uppercase;
    text-align: center;
    position: absolute;
    bottom: 0;
    transition: bottom 1s ease-in-out;
}

.s-controller {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3.75rem;
    margin-top: 3rem;
    width: 100%;
    position: absolute;
    bottom: 1.5rem;
}

.s-controller__button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 2px solid white;
    border-radius: 50%;
    background-color: var(--primary-color);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1;
    transition: transform 0.3s ease-in-out;
    transform-origin: center;
    flex-shrink: 0;
    will-change: transform;
}

.s-controller__button:hover {
    transform: scale(1.1);
}

.s-controller__button--active {
    color: var(--primary-color);
    background-color: #fff;
    border: 0.1875rem solid var(--primary-color);
    outline: 0.125rem solid #fff;
}

.s-controller__line {
    width: 50%;
    height: 2px;
    background-color: #fff;
    position: absolute;
}

/* HOVER ANIMATION */
.s-card--hovered .s-card__background {
    cursor: pointer;
    opacity: 0;
}

.s-card--hovered .s-card__image {
    filter: drop-shadow(30px 10px 4px rgba(0, 0, 0, 0.5));
    transform: scale(1.3);
}

body#spider-man-01--hovered::before {
    background-image: url("../images/pic-sm-bg-01.jpg");
}

body#spider-man-02--hovered::before {
    background-image: url("../images/pic-sm-bg-02.jpg");
}

body#spider-man-03--hovered::before {
    background-image: url("../images/pic-sm-bg-03.jpg");
}

body[id^="spider-man-"]::before {
    opacity: 1;
}

body[id^="spider-man-"] .s-card:not(.s-card--hovered) {
    filter: grayscale(100%);
}

.s-card--hovered .s-card__title {
    bottom: 50%;
}

.s-cards-carousel {
    display: flex;
    justify-content: center;
    width: calc(100vw / 3 - 10%);
    transform-style: preserve-3d;
    transition: transform 0.4s ease-in;
}
