/* Producer Vault — Melody Moguls
   Brand carried straight off the carousel spec: solid #ffb6c1 pink, black ink,
   #fefefe for secondary labels, one red #ee2a30 hand-drawn rule used exactly
   once, Montserrat throughout at 600/700/800/900. Media sits on black so the
   538 posters read against the pink. Square black bullets and short black
   divider bars stand in for the slide furniture. */

:root {
  --pink: #ffb6c1;
  --pink-deep: #f9a5b2;
  --pink-sink: #f191a1;
  --ink: #000000;
  --paper: #fefefe;
  --red: #ee2a30;

  /* Secondary labels. The brand puts these in white on the pink, which is a
     deliberately soft look on a 1080px slide. If you ever want them to punch
     harder on screen, change this one line to rgba(0,0,0,.62). */
  --label: var(--paper);

  --ink-70: rgba(0,0,0,.70);
  --ink-55: rgba(0,0,0,.55);
  --ink-35: rgba(0,0,0,.35);
  --ink-15: rgba(0,0,0,.15);

  --radius: 14px;
  --radius-sm: 8px;
  --rail-w: 276px;
  --topbar-h: 66px;

  --font: 'Montserrat', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--pink);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
}

body.locked { overflow: hidden; }

::selection { background: var(--ink); color: var(--pink); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Eyebrow labels follow the slide rule: 800, uppercase, wide tracking, white. */
.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--label);
  margin: 0;
}

/* Headline rule: 900, tight tracking, leading never below 1.0. Text stroke is
   only ever applied to headlines that are entirely black. */
h1, h2, h3 { font-weight: 900; letter-spacing: -.035em; line-height: 1.02; }

.num { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: var(--pink);
  border-bottom: 3px solid var(--ink);
}

.mark {
  display: flex; align-items: center; gap: 13px; flex: 0 0 auto;
  text-decoration: none; color: inherit;
}
/* The master logo sits on the exact brand pink, so it drops straight onto the
   bar with its shadow and wordmark band intact. No cutout needed. */
.mark-logo { height: 48px; width: auto; display: block; flex: none; }
.mark-name {
  position: relative;
  font-size: 19px; font-weight: 900; letter-spacing: -.035em;
  line-height: 1.0; white-space: nowrap;
  -webkit-text-stroke: 1.25px var(--ink);
  margin-bottom: 4px;
}
/* the one red hand-drawn rule allowed per piece */
.mark-rule {
  position: absolute; left: -4px; bottom: -11px;
  width: calc(100% + 8px); height: 14px; overflow: visible;
}
.mark-rule path { fill: none; stroke: var(--red); stroke-width: 5; stroke-linecap: round; }

.search-wrap { position: relative; flex: 1 1 auto; min-width: 0; max-width: 520px; }
#search {
  width: 100%; height: 40px;
  padding: 0 40px 0 14px;
  background: var(--pink-deep);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font); font-weight: 600; font-size: 14px;
}
#search::placeholder { color: var(--ink-55); font-weight: 600; }
#search:focus { outline: none; box-shadow: inset 0 0 0 2px var(--red); }
.slash {
  position: absolute; right: 10px; top: 11px;
  font-size: 10px; font-weight: 800; color: var(--ink-55);
  border: 2px solid var(--ink-35); border-radius: 4px;
  padding: 1px 5px;
}

.topbar-right { display: flex; align-items: center; gap: 14px; margin-left: auto; flex: 0 0 auto; }
.handle {
  font-size: 12px; font-weight: 800; letter-spacing: .04em;
  color: var(--label); white-space: nowrap;
}
#sort {
  height: 40px; background: var(--ink); color: var(--pink);
  border: 2px solid var(--ink); border-radius: var(--radius-sm);
  font-family: var(--font); font-weight: 700; font-size: 12px;
  letter-spacing: .02em; padding: 0 10px; cursor: pointer;
}
#sort:focus { outline: none; box-shadow: 0 0 0 3px var(--red); }
.count {
  font-size: 13px; font-weight: 800; color: var(--ink);
  font-variant-numeric: tabular-nums;
  min-width: 48px; text-align: right;
}

.icon-btn {
  display: none; width: 40px; height: 40px;
  background: var(--pink-deep); border: 2px solid var(--ink);
  border-radius: var(--radius-sm); cursor: pointer;
}
.bars, .bars::before, .bars::after {
  display: block; width: 16px; height: 2.5px; background: var(--ink);
  margin: 0 auto; position: relative;
}
.bars::before, .bars::after { content: ''; position: absolute; }
.bars::before { top: -5px; }
.bars::after { top: 5px; }

/* ---------- shell ---------- */
.shell { display: flex; align-items: flex-start; }

.rail {
  position: sticky; top: var(--topbar-h);
  width: var(--rail-w); flex: 0 0 var(--rail-w);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  border-right: 3px solid var(--ink);
  padding: 18px 16px 48px;
  background: var(--pink);
}
.rail::-webkit-scrollbar { width: 10px; }
.rail::-webkit-scrollbar-thumb { background: var(--ink-35); border-radius: 10px; }

.rail-scrim { display: none; }
.rail-scrim[hidden] { display: none; }

.rail-head { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 14px; }
.link-btn {
  background: none; border: none; color: var(--ink-70); cursor: pointer;
  font-family: var(--font); font-size: 10px; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase;
}
.link-btn:hover { color: var(--red); }

.rail-flags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 22px; }
.flag {
  font-family: var(--font); font-size: 11px; font-weight: 700; letter-spacing: .02em;
  padding: 7px 11px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--ink);
  border: 2px solid var(--ink);
}
.flag:hover { background: var(--pink-sink); }
.flag.on { background: var(--ink); border-color: var(--ink); color: var(--pink); font-weight: 800; }
.flag-n { margin-left: 7px; font-weight: 800; font-variant-numeric: tabular-nums; opacity: .55; }
.flag-n:empty { display: none; }
.flag.on .flag-n { opacity: .75; }
.flag.zero { opacity: .4; }

/* facet groups */
.facet { border-top: 2px solid var(--ink-15); padding: 14px 0 6px; }
.facet-head {
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; user-select: none; margin-bottom: 10px;
}
.facet-head h3 {
  margin: 0; font-size: 11px; font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase; color: var(--label);
}
.facet-head .chev { color: var(--ink-55); font-size: 11px; transition: transform .15s ease; }
.facet.collapsed .chev { transform: rotate(-90deg); }
.facet.collapsed .facet-list { display: none; }

.facet-list { display: flex; flex-direction: column; gap: 2px; }
.opt {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.25;
  border: 2px solid transparent;
}
.opt:hover { background: var(--pink-sink); }
.opt.on { background: var(--ink); border-color: var(--ink); color: var(--pink); font-weight: 700; }
.opt .dot { width: 10px; height: 10px; flex: 0 0 10px; background: var(--ink); }
.opt .label { flex: 1 1 auto; }
.opt .n { font-size: 11px; font-weight: 700; color: var(--ink-55); font-variant-numeric: tabular-nums; }
.opt.on .n { color: var(--pink); opacity: .75; }
.opt.zero { opacity: .35; }

.rail-foot {
  font-size: 11px; font-weight: 600; color: var(--ink-55);
  margin-top: 24px; line-height: 1.65;
}

/* ---------- grid ---------- */
.main { flex: 1 1 auto; min-width: 0; padding: 20px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  display: block; width: 100%; padding: 0;
  aspect-ratio: 9 / 16;
  background: var(--ink);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  color: var(--paper);
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 0 rgba(0,0,0,.22); }
.card:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

.card .strip {
  position: absolute; left: 0; top: 0; bottom: 0; width: 5px; z-index: 2;
  background: var(--ink);
}
/* Fresh flash. Solid red so it outranks the red TXT text, and it sits opposite
   the colour strip so the two never collide. */
.card .fresh-flag {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  background: var(--red); color: var(--paper);
  font-size: 9.5px; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
}

.card img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  background: #111;
  opacity: 0; transition: opacity .25s ease;
}
.card img.ready { opacity: 1; }

.card .veil {
  position: absolute; inset: auto 0 0 0; z-index: 2;
  padding: 30px 11px 11px 13px;
  background: linear-gradient(to top, rgba(0,0,0,.95) 34%, rgba(0,0,0,0));
}
.card h3 {
  margin: 0 0 7px; font-size: 13px; font-weight: 800;
  letter-spacing: -.02em; line-height: 1.2; color: var(--paper);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card .views {
  font-size: 12px; font-weight: 800; color: var(--pink);
  font-variant-numeric: tabular-nums; letter-spacing: .01em;
}
.card .star { font-size: 11px; font-weight: 700; color: var(--red); }

.meter { display: flex; gap: 2px; margin-bottom: 7px; }
.meter i { flex: 1 1 auto; height: 4px; background: rgba(255,255,255,.22); }
.meter i.on { background: var(--pink); }
.meter i.on.hot { background: var(--red); }

.empty {
  font-size: 14px; font-weight: 700; color: var(--ink-70);
  padding: 44px 4px;
}

/* ---------- detail ---------- */
.detail { position: fixed; inset: 0; z-index: 60; }
.detail[hidden] { display: none; }
.detail-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.72); }
.detail-card {
  position: relative;
  display: grid; grid-template-columns: minmax(300px, 400px) 1fr;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  width: min(1120px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  margin: 18px auto;
  background: var(--pink);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
}
.detail-close {
  position: absolute; right: 14px; top: 14px; z-index: 5;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--pink); border: 2px solid var(--ink);
  color: var(--ink); cursor: pointer; font-size: 14px; font-weight: 800;
}
.detail-close:hover { background: var(--ink); color: var(--pink); }
.detail-media {
  background: var(--ink); border-right: 3px solid var(--ink);
  display: flex; flex-direction: column; gap: 12px; padding: 16px;
  min-height: 0;
  overflow: hidden;
}
/* Sized by its own 9:16 ratio, never stretched to fill the column. Capped at
   the panel height so the built-in controls always stay on screen. */
#d-video {
  width: 100%;
  flex: 0 1 auto;
  min-height: 0;
  max-height: 100%;
  align-self: center;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  background: #000; border-radius: var(--radius-sm);
}
.detail-nav { display: flex; gap: 10px; flex: none; }
.detail-nav .btn { flex: 1 1 50%; }
.detail-media .btn.ghost { color: var(--pink); border-color: var(--pink); }
.detail-media .btn.ghost:hover { background: var(--pink); color: var(--ink); }

.detail-body { overflow-y: auto; min-height: 0; padding: 26px 28px 32px; }
.detail-body::-webkit-scrollbar { width: 10px; }
.detail-body::-webkit-scrollbar-thumb { background: var(--ink-35); border-radius: 10px; }
.detail-body h1 {
  font-size: 30px; font-weight: 900; letter-spacing: -.035em;
  line-height: 1.02; margin: 8px 0 18px;
  -webkit-text-stroke: 1.25px var(--ink);
}

.metrics { display: flex; flex-wrap: wrap; gap: 20px; padding-bottom: 18px; border-bottom: 2px solid var(--ink-15); }
.metric { display: flex; flex-direction: column; gap: 3px; }
.metric .v { font-size: 19px; font-weight: 900; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.metric .k { font-size: 10.5px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--label); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 18px 0; }
.chip {
  font-size: 11.5px; font-weight: 700;
  padding: 5px 11px; border-radius: 999px;
  border: 2px solid var(--ink); background: transparent; color: var(--ink);
  display: inline-flex; align-items: center; gap: 7px;
}
.chip .dot { width: 9px; height: 9px; border-radius: 0; }

/* black divider bar, the slide furniture translated to a section marker */
.block { padding: 20px 0 16px; }
.block::before {
  content: ''; display: block; width: 64px; height: 6px;
  background: var(--ink); margin-bottom: 14px;
}
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.block-actions { display: flex; gap: 8px; }
.block h2 {
  margin: 0; font-size: 11px; font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase; color: var(--label);
}
.copy {
  font-family: var(--font); font-size: 10px; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
  background: none; border: 2px solid var(--ink); border-radius: 999px;
  color: var(--ink); padding: 5px 11px; cursor: pointer;
}
.copy:hover { background: var(--ink); color: var(--pink); }
.copy.on { background: var(--red); border-color: var(--red); color: var(--paper); }

.mono-body { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.5; white-space: pre-wrap; color: var(--ink); }
.tags { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.8; color: var(--ink-70); word-break: break-word; }

.script { display: flex; flex-direction: column; gap: 16px; }
.script-part .k {
  font-size: 10px; font-weight: 800; letter-spacing: .18em;
  text-transform: uppercase; color: var(--label); display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.script-part .k::before {
  content: ''; width: 10px; height: 10px; background: var(--ink); flex: none;
}
.script-part p { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.5; color: var(--ink); white-space: pre-wrap; }
.script.tele .script-part p { line-height: 1.85; font-size: 17px; font-weight: 700; }
.script-empty { font-size: 13px; font-weight: 600; font-style: italic; color: var(--ink-55); }

.detail-links { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 20px; border-top: 2px solid var(--ink-15); }
.btn {
  font-family: var(--font); font-size: 12px; font-weight: 800; letter-spacing: .02em;
  padding: 11px 16px; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: var(--pink); border: 2px solid var(--ink);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn:hover { background: var(--red); border-color: var(--red); color: var(--paper); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--pink); }
.btn.primary { width: 100%; margin-top: 14px; }

/* ---------- gate ---------- */
.gate { position: fixed; inset: 0; z-index: 90; background: var(--pink); display: grid; place-items: center; }
.gate[hidden] { display: none; }
.gate-card { width: min(420px, calc(100vw - 40px)); text-align: center; }
.gate-logo { width: 100%; height: auto; display: block; margin-bottom: 18px; }

/* All-black headline, so the brand's text-stroke rule applies here. */
.gate-title {
  margin: 0 0 30px;
  font-size: clamp(34px, 9vw, 46px);
  font-weight: 900; letter-spacing: -.035em; line-height: 1.02;
  text-transform: uppercase; color: var(--ink);
  -webkit-text-stroke: 1.25px var(--ink);
}
.gate-card label {
  display: block; text-align: left;
  font-size: 13px; font-weight: 800; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink); margin: 0 0 10px;
}
.gate-card input {
  width: 100%; height: 52px; padding: 0 16px;
  background: var(--pink-deep); border: 2px solid var(--ink);
  border-radius: var(--radius-sm); color: var(--ink);
  font-family: var(--font); font-weight: 700; font-size: 17px;
  text-align: center;
}
.gate-card input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--red); }
.gate-error { font-size: 14px; font-weight: 700; color: var(--red); margin-top: 14px; }

.gate-help {
  margin-top: 26px; padding-top: 22px;
  border-top: 2px solid var(--ink-15);
}
.gate-help p {
  margin: 0 0 10px;
  font-size: 13.5px; font-weight: 600; line-height: 1.55;
  color: var(--ink-70);
}
.gate-help p:last-child { margin-bottom: 0; }
.gate-help b { font-weight: 800; color: var(--ink); }
.gate-help a { color: var(--ink); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.gate-help a:hover { color: var(--red); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  z-index: 100; background: var(--ink); color: var(--pink);
  font-family: var(--font); font-size: 13px; font-weight: 800;
  padding: 11px 18px; border-radius: 999px;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  /* Stacked: the media row sizes to the video, the body takes what is left
     and scrolls. Without this the single-row rule above squashes the video. */
  .detail-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    max-height: calc(100vh - 20px); margin: 10px auto;
  }
  .detail-media { border-right: none; border-bottom: 3px solid var(--ink); }
  #d-video { max-height: 52vh; width: auto; max-width: 100%; aspect-ratio: auto; }
  .detail-body h1 { font-size: 24px; }
}

/* Phone held sideways: stacking leaves a 9:16 clip tiny inside a wide black
   band, so keep the two-column layout and let the video use the full height. */
@media (max-width: 900px) and (orientation: landscape) and (min-width: 600px) {
  .detail-card {
    grid-template-columns: minmax(200px, 34%) 1fr;
    grid-template-rows: minmax(0, 1fr);
  }
  .detail-media { border-right: 3px solid var(--ink); border-bottom: none; }
  #d-video { max-height: 100%; aspect-ratio: 9 / 16; }
}

@media (max-width: 780px) {
  /* Search gets its own full-width row. Sharing one row with the logo and the
     sort control left it 107px wide on a 375px phone. --topbar-h is bumped to
     match, since the drawer is positioned from it. */
  :root { --topbar-h: 124px; }

  .icon-btn { display: block; flex: 0 0 auto; width: 44px; height: 44px; }
  #search { height: 44px; }
  #sort { height: 44px; }
  .handle { display: none; }
  .mark-name { display: none; }
  .mark-logo { height: 40px; }
  .topbar { gap: 10px; padding: 10px 12px; flex-wrap: wrap; align-content: center; }
  .search-wrap { order: 3; flex: 1 0 100%; max-width: none; }
  /* 16px or larger, or iOS zooms the whole page in when the field is focused. */
  #search { font-size: 16px; }
  .count { min-width: 0; font-size: 12px; margin-left: auto; }

  /* Comfortable tap targets. Anything under 44px is a miss waiting to happen. */
  .flag { min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; }
  .opt { min-height: 44px; }
  .facet-head { min-height: 44px; margin-bottom: 4px; }
  .link-btn { min-height: 44px; display: inline-flex; align-items: center; }
  .copy { min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; }
  .btn { min-height: 46px; }
  .detail-close { width: 44px; height: 44px; font-size: 16px; }
  #gate-go, .btn.primary { min-height: 50px; }

  .rail-scrim {
    display: block;
    position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 45;
    background: rgba(0,0,0,.55);
  }
  .rail-scrim[hidden] { display: none; }
  .rail {
    position: fixed; left: 0; top: var(--topbar-h); z-index: 50;
    transform: translateX(-100%); transition: transform .18s ease;
    width: 86vw; max-width: 330px;
    box-shadow: 12px 0 40px rgba(0,0,0,.35);
  }
  .rail.open { transform: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 11px; }
  .main { padding: 12px; }
  #sort { max-width: 124px; font-size: 11px; padding: 0 8px; }
}

/* Phone: the wordmark gives up its space so search stays usable. The title
   bar and the app icon carry the brand at this size. */
@media (max-width: 540px) {
  .mark-logo { height: 34px; }
  #sort { max-width: 112px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* Very narrow phones (iPhone SE and similar). The counter and a slightly wider
   sort control tip the first row into wrapping a third time, which would push
   the bar past the fixed --topbar-h and overlap the grid. */
@media (max-width: 360px) {
  .count { display: none; }
  #sort { max-width: 104px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
