/*!
 * Bootstrap 6 Cards — component pack
 * Shared chrome for the pack index and each variant page, then the card bits.
 */

:root {
  --brand: oklch(58% 0.16 300);
}

/* --------------------------------------------------------------- Pack index */

.pack-head {
  padding-block: 3.5rem 2.5rem;
  border-bottom: 1px solid var(--bs-border-color);
  background: var(--bs-bg-2);
}

.pack-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
}

.pack-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-radius-6);
  background: var(--bs-bg-body);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.pack-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in oklab, var(--brand), transparent 55%);
  box-shadow: 0 1.25rem 2.5rem -1.25rem rgb(0 0 0 / 22%);
}

.pack-thumb {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    linear-gradient(135deg,
      color-mix(in oklab, var(--brand), transparent 88%),
      color-mix(in oklab, var(--brand), transparent 97%));
  border-bottom: 1px solid var(--bs-border-color);
}

/* Miniature card sketch drawn in CSS — no screenshots to keep in sync. */
.sketch { width: min(100%, 15rem); display: grid; gap: 0.4rem; }
.sketch i { display: block; height: 0.5rem; border-radius: var(--bs-radius-pill); background: color-mix(in oklab, var(--bs-fg-body), transparent 86%); }
.sketch i.w40 { width: 40%; }
.sketch i.w60 { width: 60%; }
.sketch i.w75 { width: 75%; }
.sketch i.tall { height: 1.6rem; border-radius: var(--bs-radius-3); }
.sketch i.media { height: 3rem; border-radius: var(--bs-radius-3); background: color-mix(in oklab, var(--brand), transparent 62%); }
.sketch i.cta { height: 1.4rem; width: 45%; border-radius: var(--bs-radius-pill); background: var(--brand); }
.sketch i.dot { height: 1.6rem; width: 1.6rem; border-radius: 50%; background: color-mix(in oklab, var(--brand), transparent 55%); }
.sketch .row2 { display: flex; gap: 0.4rem; }
.sketch .row2 i { flex: 1; }
.sketch .row2 i.dot { flex: 0 0 auto; }
.sketch .grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
.sketch .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.35rem; }
.sketch .box { display: grid; gap: 0.3rem; padding: 0.4rem; border-radius: var(--bs-radius-3); border: 1px solid color-mix(in oklab, var(--bs-fg-body), transparent 86%); }

.pack-card-body { padding: 1.125rem 1.25rem 1.25rem; display: flex; flex-direction: column; flex: 1; }
.pack-card-title { font-size: 1rem; font-weight: 650; letter-spacing: -0.01em; margin-bottom: 0.25rem; }

/* ------------------------------------------------------------- Variant page */

.variant-bar {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: color-mix(in oklab, var(--bs-bg-body), transparent 8%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bs-border-color);
}

.variant-stage {
  min-height: calc(100svh - 4rem);
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 5vw, 4rem) 1rem;
}

.variant-inner { width: 100%; max-width: 42rem; }
.variant-inner.is-wide { max-width: 68rem; }

/* ------------------------------------------------------------------- Cards */

/* Media placeholder inside a card. Gradient rather than a bundled photo, so the
   pack has zero image dependencies and nothing to re-license. */
.card-media {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: linear-gradient(
    135deg,
    color-mix(in oklab, var(--brand), transparent 55%),
    color-mix(in oklab, var(--brand), transparent 85%));
  color: var(--bs-white);
  font-weight: 650;
  letter-spacing: -0.01em;
}

.card-media-sq { aspect-ratio: 1; }

/* Horizontal card — image beside the body rather than above it. */
.card-row { display: grid; }
@media (width >= 576px) { .card-row { grid-template-columns: 12rem 1fr; } }
.card-row .card-media { aspect-ratio: auto; height: 100%; min-height: 9rem; }

/* Whole-card link. The anchor covers the card via ::after, so the entire
   surface is clickable while only the title is in the tab order. */
.card-linked { position: relative; }
.card-linked .stretched-title::after {
  content: "";
  position: absolute;
  inset: 0;
}
.card-linked:hover { border-color: color-mix(in oklab, var(--brand), transparent 45%); }

/* Metric card */
.metric-figure {
  font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric-delta { font-size: 0.8125rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.2rem; }
.metric-up { color: var(--bs-fg-success); }
.metric-down { color: var(--bs-fg-danger); }

/* Sparkline drawn with a CSS gradient mask — no chart library. */
.spark { display: flex; align-items: flex-end; gap: 2px; height: 2.5rem; }
.spark span { flex: 1; border-radius: 2px 2px 0 0; background: color-mix(in oklab, var(--brand), transparent 65%); }

/* Pricing card */
.price-figure { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.price-list { list-style: none; padding: 0; }
.price-list li { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.4rem 0; }
.price-list svg { flex-shrink: 0; margin-top: 0.15rem; color: var(--bs-fg-success); }
.card-featured { border-color: var(--bs-primary-base); box-shadow: 0 0 0 1px var(--bs-primary-base); }

/* Product card */
.product-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.product-was { text-decoration: line-through; color: var(--bs-fg-3); font-weight: 400; }
.stars { display: inline-flex; gap: 1px; color: var(--bs-amber-500, #f0b429); }
.stars svg { width: 0.85rem; height: 0.85rem; }

/* Card grid used by the final variant */
.card-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
}

@media (prefers-reduced-motion: reduce) {
  .pack-card, .pack-card:hover { transition: none; transform: none; }
}
