body { overflow-x: clip !important; }

/* Tall scroll track: the sticky stage stays in view while the page scroll turns the wheel */
#projects.works-wheel-section {
    --wheel-steps: 4;
    --wheel-step: 60svh;
    position: relative;
    display: block !important;
    width: 100%;
    height: calc(max(100svh, 600px) + var(--wheel-steps) * var(--wheel-step)) !important;
    margin: 0;
    padding: 0 !important;
    overflow: visible !important;
}

.works-wheel {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100svh;
    min-height: 600px;
    overflow: hidden;
    color: #fff;
    isolation: isolate;
    user-select: none;
}

.works-wheel__stage {
    position: absolute;
    inset: 0;
    z-index: 2;
    outline: none;
}

.works-wheel__stage:focus-visible { outline: 2px solid #5bafdb; outline-offset: -5px; }

.works-wheel__rotor {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-style: preserve-3d;
    pointer-events: none;
}

.works-wheel__card {
    position: absolute;
    display: block;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    pointer-events: auto;
    outline: none;
    will-change: transform;
}

.works-wheel__card:focus-visible .works-wheel__face { outline: 2px solid #5bafdb; outline-offset: 4px; }

.works-wheel__face {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 10px;
    background: #08111e;
    box-shadow: 0 22px 55px rgba(0,0,0,.55);
    transition: box-shadow .3s ease;
}

.works-wheel.is-drum .works-wheel__card:hover .works-wheel__face { box-shadow: 0 24px 60px rgba(20,137,229,.28); }
.works-wheel__face img { display: block; width: 100%; height: 100%; object-fit: cover; }

.works-wheel__action {
    position: absolute;
    right: 14px;
    bottom: 14px;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 100px;
    background: rgba(0,0,0,.78);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
}

.works-wheel.is-drum .works-wheel__card:hover .works-wheel__action,
.works-wheel__card:focus-visible .works-wheel__action { opacity: 1; transform: translateY(0); }

.works-wheel__label,
.works-wheel__title {
    position: absolute;
    z-index: 3;
    margin: 0;
    font-size: var(--wheel-title-size, 42px);
    font-weight: 800;
    line-height: .98;
    letter-spacing: -.045em;
    text-transform: uppercase;
    pointer-events: none;
}

.works-wheel__label {
    top: 50%;
    left: 50%;
    width: max-content;
    max-width: 80%;
    text-align: center;
    transform: translate(-50%, -50%);
}

.works-wheel__label span { color: #4eaeff; }

.works-wheel__title {
    top: 50%;
    left: 5%;
    width: 27%;
    max-width: 340px;
    transform: translateY(-50%);
    opacity: 0;
    font-size: clamp(22px, 2.7vw, var(--wheel-title-size, 42px));
}

.works-wheel__index {
    position: absolute;
    z-index: 4;
    top: 50%;
    right: 3%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 17%;
    text-align: right;
    transform: translateY(-50%);
}

.works-wheel__index button {
    padding: 3px 0;
    border: 0;
    background: none;
    color: #777e88;
    font: 600 clamp(11px, 1vw, 15px)/1.3 Switzer, sans-serif;
    text-align: right;
    cursor: pointer;
    transition: color .25s ease;
}

.works-wheel__index button:hover,
.works-wheel__index button[aria-current="true"] { color: #fff; }
.works-wheel__index button:focus-visible { outline: 2px solid #5bafdb; outline-offset: 3px; }

.works-wheel__hint {
    position: absolute;
    z-index: 3;
    bottom: 5%;
    left: 50%;
    margin: 0;
    color: #8e98a4;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    transform: translateX(-50%);
    pointer-events: none;
}

@media (max-width: 700px) {
    #projects.works-wheel-section { --wheel-step: 48svh; height: calc(max(100svh, 560px) + var(--wheel-steps) * var(--wheel-step)) !important; }
    .works-wheel { min-height: 560px; }
    .works-wheel__rotor { top: 43%; }
    .works-wheel__label { top: 43%; font-size: clamp(22px, 6.3vw, 30px); }
    .works-wheel__title {
        top: calc(43% + var(--wheel-card-half, 105px) + 16px);
        bottom: auto;
        left: 5%;
        width: 90%;
        max-width: none;
        text-align: center;
        transform: none;
        padding: 10px 6px;
        border-radius: 8px;
        background: rgba(0, 0, 0, .9);
        font-size: clamp(21px, 5.5vw, 30px);
    }
    .works-wheel__index {
        display: none;
    }
    .works-wheel__index button[aria-current="true"] { border-color: #5bafdb; background: #103652; }
    .works-wheel__index-name { display: none; }
    .works-wheel__hint { bottom: 13%; width: 100%; text-align: center; }
    .works-wheel.is-drum .works-wheel__action { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .works-wheel__face,
    .works-wheel__action,
    .works-wheel__index button { transition: none; }
}
