/* marketplace_public.css — below-the-fold styles for the anonymous
   marketplace storefront (marketplace_public.html). The critical
   shell / hero / search rules stay inline in the template for first
   paint; everything else lives here so repeat visitors hit the
   immutable static cache. Bump the ?v= in marketplace_public.html on
   every edit:
     <link rel="stylesheet" href="/static/marketplace_public.css?v=N"/>
 */

  /* Autocomplete panel — same visual language as the logged-in typeahead */
  .mp-ac-panel {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: var(--depth); border: 1px solid var(--border); border-radius: 9px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.45);
    max-height: 360px; overflow-y: auto;
    z-index: 50; display: none;
    text-align: left;
  }
  .mp-ac-panel.open { display: block; }
  .mp-ac-item {
    display: grid; grid-template-columns: 28px 1fr auto; gap: 10px;
    padding: 8px 12px; align-items: center;
    text-decoration: none; color: inherit;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
  }
  .mp-ac-item:last-child { border-bottom: 0; }
  .mp-ac-item:hover, .mp-ac-item.focused { background: rgba(255,255,255,0.04); }
  .mp-ac-icon {
    width: 28px; height: 28px; border-radius: 6px;
    background: var(--abyss);
    border: 1px solid var(--border); object-fit: cover;
  }
  .mp-ac-icon-avatar {
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700;
    color: rgba(7, 8, 13, 0.9);
    background: linear-gradient(135deg,
      hsl(var(--avatar-h1, 200), 55%, 55%),
      hsl(var(--avatar-h2, 280), 55%, 45%));
  }
  .mp-ac-name { font-size: 0.85rem; font-weight: 600; color: var(--text); line-height: 1.15; }
  .mp-ac-meta {
    font-family: var(--font-mono);
    font-size: 0.7rem; color: var(--muted2); margin-top: 2px;
  }
  .mp-ac-cat {
    font-family: var(--font-mono);
    font-size: 0.7rem; color: var(--gold);
    text-transform: uppercase; letter-spacing: 0.08em;
  }
  /* Quality signals in suggestion rows (rating / install band / price) */
  .mp-ac-rating { color: var(--gold); white-space: nowrap; }
  .mp-ac-installs { white-space: nowrap; }
  .mp-ac-dot { opacity: 0.55; margin: 0 5px; }
  .mp-ac-side {
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 1px; text-align: right;
  }
  .mp-ac-price {
    font-family: var(--font-mono);
    font-size: 0.7rem; font-weight: 600; color: var(--text);
    white-space: nowrap;
  }
  .mp-ac-price.free { color: var(--green, #4ade80); }
  .mp-ac-trial {
    font-family: var(--font-mono);
    font-size: 0.6rem; color: var(--muted2); white-space: nowrap;
  }
  .mp-ac-empty {
    padding: 12px; font-family: var(--font-mono); font-size: 0.7rem;
    color: var(--muted2); text-align: center;
  }

  /* ── Header grid: Featured (left, 1.6fr) + Latest (right, 1fr) ─────── */
  .mp-header-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
    align-items: stretch;
  }
  @media (max-width: 980px) {
    .mp-header-grid { grid-template-columns: 1fr; }
  }

  /* ── Featured highlight rotation (minimum port) ────────────────────── */
  .mp-featured-stage {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    margin-bottom: 0;
  }
  .mp-featured-slide {
    grid-row: 1; grid-column: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: center;
    padding: 1.75rem;
    background: var(--depth);
    border: 1px solid var(--border);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.6s ease;
  }
  .mp-featured-slide.is-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
  }
  .mp-featured-meta { min-width: 0; }
  .mp-featured-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 0.5rem;
  }
  .mp-featured-name {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 2.4vw, 1.9rem);
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.4rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }
  .mp-featured-author {
    font-family: var(--font-prose);
    color: var(--muted);
    margin: 0 0 0.85rem;
    font-size: 0.95rem;
  }
  .mp-featured-summary {
    font-family: var(--font-prose);
    color: var(--text);
    line-height: 1.55;
    margin: 0 0 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .mp-featured-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
  }
  .mp-featured-stat strong { color: var(--text); font-weight: 600; }
  .mp-featured-stat .glyph { color: var(--gold-light); margin-right: 0.2em; }
  .mp-featured-stat .glyph-star { color: var(--star, #ffb454); }
  .mp-featured-banner-wrap {
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg,
      hsl(var(--avatar-h1, 200), 50%, 35%),
      hsl(var(--avatar-h2, 280), 50%, 25%));
    border: 1px solid var(--border);
  }
  .mp-featured-banner-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .mp-featured-banner-letters {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 3.5rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
  }
  .mp-featured-dots {
    position: absolute;
    bottom: -22px; left: 0; right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 3;
  }
  .mp-featured-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    padding: 0;
  }
  .mp-featured-dot:hover { border-color: var(--gold-dim); transform: scale(1.15); }
  .mp-featured-dot:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
  .mp-featured-dot.is-active { background: var(--gold); border-color: var(--gold); }

  /* ── Newest / Updated live rails (right side of header grid) ────────
     Two separate section cards; rows re-render in place from
     /marketplace/api/latest (see _mp_live_rails.html). */
  .mp-live-rails {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: stretch;
    min-width: 0;
  }
  @media (max-width: 600px) {
    .mp-live-rails { grid-template-columns: 1fr; }
  }
  .mp-live-card {
    background: var(--depth);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.15rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
  }
  .mp-live-card .mp-latest-viewall { margin-top: auto; }
  .mp-live-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .mp-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--green, #6bcb8b);
    cursor: default;
  }
  .mp-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green, #6bcb8b);
    animation: mp-live-pulse 2.2s ease-in-out infinite;
  }
  @keyframes mp-live-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(107, 203, 139, 0.45); }
    50%      { box-shadow: 0 0 0 4px rgba(107, 203, 139, 0); }
  }
  .mp-live-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
  }
  .mp-latest-row.is-fresh { animation: mp-live-fresh 1.8s ease; }
  @keyframes mp-live-fresh {
    0%   { background: rgba(52, 196, 244, 0.16); }
    100% { background: transparent; }
  }
  @media (prefers-reduced-motion: reduce) {
    .mp-live-dot, .mp-latest-row.is-fresh { animation: none; }
  }
  .mp-latest-head {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--muted2);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
  }
  .mp-latest-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 9px 6px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.12s;
    position: relative;
  }
  .mp-latest-row + .mp-latest-row::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 6px;
    right: 6px;
    height: 1px;
    background: rgba(255, 255, 255, 0.04);
    pointer-events: none;
  }
  .mp-latest-row:hover { background: rgba(255, 255, 255, 0.04); }
  .mp-latest-row:hover .mp-latest-name { color: var(--gold-light); }
  .mp-latest-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--abyss);
    border: 1px solid var(--border);
  }
  .mp-latest-icon-avatar {
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    color: rgba(7, 8, 13, 0.9);
    font-size: 0.95rem;
    background: linear-gradient(135deg,
      hsl(var(--avatar-h1, 200), 55%, 55%),
      hsl(var(--avatar-h2, 280), 55%, 45%));
    border: 1px solid var(--border);
  }
  .mp-latest-text { min-width: 0; }
  .mp-latest-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
    font-family: var(--font-body);
  }
  .mp-latest-sub {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--muted2);
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mp-latest-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 3px 7px;
    border-radius: 4px;
  }
  .mp-latest-tag-new {
    background: rgba(52, 196, 244, 0.14);
    color: var(--cyan);
  }
  .mp-latest-empty {
    font-size: 0.8rem;
    color: var(--muted2);
    padding: 8px 4px;
  }
  .mp-latest-viewall {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gold-light);
    text-decoration: none;
    text-align: center;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: background 0.12s, border-color 0.12s;
  }
  .mp-latest-viewall:hover { border-color: var(--gold-dim); background: rgba(59, 130, 246, 0.05); }

  /* ── Discover & Browse — 6 colored category tiles (ported from
        the logged-in marketplace.html) ──────────────────────────────── */
  .mp-discover { margin-bottom: 1.75rem; }
  .mp-discover-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
  }
  .mp-discover-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    letter-spacing: 0.02em;
  }
  .mp-cat-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
  }
  @media (max-width: 1100px) {
    .mp-cat-grid { grid-template-columns: repeat(3, 1fr); }
  }
  @media (max-width: 540px) {
    .mp-cat-grid { grid-template-columns: repeat(2, 1fr); }
  }
  .mp-cat-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 1.1rem 0.85rem;
    background: var(--depth);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.12s, transform 0.12s, background 0.12s, box-shadow 0.12s;
    text-align: center;
  }
  .mp-cat-tile:hover {
    border-color: var(--gold-dim);
    background: rgba(116, 179, 255, 0.04);
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
  }
  .mp-cat-tile.active {
    border-color: var(--gold);
    background: rgba(116, 179, 255, 0.07);
    box-shadow: 0 0 0 1px rgba(116, 179, 255, 0.15);
  }
  .mp-cat-tile-icon {
    font-size: 1.6rem;
    line-height: 1;
    color: var(--gold-light);
  }
  .mp-cat-tile-label {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  .mp-cat-tile-sub {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--muted2);
  }
  /* "All" tile — cyan accent */
  .mp-cat-tile[href="/marketplace"] {
    background: linear-gradient(135deg, rgba(52, 196, 244, 0.14), rgba(52, 196, 244, 0.03));
    border-color: rgba(52, 196, 244, 0.24);
  }
  .mp-cat-tile[href="/marketplace"] .mp-cat-tile-icon { color: var(--cyan); }
  .mp-cat-tile[href="/marketplace"]:hover {
    background: linear-gradient(135deg, rgba(52, 196, 244, 0.22), rgba(52, 196, 244, 0.06));
    border-color: rgba(52, 196, 244, 0.4);
  }
  /* Per-category solid-feel backgrounds (match logged-in palette) */
  .mp-cat-tile[data-cat="community"] {
    background: linear-gradient(135deg, rgba(87, 242, 135, 0.2), rgba(87, 242, 135, 0.04));
    border-color: rgba(87, 242, 135, 0.32);
  }
  .mp-cat-tile[data-cat="community"] .mp-cat-tile-icon { color: #95f8b4; }
  .mp-cat-tile[data-cat="community"]:hover { background: linear-gradient(135deg, rgba(87, 242, 135, 0.3), rgba(87, 242, 135, 0.08)); border-color: rgba(87, 242, 135, 0.5); }

  .mp-cat-tile[data-cat="popular"] {
    background: linear-gradient(135deg, rgba(191, 87, 0, 0.30), rgba(191, 87, 0, 0.06));
    border-color: rgba(191, 87, 0, 0.42);
  }
  .mp-cat-tile[data-cat="popular"] .mp-cat-tile-icon { color: #ff8c42; }
  .mp-cat-tile[data-cat="popular"]:hover { background: linear-gradient(135deg, rgba(191, 87, 0, 0.42), rgba(191, 87, 0, 0.10)); border-color: rgba(191, 87, 0, 0.6); }

  .mp-cat-tile[data-cat="gameplay"] {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.26), rgba(108, 92, 231, 0.04));
    border-color: rgba(108, 92, 231, 0.36);
  }
  .mp-cat-tile[data-cat="gameplay"] .mp-cat-tile-icon { color: #c4bdff; }
  .mp-cat-tile[data-cat="gameplay"]:hover { background: linear-gradient(135deg, rgba(108, 92, 231, 0.36), rgba(108, 92, 231, 0.08)); border-color: rgba(108, 92, 231, 0.55); }

  .mp-cat-tile[data-cat="admin"] {
    background: linear-gradient(135deg, rgba(237, 66, 69, 0.22), rgba(237, 66, 69, 0.04));
    border-color: rgba(237, 66, 69, 0.34);
  }
  .mp-cat-tile[data-cat="admin"] .mp-cat-tile-icon { color: #ffa7a9; }
  .mp-cat-tile[data-cat="admin"]:hover { background: linear-gradient(135deg, rgba(237, 66, 69, 0.32), rgba(237, 66, 69, 0.08)); border-color: rgba(237, 66, 69, 0.55); }

  .mp-cat-tile[data-cat="tools"] {
    background: linear-gradient(135deg, rgba(255, 159, 67, 0.22), rgba(255, 159, 67, 0.04));
    border-color: rgba(255, 159, 67, 0.32);
  }
  .mp-cat-tile[data-cat="tools"] .mp-cat-tile-icon { color: #ffb87a; }
  .mp-cat-tile[data-cat="tools"]:hover { background: linear-gradient(135deg, rgba(255, 159, 67, 0.32), rgba(255, 159, 67, 0.08)); border-color: rgba(255, 159, 67, 0.5); }

  /* ── Tag chip row ──────────────────────────────────────────────────── */
  .mp-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
  }
  .mp-tag-chip {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 0.35rem 0.7rem;
    background: var(--abyss);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease;
  }
  .mp-tag-chip:hover { border-color: var(--gold-dim); color: var(--gold-light); }
  .mp-tag-chip.active { border-color: var(--gold-dim); color: var(--gold-light); background: rgba(59, 130, 246,0.06); }

  /* ── Sort toolbar ──────────────────────────────────────────────────── */
  .mp-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
  }
  .mp-result-count {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
  }
  .mp-sort-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
  }
  .mp-sort-select {
    color-scheme: dark;
    padding: 0.45rem 0.8rem;
    background: var(--abyss);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
  }
  .mp-sort-select:focus { border-color: var(--gold-dim); }
  .mp-clear-filters {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--muted2);
    text-decoration: none;
    border: 1px dashed var(--border);
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    transition: color 0.15s ease, border-color 0.15s ease;
  }
  .mp-clear-filters:hover { color: var(--gold-light); border-color: var(--gold-dim); }

  /* ── Plugin card grid (matches logged-in marketplace.html) ─────────── */
  .mp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.1rem;
  }
  .mp-card {
    position: relative;
    display: block;
    background: var(--depth);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
  }
  .mp-card:hover {
    border-color: var(--gold-dim);
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5),
                0 0 24px -6px rgba(59, 130, 246, 0.18);
  }
  .mp-card:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
  }
  /* Featured cards get a gold left edge */
  .mp-card.featured { border-left: 4px solid var(--gold-dim); }

  /* Top-right badge stack (Featured / NEW / Updated) */
  .mp-card-corner {
    position: absolute; top: 8px; right: 8px;
    display: flex; flex-direction: column; gap: 4px;
    align-items: flex-end;
    z-index: 3;
    pointer-events: none;
  }
  .mp-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: 4px;
    line-height: 1.2;
    backdrop-filter: blur(4px);
  }
  .mp-badge.featured { background: rgba(59, 130, 246, 0.18); color: var(--gold-light); border: 1px solid var(--gold-dim); }
  .mp-badge.new      { background: rgba(52, 196, 244, 0.18); color: var(--cyan); border: 1px solid rgba(52, 196, 244, 0.32); }
  .mp-badge.updated  { background: rgba(155, 127, 232, 0.18); color: #c4bdff; border: 1px solid rgba(155, 127, 232, 0.32); }
  .mp-badge.trial    { background: rgba(107, 203, 139, 0.16); color: var(--green, #6bcb8b); border: 1px solid rgba(107, 203, 139, 0.32); }
  .mp-badge.sale     { background: rgba(224, 90, 90, 0.16); color: #ff9a9a; border: 1px solid rgba(224, 90, 90, 0.36); }
  .mp-badge.early    { background: rgba(255, 159, 67, 0.14); color: #ffb87a; border: 1px solid rgba(255, 159, 67, 0.3); }
  .mp-badge.quality  { background: rgba(240, 185, 11, 0.16); color: #ffd98a; border: 1px solid rgba(240, 185, 11, 0.35); }

  /* Banner — synthesized gradient placeholder is ALWAYS rendered;
     real banner_url img sits on top. If the img is absent or fails,
     the placeholder shows through. Matches marketplace.html exactly. */
  .mp-card-banner {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg,
      hsl(var(--avatar-h1, 40), 35%, 22%),
      hsl(var(--avatar-h2, 70), 30%, 14%));
  }
  /* Vivid synthesized "art" — same treatment as the logged-in grid
     (marketplace.css). Saturated radial glows over the plugin's
     deterministic avatar hues, with bright initials on top, so cards
     without uploaded banners still look alive. */
  .mp-card-banner-art {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
    background:
      radial-gradient(circle at 30% 30%, hsla(var(--avatar-h1, 40), 75%, 60%, 0.42), transparent 55%),
      radial-gradient(circle at 75% 70%, hsla(var(--avatar-h2, 70), 72%, 52%, 0.34), transparent 60%),
      linear-gradient(135deg,
        hsla(var(--avatar-h1, 40), 60%, 26%, 0.7),
        hsla(var(--avatar-h2, 70), 55%, 20%, 0.7));
    overflow: hidden;
  }
  .mp-card-banner-art::before {
    content: '';
    position: absolute;
    inset: -10%;
    background:
      radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.06), transparent 40%),
      radial-gradient(circle at 80% 80%, rgba(0, 0, 0, 0.35), transparent 50%);
    pointer-events: none;
  }
  .mp-card-banner-letters {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.04em;
    text-shadow:
      0 2px 12px rgba(0, 0, 0, 0.55),
      0 0 1px rgba(255, 255, 255, 0.4);
    position: relative;
    z-index: 1;
    user-select: none;
  }
  .mp-card-banner img {
    position: relative;
    z-index: 1;
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform 0.5s ease;
  }
  .mp-card:hover .mp-card-banner img { transform: scale(1.05); }
  /* Hover scrim — fades in over the banner only (not foot strip) */
  .mp-card-banner::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg,
      rgba(7,8,13,0.55) 0%, transparent 30%,
      transparent 45%, rgba(7,8,13,0.92) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
  }
  .mp-card:hover .mp-card-banner::after,
  .mp-card:focus-within .mp-card-banner::after { opacity: 1; }

  /* Hover-reveal overlay: author + rating + installs */
  .mp-card-banner-overlay {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 0.7rem 1rem 0.85rem;
    z-index: 2;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.04em;
  }
  .mp-card:hover .mp-card-banner-overlay,
  .mp-card:focus-within .mp-card-banner-overlay {
    opacity: 1;
    transform: translateY(0);
  }
  .mp-card-author { letter-spacing: 0.03em; }
  .mp-card-rating { color: var(--star, #ffb454); }

  /* One-line summary under the banner — two-line clamp, muted */
  .mp-card-summary {
    font-family: var(--font-prose);
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.45;
    margin: 0;
    padding: 0.65rem 1rem 0.6rem;
    background: var(--depth);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Pre-sale price shown struck through next to the sale price */
  .mp-card-price-was {
    color: var(--muted2);
    font-size: 0.78em;
    font-weight: 400;
    margin-right: 4px;
  }

  /* Always-visible foot strip — name + price */
  .mp-card-foot-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0.7rem 1rem 0.8rem;
    background: var(--depth);
    border-top: 1px solid var(--border);
  }
  .mp-card-foot-name {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
  }
  .mp-verified-badge {
    display: inline-block;
    margin-left: 0.3em;
    color: var(--cyan);
    font-size: 0.85em;
    vertical-align: middle;
  }
  .mp-card-foot-price {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold-light);
    flex-shrink: 0;
  }
  .mp-card-foot-price.free { color: var(--green); }

  /* CTA strip — sits below the foot strip, full-width "Install" button.
     Visually a button but it's a <span> inside the outer card <a> so
     the click bubbles to the card's href (detail page → login flow). */
  .mp-card-foot-action {
    padding: 0 1rem 0.85rem;
    background: var(--depth);
  }
  .mp-card-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    padding: 0.55rem 1rem;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    background: rgba(59, 130, 246, 0.10);
    border: 1px solid var(--gold-dim);
    border-radius: 7px;
    color: var(--gold-light);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  }
  .mp-card:hover .mp-card-cta {
    background: rgba(59, 130, 246, 0.18);
    border-color: var(--gold);
    color: var(--gold-light);
  }

  /* ── Pagination ─────────────────────────────────────────────────────── */
  .mp-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    margin-top: 2rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--muted);
  }
  .mp-pager a {
    text-decoration: none;
    color: var(--gold-light);
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 7px;
    transition: border-color 0.15s ease;
  }
  .mp-pager a:hover { border-color: var(--gold-dim); }
  .mp-pager .current {
    color: var(--text);
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--gold-dim);
    border-radius: 7px;
    background: rgba(59, 130, 246, 0.06);
  }

  /* ── Empty + error states ───────────────────────────────────────────── */
  .mp-empty, .mp-unavailable {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--depth);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-top: 1rem;
  }
  .mp-empty-title, .mp-unavailable-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--text);
    margin: 0 0 0.5rem;
  }
  .mp-empty-sub, .mp-unavailable-sub {
    font-family: var(--font-prose);
    color: var(--muted);
    margin: 0;
  }

  /* ── Bottom CTA ─────────────────────────────────────────────────────── */
  .mp-bottom-cta {
    margin: 2.5rem 0 0;
    padding: 2.25rem 1.5rem;
    background:
      radial-gradient(ellipse at center, rgba(59, 130, 246,0.10), transparent 70%),
      var(--depth);
    border: 1px solid var(--gold-dim);
    border-radius: 14px;
    text-align: center;
  }
  .mp-bottom-cta-title {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 2.5vw, 1.6rem);
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.6rem;
  }
  .mp-bottom-cta-sub {
    font-family: var(--font-prose);
    color: var(--muted);
    margin: 0 0 1.3rem;
  }
  .mp-bottom-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.75rem;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--void);
    text-decoration: none;
    border-radius: 9px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 18px rgba(59, 130, 246, 0.22);
    transition: box-shadow 0.18s ease, transform 0.12s ease;
  }
  .mp-bottom-cta-btn:hover { box-shadow: 0 6px 28px rgba(59, 130, 246, 0.42); }
  .mp-bottom-cta-btn:active { transform: translateY(1px); }

  /* ── Starter stacks — curated bundles (core/mp_stacks.py) ──────────── */
  .mp-stacks { margin-bottom: 1.75rem; }
  .mp-stacks-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.75rem;
    letter-spacing: 0.02em;
  }
  .mp-stack-rail {
    display: grid; gap: 0.85rem;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
  .mp-stack-card {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border); border-radius: 12px;
    background: var(--surface);
    text-decoration: none; color: var(--text);
    transition: border-color 0.15s ease, transform 0.12s ease;
  }
  .mp-stack-card:hover { border-color: var(--gold-light); transform: translateY(-2px); }
  .mp-stack-icon {
    font-size: 1.35rem; line-height: 1;
    width: 42px; height: 42px; flex: 0 0 42px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--raised, rgba(255,255,255,0.03));
  }
  .mp-stack-text { min-width: 0; }
  .mp-stack-name { font-weight: 700; margin-bottom: 1px; }
  .mp-stack-tagline {
    font-size: 0.8rem; color: var(--muted); line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .mp-stack-count {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
    padding: 2px 6px; border-radius: 3px; line-height: 1.2;
    background: rgba(59, 130, 246, 0.14);
    color: var(--gold-light);
    border: 1px solid var(--border);
  }

  /* ── Responsive breakpoints ─────────────────────────────────────────── */
  @media (max-width: 1199px) {
    .mp-grid { grid-template-columns: repeat(3, 1fr); }
    .mp-featured-slide { grid-template-columns: 1fr; gap: 1rem; }
    .mp-featured-banner-wrap { max-height: 240px; }
  }
  @media (max-width: 899px) {
    .mp-grid { grid-template-columns: repeat(2, 1fr); }
    .mp-rails { grid-template-columns: 1fr; }
    .mp-cat-grid { grid-template-columns: repeat(3, 1fr); }
  }
  @media (max-width: 599px) {
    .mp-grid { grid-template-columns: 1fr; }
    .mp-cat-grid { grid-template-columns: repeat(2, 1fr); }
    .mp-toolbar { flex-direction: column; align-items: stretch; }
    .mp-sort-select { width: 100%; }
    .mp-hero { padding: 1.25rem; }
  }

  @media (prefers-reduced-motion: reduce) {
    .mp-hero::before { animation: none; }
    .mp-featured-slide, .mp-card, .mp-card-banner img,
    .mp-cat-tile, .mp-pager a, .mp-tag-chip, .mp-bottom-cta-btn,
    .mp-rail-row { transition: none; }
  }

  @media print {
    body.landing::after { display: none; }
    .mp-hero::before { display: none; }
    .mp-hero { background: none; border-color: #ccc; }
    .landing-nav { display: none; }
    .mp-featured-stage, .mp-rails { display: block; }
    .mp-featured-slide { opacity: 1 !important; page-break-inside: avoid; }
    .mp-bottom-cta { background: none; }
    .mp-bottom-cta-btn { background: none; color: #000; border: 1px solid #000; box-shadow: none; }
  }
