@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/instrumentsans-var-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --paper: #f6f6f2;
  --surface: #ffffff;
  --ink: #17171b;
  --ink-soft: #4a4a52;
  --rule: #e2e2da;
  --rule-strong: #cdcdc4;
  --poppy: #ef4a24;
  --poppy-deep: #d63a12;
  --poppy-text: #b02a10;
  --sky: #cfe3f4;
  --blush: #f9d6dd;
  --lilac: #dcd6f7;
  --sand: #e9e7dc;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --text: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --gutter: 24px;
  --radius: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--poppy); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.shelf-crrem { --tint: var(--sky); }
.shelf-clients { --tint: var(--blush); }
.shelf-docs { --tint: var(--lilac); }
.shelf-studio { --tint: var(--sand); }
.shelf-shorts { --tint: var(--blush); }

/* Bar */
.bar {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.bar-row {
  position: relative; display: flex; align-items: center; gap: 16px;
  height: 64px; padding: 0 var(--gutter) 0 calc(var(--gutter) - 4px);
}
.bar-row .mark { margin-right: 8px; }
.menu {
  flex: none; width: 40px; height: 40px; margin-left: -8px; border: 0; border-radius: 50%;
  background: none; display: grid; place-items: center; cursor: pointer; color: var(--ink);
}
.menu:hover { background: #ebeae3; }
.menu svg { width: 24px; height: 24px; }
.mark { display: inline-flex; align-items: center; flex: none; color: var(--ink); }
.mark-inner { display: inline-flex; align-items: center; gap: 10px; }
.mark-badge {
  width: 30px; height: 21px; border-radius: 6px; background: var(--poppy);
  display: grid; place-items: center; flex: none;
}
.mark-badge::after {
  content: ""; width: 0; height: 0; margin-left: 2px;
  border-left: 8px solid #fff; border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}
.mark-word { font-family: var(--display); line-height: 1; white-space: nowrap; }
/* the five logo directions; films.json "logo" picks one */
.mw-bold { font-weight: 800; font-size: 23px; font-stretch: 125%; letter-spacing: -0.01em; }
.mw-family { font-weight: 400; font-size: 19px; font-stretch: 125%; letter-spacing: 0.02em; text-transform: uppercase; }
.mark-o {
  display: inline-block; position: relative; width: .74em; height: .74em; margin-right: .035em;
  border-radius: 50%; background: var(--poppy); vertical-align: baseline;
}
.mark-o::after {
  content: ""; position: absolute; left: 37%; top: 50%; transform: translateY(-50%);
  border-left: .25em solid #fff; border-top: .155em solid transparent; border-bottom: .155em solid transparent;
}
.mw-playo { font-weight: 600; font-size: 25px; letter-spacing: -0.03em; }
.mark-oa { color: var(--poppy); }
.mark-oa .mark-inner { gap: 11px; }
.mark-oa svg { width: 37px; height: 22px; flex: none; }
.mw-oa { font-weight: 500; font-size: 22px; font-stretch: 112%; letter-spacing: -0.01em; color: var(--ink); }
.mw-quiet { font-weight: 650; font-size: 25px; letter-spacing: -0.035em; }
.search { flex: 1; display: flex; justify-content: center; }
.search-box { position: relative; width: 100%; max-width: 560px; }
.search input {
  width: 100%; height: 40px; padding: 0 44px 0 18px;
  border: 1px solid var(--rule-strong); border-radius: 20px;
  background: var(--surface); color: var(--ink);
  font: 400 15px var(--text);
}
.search input::placeholder { color: var(--ink-soft); }
.search input:focus { outline: none; border-color: var(--ink); }
.search kbd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font: 500 12px var(--text); color: var(--ink-soft);
  border: 1px solid var(--rule-strong); border-radius: 5px; padding: 1px 6px;
}
.bar-link { flex: none; font-weight: 500; color: var(--ink-soft); }
.bar-link:hover { color: var(--ink); }

.chips {
  display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none;
  padding: 0 var(--gutter) 12px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 6px 14px; border-radius: 8px;
  border: 1px solid var(--rule-strong); background: var(--surface);
  font: 500 14px/1.4 var(--text); white-space: nowrap;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-current="page"] { background: var(--tint, var(--ink)); border-color: var(--ink); }
.chip-all[aria-current="page"] { background: var(--ink); color: var(--paper); }

main { max-width: 1680px; padding: 24px var(--gutter) 64px; }

/* Sidebar: fixed column on browse pages from 1100px, a drawer everywhere else */
.layout { display: block; }
.side-nav {
  position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: 264px;
  padding: 76px 12px 28px; overflow-y: auto; background: var(--paper);
  transform: translateX(-100%); transition: transform .22s ease; visibility: hidden;
  scrollbar-width: thin;
}
.nav-open .side-nav { transform: none; visibility: visible; border-right: 1px solid var(--rule); }
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(23, 23, 27, .28); }
.scrim[hidden] { display: none; }
.side-nav a {
  display: flex; align-items: center; gap: 14px; min-height: 40px; padding: 6px 12px;
  border-radius: 10px; font: 500 14.5px/1.25 var(--text);
}
.side-nav a:hover { background: #ecebe4; }
.side-nav a[aria-current="page"] { background: #e6e5dc; font-weight: 600; }
.side-nav svg { width: 22px; height: 22px; flex: none; }
.side-nav h2 { margin: 6px 12px 6px; font: 650 15px/1.3 var(--display); }
.side-nav hr { border: 0; border-top: 1px solid var(--rule); margin: 12px 12px 14px; }
.side-nav .n { margin-left: auto; padding-left: 8px; color: var(--ink-soft); font: 500 12.5px var(--text); font-variant-numeric: tabular-nums; }
.swatch { width: 20px; height: 20px; margin: 0 1px; border-radius: 6px; flex: none; background: var(--tint); box-shadow: inset 0 0 0 1px rgba(23, 23, 27, .1); }
.pl-thumb { width: 32px; height: 18px; border-radius: 3px; object-fit: cover; flex: none; background: var(--tint); margin: 0 -5px 0 -5px; }
.side-note { margin: 18px 12px 0; color: var(--ink-soft); font-size: 13px; }
.nav-head { display: flex; align-items: center; gap: 16px; height: 64px; margin: -76px -12px 12px; padding: 0 12px 0 calc(var(--gutter) - 4px); }
.nav-head .mark { pointer-events: auto; }

@media (min-width: 1100px) {
  .is-browse .layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
  .is-browse .side-nav {
    position: sticky; top: 64px; height: calc(100vh - 64px); width: auto; z-index: 1;
    transform: none; visibility: visible; padding: 12px 12px 28px; border-right: 0;
  }
  .is-browse .scrim { display: none; }
  .is-browse .nav-head { display: none; }
  .is-browse .chips { display: none; }
  .is-browse.nav-collapsed .layout { grid-template-columns: 0 minmax(0, 1fr); }
  .is-browse.nav-collapsed .side-nav { visibility: hidden; padding: 0; }
}

/* Featured */
.featured {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 32px; align-items: center; margin-bottom: 40px;
}
.featured-frame {
  position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden;
  background: var(--tint);
}
.featured-frame img, .featured-frame video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.featured-frame video { opacity: 0; transition: opacity .6s ease; }
.featured-frame video.is-on { opacity: 1; }
.featured-title {
  margin: 0 0 12px; font: 750 clamp(34px, 4.4vw, 64px)/0.98 var(--display);
  font-stretch: 118%; letter-spacing: -0.02em;
}
.featured-meta { margin: 0 0 14px; font-size: 15px; }
.featured-about { margin: 0 0 24px; font-size: 16px; max-width: 46ch; }
.button {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 20px 11px 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--poppy-deep); color: #fff; font: 600 15px var(--text);
}
.button:hover { background: var(--poppy-text); }
.button::before {
  content: ""; border-left: 9px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent;
}
.button-quiet { background: var(--surface); color: var(--ink); border: 1px solid var(--rule-strong); padding: 9px 16px; }
.button-quiet:hover { background: var(--surface); border-color: var(--ink); }
.button-quiet::before { content: none; }

.channel {
  display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline;
  padding: 18px 0 22px; margin-bottom: 8px; border-top: 1px solid var(--rule);
}
.channel p { margin: 0; color: var(--ink-soft); max-width: 70ch; }
.channel a { font-weight: 600; color: var(--poppy-text); }
.channel a:hover { text-decoration: underline; }

/* Shelves */
.shelf { margin-top: 36px; }
.shelf-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 4px; }
.shelf-head h2 {
  margin: 0; font: 700 22px/1.2 var(--display); font-stretch: 110%; letter-spacing: -0.005em;
}
.shelf-head a { margin-left: auto; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.shelf-head a:hover { color: var(--ink); }
.shelf-note { margin: 0 0 16px; color: var(--ink-soft); max-width: 75ch; }

.grid {
  display: grid; gap: 28px 16px;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}
.card { display: block; min-width: 0; }
.thumb {
  position: relative; display: block; aspect-ratio: 16 / 9;
  border-radius: var(--radius); overflow: hidden; background: var(--tint, var(--sand));
}
.thumb img, .thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb video { opacity: 0; transition: opacity .25s ease; }
.thumb video.is-on { opacity: 1; }
.dur {
  position: absolute; right: 8px; bottom: 8px; z-index: 2;
  padding: 1px 6px; border-radius: 5px;
  background: rgba(23, 23, 27, .82); color: #fff;
  font: 600 12px/1.6 var(--text); font-variant-numeric: tabular-nums;
}
.card-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 10px; font: 600 16px/1.3 var(--display); letter-spacing: -0.003em;
}
.card:hover .card-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.card-meta { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 14px; }

/* Playlist card: the stack shows there is more than one film behind it */
.card-list .thumb { overflow: visible; background: none; }
.card-list .stack {
  position: absolute; inset: 0; border-radius: var(--radius); overflow: hidden; background: var(--tint);
}
.card-list .thumb::before, .card-list .thumb::after {
  content: ""; position: absolute; left: 6%; right: 6%; border-radius: var(--radius) var(--radius) 0 0;
  background: var(--tint); border: 1px solid var(--paper);
}
.card-list .thumb::before { top: -6px; height: 20px; filter: brightness(.94); }
.card-list .thumb::after { top: -12px; left: 12%; right: 12%; height: 20px; filter: brightness(.88); z-index: -1; }
.count {
  position: absolute; right: 0; top: 0; bottom: 0; width: 38%; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: rgba(246, 246, 242, .9); color: var(--ink);
  font: 700 22px/1 var(--display); font-variant-numeric: tabular-nums;
}
.count small { font: 500 13px var(--text); color: var(--ink-soft); }

/* Shorts */
.shorts { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.card-short .thumb { aspect-ratio: 9 / 16; }

/* Watch page */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; align-items: start; }
.player-wrap { display: flex; justify-content: center; }
.player {
  position: relative; width: 100%; border-radius: 14px; overflow: hidden; background: var(--tint);
}
.player video { width: 100%; height: 100%; background: transparent; }
.player.is-tall { width: auto; height: min(78vh, 860px); }
.player.is-tall video { height: 100%; width: auto; }
.watch h1 {
  margin: 18px 0 6px; font: 700 clamp(24px, 2.4vw, 30px)/1.15 var(--display); font-stretch: 104%; letter-spacing: -0.01em;
}
.watch-meta { display: flex; flex-wrap: wrap; gap: 6px 0; color: var(--ink-soft); }
.watch-meta span + span, .featured-meta span + span { margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--rule-strong); }
.watch-about {
  margin-top: 16px; padding: 16px 18px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--rule); max-width: 78ch; font-size: 16px;
}
.watch-about p { margin: 0; }
.watch-actions { display: flex; gap: 10px; margin-top: 16px; }

.side h2 { margin: 0 0 12px; font: 700 17px/1.3 var(--display); }
.playlist {
  border: 1px solid var(--rule); border-radius: 12px; background: var(--surface);
  margin-bottom: 24px; overflow: hidden;
}
.playlist-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--rule); background: var(--tint); }
.playlist-head h2 { margin: 0; }
.playlist-head p { margin: 2px 0 0; color: var(--ink-soft); font-size: 13.5px; }
.playlist ol { list-style: none; margin: 0; padding: 6px 0; max-height: 420px; overflow-y: auto; counter-reset: pl; }
.playlist li a { display: grid; grid-template-columns: 22px 104px 1fr; gap: 10px; align-items: center; padding: 6px 12px; }
.playlist li a::before {
  counter-increment: pl; content: counter(pl); text-align: center;
  font: 500 12px var(--text); color: var(--ink-soft); font-variant-numeric: tabular-nums;
}
.playlist li a[aria-current="true"] { background: var(--paper); }
.playlist li a[aria-current="true"]::before { content: ""; justify-self: center;
  border-left: 7px solid var(--poppy); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.playlist .thumb, .next .thumb { border-radius: 6px; }
.row-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font: 600 14px/1.3 var(--display); }
.row-meta { display: block; color: var(--ink-soft); font-size: 13px; margin-top: 2px; }

.next ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.next li a { display: grid; grid-template-columns: 168px 1fr; gap: 10px; align-items: start; }
.next li a:hover .row-title { text-decoration: underline; text-underline-offset: 3px; }
.next .dur { right: 5px; bottom: 5px; font-size: 11px; }

/* Up next countdown, shown when a film ends */
.upnext {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center;
  background: rgba(246, 246, 242, .94);
}
.upnext[hidden] { display: none; }
.upnext-card { width: min(420px, 88%); text-align: left; }
.upnext-card p { margin: 0 0 6px; color: var(--ink-soft); }
.upnext-card .thumb { margin-bottom: 12px; }
.upnext-title { font: 700 20px/1.2 var(--display); margin-bottom: 14px; }
.upnext-actions { display: flex; gap: 10px; }

/* Search results */
.results[hidden], .page[hidden] { display: none; }
.results h2 { margin: 0 0 18px; font: 700 22px/1.2 var(--display); }
.empty { max-width: 52ch; color: var(--ink-soft); font-size: 16px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  padding: 10px 16px; border-radius: 8px; background: var(--ink); color: var(--paper); font-weight: 500;
}
.toast[hidden] { display: none; }

footer {
  max-width: 1680px; padding: 24px var(--gutter) 48px;
  border-top: 1px solid var(--rule); color: var(--ink-soft); font-size: 14px;
  display: flex; flex-wrap: wrap; gap: 8px 24px;
}
footer a { font-weight: 600; color: var(--ink); }
footer a:hover { text-decoration: underline; }

@media (max-width: 1100px) {
  .watch { grid-template-columns: 1fr; }
  .player.is-tall { height: min(72vh, 760px); }
}
@media (max-width: 860px) {
  .featured { grid-template-columns: 1fr; gap: 18px; }
  .bar-link { display: none; }
}
@media (max-width: 600px) {
  :root { --gutter: 16px; }
  .bar-row { gap: 10px; height: 58px; }
  .bar-row .mark { margin-right: 2px; }
  .mark-inner { transform: scale(.86); transform-origin: left center; }
  .side-nav { padding-top: 70px; }
  .nav-head { height: 58px; margin-top: -70px; }
  /* search folds into an icon; tapping it opens the box across the bar */
  .search { flex: 1; justify-content: flex-end; }
  .search-box { width: 40px; }
  .search input {
    width: 40px; padding: 0; border-color: transparent; color: transparent; cursor: pointer;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10.5' cy='10.5' r='6' fill='none' stroke='%2317171b' stroke-width='1.8'/%3E%3Cpath d='m15 15 5 5' stroke='%2317171b' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / 24px no-repeat;
  }
  .search input::placeholder { color: transparent; }
  .search:focus-within { position: absolute; left: 12px; right: 12px; top: 9px; z-index: 3; }
  .search:focus-within .search-box { width: 100%; max-width: none; }
  .search:focus-within input {
    width: 100%; padding: 0 18px; color: var(--ink); cursor: text;
    background: var(--surface); border-color: var(--ink);
  }
  .search:focus-within input::placeholder { color: var(--ink-soft); }
  .featured-meta span + span { margin-left: 0; padding-left: 0; border-left: 0; width: 100%; }
  .search kbd { display: none; }
  .grid { grid-template-columns: 1fr; gap: 24px; }
  .shorts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .next li a { grid-template-columns: 140px 1fr; }
  .watch h1 { margin-top: 14px; }
  .player { border-radius: 10px; }
}
@media (max-width: 420px) {
  .mark-inner { transform: scale(.76); }
  .bar-row .mark { margin-right: -18px; }
}
@media (prefers-reduced-motion: reduce) {
  .featured-frame video, .thumb video { transition: none; }
}
