.demo-card,
.panel,
.thumb-card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.demo-card {
    display: block;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    transition: box-shadow 180ms ease;
}

.demo-card:hover {
    box-shadow: var(--shadow-hover);
}

/* Carousel brand block above the strip */
.shell-carousel-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.carousel-brand-logo {
    height: 56px;
    width: auto;
    object-fit: contain;
}

.shell-carousel-instruction {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    text-align: center;
    margin: 0;
    opacity: 0.85;
}

/* ── Carousel card — unified fixed-width design ─────────────────────────
   ONE size for every card. Media fills with object-fit:cover regardless
   of source image/video dimensions.  No matte, no BA-slider, no variable
   width based on asset aspect-ratio.
   ──────────────────────────────────────────────────────────────────── */
.demo-card.compact {
    position: relative;
}

/* Coming Soon cards */
.demo-card--coming-soon {
    opacity: 0.55;
    cursor: default;
    filter: saturate(0.3);
    pointer-events: none;
}

.demo-card--coming-soon .demo-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 80px;
    background: repeating-linear-gradient(
        135deg,
        rgba(255,255,255,0.02) 0px,
        rgba(255,255,255,0.02) 4px,
        transparent 4px,
        transparent 12px
    );
}

.cs-output-badge {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    padding: 2px 6px;
}

.cs-tagline {
    font-size: 0.6rem;
    color: var(--muted);
    margin: 1px 0 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cs-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.55rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(255,255,255,0.1);
    color: var(--muted);
    border-radius: 4px;
    padding: 2px 5px;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.12);
}

.demo-card img:not(.matte-overlay) {
    width: 100%;
    object-fit: cover;
    display: block;
    background: linear-gradient(180deg, rgba(10, 12, 16, 0.55), rgba(18, 22, 29, 0.9));
}

/* Fixed-width card — all cards identical size */
.demo-card.compact {
    width: 172px;
    flex-shrink: 0;
    min-width: 0;
    max-width: none;
    border-radius: 14px;
    background: rgba(52, 58, 72, 0.98);
    border-color: rgba(255, 255, 255, 0.13);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255,255,255,0.07) inset;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Card header — title lives here, above the media */
.card-header {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 10px 4px;
    flex-shrink: 0;
}
.demo-card.compact h2 {
    font-size: 0.77rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
/* Outer wrapper so the crown can overflow above the card boundary */
.demo-card-outer {
    position: relative;
    display: inline-flex;   /* shrink-wraps to the card width */
    flex-direction: column;
    flex-shrink: 0;
    /* top padding makes room for the crown spike */
    padding-top: 10px;
}
/* Crown that physically sticks out above the card top */
.card-crown-spike {
    position: absolute;
    top: 0;                 /* sits at the very top of the outer wrapper = above card */
    right: 9px;
    width: 20px;
    height: 15px;
    color: #f28b3c;
    filter: drop-shadow(0 1px 3px rgba(242,139,60,0.7));
    z-index: 2;
    pointer-events: none;
}

/* Legend in the filter bar — crown + "Premium" label */
.carousel-legend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: rgba(242, 139, 60, 0.8);
    white-space: nowrap;
    padding: 0 2px;
}
.carousel-legend-crown {
    width: 11px;
    height: 9px;
    color: rgba(242, 139, 60, 0.9);
    flex-shrink: 0;
}

/* Card media — fixed height, covers regardless of source dimensions */
.card-media {
    position: relative;
    height: 122px;
    flex-shrink: 0;
    overflow: hidden;
}
.card-media-el {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-media--placeholder {
    background: linear-gradient(135deg, rgba(242,139,60,0.12), rgba(52,58,72,0.85));
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Poster standby image — shows instantly before the lazy video loads */
.card-poster-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
.demo-card.is-playing .card-poster-overlay {
    opacity: 0;
}

/* Card footer — 2-line tagline + try badge */
.card-footer {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    padding: 5px 10px 8px;
    flex-shrink: 0;
}
.card-tagline {
    flex: 1;
    min-width: 0;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.38;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Videos inside the BA slider are absolutely positioned — don't constrain them here */
.ba-slider video {
    height: 100%;
    min-height: 0;
    max-height: none;
}


/* ── Matte composite card ────────────────────────────────────────────── */
/* PNG overlay (with alpha cutout on right) sits on top of a positioned video.
   The video is sized/placed to match the transparent window in the PNG.
   PNG native: 497 × 301.  Cutout box: x 256, y 28, w 225, h 200.  */
.matte-card {
    position: relative;
    overflow: hidden;
    background: #000;
    display: block;
}

/* Both layers must fill the card exactly — no aspect-ratio, no contain */
.matte-overlay {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    position: relative;
    z-index: 2;
    pointer-events: none;
}

/* Video sits underneath, positioned to align with the PNG's transparent cutout.
   Percentages derived from the PNG's native pixel measurements (256,28,225,200
   in a 497×301 image), then expanded ~8% to fill the visible cutout window. */
.matte-video {
    position: absolute;
    left: 49.5%;
    top:  5.3%;
    width: 49%;
    height: 74%;
    object-fit: cover;
    z-index: 1;
    background: #000;
}

/* ── Before / After slider ────────────────────────────────────────────── */
.ba-slider {
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    display: block;
    width: 100%;
    height: 132px;
}


/* Both layers sit at the same absolute position and size.
   Clipping is done via clip-path on the wrapper — no layout width tricks. */
.ba-after,
.ba-before-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.ba-after {
    object-fit: cover;
    object-position: center center;
    background: #000;
    max-width: none;
    z-index: 0;
}

/* Videos often have non-matching aspect ratios — contain so nothing is cut off */
video.ba-after,
video.ba-before {
    object-fit: contain;
}

.ba-before-wrap {
    /* JS sets clip-path: inset(0 X% 0 0) to reveal the before layer */
    clip-path: inset(0 50% 0 0);   /* default: 50/50 split */
    z-index: 1;
    overflow: hidden;              /* belt-and-suspenders — nothing leaks past the clip */
}

.ba-before {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    background: #000;
    max-width: none;
    pointer-events: none;
}

.ba-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;           /* wider hit area — centred on the 3px line */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    pointer-events: all;   /* handle is clickable/draggable */
    cursor: col-resize;
    z-index: 2;
}

.ba-handle::before {       /* the visible 3px white line */
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    transform: translateX(-50%);
    background: #fff;
    box-shadow: 0 0 6px rgba(0,0,0,0.5);
    pointer-events: none;
}

.ba-knob {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #fff;
    color: #333;
    border-radius: 50%;
    font-size: 13px;
    letter-spacing: -1px;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    pointer-events: none;
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

/* card-copy still used in non-carousel contexts — keep generic version */
.demo-card.compact .card-copy {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 10px 8px;
}

.demo-card.is-active {
    border-color: rgba(242, 139, 60, 0.5);
    box-shadow:
        0 16px 30px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(242, 139, 60, 0.14),
        inset 0 0 0 1px rgba(242, 139, 60, 0.12);
    transform: translateY(-2px);
}

.demo-card-placeholder {
    display: grid;
    place-items: center;
    min-height: 220px;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(242, 139, 60, 0.18), rgba(72, 80, 98, 0.7)),
        radial-gradient(circle at top, rgba(255, 255, 255, 0.12), transparent 50%);
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
}

.card-copy,
.panel {
    padding: 20px;
}

