/* Dynamic hero postcard stack */
.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: 4rem;
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 80px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    min-height: min(60vh, calc(100vh - 110px));
}

.hero-copy {
    position: static;
    inset: auto;
    width: auto;
    max-width: 480px;
    transform: none;
    animation: hero-copy-in .7s var(--motion-ease) both;
}

.hero-card-container,
.hero-media:has(.hero-card-stack) {
    animation: none;
    grid-column: 2;
    min-width: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.hero-stack-column {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    max-width: 460px;
    height: 100%;
    margin-left: auto;
    gap: 24px;
    position: relative;
    left: -190px;
    top: 70px;
}

.hero-card-stack {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 2;
    position: relative;
    width: 460px;
    max-width: 460px;
    margin: auto 0;
    aspect-ratio: 1 / 1;
    isolation: isolate;
}

.hero-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
    border: 5px solid var(--paper);
    border-radius: var(--radius-s);
    background: var(--paper);
    box-shadow: 0 18px 38px rgba(26, 20, 14, .22), 0 2px 8px rgba(0, 0, 0, .18);
    transform-origin: 50% 70%;
    will-change: transform, opacity;
    user-select: none;
    -webkit-user-select: none;
}

.hero-card-skeleton {
    z-index: 1;
    transform: translate(-50%, -50%);
}

.hero-card-media.is-image-loading {
    position: relative;
    overflow: hidden;
    background: #e9e4da;
}

.hero-card-media.is-image-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, #e9e4da 20%, #f4f1eb 42%, #e9e4da 64%);
    background-size: 200% 100%;
    animation: hero-image-shimmer 1.4s ease-in-out infinite;
    pointer-events: none;
}

.hero-card-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .25s ease;
}

.hero-card-media.is-image-loaded .hero-card-image {
    opacity: 1;
}

.hero-skeleton-line {
    display: block;
    height: 12px;
    border-radius: 3px;
    background: linear-gradient(100deg, #e9e4da 20%, #f4f1eb 42%, #e9e4da 64%);
    background-size: 200% 100%;
    animation: hero-image-shimmer 1.4s ease-in-out infinite;
}

.hero-skeleton-title {
    width: 58%;
}

.hero-skeleton-subtitle {
    width: 78%;
    height: 8px;
    margin-top: 8px;
}

@keyframes hero-image-shimmer {
    to {
        background-position: -200% 0;
    }
}

.hero-card.top {
    cursor: grab;
    touch-action: none;
}

.hero-card.top:active {
    cursor: grabbing;
}

.hero-card-media {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 72%;
    background:
        linear-gradient(135deg, rgba(239, 226, 205, .55), rgba(170, 130, 82, .35)),
        linear-gradient(135deg, #d6c0a2, #eee4d2 54%, #b99d78);
    background-size: cover;
    background-position: center;
}

.hero-card-label {
    display: flex;
    height: 28%;
    flex-direction: column;
    justify-content: center;
    padding: 0 17px;
    background: var(--paper);
}

.hero-card-title {
    color: var(--ink);
    font-family: var(--f-display);
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.15;
}

.hero-card-subtitle {
    margin-top: 4px;
    color: var(--ink-soft);
    font: 12px var(--f-mono);
    letter-spacing: .04em;
    text-transform: none;
}

.hero-stack-caption {
    min-height: 1.3em;
    margin: 0;
    color: var(--ink-soft);
    font: 10px var(--f-mono);
    text-align: center;
    align-self: flex-end;
}

@media (min-width: 701px) {
    .hero-stack-caption,
    .hero-card-instruction {
        display: none;
    }
}

@media (max-width: 700px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 28px;
        min-height: auto;
        padding-left: 0;
    }

    .hero-copy {
        order: 1;
        max-width: none;
    }

    .hero-card-container,
    .hero-media:has(.hero-card-stack) {
        position: relative;
        inset: auto;
        grid-column: 1;
        order: 2;
        height: auto;
        min-height: 350px;
    }

    .hero-media:has(.hero-card-stack) {
        justify-content: center;
        padding-top: 28px;
    }

    .hero-card-stack {
        width: 100%;
        max-width: 350px;
        margin: 0 auto;
    }

    .hero-stack-column {
        left: 0;
        top: 0;
        max-width: 350px;
        margin-inline: auto;
    }

    .hero-stack-caption {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {

    .hero-card,
    .hero-card-image {
        transition: none;
    }

    .hero-card-media.is-image-loading::after,
    .hero-skeleton-line {
        animation: none;
        background: #eeeae2;
    }
}

@keyframes hero-copy-in {
    from {
        opacity: 0;
        transform: translate3d(-16px, 0, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}