/* ==========================================================================
   DZG — Product cards
   Two flagship rows (Reso, Mint) plus a three-up row for the rest.
   Every card shares one neutral stage; colour comes from the screens.
   ========================================================================== */

.product-stack {
    display: grid;
    gap: clamp(16px, 1.8vw, 24px);
    margin-top: clamp(32px, 4vw, 56px);
}

.pgrid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(16px, 1.8vw, 24px);
}

/* ------------------------------------------------------------ Card shell */

.pcard {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    background: var(--bg);
    transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease),
        border-color 0.4s var(--ease);
}

.pcard:hover {
    transform: translateY(-3px);
    border-color: transparent;
    box-shadow: var(--lift-2);
}

/* One neutral stage for every product. The screens themselves carry the
   colour; giving each card its own tint turned the page into a swatch book. */
.pcard-visual {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background:
        linear-gradient(168deg, #f7f7f8 0%, #eeeef0 62%, #e8e8eb 100%);
}

.pcard-visual img,
.pcard-visual video,
.pcard-visual svg,
.pcard-visual iframe {
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
}

.pcard-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 11px;
    padding: clamp(22px, 2.4vw, 30px);
}

.pcard-head {
    display: flex;
    align-items: center;
    gap: 11px;
}

.pcard-icon {
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 8px;
    object-fit: contain;
}

.pcard-name {
    font-size: clamp(19px, 1.8vw, 23px);
    font-weight: 600;
    letter-spacing: -0.024em;
    line-height: 1.15;
}

.pcard-line {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.015em;
    color: var(--ink);
}

.pcard-desc {
    font-size: 15px;
    line-height: 1.58;
    color: var(--ink-2);
}

.pcard-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: auto;
    padding-top: 18px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tags li {
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-2);
    white-space: nowrap;
}

/* The whole card is one link. The cursor and the hover lift say so; the
   visible url line stays for affordance and for keyboard focus. */
.pcard { cursor: pointer; }
.pcard-hit { position: absolute; inset: 0; z-index: 2; }
.pcard:focus-within { outline: 2px solid var(--ink); outline-offset: 3px; }
.pcard:hover .pcard-go { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

.pcard-go {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
}

.pcard-go svg { transition: transform 0.24s var(--ease); }
.pcard:hover .pcard-go svg { transform: translateX(4px); }

/* --------------------------------------------------------- Flagship rows */

.pcard-flag { flex-direction: row; align-items: stretch; }
.pcard-flag.is-mirrored { flex-direction: row-reverse; }

.pcard-flag .pcard-visual {
    flex: 1 1 58%;
    aspect-ratio: auto;
    min-height: 440px;
}

.pcard-flag .pcard-body {
    flex: 1 1 42%;
    justify-content: center;
    gap: 14px;
    padding: clamp(30px, 3.6vw, 52px);
}

.pcard-flag .pcard-icon { width: 40px; height: 40px; border-radius: 10px; }

.pcard-flag .pcard-name {
    font-size: clamp(28px, 3.2vw, 40px);
    letter-spacing: -0.032em;
}

.pcard-flag .pcard-line {
    font-size: clamp(18px, 1.6vw, 21px);
    letter-spacing: -0.018em;
}

.pcard-flag .pcard-desc { font-size: 16px; }

.flag-badge {
    align-self: flex-start;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--surface);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ink-2);
}

/* Store availability — a credibility cue, not a download path */
.stores {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.store-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px 5px 9px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink);
    background: var(--bg);
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.store-chip:hover { border-color: var(--ink); }
.store-chip svg { flex: none; }

/* ------------------------------------------------------ Product visuals */

/* Nebula's map reads as a dark product screen against the light page. */
.nebula-screen {
    display: grid;
    place-items: center;
    background: #050507;
    padding: 0;
}

.nebula-screen img,
.nebula-screen .nebula-live {
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
}

/* The live graph is the card — it plays from its opening move, not from a
   frozen frame. The still exists only for the cases where it cannot run. */
.nebula-live {
    opacity: 0;
    pointer-events: none;
    background: #050507; /* opaque, so nothing bleeds through the canvas */
    transition: opacity 0.5s var(--ease);
}

.nebula-live.is-live { opacity: 1; }

/* Fallback still: hidden wherever the live graph runs. */
.nebula-screen img { display: none; }

@media (max-width: 899px) {
    .nebula-screen img { display: block; }
    .nebula-live { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .nebula-screen img { display: block; }
    .nebula-live { display: none; }
}

/* Product screens float whole on the neutral stage. Cropping a UI screenshot
   to fill the frame cuts off the part that proves the point, so these are
   contained and centred instead. */
.mint-screen {
    display: grid;
    place-items: center;
    padding: clamp(20px, 2.6vw, 40px);
}

.mint-screen img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 26px 54px -26px rgba(0, 0, 0, 0.5);
}

/* ResoLocal's demo reel is ~13 MB — loaded only when the card nears the viewport. */
.demo-frame {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: clamp(16px, 2.2vw, 28px);
}

.demo-frame video,
.demo-frame .demo-still {
    grid-area: 1 / 1;
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 22px 44px -24px rgba(0, 0, 0, 0.55);
}

/* The still is the reliable state; the reel covers it once it plays. */
.demo-frame video { z-index: 1; }
.demo-still { background: #0a0a0b; }

/* ------------------------------------------------------------- Responsive */

@media (max-width: 1080px) {
    .pcard-flag,
    .pcard-flag.is-mirrored { flex-direction: column; }
    .pcard-flag .pcard-visual { min-height: 0; aspect-ratio: 16 / 10; }
    .pgrid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pgrid-3 > :last-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    .pgrid-3 { grid-template-columns: 1fr; }
    .pgrid-3 > :last-child { grid-column: auto; }
    .pcard { border-radius: var(--r-lg); }
    .pcard-visual { aspect-ratio: 4 / 3; }
    .pcard-foot { flex-direction: column; align-items: flex-start; gap: 14px; }
    .demo-frame { padding: 14px; }
    .mint-screen { padding: 16px; }
}
