:root {
  --color-text: #231f20;
  --color-text-invert: #ffffff;
  --color-surface: #f4f4f4;
  --color-panel: #ffffff;
  --color-dark: #000000;
  --color-muted: #696969;
  --color-focus: #1534ff;
  --layout-width: min(1464px, calc(100% - 70px));
  --space-xs: 6px;
  --space-sm: 8px;
  --space-md: 22px;
  --space-lg: 31px;
  --space-xl: 52px;
  --motion-fast: 300ms;
  --motion-normal: 500ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

a,
button {
  color: inherit;
}

a {
  text-decoration: none;
  border-bottom: 2px solid currentColor;
  transition: border-color var(--motion-fast) ease, opacity var(--motion-fast) ease;
}

a:hover {
  border-color: transparent;
}

button {
  font: inherit;
}

a:focus-visible,
button:focus-visible,
.work-item__media:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 4px;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: var(--layout-width);
  margin: 0 auto;
  padding: 48px 0 0;
  transform: translateX(-50%);
}

.site-header::before {
  content: "";
  position: fixed;
  top: 0;
  left: 50%;
  z-index: -1;
  width: 100vw;
  height: 168px;
  background: linear-gradient(
    180deg,
    rgba(244, 244, 244, 0.98) 0%,
    rgba(244, 244, 244, 0.78) 42%,
    rgba(244, 244, 244, 0) 100%
  );
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  mask-image: linear-gradient(180deg, #000 0%, #000 48%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 48%, transparent 100%);
  pointer-events: none;
  transform: translateX(-50%);
}

.brand,
.brand-mark {
  border: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.brand-logo {
  display: block;
  width: 96px;
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.brand-mark {
  display: none;
}

sup {
  position: relative;
  top: -1em;
  font-size: 0.4em;
  line-height: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav:hover a,
.nav:focus-within a {
  opacity: 0.45;
}

.nav a {
  color: #231f20;
  border-color: transparent;
  font-weight: 500;
  opacity: 0.94;
}

.nav a:hover,
.nav a:focus-visible {
  opacity: 1;
  border-color: currentColor;
}

.page {
  width: var(--layout-width);
  margin: 0 auto;
  padding-top: 196px;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(36, minmax(0, 1fr));
  gap: 10px;
}

.work-grid:empty {
  min-height: 52vh;
  background: url("Logo MB black - png.png") center / 96px auto no-repeat;
}

.work-item {
  position: relative;
  grid-column: span 16;
  min-width: 0;
  background: #e7e7e7;
  overflow: hidden;
}

.work-item--slot-0,
.work-item--slot-4,
.work-item--slot-5,
.work-item--slot-8,
.work-item--slot-11,
.work-item--slot-12 {
  grid-column: span 16;
}

.work-item--slot-1,
.work-item--slot-6,
.work-item--slot-10,
.work-item--slot-13 {
  grid-column: span 20;
}

.work-item--slot-2,
.work-item--slot-3,
.work-item--slot-7,
.work-item--slot-9 {
  grid-column: span 10;
}

.work-item--slot-featured {
  grid-column: 1 / -1;
}

.work-item__media {
  position: relative;
  height: clamp(250px, 22.8vw, 350px);
  min-height: 0;
  overflow: hidden;
  background: #e2e2e2 url("Logo MB black - png.png") center / 96px auto no-repeat;
  cursor: pointer;
}

.work-item--slot-featured .work-item__media {
  height: clamp(510px, calc(45.6vw + 10px), 710px);
}

.work-item img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(var(--thumb-scale, 1.001));
  transition: transform var(--motion-normal) ease, filter var(--motion-normal) ease;
}

.work-item:hover img,
.work-item:focus-within img {
  transform: scale(calc(var(--thumb-scale, 1.001) * 1.025));
  filter: brightness(0.58);
}

.work-item--fallback .work-item__media::before {
  content: "";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #e2e2e2 url("Logo MB black - png.png") center / 112px auto no-repeat;
}

.work-item__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 16px 31px;
  color: var(--color-text-invert);
  background: transparent;
  opacity: 1;
  transition: background var(--motion-normal) ease;
}

.work-item:hover .work-item__overlay,
.work-item:focus-within .work-item__overlay {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.58));
}

.work-item__title {
  max-width: min(680px, 90%);
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  font-size: clamp(28px, 1.85vw, 38px);
  font-weight: 400;
  line-height: 1.08;
  color: var(--color-text-invert);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--motion-fast) ease, transform var(--motion-fast) ease;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.work-item__actions {
  display: flex;
  gap: 27px;
  margin-top: auto;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.work-item:hover .work-item__title,
.work-item:focus-within .work-item__title,
.work-item:hover .work-item__actions,
.work-item:focus-within .work-item__actions {
  opacity: 1;
  transform: translateY(0);
}

.text-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0;
  color: var(--color-text-invert);
  background: transparent;
  border: 0;
  border-bottom: 2px solid currentColor;
  cursor: pointer;
}

.text-action:hover {
  border-bottom-color: transparent;
}

.text-action::before {
  display: inline-block;
  margin-right: 8px;
  font-size: 0.86em;
}

.text-action--play::before {
  content: "▷";
}

.text-action--project::before {
  content: "↗";
}

.end-footer {
  width: var(--layout-width);
  margin: 10px auto 0;
  padding-bottom: 34px;
}

.end-footer__button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 72px;
  padding: 0 24px;
  color: var(--color-text);
  background: #f1f1f1;
  border: 0;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.end-footer__button::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 24px;
  height: 24px;
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
}

.end-footer__button:hover {
  background: #ececec;
}

.info-panel {
  position: fixed;
  inset: auto 0 100% 0;
  z-index: 40;
  min-height: 100vh;
  overflow: auto;
  background: var(--color-panel);
  opacity: 0;
  transition: transform var(--motion-normal) ease, opacity var(--motion-fast) ease;
}

.info-panel.is-open {
  transform: translateY(100%);
  opacity: 1;
}

.info-panel__inner {
  width: calc(100% - 108px);
  margin: 0 auto;
  padding: 48px 0 70px;
}

.info-panel__intro {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding-top: 160px;
  font-size: clamp(36px, 5vw, 82px);
  line-height: 1.08;
}

.info-panel__intro p,
.info-panel__grid p,
.info-panel__grid h2 {
  margin: 0;
}

.info-panel__grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(180px, 0.7fr) minmax(320px, 1.4fr);
  gap: 48px;
  max-width: 1180px;
  margin-top: 90px;
  font-size: 18px;
  line-height: 1.45;
}

.info-panel__grid h2 {
  margin-bottom: var(--space-md);
  color: var(--color-muted);
  font-size: inherit;
  font-weight: 400;
}

.info-panel__contact p {
  max-width: 520px;
}

.quick-view {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 36px;
  background: rgba(0, 0, 0, 0.86);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--motion-fast) ease, visibility 0ms linear var(--motion-fast);
  --video-ratio: 1.7777777778;
}

.quick-view.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--motion-fast) ease;
}

.quick-view__frame {
  width: min(56vw, 920px, calc(64vh * var(--video-ratio)));
  height: min(64vh, calc(56vw / var(--video-ratio)), calc(920px / var(--video-ratio)));
  background: var(--color-dark) url("Logo MB white - png.png") center / 96px auto no-repeat;
}

.quick-view iframe,
.project-detail__player iframe {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--color-dark);
  border: 0;
}

.project-detail__player iframe {
  height: 100%;
}

.project-detail {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: auto;
  background: var(--color-panel);
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%);
  transition: opacity var(--motion-fast) ease, transform var(--motion-normal) ease, visibility 0ms linear var(--motion-fast);
}

.project-detail.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition: opacity var(--motion-fast) ease, transform var(--motion-normal) ease;
}

.project-detail__inner {
  width: min(1200px, calc(100% - 240px));
  margin: 0 auto;
  padding: 40px 0 90px;
}

.project-detail__head {
  padding-bottom: 34px;
  text-align: center;
  border-bottom: 1px solid var(--color-text);
}

.project-detail__head h2 {
  margin: 0;
  font-size: 36px;
  font-weight: 600;
  line-height: 1.12;
}

.project-detail__copy {
  width: min(560px, 100%);
  margin: 44px auto 0;
  color: var(--color-muted);
  text-align: center;
  font-size: 16px;
  line-height: 1.5;
  white-space: pre-line;
}

.project-detail__copy p {
  margin: 0;
}

.project-detail__player {
  width: min(100%, calc(82vh * var(--video-ratio, 1.7777777778)));
  margin-top: 48px;
  margin-right: auto;
  margin-left: auto;
  aspect-ratio: var(--video-ratio, 1.7777777778);
  background: var(--color-dark) url("Logo MB white - png.png") center / 96px auto no-repeat;
}

.close-button {
  position: fixed;
  z-index: 80;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.close-button::before,
.close-button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: currentColor;
  transform-origin: center;
}

.close-button::before {
  transform: rotate(45deg);
}

.close-button::after {
  transform: rotate(-45deg);
}

.close-button--dark {
  top: 35px;
  right: clamp(32px, 5.5vw, 112px);
  color: var(--color-text);
}

.project-detail > .close-button--dark {
  position: absolute;
  top: 18px;
  right: 18px;
}

.close-button--light {
  top: 8px;
  right: 16px;
  color: var(--color-text-invert);
}

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

@media (max-width: 1100px) {
  body {
    font-size: 18px;
  }

  .page {
    padding-top: 160px;
  }

  .work-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .work-item,
  .work-item--slot-0,
  .work-item--slot-1,
  .work-item--slot-2,
  .work-item--slot-3,
  .work-item--slot-4,
  .work-item--slot-5,
  .work-item--slot-6,
  .work-item--slot-7 {
    grid-column: span 3;
  }

  .work-item--wide,
  .work-item--panorama {
    grid-column: span 6;
  }

  .project-detail__inner {
    width: min(1000px, calc(100% - 120px));
  }

  .project-detail > .close-button--dark {
    right: 18px;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 14px;
    line-height: 1.4;
  }

  .site-header {
    position: static;
    display: block;
    width: calc(100% - 16px);
    padding-top: 30px;
    text-align: center;
    transform: none;
  }

  .site-header::before {
    display: none;
  }

  .brand--desktop {
    display: none;
  }

  .brand-mark {
    display: inline-flex;
    width: 82px;
    height: 48px;
    justify-content: center;
    align-items: center;
    overflow: hidden;
  }

  .brand-mark img {
    width: 82px;
    max-width: 100%;
    height: auto;
  }

  .nav {
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
  }

  .page {
    width: calc(100% - 16px);
    padding-top: 34px;
  }

  .end-footer {
    width: calc(100% - 16px);
    padding-bottom: 22px;
  }

  .end-footer__button {
    min-height: 58px;
    font-size: 16px;
  }

  .work-grid {
    display: block;
  }

  .work-item {
    margin-bottom: 8px;
  }

  .work-item,
  .work-item--wide,
  .work-item--panorama,
  .work-item--portrait,
  .work-item--square {
    grid-column: auto;
  }

  .work-item__media,
  .work-item--slot-featured .work-item__media,
  .work-item--portrait .work-item__media,
  .work-item--square .work-item__media,
  .work-item--panorama .work-item__media {
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .work-item__overlay {
    display: none;
  }

  .work-item__title {
    max-width: 92%;
    font-size: 22px;
    line-height: 1.1;
  }

  .work-item__actions {
    display: none;
  }

  .info-panel__inner {
    width: calc(100% - 32px);
    padding-top: 78px;
  }

  .info-panel__intro,
  .info-panel__grid {
    display: block;
  }

  .info-panel__intro {
    padding-top: 36px;
    font-size: 30px;
  }

  .info-panel__grid section + section {
    margin-top: 28px;
  }

  .info-panel__grid {
    margin-top: 56px;
    font-size: 16px;
  }

  .quick-view {
    padding: 0 8px;
  }

  .quick-view__frame {
    width: min(96vw, calc(84vh * var(--video-ratio)));
    height: min(84vh, calc(96vw / var(--video-ratio)));
  }

  .project-detail__inner {
    width: calc(100% - 32px);
    padding: 72px 0 60px;
  }

  .project-detail__head {
    padding-bottom: 24px;
  }

  .project-detail__head h2 {
    font-size: 28px;
  }

  .project-detail__copy {
    margin: 28px auto 0;
    text-align: left;
  }

  .close-button--dark {
    top: 18px;
    right: 18px;
  }

  .project-detail > .close-button--dark {
    right: 18px;
  }
}
