/* Layout, future arrival transforms and interactive poses have separate owners. */
.coverflow-gallery.carousel-hero-section {
    --gallery-ink: #f1f6f5;
    --gallery-muted: #b7cbd0;
    --gallery-cyan: #67c4dd;
    min-height: auto;
    color: var(--gallery-ink);
}
.coverflow-gallery .carousel-section-veil {
    background: linear-gradient(180deg, #061920 0%, rgba(6, 25, 32, .94) 30%, rgba(16, 46, 55, .9) 75%, #102e37 100%);
}
.coverflow-gallery__body {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 88rem;
    margin-inline: auto;
    padding-block: clamp(3rem, 5vw, 5rem) 3rem;
}
.coverflow-gallery__heading {
    padding-inline: 1.5rem;
    text-align: center;
}
.coverflow-gallery__heading h2 {
    margin: 0;
    color: var(--gallery-ink);
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -.035em;
    text-wrap: balance;
}
.coverflow-gallery__heading h2 span { color: var(--gallery-cyan); }
.coverflow-gallery__heading p {
    margin: 1rem 0 0;
    color: var(--gallery-muted);
    font-size: .875rem;
    line-height: 1.6;
    text-wrap: balance;
}
.coverflow-gallery__track {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
    gap: 1.5rem;
    padding: 2rem 1.5rem;
}
.coverflow-card__arrival { min-width: 0; }
.coverflow-card__pose { height: 100%; }
.coverflow-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid rgba(155, 202, 211, .24);
    border-radius: 1.35rem;
    background: #102e37;
    color: var(--gallery-ink);
    text-decoration: none;
    box-shadow: 0 20px 50px rgba(0, 8, 14, .24);
    -webkit-user-drag: none;
}
.coverflow-card__image-reveal {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: #173a45;
}
.coverflow-card__image {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 1.6;
    object-fit: cover;
    pointer-events: none;
}
.coverflow-card__copy {
    position: relative;
    flex: 0 0 auto;
    padding: 1.4rem 1.6rem 1.5rem;
    border-top: 1px solid rgba(155, 202, 211, .12);
}
.coverflow-card .card-title {
    margin: 0;
    padding-right: .5rem;
    color: var(--gallery-ink);
    font-size: clamp(1.2rem, 1.9vw, 1.55rem);
    font-weight: 650;
    line-height: 1.23;
    letter-spacing: -.025em;
    text-wrap: balance;
}
.coverflow-card__description {
    margin: .7rem 0 0;
    color: #c2d4d7;
    font-size: .84rem;
    line-height: 1.6;
}
.coverflow-card__open {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
    color: var(--gallery-cyan);
}
.coverflow-card__open svg { width: 1.35rem; height: 1.35rem; stroke: currentColor; stroke-width: 1.6; }
.coverflow-card.service-card-portal { background: #193f48; }
.service-card-portal .coverflow-card__image-reveal {
    display: grid;
    place-items: center;
    background: radial-gradient(ellipse at 50% 55%, #315c6c 0%, #193f48 65%);
}
.service-card-portal .coverflow-card__image {
    width: 72%;
    height: 85%;
    object-fit: contain;
}
.coverflow-gallery__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 27rem;
    margin: 0 auto;
    padding-inline: 1.5rem;
}
.coverflow-gallery__controls[hidden] { display: none; }
.coverflow-gallery__position { margin: 0; font-size: .9rem; color: var(--gallery-muted); font-variant-numeric: tabular-nums; }
.coverflow-gallery__position [data-gallery-index] { color: var(--gallery-ink); font-size: 1.2rem; margin-right: .35rem; }
.coverflow-gallery__buttons { display: flex; gap: .8rem; }
.coverflow-gallery__buttons button {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: 1px solid rgba(155, 202, 211, .4);
    border-radius: 50%;
    background: rgba(16, 46, 55, .7);
    color: var(--gallery-ink);
    cursor: pointer;
    transition: background .2s, border-color .2s;
}
.coverflow-gallery__buttons svg { width: 1.3rem; height: 1.3rem; stroke: currentColor; stroke-width: 1.6; }
.coverflow-gallery__buttons button:hover { background: #315c6c; border-color: var(--gallery-cyan); }
.coverflow-gallery__buttons button:disabled { opacity: .4; cursor: default; }
.coverflow-gallery :is(a, button, [tabindex]):focus-visible { outline: 2px solid var(--gallery-cyan); outline-offset: 5px; }

/* Progressive enhancement: static seven-link grid is the module-failure fallback. */
[data-gallery-ready] .coverflow-gallery__viewport {
    --gallery-card-width: clamp(19rem, 29vw, 26rem);
    --gallery-offset: clamp(16rem, 25vw, 22rem);
    --gallery-drag: 0px;
    position: relative;
    height: clamp(33rem, 43vw, 36rem);
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
    cursor: grab;
}
[data-gallery-ready] .coverflow-gallery__track { display: block; padding: 0; }
[data-gallery-ready] .coverflow-card__arrival {
    position: absolute;
    top: 2rem;
    left: 50%;
    width: var(--gallery-card-width);
    height: calc(100% - 4rem);
    margin-left: calc(var(--gallery-card-width) / -2);
    perspective: 1200px;
}
[data-gallery-ready] .coverflow-card__pose {
    height: 100%;
    transform: translateX(calc(var(--card-offset, 0px) + var(--gallery-drag))) translateZ(var(--card-depth, 0px)) rotateY(var(--card-tilt, 0deg)) scale(var(--card-scale, 1));
    opacity: var(--card-opacity, 0);
    transition: transform .58s cubic-bezier(.2, .75, .2, 1), opacity .28s ease;
}
[data-gallery-ready] .coverflow-card__arrival[data-position="center"] { z-index: 3; }
[data-gallery-ready] .coverflow-card__arrival[data-position="center"] .coverflow-card__pose {
    --card-opacity: 1;
    --card-offset: 0px;
    --card-scale: 1;
    --card-depth: 0px;
    --card-tilt: 0deg;
}
[data-gallery-ready] .coverflow-card__arrival[data-position="left"],
[data-gallery-ready] .coverflow-card__arrival[data-position="right"] { z-index: 2; }
[data-gallery-ready] .coverflow-card__arrival:is([data-position="left"], [data-position="right"]) .coverflow-card__pose {
    --card-opacity: .68;
    --card-scale: .83;
    --card-depth: -55px;
}
[data-gallery-ready] [data-position="left"] .coverflow-card__pose { --card-offset: calc(-1 * var(--gallery-offset)); --card-tilt: 23deg; }
[data-gallery-ready] [data-position="right"] .coverflow-card__pose { --card-offset: var(--gallery-offset); --card-tilt: -23deg; }
[data-gallery-ready] [data-position="hidden"] { pointer-events: none; }
[data-gallery-ready] [data-position="hidden"] .coverflow-card__pose { --card-offset: 0px; --card-scale: .65; --card-depth: -180px; --card-opacity: 0; }
[data-gallery-ready] [data-position="center"] .coverflow-card { border-color: rgba(155, 202, 211, .5); }
[data-gallery-dragging] .coverflow-gallery__viewport { cursor: grabbing; user-select: none; }
[data-gallery-dragging] .coverflow-card__pose { transition: none; }
[data-gallery-reduced] .coverflow-card__pose { transition: none; }

@media (max-width: 900px) {
    [data-gallery-ready] .coverflow-gallery__viewport { --gallery-card-width: 20rem; --gallery-offset: 15.5rem; height: 33rem; }
    .coverflow-card__copy { padding: 1.25rem; }
}
@media (max-width: 600px) {
    .coverflow-gallery__body { padding-block: 2.5rem 2rem; }
    .coverflow-gallery__heading { padding-inline: 1.3rem; }
    .coverflow-gallery__heading p { max-width: 19rem; margin-inline: auto; font-size: .8rem; }
    [data-gallery-ready] .coverflow-gallery__viewport { --gallery-card-width: min(76vw, 20rem); --gallery-offset: 70vw; height: 31rem; }
    [data-gallery-ready] .coverflow-card__arrival { top: 1.75rem; height: calc(100% - 3.5rem); }
    [data-gallery-ready] .coverflow-card__arrival:is([data-position="left"], [data-position="right"]) .coverflow-card__pose { --card-scale: .86; --card-depth: -25px; --card-opacity: .6; }
    [data-gallery-ready] [data-position="left"] .coverflow-card__pose { --card-tilt: 12deg; }
    [data-gallery-ready] [data-position="right"] .coverflow-card__pose { --card-tilt: -12deg; }
    .coverflow-card .card-title { font-size: 1.3rem; }
    .coverflow-card__description { font-size: .83rem; }
    .coverflow-gallery__controls { max-width: min(72vw, 18rem); }
}
@media (prefers-reduced-motion: reduce) {
    .coverflow-gallery .coverflow-card__pose, .coverflow-gallery__buttons button { transition: none; }
}
