/* ============================================================================
   Storefront — shared by the catalogue, product page, home and portfolio.
   Product cards, generated covers, the facts table, gallery, changelog, prose,
   profile photo, timeline and the contact layout. Components layer.
   ========================================================================== */
@layer components {

/* ---------- Product cards -------------------------------------------------
   A tile: cover on top, name and price on one line, a one-line pitch, quiet
   meta at the foot. Pointed at, the card lifts and casts the brand's red
   shadow — the one hover effect in the catalogue. ------------------------- */
.pcard-grid {
    display: grid;
    gap: var(--space-6);
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.pcard {
    position: relative;
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--surface-1);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    color: inherit; text-decoration: none;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.pcard:hover {
    transform: translateY(-3px);
    border-color: var(--action-primary-line);
    box-shadow: -6px 18px 36px -18px var(--redshadow-card), var(--shadow-2);
}
.pcard:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }

.pcard-cover { aspect-ratio: 16 / 10; border-bottom: 1px solid var(--border-subtle); }
.pcard-cover img { transition: transform 0.5s var(--ease); }
.pcard:hover .pcard-cover img { transform: scale(1.03); }

.pcard-body { display: flex; flex-direction: column; gap: var(--space-2); flex: 1; padding: var(--space-5); }

.pcard-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-4); }
.pcard-title { font-size: var(--text-base); font-weight: 650; line-height: 1.3; letter-spacing: -0.015em; color: var(--text-primary); }
.pcard-price {
    flex: none; font-size: var(--text-sm); font-weight: 650; color: var(--text-primary);
    font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pcard-price small { font-weight: 400; font-size: var(--text-xs); color: var(--text-tertiary); margin-left: 2px; }
.pcard-price.is-free { color: var(--status-ok-fg); }

.pcard-text {
    color: var(--text-secondary); font-size: var(--text-sm); line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.pcard-meta {
    display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
    margin-top: auto; padding-top: var(--space-4);
    font-size: var(--text-xs); color: var(--text-tertiary);
}
.pcard-meta .mono { font-size: var(--text-2xs); padding: 2px 6px; border-radius: 4px; background: var(--overlay-firm); color: var(--text-secondary); }
.pcard-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border-hover); }
.pcard-cta { display: none; }

/* The one product a page leads with: the full row, text left, cover right. */
.pcard--spotlight {
    grid-column: 1 / -1;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    border-radius: var(--radius-xl);
}
.pcard--spotlight .pcard-cover { order: 2; aspect-ratio: auto; min-height: 340px; border-bottom: 0; border-left: 1px solid var(--border-subtle); }
.pcard-body > .badge { align-self: flex-start; margin-bottom: var(--space-2); }
.pcard--spotlight .pcard-body { justify-content: center; gap: var(--space-3); padding: var(--space-10); }
.pcard--spotlight .pcard-head { flex-direction: column; align-items: flex-start; gap: var(--space-3); }
.pcard--spotlight .pcard-title { font-family: var(--font-display); font-size: clamp(1.75rem, 3vw, var(--text-3xl)); font-weight: 700; letter-spacing: -0.04em; line-height: 1.02; }
.pcard--spotlight .pcard-text { font-size: var(--text-base); -webkit-line-clamp: 4; max-width: 46ch; }
.pcard--spotlight .pcard-price { font-size: var(--text-xl); letter-spacing: -0.02em; }
.pcard--spotlight .pcard-meta { margin-top: var(--space-2); padding-top: 0; }
.pcard--spotlight .pcard-cta { display: inline-flex; align-self: flex-start; margin-top: var(--space-4); }

@media (max-width: 860px) {
    .pcard--spotlight { grid-template-columns: minmax(0, 1fr); }
    .pcard--spotlight .pcard-cover { order: 0; aspect-ratio: 16 / 9; min-height: 0; border-left: 0; border-bottom: 1px solid var(--border-subtle); }
    .pcard--spotlight .pcard-body { padding: var(--space-6); }
}
@media (prefers-reduced-motion: reduce) {
    .pcard:hover, .pcard:hover .pcard-cover img { transform: none; }
}

/* ---------- Generated cover ------------------------------------------------
   A dark field with a pool of red light, the ghost's silhouette lying in it
   as a red shadow, and the monogram casting a hard red shadow like the mark.
   Everything scales with the cover (container units), so no page sizes it. */
.cover {
    position: relative; overflow: hidden; isolation: isolate;
    container-type: inline-size;
    background:
        radial-gradient(70% 80% at var(--cover-x) var(--cover-y), var(--cover-glow), transparent 72%),
        var(--cover-base);
}
.cover::before {
    content: ""; position: absolute; z-index: 0;
    width: 58cqw; aspect-ratio: 1;
    left: calc(var(--cover-x) - 29cqw); top: calc(var(--cover-y) - 44cqw);
    background: var(--cover-shadow);
    opacity: 0.14;
    -webkit-mask: url(../images/RedSkia_Icon.svg) center / contain no-repeat;
    mask: url(../images/RedSkia_Icon.svg) center / contain no-repeat;
}
.cover img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.cover-mark {
    position: absolute; z-index: 1; left: 8cqw; bottom: 9cqw;
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 15cqw, 7rem); font-weight: 700; line-height: 0.8;
    letter-spacing: -0.05em;
    color: var(--cover-ink);
    text-shadow: var(--cover-sx) var(--cover-sy) 0 var(--cover-echo, var(--cover-shadow));
}

/* ---------- Package facts table ------------------------------------------- */
.spec-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.spec-table th, .spec-table td { padding: var(--space-3) 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border-subtle); }
.spec-table th { font-weight: 450; color: var(--text-tertiary); white-space: nowrap; padding-right: var(--space-4); }
.spec-table td { font-family: var(--font-mono); font-size: var(--text-xs); word-break: break-all; color: var(--text-primary); text-align: right; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: none; }

.assurances { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-secondary); }
.assurances li { display: flex; gap: var(--space-2); align-items: flex-start; }
.assurances svg { flex: none; width: 16px; height: 16px; margin-top: 0.15rem; color: var(--status-ok-fg); }

/* ---------- Gallery --------------------------------------------------------- */
.gallery { display: flex; flex-direction: column; gap: var(--space-3); }
.gallery-main {
    aspect-ratio: 16 / 9; overflow: hidden;
    background: var(--surface-sunken);
    border-radius: var(--radius-xl);
    box-shadow: 0 0 0 1px var(--border-default), var(--shadow-2);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-strip { display: flex; gap: var(--space-2); overflow-x: auto; padding: 2px 2px var(--space-1); }
.gallery-strip button {
    flex: none; width: 96px; aspect-ratio: 16 / 9; padding: 0; overflow: hidden; cursor: pointer;
    border: 1px solid var(--border-default); border-radius: var(--radius); background: var(--surface-sunken);
    opacity: 0.55; transition: opacity 0.15s var(--ease), border-color 0.15s var(--ease);
}
.gallery-strip button:hover { opacity: 1; }
.gallery-strip button[aria-current="true"] { opacity: 1; border-color: var(--text-primary); }
.gallery-strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-caption { font-size: var(--text-xs); color: var(--text-tertiary); }

/* ---------- Changelog ------------------------------------------------------- */
.release { position: relative; padding: 0 0 var(--space-6) var(--space-6); border-left: 1px solid var(--border-default); }
.release:last-child { padding-bottom: 0; border-left-color: transparent; }
.release::before {
    content: ""; position: absolute; left: -5px; top: 6px; width: 9px; height: 9px; border-radius: 50%;
    background: var(--surface-page); border: 2px solid var(--border-hover);
}
.release:first-child::before { border-color: var(--action-primary-bg); background: var(--action-primary-bg); }
.release-head { display: flex; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-2); }
.release-version { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); }
.release-date { font-size: var(--text-xs); color: var(--text-tertiary); }

/* ---------- Prose ----------------------------------------------------------- */
.prose { max-width: var(--measure); color: var(--text-secondary); font-size: 1.0625rem; line-height: 1.75; }
.prose h3 { color: var(--text-primary); font-size: var(--text-xl); margin: var(--space-10) 0 var(--space-3); }
.prose p { margin-bottom: var(--space-5); white-space: pre-line; }
.prose ul { padding-left: 1.1rem; margin-bottom: var(--space-5); }
.prose li { margin-bottom: var(--space-2); }
.prose li::marker { color: var(--accent-text); }

/* ---------- Contact --------------------------------------------------------- */
.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-8); align-items: start; }
@media (max-width: 860px) { .contact-layout { grid-template-columns: minmax(0, 1fr); } }

/* Bots fill hidden inputs; people never see this one. */
.honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

}
