/* Landing-only pieces showcase — approachability card add + fly-zoom extract */

.showcase-pieces {
    --sp-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --sp-ink: #15282f;
    --sp-ink-soft: rgba(21, 40, 47, 0.62);
    --sp-line: rgba(21, 40, 47, 0.12);
    --sp-surface: #fffdf8;
    position: relative;
    overflow: hidden;
    border-radius: 1.35rem;
    border: 1px solid color-mix(in srgb, var(--cl-ink, #1c1814) 12%, transparent);
    background:
        radial-gradient(90% 70% at 8% 0%, rgba(196, 137, 90, 0.16), transparent 55%),
        radial-gradient(70% 60% at 100% 8%, rgba(79, 135, 148, 0.12), transparent 50%),
        linear-gradient(165deg, #f7f3ec 0%, #f3eee6 52%, #efe8dc 100%);
    box-shadow: 0 18px 40px rgba(28, 24, 20, 0.1);
    color: var(--sp-ink);
    aspect-ratio: 16 / 11;
    min-height: 22rem;
    max-height: 36rem;
}

.showcase-pieces__stage {
    position: absolute;
    inset: 0;
    padding: 3rem 1rem 1.25rem;
    display: grid;
    place-items: center;
}

.showcase-pieces__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem 0.75rem;
    width: min(100%, 28rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.showcase-pieces__cell {
    margin: 0;
    padding: 0.35rem 0.2rem 0.55rem;
    position: relative;
}

.showcase-pieces__card {
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--sp-line);
    border-radius: 1.1rem;
    background: var(--sp-surface);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.7) inset,
        0 10px 24px rgba(21, 40, 47, 0.06);
    transform: rotate(var(--tilt, 0deg)) translateY(var(--shift, 8px));
    opacity: 0;
    pointer-events: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    color: inherit;
    text-align: left;
    padding: 0;
}

.showcase-pieces__card.is-in {
    animation: showcasePiecesIn 0.65s var(--sp-ease) forwards;
    pointer-events: auto;
}

.showcase-pieces__card.is-in:hover,
.showcase-pieces__card.is-in:focus-visible {
    z-index: 2;
    outline: none;
    transform: rotate(0deg) translateY(-4px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.7) inset,
        0 14px 30px rgba(21, 40, 47, 0.12);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.showcase-pieces.is-playing .showcase-pieces__card.is-in:hover,
.showcase-pieces.is-playing .showcase-pieces__card.is-in:focus-visible {
    transform: rotate(var(--tilt, 0deg)) translateY(0);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.7) inset,
        0 10px 24px rgba(21, 40, 47, 0.06);
}

.showcase-pieces__card.is-lifted {
    visibility: hidden;
    pointer-events: none;
}

.showcase-pieces__media {
    position: relative;
    aspect-ratio: 1 / 1.08;
    overflow: hidden;
    background: var(--sp-badge, #5b8fd4);
}

.showcase-pieces__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.showcase-pieces__card--group .showcase-pieces__media {
    aspect-ratio: 1 / 1;
    border-radius: 0.85rem 0.85rem 0 0;
}

.showcase-pieces__fallback {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: #fff;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: 0.02em;
}

.showcase-pieces__card--group .showcase-pieces__fallback {
    font-size: 1.15rem;
    letter-spacing: 0.04em;
}

.showcase-pieces__name {
    margin: 0;
    padding: 0.55rem 0.7rem 0.7rem;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.showcase-pieces__foot {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.showcase-pieces__body {
    display: none;
    flex-direction: column;
    gap: 0.38rem;
    padding: 0 0.7rem 0.85rem;
    margin-top: -0.15rem;
}

.showcase-pieces__line {
    display: block;
    height: 0.42rem;
    width: var(--sp-line-w, 80%);
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        rgba(21, 40, 47, 0.1) 0%,
        rgba(21, 40, 47, 0.16) 45%,
        rgba(21, 40, 47, 0.08) 100%
    );
}

.showcase-pieces__line:nth-child(even) {
    opacity: 0.78;
}

.showcase-pieces__fly {
    position: absolute;
    z-index: 5;
    left: 0;
    top: 0;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    border-radius: 1.1rem;
    background: var(--sp-surface);
    box-shadow: 0 22px 48px rgba(21, 40, 47, 0.22);
    pointer-events: none;
    transform-origin: center center;
    will-change: left, top, width, height, transform;
}

.showcase-pieces__fly .showcase-pieces__card {
    width: 100%;
    height: 100%;
    opacity: 1;
    transform: none;
    animation: none;
    box-shadow: none;
    border: 0;
    display: flex;
    flex-direction: column;
}

.showcase-pieces__fly .showcase-pieces__media {
    flex: 1 1 auto;
    min-height: 0;
    aspect-ratio: auto;
    height: auto;
}

.showcase-pieces__fly .showcase-pieces__foot {
    flex: 0 0 auto;
}

.showcase-pieces__fly .showcase-pieces__name {
    padding: 0.65rem 0.85rem 0.45rem;
    font-size: 1rem;
    white-space: normal;
}

.showcase-pieces__fly .showcase-pieces__body {
    display: flex;
    opacity: 0;
    max-height: 0;
    padding: 0 0.85rem;
    margin: 0;
    overflow: hidden;
    transform: translateY(8px);
    will-change: opacity, max-height, transform;
}

.showcase-pieces__hint {
    position: absolute;
    z-index: 3;
    left: 0.85rem;
    top: 0.85rem;
    transform: none;
    margin: 0;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.82);
    border: 1px solid rgba(21, 40, 47, 0.1);
    color: var(--sp-ink-soft);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s var(--sp-ease);
}

.showcase-pieces.is-active .showcase-pieces__hint {
    opacity: 1;
}

.showcase-pieces.is-playing .showcase-pieces__hint {
    opacity: 0;
}

.showcase-pieces__replay {
    position: absolute;
    z-index: 4;
    right: 0.85rem;
    top: 0.85rem;
    bottom: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(21, 40, 47, 0.14);
    background: rgba(255, 253, 248, 0.92);
    color: var(--sp-ink);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    cursor: pointer;
    appearance: none;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-0.15rem);
    transition:
        opacity 0.35s var(--sp-ease),
        transform 0.35s var(--sp-ease),
        background 0.2s var(--sp-ease),
        border-color 0.2s var(--sp-ease);
}

.showcase-pieces__replay i {
    font-size: 0.95rem;
    line-height: 1;
}

.showcase-pieces.is-active:not(.is-playing) .showcase-pieces__replay {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.showcase-pieces__replay:hover,
.showcase-pieces__replay:focus-visible {
    background: #fff;
    border-color: rgba(61, 142, 196, 0.45);
    outline: none;
}

.showcase-pieces__replay:focus-visible {
    box-shadow: 0 0 0 3px rgba(61, 142, 196, 0.28);
}

@keyframes showcasePiecesIn {
    to {
        opacity: 1;
        transform: rotate(var(--tilt, 0deg)) translateY(0);
    }
}

@media (max-width: 575.98px) {
    .showcase-pieces {
        aspect-ratio: 1 / 1.05;
        min-height: 20rem;
    }

    .showcase-pieces__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: min(100%, 18rem);
    }

    .showcase-pieces__cell:nth-child(n + 5) {
        display: none;
    }

    .showcase-pieces__replay span {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .showcase-pieces__card.is-in {
        animation: none;
        opacity: 1;
        transform: rotate(var(--tilt, 0deg));
    }
}
