:root {
  --pad: clamp(22px, 3vw, 48px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  background: #0b0b0b; color: #fff;
  font-family: "Jost", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  font-size: 14px; font-weight: 400; line-height: 1.4; letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Header: just the name and the role. */
.bar { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 38px var(--pad) 0; pointer-events: none; }
/* Name and title are one unit: the title sits right under the name, in small light capitals. */
.lock { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.bar .name { font-size: 12px; letter-spacing: .24em; text-transform: uppercase; }
.bar .name, .bar .role { pointer-events: auto; }
.bar .role { font-size: 9.2px; font-weight: 300; letter-spacing: .355em; text-transform: uppercase; color: rgba(255, 255, 255, .62); margin-left: -.05em; }   /* the small shift makes the round C line up optically with the K above it */
.bar .role:hover { color: #fff; }
.menu { display: flex; gap: clamp(16px, 2.4vw, 34px); pointer-events: auto; }
.menu a { font-size: 13px; letter-spacing: .04em; color: rgba(255, 255, 255, .78); }
.menu a:hover, .menu a.on { color: #fff; text-decoration: underline; text-underline-offset: 5px; }

/* The current project fills the page. */
.stage { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #0b0b0b; }
.view { position: absolute; inset: 0; }
/* Projects dissolve into one another; the old picture stays until the new one is fully there. */
.layer { position: absolute; inset: 0; opacity: 0; transition: opacity .9s cubic-bezier(.4, 0, .2, 1); }
.layer.on { opacity: 1; }
.layer img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.layer video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .01; transition: opacity .8s cubic-bezier(.4, 0, .2, 1); }
.layer.playing video { opacity: 1; }
.stage::after {
  content: ""; position: absolute; inset: 0; z-index: 100000; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .2) 38%, rgba(0, 0, 0, 0) 68%), rgba(0, 0, 0, .14);
}

/* A thin line along the bottom shows how far through the clip you are. */
.pg { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; z-index: 100001; background: rgba(255, 255, 255, .18); }
.pg i { display: block; height: 100%; background: #fff; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* The list of projects: just the titles. */
.panel { position: fixed; z-index: 3; left: var(--pad); top: clamp(110px, 17vh, 160px); display: flex; flex-direction: column; max-height: calc(100vh - clamp(110px, 17vh, 160px) - 96px); max-height: calc(100dvh - clamp(110px, 17vh, 160px) - 96px); }
.filter { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 22px; }
.filter button { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; letter-spacing: .04em; color: rgba(255, 255, 255, .6); cursor: pointer; }
.filter button:hover, .filter button.on { color: #fff; }
.filter button.on { text-decoration: underline; text-underline-offset: 5px; }
.list { list-style: none; overflow-y: auto; scrollbar-width: none; min-height: 0; margin-left: calc(-1 * var(--pad)); padding-left: var(--pad); }   /* the titles line up with the name and the filter; the dash sits in the margin */
.row[hidden] { display: none; }
.list::-webkit-scrollbar { display: none; }
.row { position: relative; padding: 5px 0; font-size: 15px; line-height: 1.3; color: rgba(255, 255, 255, .62); cursor: default; transition: color .3s var(--ease), transform .4s var(--ease); }
.row::before { content: ""; position: absolute; left: calc(12px - var(--pad)); top: 50%; width: 0; height: 1px; background: #fff; transition: width .4s var(--ease); }
.row a { display: inline; color: inherit; text-decoration: none; }
.row.active::after { content: "Dir. " attr(data-dir); margin-left: 14px; font-size: 12px; color: rgba(255, 255, 255, .72); }
.row:hover { color: #fff; }
.row.active { color: #fff; }
.row.active::before { width: max(0px, calc(var(--pad) - 24px)); }

@media (max-width: 700px) {
  .row { font-size: 14px; padding: 4px 0; }
}
@media (max-width: 700px) and (pointer: coarse) {
  .row { padding: 11px 0; }   /* about 44px tall, so a thumb can hit each title */
  .row a::after { content: ""; position: absolute; inset: 0; }   /* the whole row is the tap target */
  .filter button { padding: 12px 0; }
  .panel { top: clamp(100px, 15vh, 140px); }
}
@media (prefers-reduced-motion: reduce) {
  .layer, .layer video, .row, .row::before { transition: none !important; }
}
@media (max-width: 560px) {
  .menu { gap: 12px; }
  .menu a { font-size: 12px; }
  .bar .name { letter-spacing: .16em; }
}

/* On a touch screen the chosen title says it opens with another tap. */
@media (hover: none), (pointer: coarse) {
  .row.active::after { content: "View \2192"; font-size: 12px; letter-spacing: .06em; }
}

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.layer[data-pos="27% 50%"] img, .layer[data-pos="27% 50%"] video { object-position: 27% 50%; }
