/* 05 · SELECTED WORKS — clips on a timeline. The open clip plays full-frame and lights the room;
   the rest are slivers with vertical names. Phones: a 2-column bin (same DOM). */

.bin.works { position: relative; z-index: 2; background: #050506; color: var(--text); padding-bottom: clamp(64px, 11vh, 130px); overflow: hidden; isolation: isolate; }
.bin > .clip-head { margin-bottom: clamp(56px, 9vh, 110px); }

/* the room light: a huge blurred copy of the open clip behind the track (ambient mode) */
.bin-glow { position: absolute; inset: 10% -10% -10%; z-index: -1; pointer-events: none; }
.bin-glow img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none;
  filter: blur(100px) saturate(1.6); transform: scale(1.1); opacity: 0; transition: opacity 1.2s var(--ease-out); }
.bin-glow img.on { opacity: 0.42; }
.bin-glow::after { content: ''; position: absolute; inset: 0; background: radial-gradient(75% 65% at 50% 58%, rgba(5,5,6,0) 0%, rgba(5,5,6,.5) 68%, #050506 100%); }

.bin-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px clamp(24px, 4vw, 64px); align-items: end; margin-bottom: clamp(22px, 4vh, 44px); }
.bin-head .kick { grid-column: 1 / -1; }
.bin-head .sec-h { margin: 0; }
.bin-p { margin: 0; color: var(--muted); font-size: clamp(14px, 1vw, 16px); max-width: 34ch; text-align: right; }

/* ---------------------------------------------------------------- desktop: the track */
.bin-grid { --h: clamp(340px, 56vh, 600px); --open: min(64%, calc(var(--h) * 16 / 9)); --ruler: 26px;
  position: relative; display: flex; gap: 4px; height: calc(var(--h) + var(--ruler)); }
/* ruler ticks across the whole track, like the time ruler above a timeline */
.bin-grid::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: var(--ruler); pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.22) 0 1px, transparent 1px 64px) 0 100% / 100% 9px no-repeat,
    repeating-linear-gradient(90deg, rgba(255,255,255,.1) 0 1px, transparent 1px 16px) 0 100% / 100% 5px no-repeat;
  border-bottom: 1px solid rgba(255,255,255,.12); }

.bin-tile { position: relative; flex: 1 1 0px; min-width: 0; display: block; padding: var(--ruler) 0 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; container-type: inline-size;
  transition: flex-grow 0.75s var(--ease-out), flex-basis 0.75s var(--ease-out); }
.bin-tile.on { flex: 0 0 var(--open); }
.bin-tc { position: absolute; left: 12px; top: 3px; font-size: 10px; letter-spacing: 0.04em; color: rgba(255,255,255,.4); white-space: nowrap; transition: color 0.4s, opacity 0.4s; }
.bin-tile.on .bin-tc { color: rgba(255,255,255,.85); }
.bin-tile:not(.on) .bin-tc { opacity: 0; }

.bin-clip { position: relative; display: block; height: 100%; border-radius: 6px; overflow: hidden; background: #0d0d0f;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
/* the clip header bar in the label colour (Premiere / Resolve) with the file name */
.bin-bar { position: absolute; z-index: 3; left: 0; right: 0; top: 0; height: 22px; display: flex; align-items: center; gap: 8px; padding: 0 8px;
  background: color-mix(in oklab, var(--tag) 78%, #000); color: rgba(255,255,255,.92); font-size: 10.5px; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; }
.bin-bar b { font-weight: 600; opacity: .75; }
.bin-fn { overflow: hidden; text-overflow: ellipsis; }

.bin-media { position: absolute; inset: 22px 0 0; display: block; overflow: hidden; container-type: inline-size; }
.bin-media img, .bin-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; }
.bin-media img { transition: filter 0.7s var(--ease-out), transform 1.4s var(--ease-out); }
.bin-media video { opacity: 0; transition: opacity 0.25s linear; }
.bin-media video.ready { opacity: 1; }
.bin-tile:not(.on) .bin-media img { filter: brightness(0.42) saturate(0.55); transform: scale(1.06); }
.bin-tile:not(.on):hover .bin-media img { filter: brightness(0.7) saturate(0.8); }
/* a shade under the caption of the open clip */
.bin-media::after { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(0,0,0,0) 52%, rgba(0,0,0,.78) 100%); opacity: 0; transition: opacity 0.6s; }
.bin-tile.on .bin-media::after { opacity: 1; }

/* sliver label: the work name written along the clip */
.bin-vl { position: absolute; z-index: 2; left: 50%; bottom: 14px; writing-mode: vertical-rl; transform: translateX(-50%) rotate(180deg);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,.72); white-space: nowrap; max-height: calc(100% - 50px); overflow: hidden; text-overflow: ellipsis;
  transition: opacity 0.35s; }
.bin-tile.on .bin-vl { opacity: 0; }

/* caption of the open clip */
.bin-cap { position: absolute; z-index: 2; left: clamp(16px, 1.6vw, 26px); right: clamp(110px, 10vw, 150px); bottom: clamp(16px, 1.8vw, 26px); display: grid; gap: 8px;
  opacity: 0; transform: translate3d(0, 10px, 0); transition: opacity 0.35s, transform 0.5s var(--ease-out); pointer-events: none; }
.bin-tile.on .bin-cap { opacity: 1; transform: none; transition-delay: 0.3s; }
.bin-t { font-family: var(--f-display); font-weight: 400; letter-spacing: -0.01em;
  font-size: clamp(20px, 2vw, 32px); line-height: 1.08; text-shadow: 0 2px 22px rgba(0,0,0,.5); max-width: 22ch; }
.bin-m { display: flex; gap: 12px; align-items: baseline; font-size: 11px; letter-spacing: 0.1em; color: rgba(255,255,255,.75); white-space: nowrap; text-transform: uppercase; }
.bin-m b { font-weight: 600; color: #fff; }
.bin-open { position: absolute; z-index: 2; right: clamp(16px, 1.6vw, 26px); bottom: clamp(16px, 1.8vw, 26px); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 8px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); background: rgba(10,10,12,.4); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.35s, background-color 0.25s, color 0.25s; }
.bin-tile.on .bin-open { opacity: 1; transition-delay: 0.35s; }
.bin-tile.on:hover .bin-open { background: #fff; color: #0b0b0c; }

/* the playhead: from the ruler down through the open clip; its head sits on the ruler */
.bin-ph { position: absolute; z-index: 4; top: 4px; bottom: 0; left: 0; width: 2px; margin-left: -1px; background: var(--rec); box-shadow: 0 0 12px rgba(255,69,58,.65);
  opacity: 0; transform: translate3d(calc(var(--p, 0) * 100cqw), 0, 0); pointer-events: none; }
.bin-ph::before { content: ''; position: absolute; left: -5px; top: -4px; width: 12px; height: 14px; background: var(--rec); clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%); }
.bin-tile.on .bin-ph { opacity: 1; }

.bin-tile:focus-visible { outline: none; }
.bin-tile:focus-visible .bin-clip { box-shadow: inset 0 0 0 2px #fff; }

.bin-foot { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: clamp(24px, 4.5vh, 48px); }
.bin-count { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.bin .works-hook { position: static; }

/* ---------------------------------------------------------------- phones: a plain 2-column bin */
@media (max-width: 759px) {
  .bin-head { grid-template-columns: minmax(0, 1fr); }
  .bin-p { text-align: left; }
  .bin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 10px; height: auto; align-items: start; }
  .bin-grid::before, .bin-tc, .bin-vl, .bin-open, .bin-ph { display: none; }
  .bin-tile, .bin-tile.on { flex: none; padding: 0; }
  .bin-tile { container-type: normal; }
  .bin-clip { height: auto; display: grid; gap: 10px; overflow: visible; background: none; box-shadow: none; border-radius: 0; }
  .bin-bar { display: none; }
  .bin-media { position: relative; inset: auto; aspect-ratio: 16 / 9; border-radius: 6px; }
  .bin-tile:not(.on) .bin-media img { filter: brightness(0.75); transform: none; }
  .bin-media::after { display: none; }
  .bin-cap { position: static; opacity: 1; transform: none; gap: 4px; }
  .bin-t { font-family: inherit; font-weight: 600; font-size: 14px; line-height: 1.25; text-shadow: none; }
  .bin-m { font-size: 10px; color: var(--muted); }
  .bin-m .bin-k { display: none; }
  .bin-foot { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .bin-tile, .bin-media img, .bin-glow img, .bin-cap { transition: none !important; }
}

/* editor keys hint (desktop only — added by bin.js on a fine pointer) */
.bin-keys { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: 11px; letter-spacing: 0.08em; color: var(--muted); opacity: 0.7; }
.bin-keys kbd { font: inherit; min-width: 20px; padding: 3px 5px; text-align: center; border: 1px solid var(--line-strong, #2c2c30); border-radius: 5px; color: var(--text, #f1efea); }
.bin-keys span { margin-left: 6px; text-transform: uppercase; letter-spacing: 0.14em; }
@media (max-width: 759px) { .bin-keys { display: none; } }
