/* Library redesign (design_handoff_library_redesign).
   Ported from the prototype's library.css + tokens.css, adapted to the live
   Next.js app: fonts, base reset, --vio (orange), --bg-*, --ink-* and
   .sticker-checker all already live in globals.css. This file adds ONLY the
   library-specific surface — the browse-by-format strip, per-format cards, the
   detail galleries, and the shared lightbox / remix modal.

   Scoped-free on purpose: an audit confirmed .card / .badge / .modal / .lb are
   used nowhere outside app/library, so these semantic classes don't collide.
   No visible borders anywhere — separation via bg-tint + shadow + spacing. */

/* Per-format accent hues — each format reads as its own family at a glance,
   all sharing the same chroma/lightness, only the hue varies (oklch). */
:root {
  --f-video:         oklch(0.72 0.14 35);
  --f-image:         oklch(0.72 0.14 300);
  --f-carousel:      oklch(0.72 0.14 200);
  --f-fb-creative:   oklch(0.72 0.14 350);
  --f-motion-design: oklch(0.72 0.14 150);
  --f-poster:        oklch(0.72 0.14 70);
  --f-sticker-pack:  oklch(0.72 0.14 270);
  /* +podcast-cuts hue, same chroma/lightness family (library v2). */
  --f-podcast-cuts:  oklch(0.72 0.14 110);

  /* Block accent (library v2) — deliberately OFF the format wheel: a low-chroma
     cool tone so a block chip never reads as a format chip. Color = format;
     mono + glyph = block. */
  --block-ink:    oklch(0.84 0.028 245);
  --block-tint:   oklch(0.84 0.028 245 / 0.10);
  --block-tint-2: oklch(0.84 0.028 245 / 0.16);
}

/* ── Hero (library home) ─────────────────────────────────────────── */
.lib-hero { padding-top: 96px; padding-bottom: 22px; }
@media (max-width: 720px) { .lib-hero { padding-top: 72px; } }
.lib-eyebrow { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--vio); margin: 0 0 18px; display: inline-flex; gap: 8px; align-items: center; }
.lib-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(38px, 5.4vw, 72px);
  letter-spacing: -0.015em; line-height: 1.0; text-transform: uppercase; margin: 0 0 20px; max-width: 18ch; }
.lib-title .acc { color: var(--vio); }
.lib-sub { font-size: 16.5px; line-height: 1.55; color: var(--ink-3); margin: 0; max-width: 70ch; }
.lib-sub strong { color: var(--ink); font-weight: 600; }
.lib-sub a { color: var(--vio); }
.lib-sub a:hover { color: var(--vio-2); text-decoration: underline; }

/* ── Search (sticky pill) ────────────────────────────────────────── */
.lib-toolbar { position: sticky; top: 78px; z-index: 30; padding-top: 18px; padding-bottom: 14px;
  /* Translucent blur (matches the Nav above) instead of an opaque black band —
     the feed shows faintly through the sticky strip rather than a hard black bar. */
  background: color-mix(in oklch, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px) saturate(1.1); }
@media (max-width: 900px) { .lib-toolbar { top: 12px; } }
.lib-search { display: flex; align-items: center; gap: 14px; width: 100%; background: var(--bg-1);
  border-radius: 16px; padding: 15px 20px; color: var(--mute); transition: background .16s; }
.lib-search:focus-within { background: var(--bg-2); color: var(--ink-3); }
.lib-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--ink);
  font-family: var(--font-sans); font-size: 16.5px; }
.lib-search input::placeholder { color: var(--mute-2); }

/* ── Browse-by-format strip (doubles as the format filter) ───────── */
.browse { margin: 22px 0 10px; }
.browse-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; }
@media (max-width: 1380px) { .browse-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 720px) { .browse-grid { grid-template-columns: repeat(2, 1fr); } }
.catcard { position: relative; overflow: hidden; border-radius: 16px; background: var(--bg-1);
  padding: 16px 14px 14px; cursor: pointer; border: 0; text-align: left; color: inherit;
  display: flex; flex-direction: column; gap: 28px; min-height: 116px;
  transition: background .2s, transform .2s, box-shadow .2s; }
.catcard:hover { background: var(--bg-2); transform: translateY(-2px); }
.catcard.active { background: var(--bg-2); }
.catcard.all.active { box-shadow: inset 0 0 0 2px var(--ink); }
.catcard .gly { font-family: var(--font-display); font-size: 24px; line-height: 1;
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--bg); }
.catcard .cc-name { display: block; font-family: var(--font-display); font-weight: 700; font-size: 14px;
  text-transform: uppercase; letter-spacing: -0.01em; }
.catcard .cc-count { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--mute);
  margin-top: 3px; letter-spacing: 0.04em; }
.catcard .glow { position: absolute; right: -30px; top: -30px; width: 110px; height: 110px;
  border-radius: 50%; filter: blur(34px); opacity: .26; pointer-events: none; }

/* ── Result bar ──────────────────────────────────────────────────── */
.resultbar { display: flex; align-items: center; gap: 14px; font-family: var(--font-mono);
  font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); margin: 22px 0 16px; }
.resultbar .clear { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--vio); background: none; border: 0; cursor: pointer; padding: 0; }
.resultbar .clear:hover { color: var(--vio-2); }
.shelf-blurb { font-size: 14px; color: var(--ink-3); margin: -8px 0 16px; max-width: 72ch; }

/* ── Masonry ─────────────────────────────────────────────────────── */
/* Balanced, row-major masonry: JS packs items (in feed order) into the
   currently-shortest of N explicit flex columns. Items flow left→right,
   top→bottom and columns stay even, unlike CSS `columns` (column-major). The
   column count is set by LibraryListing via a resize listener. */
.masonry { display: flex; align-items: flex-start; gap: 18px; }
.mcol { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; }

/* ── Block-page "Units that use this" grid ─────────────────────────── */
/* The block page (Screen 3) lists units NOT through the JS-packed masonry but
   as a plain responsive grid. `.masonry` is flex + expects pre-packed column
   children; a bare UnitTile dropped in there stretches to 100% (a lone unit's
   video then filled the page width). This grid bounds every tile to a ~240px
   column and flows the rest into rows. Items align to the top so mixed-aspect
   tiles don't stretch. */
.block-units-grid { display: grid; gap: 18px; align-items: start;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.block-units-grid .utile { margin-bottom: 0; }
/* A single unit shouldn't blow up to a full-width tile — cap the lone column. */
.block-units-grid:has(.utile:only-child) { grid-template-columns: minmax(240px, 300px); }

/* ── Card ────────────────────────────────────────────────────────── */
.card { position: relative; display: block; break-inside: avoid; margin-bottom: 18px;
  background: var(--bg-1); border-radius: 20px; cursor: pointer; text-align: left; width: 100%;
  border: 0; color: inherit; overflow: visible; box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
  transition: background .22s, transform .22s, box-shadow .22s; }
.card:hover { background: var(--bg-2); transform: translateY(-3px); box-shadow: 0 12px 30px rgb(0 0 0 / 0.34); }
.card-media { position: relative; width: 100%; overflow: hidden; border-radius: 20px; background: #050506; }
.card-media > img, .card-media > video { width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .42s cubic-bezier(.22,1,.36,1); }
.card:hover .card-media > img, .card:hover .card-media > video { transform: scale(1.035); }
.card-media.checker { background: var(--bg-2); }
.card-media video::-webkit-media-controls,
.card-media video::-webkit-media-controls-enclosure,
.deck video::-webkit-media-controls,
.take .tk-media video::-webkit-media-controls { display: none !important; }

.badge { position: absolute; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 4px 9px; border-radius: 999px; backdrop-filter: blur(6px); z-index: 3; }
.badge.tl { top: 10px; left: 10px; }
.badge.br { bottom: 10px; right: 10px; }
.badge.dark { background: rgb(10 10 11 / 0.62); color: #fff; }
.badge.light { background: rgb(245 245 244 / 0.92); color: #0a0a0b; }

.play-badge { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  opacity: 0; transition: opacity .2s; z-index: 3; }
.card:hover .play-badge { opacity: 1; }
.play-badge span { width: 46px; height: 46px; border-radius: 999px; display: grid; place-items: center;
  background: var(--vio); color: #1a1205; box-shadow: 0 6px 18px rgb(0 0 0 / 0.4); }

/* sticker peek (2×2) */
.sticker-peek { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 12px; }
.sticker-peek .sp { aspect-ratio: 1/1; border-radius: 12px; overflow: hidden; display: grid; place-items: center; }
.sticker-peek .sp img { width: 100%; height: 100%; object-fit: contain; padding: 8%; }

/* carousel deck (stacked-cards peek above the front slide) */
.deck { position: relative; padding-top: 12px; }
.deck .deck-l { position: absolute; left: 50%; transform: translateX(-50%); border-radius: 16px; z-index: 1;
  box-shadow: 0 -1px 3px rgb(0 0 0 / 0.25); }
.deck .deck-l.l1 { top: 6px; width: 93%; height: calc(100% - 18px); background: var(--bg-4); }
.deck .deck-l.l2 { top: 0; width: 86%; height: calc(100% - 18px); background: var(--bg-3); }
.deck .deck-front { position: relative; z-index: 2; display: block; width: 100%; aspect-ratio: 4/5;
  object-fit: cover; border-radius: 16px; background: #050506; transition: transform .42s cubic-bezier(.22,1,.36,1); }
.card:hover .deck .deck-front { transform: scale(1.02); }

/* fb peek (2×2 grid) */
.fb-peek { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; }
.fb-peek .fp { aspect-ratio: 1/1; overflow: hidden; }
.fb-peek .fp img { width: 100%; height: 100%; object-fit: cover; }
.fb-peek .fp:first-child { border-top-left-radius: 16px; }
.fb-peek .fp:nth-child(2) { border-top-right-radius: 16px; }
.fb-peek .fp:nth-child(3) { border-bottom-left-radius: 16px; }
.fb-peek .fp:nth-child(4) { border-bottom-right-radius: 16px; }

/* card body */
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 15px 16px; }
.card-flabel { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 7px; }
.card-flabel .dot { width: 7px; height: 7px; border-radius: 2px; }
.card-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.12;
  letter-spacing: -0.01em; text-transform: uppercase; margin: 0; color: var(--ink); }
.card-tagline { font-size: 13px; line-height: 1.5; color: var(--ink-3); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.tagcode { font-family: var(--font-mono); font-size: 11px; color: var(--vio-2);
  background: color-mix(in srgb, var(--vio) 13%, transparent); padding: 3px 9px; border-radius: 999px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; min-width: 0; }
.modelchip { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); background: var(--bg-2);
  padding: 3px 9px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.card:hover .modelchip { background: var(--bg-3); }

/* card overlay remix button (hover) */
.card-remix { position: absolute; top: 10px; right: 10px; z-index: 4; display: inline-flex; align-items: center;
  gap: 6px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 6px 11px; border-radius: 999px; border: 0; cursor: pointer; background: var(--vio); color: #1a1205;
  opacity: 0; transform: translateY(-4px); transition: opacity .18s, transform .18s; box-shadow: 0 4px 12px rgb(0 0 0 /0.35); }
.card:hover .card-remix, .card:focus-within .card-remix { opacity: 1; transform: none; }

/* fallback cover */
.fallback { position: relative; width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; }
.fallback .bgly { position: absolute; right: -18px; bottom: -28px; font-family: var(--font-display);
  font-size: 150px; line-height: 1; color: rgb(255 255 255 / 0.06); }
.fallback .inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 22px; text-align: center; }
.fallback .chip { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: rgb(255 255 255 / 0.08); font-family: var(--font-display); font-size: 20px; color: rgb(255 255 255 / 0.85); }
.fallback .fl-fmt { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgb(255 255 255 / 0.55); }
.fallback .fl-name { font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1.15;
  text-transform: uppercase; color: rgb(255 255 255 / 0.86); max-width: 16ch; }

/* empty state + sentinel */
.empty { padding: 56px 20px; background: var(--bg-1); border-radius: 18px; text-align: center; color: var(--mute); }
.sentinel { height: 60px; display: grid; place-items: center; font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute-2); }
/* Infinite-scroll loader (#100): 3-dot pulse instead of a text string. */
.sentinel .dot3 { display: inline-flex; gap: 6px; }
.sentinel .dot3 i { width: 6px; height: 6px; border-radius: 50%; background: var(--mute-2);
  animation: dpulse 1s infinite ease-in-out; }
.sentinel .dot3 i:nth-child(2) { animation-delay: 0.15s; }
.sentinel .dot3 i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dpulse { 0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .sentinel .dot3 i { animation: none; opacity: 0.6; } }

/* ── Detail page ─────────────────────────────────────────────────── */
.detail-top { padding-top: 96px; padding-bottom: 8px; }
@media (max-width: 900px) { .detail-top { padding-top: 72px; } }
.breadcrumb { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em; color: var(--mute);
  display: inline-flex; align-items: center; gap: 7px; margin: 0 0 18px; }
.breadcrumb a { color: var(--mute); }
.breadcrumb a:hover { color: var(--vio); }
.breadcrumb .sep { opacity: .5; }
.detail-hero { display: grid; gap: 44px; align-items: start; grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr); }
.detail-hero.nomedia { grid-template-columns: 1fr; }
@media (max-width: 900px) { .detail-hero { grid-template-columns: 1fr; gap: 24px; } }
.detail-media { position: sticky; top: 96px; border-radius: 18px; overflow: hidden; background: #050506; }
@media (max-width: 900px) { .detail-media { position: static; } }
.detail-media .sticker-stage { display: grid; place-items: center; padding: 12%; aspect-ratio: 1/1; }
.detail-media .sticker-stage img { width: 78%; object-fit: contain; }
.detail-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(34px,4.4vw,58px);
  line-height: 1.02; letter-spacing: -0.015em; text-transform: uppercase; margin: 8px 0 14px; }
.detail-sub { font-size: clamp(16px,1.4vw,19px); line-height: 1.5; color: var(--ink-3); margin: 0 0 18px; max-width: 56ch; }
.detail-models { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; list-style: none; padding: 0; }
.cta-row { display: flex; flex-direction: column; gap: 12px; max-width: 600px; }
.cta-main { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-remix { display: inline-flex; align-items: center; gap: 9px; padding: 13px 22px; border-radius: 999px;
  background: var(--vio); color: #1a1205; font-weight: 600; font-size: 15px; border: 0; cursor: pointer;
  transition: transform .16s, background .16s; }
.btn-remix:hover { background: var(--vio-2); transform: translateY(-1px); }
.cta-hint { font-size: 13px; line-height: 1.5; color: var(--mute); margin: 0; }
.cta-hint code { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); background: var(--bg-2);
  padding: 2px 7px; border-radius: 6px; overflow-wrap: anywhere; }

/* section header within detail */
.sec { padding-top: 30px; padding-bottom: 8px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 6px; flex-wrap: wrap; }
.sec-head h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(24px,3vw,36px);
  text-transform: uppercase; letter-spacing: -0.01em; margin: 0; }
.sec-head .count { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--mute); font-variant-numeric: tabular-nums; }
.sec-blurb { font-size: 15.5px; line-height: 1.55; color: var(--ink-3); margin: 8px 0 22px; max-width: 64ch; }

/* ── Sticker detail ──────────────────────────────────────────────── */
.pack { margin-bottom: 30px; }
.pack-head { display: flex; align-items: center; gap: 16px; width: 100%; background: var(--bg-1);
  border-radius: 18px; padding: 14px; border: 0; cursor: pointer; text-align: left; color: inherit; transition: background .16s; }
.pack-head:hover { background: var(--bg-2); }
.pack-strip { display: flex; gap: 6px; flex-shrink: 0; }
.pack-strip .ps { width: 46px; height: 46px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; }
.pack-strip .ps img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.pack-meta { min-width: 0; flex: 1; }
.pack-meta h3 { font-family: var(--font-display); font-weight: 700; font-size: 18px; text-transform: uppercase;
  letter-spacing: -0.01em; margin: 0; }
.pack-meta p { font-size: 13px; color: var(--ink-3); margin: 3px 0 0; }
.pack-chev { margin-left: auto; color: var(--mute); transition: transform .22s; flex-shrink: 0; }
.pack-chev.open { transform: rotate(180deg); }
.pack-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; margin-top: 18px; }
@media (max-width: 1100px) { .pack-grid { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 760px)  { .pack-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 460px)  { .pack-grid { grid-template-columns: repeat(3, 1fr); } }
.sticker-tile { position: relative; border-radius: 16px; padding: 12px; cursor: pointer; border: 0;
  display: flex; flex-direction: column; gap: 8px; transition: transform .18s; }
.sticker-tile:hover { transform: translateY(-3px); }
.sticker-tile > img { width: 100%; aspect-ratio: 1/1; object-fit: contain; }
.sticker-tile .sl { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticker-tile .mini-remix { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 999px;
  background: var(--vio); color: #1a1205; border: 0; display: grid; place-items: center; cursor: pointer;
  opacity: 0; transform: scale(.8); transition: opacity .16s, transform .16s; }
.sticker-tile:hover .mini-remix, .sticker-tile:focus-within .mini-remix { opacity: 1; transform: none; }

/* ── Carousel detail ─────────────────────────────────────────────── */
.series-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 1100px) { .series-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .series-grid { grid-template-columns: 1fr; } }
.series-card { background: var(--bg-1); border-radius: 20px; overflow: hidden; cursor: pointer; border: 0;
  text-align: left; color: inherit; box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
  transition: background .2s, transform .2s, box-shadow .2s; }
.series-card:hover { background: var(--bg-2); transform: translateY(-3px); box-shadow: 0 12px 30px rgb(0 0 0 / 0.34); }
.series-card .sc-media { position: relative; }
.series-card .sc-media img { width: 100%; aspect-ratio: 4/5; object-fit: cover; transition: transform .4s cubic-bezier(.22,1,.36,1); }
.series-card:hover .sc-media img { transform: scale(1.03); }
.series-card .sc-body { padding: 14px 16px 16px; }
.series-card .sc-body h3 { font-family: var(--font-display); font-weight: 700; font-size: 17px; text-transform: uppercase;
  letter-spacing: -0.01em; margin: 0 0 4px; }
.series-card .sc-body p { font-size: 12.5px; color: var(--ink-3); margin: 0; }

/* Carousel modal (Instagram-style post viewer) */
.cmodal { position: fixed; inset: 0; z-index: 210; background: rgb(0 0 0 / 0.82); backdrop-filter: blur(10px);
  display: grid; place-items: center; padding: 28px; animation: lbfade .2s ease; }
.cmodal-card { width: 100%; max-width: 460px; background: var(--bg-1); border-radius: 22px; overflow: hidden;
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.6); display: flex; flex-direction: column; max-height: 92vh; }
.cmodal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.cmodal-head h3 { font-family: var(--font-display); font-weight: 700; font-size: 17px; text-transform: uppercase;
  letter-spacing: -0.01em; margin: 0; display: inline-flex; align-items: baseline; gap: 10px; }
.cmodal-head h3 .idx { font-family: var(--font-mono); font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }
.cmodal-stage { position: relative; display: grid; place-items: center; background: #050506; overflow: hidden; }
.cmodal-stage img { width: 100%; height: 100%; object-fit: contain; }
.cmodal-foot { padding: 14px 16px 16px; }
.cmodal-cap { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.cmodal-cap .cm-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; text-transform: uppercase;
  letter-spacing: -0.01em; margin: 0; }
.cmodal-cap .cm-sub { font-size: 12.5px; color: var(--ink-3); margin: 3px 0 0; }
.swipe-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 999px;
  background: rgb(10 10 11 / 0.6); backdrop-filter: blur(6px); color: var(--ink); border: 0; display: grid;
  place-items: center; cursor: pointer; transition: background .16s; }
.swipe-nav:hover { background: var(--bg-3); }
.swipe-nav.prev { left: 12px; } .swipe-nav.next { right: 12px; }
.swipe-dots { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.swipe-dots button { height: 8px; border-radius: 999px; border: 0; cursor: pointer; background: var(--bg-3);
  width: 8px; transition: width .2s, background .2s; }
.swipe-dots button.on { width: 24px; background: var(--vio); }

/* ── FB detail ───────────────────────────────────────────────────── */
.fchip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px;
  font-size: 14px; font-weight: 500; border: 0; cursor: pointer; color: var(--ink-3); background: var(--bg-1);
  transition: background .16s, color .16s; }
.fchip:hover { background: var(--bg-2); color: var(--ink); }
.fchip.active { background: var(--ink); color: var(--bg); }
.fchip .cnt { font-variant-numeric: tabular-nums; opacity: .6; font-size: 12px; }
.fb-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.fb-group { margin-bottom: 36px; }
.fb-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.fb-group-head h3 { font-family: var(--font-display); font-weight: 700; font-size: 19px; text-transform: uppercase;
  letter-spacing: -0.01em; margin: 0; }
.fb-group-head .gc { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); }
.fb-group p.gb { font-size: 13px; color: var(--ink-3); margin: 4px 0 14px; }
.fb-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .fb-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .fb-grid { grid-template-columns: repeat(2, 1fr); } }
.fb-tile { position: relative; border-radius: 16px; overflow: hidden; cursor: pointer; border: 0; padding: 0;
  background: var(--bg-1); box-shadow: 0 1px 2px rgb(0 0 0 / 0.25); transition: transform .2s, box-shadow .2s; }
.fb-tile:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgb(0 0 0 / 0.32); }
.fb-tile img { width: 100%; aspect-ratio: 1/1; object-fit: cover; transition: transform .4s cubic-bezier(.22,1,.36,1); }
.fb-tile:hover img { transform: scale(1.04); }
.fb-tile .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 11px;
  background: linear-gradient(to top, rgb(0 0 0 / 0.78), transparent); font-family: var(--font-mono);
  font-size: 11px; color: #fff; text-align: left; }

/* ── Poster detail ───────────────────────────────────────────────── */
.poster-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 1100px) { .poster-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .poster-grid { grid-template-columns: repeat(2, 1fr); } }
.poster-tile { position: relative; border-radius: 18px; overflow: hidden; cursor: pointer; border: 0; padding: 0;
  background: var(--bg-1); box-shadow: 0 1px 2px rgb(0 0 0 / 0.25); transition: transform .2s, box-shadow .2s; }
.poster-tile:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgb(0 0 0 / 0.34); }
.poster-tile img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.poster-tile .cap { position: absolute; left: 12px; bottom: 12px; font-family: var(--font-mono); font-size: 11px;
  color: #fff; background: rgb(10 10 11 / 0.6); backdrop-filter: blur(6px); padding: 4px 10px; border-radius: 999px; }

/* ── Video / takes detail ────────────────────────────────────────── */
.takes-grid { display: grid; gap: 22px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1000px) { .takes-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .takes-grid { grid-template-columns: 1fr; } }
.takes-grid.single { grid-template-columns: minmax(0, 520px); justify-content: center; }
.take { background: var(--bg-1); border-radius: 18px; overflow: hidden; box-shadow: 0 1px 2px rgb(0 0 0 / 0.25); }
.take .tk-media { position: relative; background: #050506; cursor: pointer; }
.take .tk-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.take .tk-body { padding: 13px 15px 15px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.take .tk-body h4 { font-family: var(--font-display); font-weight: 700; font-size: 15px; text-transform: uppercase;
  letter-spacing: -0.01em; margin: 0 0 4px; }
.take .tk-body p { font-size: 12.5px; color: var(--ink-3); margin: 0; }

/* soon / no-media gallery */
.soon { background: var(--bg-1); border-radius: 18px; padding: 40px 24px; text-align: center; color: var(--ink-3); }
.soon .sgly { font-family: var(--font-display); font-size: 34px; color: var(--vio); margin-bottom: 12px; }

/* Remix CTA pill used in galleries */
.remix-pill { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.06em; text-transform: uppercase; padding: 7px 12px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--bg-2); color: var(--ink-2); transition: background .16s, color .16s; flex-shrink: 0; }
.remix-pill:hover { background: var(--vio); color: #1a1205; }

/* ── Lightbox (shared) ───────────────────────────────────────────── */
/* Rendered via a portal to <body> (see Lightbox.tsx), so this z-index competes
   only with other top-level overlays — kept well above nav (50) + sticky panel
   so the backdrop covers ALL page content. */
.lb { position: fixed; inset: 0; z-index: 1000; background: rgb(0 0 0 / 0.95); backdrop-filter: blur(10px);
  display: grid; place-items: center; padding: 28px; animation: lbfade .2s ease; }
@keyframes lbfade { from { opacity: 0; } to { opacity: 1; } }
.lb-stage { position: relative; display: grid; place-items: center; max-width: min(94vw, 1200px); max-height: 88vh; }
.lb-stage img, .lb-stage video { max-width: min(94vw, 1200px); max-height: 88vh; width: auto; height: auto;
  object-fit: contain; border-radius: 14px; background: #050506; }
.lb-stage.checker { background: var(--bg-2); border-radius: 18px; padding: 30px; }
.lb-stage.checker img { max-height: 70vh; }
.lb-close { position: fixed; top: 22px; right: 24px; width: 44px; height: 44px; border-radius: 999px;
  background: var(--bg-2); color: var(--ink); border: 0; display: grid; place-items: center; cursor: pointer; z-index: 2; }
.lb-nav { position: fixed; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 999px;
  background: var(--bg-2); color: var(--ink); border: 0; display: grid; place-items: center; cursor: pointer; z-index: 2; }
.lb-nav:hover, .lb-close:hover { background: var(--bg-3); }
.lb-nav.prev { left: 24px; } .lb-nav.next { right: 24px; }
.lb-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 56px 28px 22px; pointer-events: none;
  background: linear-gradient(to top, rgb(0 0 0 / 0.8), transparent); display: flex; align-items: flex-end;
  justify-content: space-between; gap: 16px; }
.lb-bar .lbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--vio-2); margin-bottom: 6px; }
.lb-bar .ttl { font-family: var(--font-display); font-weight: 700; font-size: 20px; text-transform: uppercase;
  letter-spacing: -0.005em; color: #fff; }
.lb-bar .lb-actions { pointer-events: auto; }

/* ── Remix modal (shared) ────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 220; background: rgb(0 0 0 / 0.72); backdrop-filter: blur(8px);
  display: grid; place-items: center; padding: 24px; animation: lbfade .18s ease; }
.modal-card { width: 100%; max-width: 540px; background: var(--bg-1); border-radius: 22px; padding: 26px;
  box-shadow: 0 24px 70px rgb(0 0 0 / 0.6); }
.modal-card .m-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.modal-card .m-thumb { width: 72px; height: 72px; border-radius: 14px; overflow: hidden; flex-shrink: 0;
  background: var(--bg-2); display: grid; place-items: center; }
.modal-card .m-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.modal-card .m-thumb video { width: 100%; height: 100%; object-fit: cover; }
.modal-card .m-eyebrow { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--vio); margin: 0 0 5px; }
.modal-card h3 { font-family: var(--font-display); font-weight: 700; font-size: 22px; text-transform: uppercase;
  letter-spacing: -0.01em; margin: 0; line-height: 1.08; }
.modal-card .m-from { font-size: 12.5px; color: var(--mute); margin: 5px 0 0; font-family: var(--font-mono); }
.modal-card .m-close { margin-left: auto; width: 34px; height: 34px; border-radius: 999px; background: var(--bg-2);
  color: var(--ink-3); border: 0; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.modal-card .m-close:hover { background: var(--bg-3); color: var(--ink); }
.m-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--mute); margin: 18px 0 7px; }
.m-copyrow { display: flex; align-items: center; gap: 10px; background: #050506; border-radius: 12px; padding: 13px 14px; }
.m-copyrow code { flex: 1; font-family: var(--font-mono); font-size: 13.5px; color: var(--ink); overflow-wrap: anywhere; }
.m-copyrow .copy { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.06em; text-transform: uppercase; padding: 7px 12px; border-radius: 8px; border: 0; cursor: pointer;
  background: var(--bg-2); color: var(--ink-2); flex-shrink: 0; transition: background .16s, color .16s; }
.m-copyrow .copy:hover { background: var(--vio); color: #1a1205; }
.m-copyrow .copy.copied { background: color-mix(in srgb, var(--vio) 24%, transparent); color: var(--vio-2); }
.m-hint { font-size: 13px; line-height: 1.55; color: var(--mute); margin: 16px 0 0; }
.m-hint strong { color: var(--ink-3); font-weight: 600; }

/* how-to-remix ordered list */
.remix-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px;
  font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.remix-steps strong { color: var(--ink); }
.remix-steps code { font-family: var(--font-mono); font-size: 13px; background: var(--bg-2); padding: 2px 7px;
  border-radius: 6px; overflow-wrap: anywhere; }

/* ── Detail page rework (design_handoff_detail_rework) ───────────── */
.detail-meta { align-self: center; }

/* Hero cover: size to the media's own aspect, capped by height so tall 9:16
   videos don't dominate the fold. Override MediaPlayer's width:100% + inline
   aspect-ratio so portrait clips render compact and centered, landscape fills
   the column. The dark plate / radius move onto the media itself. */
.detail-media { background: transparent; overflow: visible; display: flex; justify-content: center; }
.detail-media .mp-shell { width: auto; max-width: 100%; max-height: 72vh; aspect-ratio: auto; margin: 0 auto; }
.detail-media .mp-video,
.detail-media .mp-image { width: auto; height: auto; max-width: 100%; max-height: 72vh; object-fit: contain; border-radius: 18px; }
.detail-media .sticker-stage { max-height: 60vh; }
@media (max-width: 900px) {
  .detail-media { position: static; }
  .detail-media .mp-shell { max-height: none; width: 100%; }
  .detail-media .mp-video, .detail-media .mp-image { max-height: none; width: 100%; }
}

/* Gallery sub-sections are <section>s nested inside the results section, so
   they inherit the global `section{padding-top:120px}`. Reset it — the huge
   gap before the first sticker pack / FB group came from that leak. */
.pack, .fb-group { padding-top: 0; }
.btn-remix-lg { padding: 16px 28px; font-size: 16px; border-radius: 999px; }
.cta-row { display: flex; flex-direction: column; gap: 10px; max-width: 560px; align-items: flex-start; }
.cta-micro { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em; color: var(--mute); margin: 0; }

.details-toggle { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; padding: 0;
  background: none; border: 0; cursor: pointer; font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.04em; color: var(--mute); transition: color .16s; }
.details-toggle:hover { color: var(--ink-3); }
.details-toggle svg { transition: transform .22s; }
.details-toggle.open svg { transform: rotate(180deg); }

.details-panel { margin-top: 16px; max-width: 560px; background: var(--bg-1); border-radius: 16px;
  padding: 18px; display: flex; flex-direction: column; gap: 8px; animation: dpfade .2s ease; }
@keyframes dpfade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.details-panel .dp-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--mute); margin: 10px 0 5px; }
.details-panel .dp-label:first-child { margin-top: 0; }
.details-panel .detail-models { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.details-panel .dp-steps { font-size: 13px; line-height: 1.55; color: var(--mute); margin: 14px 0 0; }
.details-panel .dp-steps strong { color: var(--ink-3); font-weight: 600; }

.sec-results { padding-top: 40px; }

.floating-remix { position: fixed; right: 24px; bottom: 24px; z-index: 40; display: inline-flex;
  align-items: center; gap: 9px; padding: 14px 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--vio); color: #1a1205; font-weight: 600; font-size: 15px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.45); opacity: 0; transform: translateY(16px) scale(.96);
  pointer-events: none; transition: opacity .24s, transform .24s; }
.floating-remix.show { opacity: 1; transform: none; pointer-events: auto; }
.floating-remix:hover { background: var(--vio-2); }
@media (max-width: 600px) { .floating-remix { right: 14px; bottom: 14px; } }

@media (prefers-reduced-motion: reduce) {
  .card, .catcard, .card-media > img, .card-media > video, .deck .deck-front, .play-badge,
  .card-remix, .pack-chev, .swipe-dots button, .lb, .modal, .cmodal, .details-toggle svg,
  .details-panel, .floating-remix { transition: none !important; animation: none !important; }
}
