html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background: #111;
}

main {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 100%;
    overflow: hidden;
}

.item {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-color: var(--background);
    overflow: hidden;
}

.item.active {
    display: block;
}

.item .title {
    font-size: clamp(3rem, 8vw, 12rem);
    color: #ffffff;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-weight: bold;
    text-align: center;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    line-height: 0.95;
    pointer-events: none;
}

.item .fruit {
    width: min(90vw, 900px);
    max-width: 100%;
    height: auto;
    left: 50%;
    transform: translateX(-50%);
    position: absolute;
    top: 0;
    z-index: 3;
    object-fit: contain;
    pointer-events: none;
}

.item .refri {
    width: min(600px, 90vw);
    max-width: 100%;
    height: auto;
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    object-fit: contain;
    pointer-events: none;
}

#prev,
#next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(44px, 6vw, 56px);
    height: clamp(44px, 6vw, 56px);
    background-color: #eee9;
    border: 1px solid #eee9;
    color: #eee;
    font-size: x-large;
    font-family: monospace;
    cursor: pointer;
    z-index: 4;
    border-radius: 50%;
}

#prev {
    left: 10px;
}

#next {
    right: 10px;
}

@keyframes toActive {
    from {
        top: 100%;
        opacity: 0;
    }
}

.item.active img.fruit {
    animation: toActive 1s ease-in-out 1;
}

.item.active .title {
    animation: toActive 1s ease-in-out 1;
}

@media (max-width: 768px) {
    .item .title {
        font-size: clamp(2.2rem, 7vw, 3.4rem);
        top: 25%;
        transform: translate(-50%, -25%);
    }

    .item .fruit {
        width: min(92vw, 500px);
        top: 0.5rem;
    }

    .item .refri {
        width: min(80vw, 420px);
    }

    #prev,
    #next {
        width: 46px;
        height: 46px;
    }
}

@media (max-width: 480px) {
    .item .title {
        font-size: clamp(1.8rem, 8vw, 2.5rem);
        top: 26%;
        transform: translate(-50%, -26%);
    }

    .item .fruit {
        width: min(96vw, 320px);
        top: 0.2rem;
    }

    .item .refri {
        width: min(86vw, 300px);
    }

    #prev {
        left: 0.5rem;
    }

    #next {
        right: 0.5rem;
    }
}

