:root {
  color-scheme: dark;
  --bg: #000;
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.46);
  --dim: rgba(255, 255, 255, 0.18);
  --line: rgba(255, 255, 255, 0.28);
  --line-soft: rgba(255, 255, 255, 0.12);
  --accent: #090044;
  --page: clamp(10px, 0.9vw, 18px);
  --mono: "SFMono-Regular", "Roboto Mono", "Liberation Mono", Consolas, monospace;
  --sans: Helvetica, Arial, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body.has-dialog {
  overflow: hidden;
}

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

img {
  display: block;
  max-width: 100%;
}

video {
  display: block;
}

button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.mono,
.inline-control {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0;
  line-height: 18px;
  text-transform: uppercase;
}

.site-logo {
  position: fixed;
  top: var(--page);
  left: var(--page);
  z-index: 20;
  max-width: min(34vw, 360px);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0;
  line-height: 18px;
  text-transform: uppercase;
  mix-blend-mode: difference;
}

.site-header {
  position: fixed;
  top: var(--page);
  right: var(--page);
  z-index: 20;
  width: min(210px, calc(50vw - var(--page) * 2));
  color: var(--text);
  mix-blend-mode: difference;
}

.site-menu {
  display: grid;
  grid-auto-rows: min-content;
  justify-items: start;
  row-gap: 10px;
}

.work-menu,
.work-menu-panel {
  display: grid;
  grid-auto-rows: min-content;
  row-gap: 2px;
}

.work-menu-panel {
  padding-left: 4ch;
}

.inline-control {
  display: grid;
  grid-template-columns: 4ch minmax(0, 1fr);
  column-gap: 1ch;
  text-align: left;
}

.inline-control:hover,
.inline-control.is-active {
  color: var(--muted);
}

.hero-slider {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: #000;
}

.slides {
  position: absolute;
  inset: 0;
  padding: 0;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  z-index: 1;
}

.slide {
  grid-area: 1 / 1;
  display: grid;
  place-items: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
  opacity: 0;
  transform: scale(1.006);
  transition: opacity 280ms linear, transform 900ms cubic-bezier(0.2, 0, 0, 1);
  pointer-events: none;
}

.slide.is-active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.slide-link,
.slide-bg,
.slide-media {
  grid-area: 1 / 1;
}

.slide-link {
  z-index: 2;
  justify-self: stretch;
  align-self: stretch;
}

.slide-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(22px) saturate(0.8) contrast(1.04);
  opacity: 0.46;
  transform: scale(1.09);
}

.slide-media {
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  background: transparent;
  filter: saturate(0.96) contrast(1.02);
  box-shadow: none;
}

.slide.is-active .slide-bg {
  animation: breathe-bg 5600ms linear both;
}

.slider-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.28), transparent 24%),
    linear-gradient(to top, rgba(0, 0, 0, 0.52), transparent 36%);
}

.slider-footer {
  position: absolute;
  left: var(--page);
  right: var(--page);
  bottom: calc(var(--page) + env(safe-area-inset-bottom));
  z-index: 15;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content max-content;
  column-gap: clamp(18px, 4vw, 72px);
  align-items: end;
  color: var(--text);
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.78);
  pointer-events: none;
}

.slider-progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 2px;
  margin-top: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
}

.slider-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  background: currentColor;
  animation: slider-progress 5600ms linear infinite;
}

.slider-caption {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 1ch;
  pointer-events: auto;
}

.slider-title {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slider-title:hover,
.slider-nav:hover {
  color: var(--muted);
}

.slider-nav {
  pointer-events: auto;
}

.work-view {
  position: relative;
  z-index: 5;
  min-height: 100svh;
  padding: 120px var(--page) 90px;
  background: #f3f3f0;
  color: #090044;
}

.view-header {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 10px;
  align-items: start;
  padding-bottom: 15px;
  border-bottom: 2px solid currentColor;
}

.view-header h1 {
  grid-column: 1 / 3;
  margin: 0;
  font: inherit;
}

.view-mode {
  grid-column: 4;
  display: grid;
  grid-auto-rows: min-content;
  row-gap: 2px;
}

.project-grid {
  --cols: 4;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 60px 10px;
  padding-top: 30px;
}

.project-card {
  display: grid;
  grid-template-rows: 1fr min-content;
  row-gap: 15px;
}

.project-card a {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #fff;
}

.project-card-media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 280ms ease, filter 280ms ease;
}

.project-card a:hover .project-card-media {
  filter: saturate(1.08) contrast(1.04);
  transform: scale(1.045);
}

.project-card-info {
  display: grid;
  grid-auto-rows: min-content;
  row-gap: 2px;
  padding-right: 30px;
}

.project-card-info span:last-child {
  color: rgba(9, 0, 68, 0.48);
}

.work-view .inline-control:hover,
.work-view .inline-control.is-active {
  color: rgba(9, 0, 68, 0.45);
}

.project-list {
  display: none;
  padding-top: 0;
}

.work-view[data-mode="list"] .project-grid {
  display: none;
}

.work-view[data-mode="list"] .project-list {
  display: grid;
}

.project-row {
  position: relative;
  border-bottom: 2px solid currentColor;
}

.project-row-link {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 10px;
  min-height: 61px;
  padding: 30px 0 13px;
  background: transparent;
  transition: color 160ms ease, background-color 160ms ease;
}

.project-row-link span {
  min-width: 0;
  padding-left: 4ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-row-link:hover {
  background: var(--accent);
  color: rgba(255, 255, 255, 0.42);
}

.row-preview {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 3;
  display: none;
  width: calc((100vw - var(--page) * 2 - 30px) / 4);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  pointer-events: none;
}

.project-row:hover .row-preview {
  display: block;
}

.about-section {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 10px;
  padding: 120px var(--page) 120px;
  background: #f3f3f0;
  color: #090044;
  border-top: 2px solid currentColor;
}

.about-section h2 {
  grid-column: 2 / 4;
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(28px, 3.2vw, 54px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.03;
}

.about-section p {
  grid-column: 4;
  margin: 0;
  color: rgba(9, 0, 68, 0.62);
  font-size: clamp(16px, 1.35vw, 22px);
}

.about-links {
  grid-column: 4;
  display: grid;
  grid-auto-rows: min-content;
  row-gap: 2px;
  margin-top: 42px;
}

.about-links a:hover {
  color: rgba(9, 0, 68, 0.45);
}

.site-footer {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 10px;
  padding: 10px var(--page);
  background: #f3f3f0;
  color: #090044;
  border-top: 2px solid currentColor;
}

.site-footer a:hover {
  color: rgba(9, 0, 68, 0.45);
}

.project-dialog {
  width: min(1180px, calc(100vw - 22px));
  max-height: calc(100svh - 22px);
  padding: 0;
  border: 2px solid var(--text);
  border-radius: 0;
  background: #000;
  color: var(--text);
  overflow: hidden;
}

.project-dialog::backdrop {
  background: rgba(0, 0, 0, 0.82);
}

.project-dialog[open] {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  mix-blend-mode: difference;
}

.dialog-close:hover {
  color: var(--muted);
}

.dialog-media-wrap {
  display: grid;
  place-items: center;
  min-height: min(70svh, 760px);
  background: #000;
}

.dialog-media {
  width: 100%;
  height: 100%;
  max-height: calc(100svh - 22px);
  object-fit: contain;
  border: 0;
}

.dialog-video,
.dialog-embed {
  aspect-ratio: 16 / 9;
  height: auto;
}

.dialog-copy {
  display: grid;
  align-content: end;
  padding: 44px 18px 18px;
}

.dialog-copy h2 {
  margin: 0 0 28px;
  font-size: clamp(38px, 4.4vw, 76px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.94;
}

.dialog-copy p {
  margin: 0;
  color: var(--muted);
}

#dialog-counter {
  margin-bottom: 12px;
  color: var(--text);
}

.project-meta {
  display: grid;
  grid-auto-rows: min-content;
  row-gap: 2px;
  margin: 0 0 28px;
  padding-top: 15px;
  border-top: 2px solid var(--line);
}

.project-meta div {
  display: grid;
  grid-template-columns: 9ch minmax(0, 1fr);
  column-gap: 1ch;
}

.project-meta dt {
  color: var(--muted);
}

.project-meta dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 1280px) {
  .project-grid {
    --cols: 3;
  }

  .view-header,
  .project-row-link,
  .about-section,
  .site-footer {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .view-header h1 {
    grid-column: 1 / 3;
  }

  .view-mode,
  .about-section p,
  .about-links {
    grid-column: 3;
  }

  .about-section h2 {
    grid-column: 1 / 3;
  }

  .project-row-link span:nth-child(2) {
    display: none;
  }
}

@media (max-width: 840px) {
  :root {
    --page: 10px;
  }

  .site-logo {
    max-width: 46vw;
    font-size: 11px;
    line-height: 16px;
  }

  .site-header {
    width: min(150px, calc(44vw - 10px));
  }

  .slides {
    padding: 0;
  }

  .slider-footer {
    grid-template-columns: minmax(0, 1fr) max-content;
    row-gap: 8px;
  }

  .slide-media {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
  }

  .slider-caption {
    grid-column: 1 / -1;
  }

  .slider-nav-prev {
    grid-column: 1;
    justify-self: start;
  }

  .slider-nav-next {
    grid-column: 2;
    justify-self: end;
  }

  .work-view {
    padding-top: 92px;
  }

  .project-grid {
    --cols: 2;
    gap: 42px 10px;
  }

  .view-header,
  .project-row-link,
  .about-section,
  .site-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .view-header h1,
  .about-section h2 {
    grid-column: 1 / -1;
  }

  .view-mode,
  .about-section p,
  .about-links {
    grid-column: 1 / -1;
    margin-top: 18px;
  }

  .project-row-link span {
    padding-left: 0;
  }

  .project-row-link span:nth-child(3) {
    display: none;
  }

  .row-preview {
    display: none !important;
  }

  .project-dialog[open] {
    grid-template-columns: 1fr;
  }

  .dialog-media-wrap {
    min-height: 48svh;
  }

  .dialog-media {
    max-height: 58svh;
  }
}

@media (max-width: 560px) {
  .mono,
  .inline-control {
    font-size: 11px;
    line-height: 16px;
  }

  .site-header {
    top: calc(var(--page) + 58px);
    right: auto;
    left: var(--page);
    width: min(210px, calc(100vw - var(--page) * 2));
  }

  .work-menu-panel {
    padding-left: 0;
  }

  .project-grid {
    --cols: 1;
  }

  .project-row-link {
    grid-template-columns: minmax(0, 1fr) max-content;
  }

  .project-row-link span:nth-child(2),
  .project-row-link span:nth-child(3) {
    display: none;
  }

  .site-footer {
    grid-template-columns: 1fr;
    row-gap: 2px;
  }

  .dialog-copy {
    padding: 34px 12px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@keyframes slider-progress {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@keyframes breathe-bg {
  from {
    transform: scale(1.09);
  }

  to {
    transform: scale(1.14);
  }
}

@keyframes float-media {
  from {
    transform: scale(0.992);
  }

  to {
    transform: scale(1);
  }
}
