/* ============================================================
   ivoschi — Polaroid Cards Drop-in (V5b·3 / Hatch)
   Append AFTER styles.css and AFTER textures.css (if used).

   Turns the homepage showcase cards into tilted "polaroid / sticker"
   cards: dark integrated background, tape strip across the top,
   alternating tilts, hover lifts and straightens.

   Targets: .showcase .card (no HTML changes needed).
   ============================================================ */

.showcase {
  padding-top: 24px;
  /* Rotated cards expand their axis-aligned bounding box, which would push
     body.scrollWidth past the viewport and trigger iOS Safari auto-zoom-out.
     Clip the horizontal rotation-overhang here. We use overflow-x: clip
     (not hidden) so it doesn't establish a scroll container or break the
     vertical tape-strip overhang on each card. */
  overflow-x: clip;
  /* breathing room so the tilt + tape don't get clipped at the very edges */
  padding-left: 4px;
  padding-right: 4px;
  margin-left: -4px;
  margin-right: -4px;
}

/* --- card body ----------------------------------------------------- */
.showcase .card {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255,255,255,0.025) 0 1px,
      transparent 1px 8px),
    radial-gradient(ellipse 80% 100% at 30% 0%, rgba(255,255,255,0.04), transparent 60%),
    linear-gradient(180deg, #16161a 0%, #0d0d0f 100%);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.03) inset,
    0 14px 28px -14px rgba(0,0,0,0.85);
  transform: rotate(-1.2deg);
  transition: transform .35s cubic-bezier(.2,.8,.2,1),
              box-shadow .35s, border-color .35s;
  overflow: visible; /* allow tape to overhang */
}
.showcase .card:nth-child(2) { transform: rotate(0.8deg) translateY(8px); }
.showcase .card:nth-child(3) { transform: rotate(-0.5deg) translateY(-6px); }

/* --- tape strip across the top ------------------------------------ */
.showcase .card::before {
  content: '';
  position: absolute;
  top: -8px; left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 84px; height: 22px;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,0.08) 0 6px,
      rgba(0,0,0,0.15) 6px 12px),
    color-mix(in oklab, var(--accent) 45%, #1a1a1f);
  border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
  opacity: 0.9;
  z-index: 4;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  /* override the textures.css hatch overlay on .showcase .card::before */
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,0.08) 0 6px,
      rgba(0,0,0,0.15) 6px 12px);
  mix-blend-mode: normal;
  padding: 0;
  -webkit-mask: none; mask: none;
  border-radius: 0;
  pointer-events: none;
}
.showcase .card::after { content: none; }

/* --- media (the photo) -------------------------------------------- */
.showcase .card .card__media {
  margin: 14px 14px 0;
  border-radius: 2px;
  aspect-ratio: 4/3;
  border: 1px solid rgba(0,0,0,0.4);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
  filter: contrast(1.05) saturate(0.9);
}

/* --- text body ---------------------------------------------------- */
.showcase .card .card__body {
  padding: 14px 16px 18px;
  gap: 6px;
}
.showcase .card .card__title {
  font-family: var(--font-sans);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  font-size: 18px;
  color: var(--text);
}
.showcase .card .card__desc {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}
.showcase .card .card__cta {
  background: var(--accent);
  color: #0a0a0a;
  padding: 5px 11px;
  border-radius: 0;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.12em;
}

/* --- hover: lift, straighten, glow -------------------------------- */
.showcase .card:hover {
  transform: rotate(0deg) scale(1.04);
  border-color: var(--border-2);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 24px 48px -16px rgba(0,0,0,0.95),
    0 0 0 1px color-mix(in oklab, var(--accent) 30%, transparent);
  z-index: 10;
}
.showcase .card:hover .card__media img { transform: scale(1.04); }

/* --- mobile: kill the tilt + slim the cards ----------------------- */
@media (max-width: 600px) {
  .showcase { padding-top: 16px; gap: 18px; }
  .showcase .card,
  .showcase .card:nth-child(2),
  .showcase .card:nth-child(3) {
    transform: none;
    box-shadow: 0 6px 16px -8px rgba(0,0,0,0.7);
  }
  .showcase .card .card__media {
    margin: 10px 10px 0;
    aspect-ratio: 16/10;
  }
  .showcase .card .card__body {
    padding: 12px 14px 14px;
    gap: 5px;
  }
  .showcase .card .card__title { font-size: 16px; }
  .showcase .card .card__desc { font-size: 11.5px; line-height: 1.45; }
  .showcase .card::before { width: 64px; height: 16px; top: -6px; }
  /* hover-lift not relevant on touch — disable scale to avoid accidental zooms */
  .showcase .card:hover { transform: none; }
}
