
/* System: one face, one weight, one size. Baseline grid of 14px: every line of text sits on it, every vertical space is a whole number of lines. 10px side gutters. */
:root {
  --bg: #000000;
  --fg: #ffffff;
  --grey: #8a8a8a;
  --plate: #1a1a1a;
  --font: "Arial MT Pro", Arial, "Helvetica Neue", Helvetica, sans-serif;
  --size: 13px;
  --lead: 1.1;
  --L: 14px;           /* baseline unit = one line of text */
  --half: 7px;
  --g: 10px;
  --indent: 2.2em;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--fg);
  font: 700 var(--size)/var(--L) var(--font);
  -webkit-font-smoothing: antialiased;
}
a, button { color: inherit; font: inherit; background: none; border: 0; text-decoration: none; cursor: pointer; }
a:hover, button:hover { color: var(--grey); }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 2px; }
.grey { color: var(--grey); }
.pad {
  padding-left: max(var(--g), env(safe-area-inset-left, 0px));
  padding-right: max(var(--g), env(safe-area-inset-right, 0px));
}

/* header: one line */
.top { display: flex; justify-content: space-between; align-items: center; gap: var(--g); padding-block: var(--half); }
/* main bar: hides when scrolling down, comes back when scrolling up or at the top */
#bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); transition: transform .3s ease; }
#bar.hide { transform: translateY(calc(-100% - env(safe-area-inset-top, 0px))); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 6; background: var(--bg); }
@media (prefers-reduced-motion: reduce) { #bar { transition: none; } }
.top nav { display: flex; gap: 1.2em; }

/* cover */
.stage { position: relative; }
.cover {
  position: relative; display: block; width: 100%;
  height: calc(100svh - var(--L) * 5.5);  /* header + caption + first line of the project info peeks in */
  min-height: 320px;
  overflow: hidden; background: var(--plate);
  cursor: pointer; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
@supports (height: round(down, 100px, 14px)) { .cover { height: round(down, calc(100svh - var(--L) * 5.5), var(--L)); } }
.cover img, .cover video { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 700px) {
  .cover { min-height: 0; }
}
/* desktop: over the cover the pointer becomes the word Previous / Next */
@media (hover: hover) and (pointer: fine) { .cover { cursor: none; } }
.cursor-label { position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none; opacity: 0; color: #fff; mix-blend-mode: difference; white-space: nowrap; transform: translate(-50%, -50%); }
.cursor-label.on { opacity: 1; }
.caption { display: flex; justify-content: space-between; gap: var(--g); padding-block: var(--half); }
.caption span:first-child { min-width: 0; }

/* project */
.project { padding-top: var(--half); }
.facts { display: grid; grid-template-columns: 1fr; gap: var(--L) var(--g); }
@media (min-width: 701px) { .facts { grid-template-columns: 1fr 1fr; } }
.facts dl > div { display: grid; grid-template-columns: 6em minmax(0, 1fr); column-gap: var(--g); }
.facts dt { color: var(--grey); }
.facts p { max-width: 62ch; }
.facts .head { display: block; }

.media { display: grid; grid-template-columns: 1fr; gap: var(--L) var(--g); margin-top: var(--L); }
@media (min-width: 701px) { .media { grid-template-columns: 1fr 1fr; } .media .full { grid-column: span 2; } }
.media figure { position: relative; min-width: 0; }
.plate {
  position: relative; width: 100%; max-width: 100%; background: var(--plate);
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--g);
  padding: var(--g); color: var(--grey); overflow: hidden;
}
.plate.video::after { content: "▶"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: var(--fg); }

.next { display: flex; justify-content: space-between; gap: var(--g); padding-block: calc(var(--L) * 6) var(--L); }
footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--g); padding-block: var(--g) max(var(--g), env(safe-area-inset-bottom, 0px)); }

/* overlays: index + info */
.sheet {
  position: fixed; inset: 0; z-index: 10; background: var(--bg);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-top: env(safe-area-inset-top, 0px);
}
.sheet .body { padding-block: calc(var(--L) + var(--half)) calc(var(--L) * 3); }
.rows { list-style: none; }
.rows button { width: 100%; text-align: left; display: grid; grid-template-columns: 3.5em minmax(0, 1fr); column-gap: var(--g); }
@media (min-width: 701px) {
  .rows button { grid-template-columns: 3.5em minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 1fr); }
}
.rows button { color: var(--grey); }
@media (max-width: 700px) { .rows .cell-role { grid-column: 2; } .rows .cell-title { grid-column: 2; } }
.rows button:hover, .rows button:focus-visible, .rows button:active { color: var(--fg); }
.hang { padding-left: var(--indent); text-indent: calc(var(--indent) * -1); }
.info-grid { display: grid; grid-template-columns: 1fr; gap: calc(var(--L) * 2) var(--g); }
@media (min-width: 701px) { .info-grid { grid-template-columns: 1fr 1fr; } }
.info-grid p + p { margin-top: var(--L); }
.info-grid ul { list-style: none; }
.info-stack { display: grid; gap: var(--L); max-width: 62ch; }
.info-stack ul { list-style: none; }

@media (prefers-reduced-motion: no-preference) {
  .cover:not(.swiped) .slide.cur, .cover .plate { animation: in .35s ease-out; }
  @keyframes in { from { opacity: .0; } to { opacity: 1; } }
}

/* real media */
.cover { touch-action: pan-y; }
.cover .track { position: absolute; inset: 0; will-change: transform; }
.cover .slide { position: absolute; top: 0; width: 100%; height: 100%; object-fit: cover; }
.cover .slide.ph { display: flex; align-items: flex-end; padding: var(--g); background: var(--plate); color: var(--grey); }
.cover .slide.prev { left: calc(-100% - var(--g)); }
.cover .slide.cur { left: 0; }
.cover .slide.next { left: calc(100% + var(--g)); }
.media img { display: block; width: 100%; height: auto; max-width: 100%; background: var(--bg); }  /* transparent PNGs sit on black */
.media figcaption { margin-top: var(--L); max-width: 62ch; color: var(--grey); }
@media (min-width: 701px) { .media { align-items: start; } }

/* video player: a yin-yang play button that turns while the video plays, a 1px progress line, sound and full screen */
.media video.gif { display: block; width: 100%; height: auto; max-width: 100%; background: var(--bg); pointer-events: none; }
.player video { display: block; width: 100%; height: auto; max-width: 100%; background: var(--plate); cursor: pointer; }
.ctrl { display: flex; align-items: center; gap: var(--g); margin-top: var(--L); min-width: 0; height: var(--L); }
.yy-btn { flex: none; width: var(--L); height: var(--L); padding: 0; display: block; }
.yy-btn svg { display: block; width: 100%; height: 100%; animation: yyspin 4s linear infinite; }
.player.paused .yy-btn svg { animation-play-state: paused; }
.player.paused .yy-btn { opacity: .55; }
@keyframes yyspin { to { transform: rotate(360deg); } }
/* loading: a spinning yin-yang, only while an image or video is still arriving */
.ld { position: absolute; left: 50%; top: 50%; width: var(--L2, 28px); height: var(--L2, 28px); margin: -14px 0 0 -14px; z-index: 2; pointer-events: none; opacity: 0; animation: ldin .2s ease-out .15s forwards; transition: opacity .2s; }
.ld svg { display: block; width: 100%; height: 100%; animation: yyspin 1.1s linear infinite; }
.ld.out { opacity: 0 !important; animation: none; }
@keyframes ldin { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ld svg { animation-duration: 3s; } }
@media (prefers-reduced-motion: reduce) { .yy-btn svg { animation: none; } }
.bar { flex: 1; min-width: 40px; height: var(--L); position: relative; cursor: pointer; }
.bar::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--grey); }
.bar i { position: absolute; left: 0; top: calc(50% - 1px); height: 2px; width: 0; background: var(--fg); }
.time { font-variant-numeric: tabular-nums; }
.ctrl .snd, .ctrl .fs { white-space: nowrap; }
@media (max-width: 700px) { .ctrl .fs { display: none; } }
