/* Films V2 · "The edit". The portfolio as the studio's edit timeline. */
@font-face { font-family: 'Mango Grotesque'; src: url(/fonts/mango/MangoGrotesque-ExtraBold.woff2) format('woff2'); font-weight: 800; font-display: swap; }

:root {
  --panel: #26272a;      /* edit-suite grey: the working surface */
  --lane: #2c2d31;
  --lane-alt: #313236;
  --rule: #3c3d42;
  --monitor: #000;
  --ink: #e8e7e3;
  --muted: #8e8f93;
  /* clip colour labels, one per client */
  --c-melrose: #c98a93;
  --c-boat: #5fa3a3;
  --c-king: #a3a85e;
  --c-sideqwest: #9d8bc8;
  --c-afterlife: #e0a15a;
  --sans: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --display: 'Mango Grotesque', 'Arial Narrow', sans-serif;
  --pad: 24px;
  --namecol: 184px;
  --track: 54px;
  --mon-h: min(calc(100vh - 68px - 26px - 28px - 6 * var(--track) - 22px), 560px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--panel); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15px/1.5 var(--sans); font-feature-settings: 'tnum' 0; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, video { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.skip { position: absolute; left: var(--pad); top: -48px; background: var(--ink); color: var(--panel); padding: 8px 12px; z-index: 50; }
.skip:focus { top: 12px; }
kbd { font: 600 12px/1 var(--sans); padding: 2px 5px 3px; border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 3px; color: var(--ink); }

/* ---------- Bar ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; height: 68px; padding: 0 var(--pad); }
.brand img { height: 34px; width: auto; }
.bar-nav { display: flex; gap: 28px; align-items: center; font-weight: 500; }
.bar-nav a { text-decoration: none; }
.bar-nav a:hover { text-decoration: underline; }
.bar-book { padding: 7px 14px 8px; background: var(--ink); color: var(--panel); border-radius: 3px; }
.bar-book:hover { text-decoration: none !important; background: #fff; }

/* ---------- Viewer: program monitor + slate ---------- */
.viewer { display: grid; grid-template-columns: auto minmax(260px, 1fr); gap: 32px; padding: 4px var(--pad) 22px; align-items: end; }
.monitor { position: relative; height: var(--mon-h); aspect-ratio: 16 / 9; max-width: calc(100vw - var(--pad) * 2 - 292px); background: var(--monitor); overflow: hidden; }
.mon-still, .mon-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--monitor); }
.mon-video { opacity: 0; transition: opacity .25s ease; }
.monitor.has-frame .mon-video { opacity: 1; }
.mon-hit { position: absolute; inset: 0; z-index: 2; }
.mon-msg { position: absolute; left: 14px; bottom: 12px; z-index: 3; margin: 0; font-size: 13px; color: var(--ink); text-shadow: 0 1px 2px #000; }
.mon-msg:empty { display: none; }
.slate { padding-bottom: 2px; min-width: 0; }
.slate-client { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); }
.slate-client::before { content: ''; width: 10px; height: 10px; border-radius: 2px; background: var(--label, var(--muted)); }
.slate-title { margin: 0; font: 800 clamp(48px, 6.2vw, 92px)/.84 var(--display); text-transform: uppercase; letter-spacing: .005em; overflow-wrap: anywhere; }
.slate-where { margin: 12px 0 0; color: var(--muted); max-width: 36ch; }
.slate-where:empty { display: none; }
.slate-tc { margin: 18px 0 0; font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.tc-dur { color: var(--muted); margin-left: .5em; }
.slate-ctrl { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 16px; font-weight: 500; }
.btn-play { padding: 8px 16px 9px; min-width: 84px; background: var(--ink); color: var(--panel); border-radius: 3px; }
.btn-play:hover { background: #fff; }
.btn-sound, .btn-full { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule); }
.btn-sound:hover, .btn-full:hover { text-decoration-color: var(--ink); }
.slate-keys { margin: 18px 0 0; font-size: 13px; color: var(--muted); max-width: 52ch; }
.slate-keys .nowrap { white-space: nowrap; }

/* ---------- Timeline ---------- */
.edit { border-top: 1px solid var(--rule); background: var(--lane); -webkit-user-select: none; user-select: none; }
.edit-scroll { overflow-x: auto; overflow-y: hidden; scrollbar-color: var(--rule) transparent; }
.edit-inner { position: relative; min-width: 100%; }
.ruler { position: relative; height: 28px; margin-left: var(--namecol); border-bottom: 1px solid var(--rule); background:
  repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px var(--pps10)) 0 100% / 100% 10px no-repeat,
  repeating-linear-gradient(90deg, #45464b 0 1px, transparent 1px var(--pps)) 0 100% / 100% 5px no-repeat; cursor: ew-resize; touch-action: none; }
.ruler span { position: absolute; top: 5px; font-size: 11px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; transform: translateX(4px); }
.track { position: relative; height: var(--track); display: flex; border-bottom: 1px solid var(--panel); background: var(--lane); }
.track:nth-child(even) { background: var(--lane-alt); }
.track-name { position: sticky; left: 0; z-index: 4; flex: 0 0 var(--namecol); display: flex; align-items: center; gap: 10px; padding: 0 12px 0 var(--pad); background: inherit; border-right: 1px solid var(--rule); font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; }
.track-name b { font-weight: 500; color: var(--muted); min-width: 1.6em; font-variant-numeric: tabular-nums; }
.track-name i { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 2px; background: var(--label); }
.track-name span { overflow: hidden; text-overflow: ellipsis; }
.lane { position: relative; flex: 1 1 auto; }

.clip { position: absolute; top: 4px; bottom: 4px; display: grid; grid-template-rows: 16px 1fr 12px; border-radius: 3px; overflow: hidden; background: #1c1d20; text-align: left; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); transition: opacity .45s ease, transform .55s var(--ease); transition-delay: var(--d, 0ms); }
.clip-name { padding: 1px 6px 0; background: var(--label); color: #1d1e21; font-size: 11px; font-weight: 600; line-height: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clip-strip { background-repeat: no-repeat; background-size: auto 100%; background-position: 0 0; filter: saturate(.85); }
.clip-wave { position: relative; background: color-mix(in srgb, var(--label) 22%, #1c1d20); }
.clip-wave::after { content: ''; position: absolute; inset: 1px 0; background: var(--label); -webkit-mask: var(--wave) 0 50% / 100% 100% no-repeat; mask: var(--wave) 0 50% / 100% 100% no-repeat; opacity: .9; }
.clip:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.clip.is-cued { box-shadow: inset 0 0 0 2px var(--ink); }
.clip:focus-visible { outline-offset: 1px; }

.slot { position: absolute; top: 4px; bottom: 4px; display: flex; align-items: center; gap: 14px; padding: 0 14px; border: 1px dashed #5a5b61; border-radius: 3px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.slot a { color: var(--ink); font-weight: 600; }

.playhead { position: absolute; top: 0; bottom: 0; left: var(--namecol); width: 1px; z-index: 6; background: var(--ink); transform: translateX(var(--ph-x, 0px)); pointer-events: none; }
.playhead .ph-head { position: absolute; top: 0; left: -7px; width: 15px; height: 16px; background: var(--ph-label, var(--ink)); clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%); pointer-events: auto; cursor: ew-resize; touch-action: none; }
.playhead:focus-visible { outline: none; }
.playhead:focus-visible .ph-head { outline: 2px solid var(--ink); outline-offset: 2px; }
.is-sweeping .playhead { transition: transform 1.1s var(--ease); }

/* The one orchestrated moment: clips conform onto their tracks, left to right */
.is-conforming .clip { opacity: 0; transform: translateY(-12px); }

/* ---------- Studio ---------- */
.studio { display: grid; grid-template-columns: minmax(260px, 2fr) 1fr 1fr; gap: 24px 40px; padding: 48px var(--pad) 40px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); }
.studio p { margin: 0; }
.studio-about p { color: var(--ink); font-size: 17px; line-height: 1.45; max-width: 34ch; }
.studio-col { display: flex; flex-direction: column; gap: 6px; }
.studio-col a { color: var(--ink); text-decoration: none; width: fit-content; }
.studio-col a:hover { text-decoration: underline; }
.studio-contact .book { margin-top: 8px; padding: 7px 14px 8px; background: var(--ink); color: var(--panel) !important; border-radius: 3px; }
.studio-legal { grid-column: 1 / -1; display: flex; gap: 20px; padding-top: 24px; border-top: 1px solid var(--rule); font-size: 13px; }
.studio-legal a { color: var(--muted); }

/* ---------- Narrower desktops ---------- */
@media (max-width: 1100px) {
  .viewer { grid-template-columns: 1fr; align-items: start; }
  .monitor { height: auto; width: 100%; max-width: none; }
}

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  :root { --pad: 16px; --namecol: 116px; --track: 50px; }
  .bar { height: 58px; }
  .brand img { height: 28px; }
  .bar-nav { gap: 16px; font-size: 14px; }
  .bar-nav a:not(.bar-book) { display: none; }
  .viewer { position: sticky; top: 0; z-index: 10; gap: 10px; padding: 0 0 12px; background: var(--panel); }
  .monitor { width: 100%; }
  .slate { padding: 0 var(--pad); }
  .slate-client { font-size: 14px; margin-bottom: 4px; }
  .slate-title { font-size: 42px; }
  .slate-where, .slate-keys { display: none; }
  .slate-tc { font-size: 16px; margin-top: 8px; }
  .slate-ctrl { margin-top: 10px; gap: 8px 14px; font-size: 14px; }
  .track-name { gap: 6px; padding: 0 6px 0 12px; font-size: 11.5px; }
  .track-name b { display: none; }
  .studio { grid-template-columns: 1fr; padding-top: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0ms !important; animation: none !important; }
  .is-conforming .clip { opacity: 1; transform: none; }
}
