:root {
  --bg: #000;
  --text: #fff;
  --muted: #777;
  --line: #1d1d1d;
  --pad: clamp(12px, 3vw, 40px);
  --font-size: .7rem;
  --tracking: .1em;
  --carousel-height: 48vh;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: monospace;
  font-size: var(--font-size);
  letter-spacing: var(--tracking);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  min-height: 0;
  padding: 28px var(--pad) 0;
  background: transparent;
  mix-blend-mode: difference;
}

.brand {
  grid-column: 2;
  display: block;
  font: inherit;
}

nav {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  margin-top: 24px;
  line-height: 1.25;
}

nav a,
.work-label,
.section-kicker,
.installation-intro h2,
.about-section,
.contact-section,
footer {
  font-size: var(--font-size);
}

nav a,
.filters button {
  transition: opacity .2s ease;
}

.play-nav-link {
  display: inline-flex;
  align-items: baseline;
  gap: .15em;
  margin-top: 1em;
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  transition: color .2s ease, transform .35s ease, opacity .2s ease;
}

.play-nav-link.is-at-play {
  color: var(--muted);
}

.play-note {
  color: var(--text);
  font-family: monospace;
  font-size: .82em;
  transition: color .2s ease;
}

.play-nav-link.is-at-play .play-note {
  color: var(--muted);
}

nav a.is-current {
  color: var(--muted);
}

nav a:hover,
.filters button:hover {
  opacity: .55;
}

main {
  padding: 0 var(--pad);
}

section {
  scroll-margin-top: 128px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.work-section {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding-top: clamp(42px, 6vw, 82px);
  padding-bottom: 5vh;
}

.work-controls {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 18px;
}

.work-label {
  color: var(--muted);
}

.filters {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
}

.filters button {
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.filters button span {
  margin-left: 3px;
  font-size: .56rem;
  vertical-align: top;
}

.filters button.is-active {
  color: var(--text);
}

.carousel-viewport {
  width: 100%;
  height: var(--carousel-height);
  overflow: hidden;
}

.carousel-track {
  display: flex;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  height: 100%;
  gap: 3px;
}

.project-card {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  cursor: pointer;
  transition: flex .55s ease, flex-basis .55s ease, opacity .35s ease;
}

.project-card.is-playing {
  flex: 0 0 var(--carousel-height);
  aspect-ratio: 1 / 1;
  z-index: 2;
}

.project-card img,
.project-card video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #101010;
  filter: grayscale(1) brightness(.5);
  transition: filter .4s ease, opacity .3s ease;
}

.project-card video {
  opacity: 0;
}

.project-card:hover img,
.project-card:hover video,
.project-card.is-playing img,
.project-card.is-playing video {
  filter: grayscale(0) brightness(1);
}

.project-card.is-playing video {
  opacity: 1;
}

.carousel-track.has-filter .project-card:not(.is-highlighted) {
  opacity: .27;
}

.carousel-track.has-filter .project-card.is-playing {
  opacity: 1;
}

.carousel-track.has-filter .project-card.is-highlighted {
  opacity: 1;
}

.carousel-track.has-filter .project-card.is-highlighted img,
.carousel-track.has-filter .project-card.is-highlighted video,
.carousel-track.has-filter .project-card.is-playing img,
.carousel-track.has-filter .project-card.is-playing video {
  filter: grayscale(0) brightness(1);
}

.work-footer {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr);
  gap: 24px;
  align-items: start;
  flex: 1;
  min-height: 112px;
  padding-top: .25rem;
}

.work-intro {
  align-self: center;
  margin-top: 0;
  max-width: 90ch;
  color: var(--muted);
  line-height: 1.45;
}

.active-project {
  min-height: 18px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-kicker {
  color: var(--muted);
}

.film-section {
  min-height: 100svh;
  padding-top: 7vh;
  padding-bottom: 5vh;
}

.film-feature {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
  height: var(--carousel-height);
  margin-top: 18px;
  cursor: pointer;
  outline: none;
}

.film-copy {
  flex: 1 1 auto;
  max-width: 82ch;
  margin-right: auto;
  padding-top: .1rem;
  text-align: left;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity .35s ease, transform .35s ease;
}

.film-copy h2 {
  margin-bottom: .8rem;
  font: inherit;
  font-weight: 400;
}

.film-copy p {
  line-height: 1.45;
}

.film-images {
  display: flex;
  flex: 0 1 auto;
  gap: 3px;
  max-width: 78%;
  height: var(--carousel-height);
}

.film-image {
  display: block;
  width: auto;
  min-width: 0;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
  outline: none;
  filter: grayscale(1) brightness(.6);
  transition: filter .35s ease;
}

.film-poster {
  object-position: left center;
}

.film-hero {
  object-position: right center;
}

.film-feature:hover .film-copy,
.film-feature:focus-visible .film-copy,
.film-feature.is-active .film-copy {
  opacity: 1;
  transform: translateY(0);
}

.film-image:hover,
.film-image:focus-visible,
.film-image.is-active {
  filter: grayscale(0) brightness(1);
}

.installation-section {
  min-height: 100svh;
  padding-top: 7vh;
  padding-bottom: 5vh;
}

.installation-intro {
  display: grid;
  grid-template-columns: 1fr minmax(0, 2fr);
  gap: 24px;
  margin: 18px 0;
  line-height: 1.45;
}

.installation-intro h2 {
  font: inherit;
  font-weight: 400;
}

.installation-intro p {
  width: min(82ch, 100%);
  max-width: 100%;
  justify-self: end;
  text-align: left;
}

.installation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  gap: 3px;
  width: 100%;
  height: var(--carousel-height);
  min-height: var(--carousel-height);
  overflow: hidden;
}

.installation-grid figure {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.installation-grid img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  filter: grayscale(1) brightness(.6);
  transition: filter .35s ease;
}

.installation-grid img:hover {
  filter: grayscale(0) brightness(1);
}

.installation-caption {
  height: 53px;
  padding-top: .25rem;
  margin-left: auto;
  width: min(82ch, 100%);
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.about-section {
  min-height: 100svh;
  padding-top: 16vh;
  padding-bottom: 10vh;
}

.contact-section {
  min-height: 100svh;
  padding-top: 16vh;
  padding-bottom: 10vh;
}

.play-section {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding-top: 10vh;
  padding-bottom: 8vh;
}

.dub-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: .65em;
  margin: 18px 0 10px;
  color: var(--muted);
}

.single-mode-label,
.chord-mode-label {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: color .2s ease;
}

.single-mode-label.is-active,
.chord-mode-label.is-active {
  color: var(--text);
}

.dub-controls button {
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.dub-controls button.is-active {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: .22em;
}

.piano {
  position: relative;
  display: flex;
  width: 100%;
  height: var(--carousel-height);
  overflow: hidden;
  border: 1px solid #252525;
  background: #050505;
  touch-action: none;
  user-select: none;
}

.piano-key {
  position: relative;
  border: 0;
  border-right: 2px solid #050505;
  border-radius: 0;
  cursor: pointer;
  outline: none;
  transition: background-color .12s ease, filter .12s ease;
}

.piano-key.white {
  z-index: 1;
  flex: 1 1 0;
  height: 100%;
  background: #d6d6d1;
}

.piano-key.black {
  position: absolute;
  z-index: 3;
  top: 0;
  width: 4.2%;
  height: 63%;
  transform: translateX(-50%);
  background: #0a0a0a;
  border-right: 0;
  box-shadow: 0 3px 0 #1d1d1d;
}

.piano-key.white.is-active {
  background: #e89a62;
}

.piano-key.black.is-active {
  background: #e89a62;
}

.piano-key::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  color: #111;
  font: inherit;
  font-size: .55rem;
  opacity: .45;
}

.piano-key.black::after {
  color: #fff;
}

.note-readout {
  min-height: 18px;
  padding-top: .25rem;
  text-align: right;
}

.play-section footer {
  margin-top: auto;
  padding-bottom: 0;
}

.about-section p {
  max-width: 42rem;
  margin-top: .8rem;
  line-height: 1.45;
}

.contact-section > div:last-child {
  display: flex;
  flex-direction: column;
  gap: .8rem;
  margin-top: .8rem;
}

footer {
  margin-top: 8vh;
  padding: 24px 0 42px;
  color: var(--muted);
  line-height: 1.45;
  text-align: center;
}

@media (max-width: 900px) {
  :root {
    --carousel-height: 58vh;
  }

  .site-header {
    padding-top: 20px;
  }

  .work-controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .work-footer {
    grid-template-columns: minmax(0, 1fr);
    min-height: 108px;
  }

  .active-project {
    text-align: left;
  }

  .filters {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .installation-intro {
    grid-template-columns: 1fr;
  }

  .film-images {
    max-width: 72%;
  }

  .installation-intro p {
    width: 100%;
  }

  .installation-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
    height: calc(var(--carousel-height) * .8);
    min-height: calc(var(--carousel-height) * .8);
  }

  .film-feature {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    height: auto;
  }

  .film-images {
    order: 1;
    width: 100%;
    max-width: 100%;
    height: calc(var(--carousel-height) * .8);
    min-height: calc(var(--carousel-height) * .8);
  }

  .film-image {
    flex: 1 1 0;
    width: 0;
    height: 100%;
    object-fit: cover;
    transition: flex-grow .635s cubic-bezier(.333333, 1, .666667, 1), filter .35s ease;
  }

  .film-image:hover,
  .film-image:focus-visible,
  .film-image.is-active {
    flex-grow: 2.5;
  }

  .film-copy {
    order: 2;
    max-width: 100%;
    min-height: 76px;
    padding-top: .65rem;
  }

  .installation-grid img {
    object-fit: cover;
  }

  .piano {
    height: calc(var(--carousel-height) * .8);
  }

  .piano-key.black {
    width: 5.2%;
  }
}

@media (max-width: 520px) {
  :root {
    --carousel-height: min(58svh, 88vw);
  }

  .film-poster {
    display: none;
  }

  .film-hero {
    display: block;
    flex: 1 1 100%;
    width: 100%;
    object-position: -6px bottom;
  }

  .film-copy {
    opacity: 1;
    transform: none;
  }

  .work-section {
    padding-bottom: 3vh;
  }

  nav {
    gap: 2px;
  }

  .filters {
    gap: 16px;
  }

  .carousel-viewport {
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overflow-anchor: none;
    scroll-behavior: auto;
  }

  .carousel-viewport::-webkit-scrollbar,
  .piano-scroll::-webkit-scrollbar {
    display: none;
  }

  .carousel-track {
    justify-content: flex-start;
    width: max-content;
    min-width: 100%;
  }

  .project-card {
    flex: 0 0 auto;
    width: clamp(24px, 8.5vw, 42px);
    min-width: 0;
    transition: opacity .35s ease;
  }

  .project-card.is-playing {
    flex: 0 0 auto;
    width: var(--carousel-height);
  }

  .project-card img,
  .project-card video {
    left: 50%;
    right: auto;
    width: var(--carousel-height);
    transform: translateX(-50%);
  }

  .installation-grid {
    display: flex;
    width: 100%;
    height: calc(var(--carousel-height) * .8);
    min-height: calc(var(--carousel-height) * .8);
    overflow: hidden;
  }

  .installation-grid figure {
    flex: 1 1 0;
    width: auto;
    transform: translateZ(0);
    will-change: flex-grow;
    transition: flex-grow .635s cubic-bezier(.333333, 1, .666667, 1);
  }

  .installation-grid figure.is-active {
    flex-grow: 4;
  }

  .installation-grid figure.is-active img {
    filter: grayscale(0) brightness(1);
  }

  .work-footer {
    flex: 0 0 auto;
    min-height: 88px;
    padding-top: .15rem;
  }

  .work-intro {
    align-self: start;
    margin-top: .65rem;
  }

  .piano-scroll {
    width: 100%;
    overflow: hidden;
  }

  .piano {
    width: 100%;
    min-width: 0;
  }

  .piano-key.black {
    width: 7.2%;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  :root {
    --font-size: 9px;
  }

  html,
  body {
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
  }

  body,
  .brand,
  nav,
  nav a,
  .work-label,
  .filters button,
  .section-kicker,
  .installation-intro h2,
  .installation-intro p,
  .installation-caption,
  .about-section,
  .about-section p,
  .contact-section,
  .contact-section a,
  footer {
    font-size: 9px !important;
    line-height: 1.45;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
  }

  .about-section p,
  .installation-intro p,
  .contact-section a {
    max-width: 42rem;
    letter-spacing: var(--tracking);
  }
}
