:root {
  --bg: #020202;
  --fg: #f4f2ec;
  --muted: rgba(244, 242, 236, 0.58);
  --line: rgba(244, 242, 236, 0.14);
  --page: clamp(30px, 6vw, 132px);
  --gap: clamp(12px, 1.05vw, 20px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, Arial, sans-serif;
}

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

img {
  max-width: 100%;
}

.site-header {
  position: relative;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
  padding: 34px var(--page) 28px;
  background: var(--bg);
}

.brand {
  display: inline-block;
  width: max-content;
  text-transform: uppercase;
}

.brand span,
.site-nav a,
.site-footer,
.label,
.project-overlay small,
.credits dt,
.contact-panel a {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand small {
  display: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px 26px;
}

.work-page {
  padding: 0 var(--page) clamp(72px, 9vw, 132px);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  max-width: 1280px;
  margin: 0 auto;
  animation: fade-in 520ms ease both;
}

.project-card {
  min-width: 0;
  background: var(--bg);
}

.project-card a {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9.8;
}

.project-card:nth-child(6n + 1) a,
.project-card:nth-child(6n + 5) a {
  aspect-ratio: 16 / 9.8;
}

.project-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--cover-position, center 42%);
  opacity: 1;
  transform: scale(var(--cover-scale, 1.1));
  transition: filter 180ms ease, opacity 180ms ease, transform 520ms ease;
}

.project-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  background: rgba(0, 0, 0, 0.54);
  opacity: 0;
  text-align: center;
  transition: opacity 180ms ease;
}

.project-overlay small {
  color: var(--muted);
}

.project-overlay strong {
  max-width: 520px;
  font-size: clamp(15px, 1.35vw, 24px);
  line-height: 1.08;
}

.project-card a:hover img {
  filter: brightness(0.62);
  transform: scale(calc(var(--cover-scale, 1.1) + 0.025));
}

.project-card a:hover .project-overlay,
.project-card a:focus-visible .project-overlay {
  opacity: 1;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 0 var(--page) 42px;
  color: var(--muted);
}

.site-footer a {
  color: var(--fg);
}

.about-page,
.project-page {
  padding: clamp(42px, 6vw, 82px) var(--page) 72px;
}

.about-panel {
  max-width: 880px;
}

.label {
  margin: 0 0 16px;
  color: var(--muted);
}

.about-panel h1,
.project-info h1 {
  margin: 0;
  font-size: clamp(26px, 3.2vw, 42px);
  line-height: 1;
  letter-spacing: 0;
}

.role {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 24px);
}

.about-copy {
  max-width: 680px;
  margin: 34px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2.1vw, 30px);
  line-height: 1.28;
}

.contact-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  margin-top: clamp(54px, 8vw, 96px);
}

.contact-panel a,
.back-link {
  border-bottom: 1px solid currentColor;
}

.project-media {
  display: grid;
  gap: var(--gap);
  max-width: 760px;
  margin-inline: auto;
  animation: fade-in 520ms ease both;
}

.media-frame {
  aspect-ratio: 16 / 9;
  background: #111;
}

.media-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.external-video {
  position: relative;
  display: block;
  width: min(100%, 760px);
  aspect-ratio: 16 / 9;
  margin-inline: auto;
  overflow: hidden;
  background: #111;
}

.media-frame.is-vertical,
.external-video.is-vertical {
  width: min(100%, 760px);
  margin-inline: auto;
  aspect-ratio: 16 / 9;
}

.external-video img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.74;
}

.external-video span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-bottom: 1px solid currentColor;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.external-video.is-vertical img {
  width: min(100%, 250px);
  max-width: none;
  height: 100%;
  margin-inline: auto;
  object-fit: cover;
}

.project-info {
  display: grid;
  gap: 8px;
  max-width: 760px;
  margin: clamp(28px, 4vw, 44px) auto 0;
}

.credits {
  display: grid;
  max-width: 760px;
  margin-inline: auto;
  gap: 1px;
  margin-top: clamp(32px, 5vw, 64px);
  border-top: 1px solid var(--line);
}

.credits div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.credits dt,
.credits dd {
  margin: 0;
}

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

.credits dd {
  font-size: 14px;
  line-height: 1.4;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  max-width: 760px;
  margin: clamp(34px, 5vw, 64px) auto 0;
}

.project-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.project-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  max-width: 760px;
  margin: clamp(48px, 7vw, 88px) auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.project-nav a {
  display: grid;
  gap: 8px;
}

.project-nav a:last-child {
  text-align: right;
}

.project-nav small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.project-nav span {
  font-size: clamp(14px, 1.2vw, 18px);
  line-height: 1.2;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 1080px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  :root {
    --page: 24px;
    --gap: 14px;
  }

  .site-header {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-top: 26px;
    padding-bottom: 20px;
  }

  .site-nav {
    justify-content: flex-start;
    gap: 12px 18px;
  }

  .work-page {
    padding-bottom: 72px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card a,
  .project-card:nth-child(6n + 1) a,
  .project-card:nth-child(6n + 5) a {
    aspect-ratio: 16 / 9.4;
  }

  .project-overlay {
    inset: auto 0 0;
    place-content: end start;
    justify-items: start;
    min-height: 42%;
    padding: 18px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.78), transparent);
    opacity: 1;
    text-align: left;
  }

  .project-overlay strong {
    font-size: 16px;
    line-height: 1.1;
  }

  .project-overlay small {
    font-size: 9px;
  }

  .about-panel h1,
  .project-info h1 {
    font-size: clamp(26px, 8vw, 38px);
  }

  .about-copy {
    font-size: 18px;
  }

  .credits div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .project-gallery,
  .project-nav {
    grid-template-columns: 1fr;
  }

  .project-nav a:last-child {
    text-align: left;
  }
}
