.index-intro {
  display: flex;
  justify-content: center;
  text-align: center;
  margin: 0;
}

.index {
  --index-columns: 2;
  display: grid;
  grid-template-columns: repeat(var(--index-columns), minmax(0, 1fr));
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 180ms var(--page-transition-easing, ease), transform 180ms var(--page-transition-easing, ease);
}

@media (max-width: 640px) {
  .index-intro {
    justify-content: center;
    text-align: center;
  }
  .index {
    --index-columns: 2;
    gap: 8px;
  }
}

.index > li {
  width: 100%;
  justify-self: stretch;
/*
  content-visibility: auto;
  contain-intrinsic-size: 400px 500px; */
}

.index.index--filtering {
  opacity: 0;
  transform: translateY(8px);
}

.index.index--filtering-visible {
  opacity: 1;
  transform: translateY(0);
}

.index > li > a,
.berge-grid > li > a {
  display: block;
}

.project-card {
  position: relative;
  transform: scale(1);
  transform-origin: bottom center;
  transition: transform 0.3s ease;
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  .project-card:hover {
    transform: scale(1.01) !important;
    z-index: 2;
  }
}

.project-card__link {
  position: relative;
  display: block;
  border-radius: 4px;
  overflow: hidden;
}

.project-card__media {
  position: relative;
  display: block;
  border-radius: 4px;
  overflow: hidden;
}

.project-card__label {
  display: none;
}



.index__item--filter {
  opacity: 0;
  transform: translateY(var(--reveal-distance, 32px));
  animation: index-filter-reveal var(--reveal-duration, .6s) var(--reveal-easing, ease) forwards;
  animation-delay: var(--filter-delay, 0ms);
}

@keyframes index-filter-reveal {
  from {
    opacity: 0;
    transform: translateY(var(--reveal-distance, 32px));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .index > li {
    max-width: none;
    justify-self: stretch;
  }
}

@media (max-width: 640px) {
  .template-index .project-card__link {
    overflow: visible;
  }

  .template-index .project-card__label {
    display: block;
    margin-top: 8px;
    margin-bottom: 4px;
    margin-left: 
    color: black;
    font-size: 14px;
    line-height: 1.2;
    text-align: left;
    white-space: normal;
  }

  .template-index .project-card__media .project-title {
    display: none;
  }
}

@media (min-width: 641px) {
  .template-index .project-card__label {
    display: none;
  }
}

/* Sentinel item for infinite loading */
.index__sentinel {
  list-style: none;
  grid-column: 1 / -1;
  height: 1px;
  min-height: 1px;
  padding: 0;
  margin: 0;
  position: relative;
}

.index__sentinel[data-state="prefetching"],
.index__sentinel[data-state="loading"] {
  height: 40px;
  min-height: 40px;
}

.index__sentinel[data-state="prefetching"]::before,
.index__sentinel[data-state="loading"]::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 32px;
  height: 3px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.14);
}

.index__sentinel[data-state="loading"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 32px;
  height: 3px;
  border-radius: 999px;
  transform: translateX(-50%);
  transform-origin: left center;
  background: rgba(0, 0, 0, 0.72);
  animation: index-sentinel-progress 900ms ease-in-out infinite;
}

@keyframes index-sentinel-progress {
  0% {
    transform: translateX(-50%) scaleX(0.2);
    opacity: 0.35;
  }
  50% {
    transform: translateX(-50%) scaleX(1);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) scaleX(0.2);
    opacity: 0.35;
  }
}

@media (min-width: 768px) {
  .index {
    --index-columns: 3;
  }
}

@media (min-width: 1024px) {
  .index {
    --index-columns: 4;
  }
}

@media (min-width: 1360px) {
  .index {
    --index-columns: 5;
  }
}

.index figure {
  margin: 0;
  padding: 0;
  position: relative;
}

.index img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.filters {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.filters ul {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
  flex-wrap: wrap;
}

.filters li {
  margin: 0;
}

@media (max-width: 640px) {
  .filters {
    justify-content: center;
    margin-top: 16px;
    margin-left: 2px;
  }

  .filters ul {
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
}

.filters a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(222, 222, 222, 0);
  color: black;
  text-decoration: none;
  line-height: 1.2;
  font-size: 14px;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .filters a:hover:not(.is-active) {
    background: rgba(222, 222, 222, 1);
    color: black;
  }
}

.filters a.is-active {
  background: rgba(222, 222, 222, 1);
  color: black;
}


@media (max-width: 640px) {
  .filters a {
    background: rgba(222, 222, 222, 1);
  }
  .filters a.is-active {
    background: rgba(0, 0, 0, 1);
    color: white;
  }
}

.project-figure {
  position: relative;
  margin: 0;
  border-radius: 4px;
  overflow: hidden;
}

.project-figure:focus-within {
  z-index: 2;
}

@media (hover: hover) and (pointer: fine) {
  .project-figure:hover {
    z-index: 2;
  }
}

.thumb-wrap {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  display: block;
  line-height: 0;
  border-radius: 4px;
  height: 100%;
  width: 100%;
}

.thumb {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  position: absolute;
  inset: 0;
}

.thumb--hover {
  border-radius: inherit;
  z-index: 2;
}

.thumb--default {
  z-index: 1;
}

.thumb,
.thumb-wrap .lottie,
.thumb-wrap video,
.thumb-wrap img {
  border-radius: inherit;
  background: transparent;
}

.thumb-wrap--has-hover .thumb--hover {
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.thumb-wrap--has-hover .thumb--default {
  transition: opacity 0.25s ease;
}

.thumb-wrap picture {
  position: relative;
  z-index: 1;
  background: transparent !important;
}

.thumb-wrap--has-hover:focus-within .thumb--hover,
.project-card:focus-within .thumb-wrap--has-hover .thumb--hover,
.berge-grid > li > a:focus-visible .thumb-wrap--has-hover .thumb--hover {
  opacity: 1;
}

.thumb-wrap--has-hover:focus-within .thumb--default,
.project-card:focus-within .thumb-wrap--has-hover .thumb--default,
.berge-grid > li > a:focus-visible .thumb-wrap--has-hover .thumb--default {
  opacity: 0;
}

@media (hover: hover) and (pointer: fine) {
  .thumb-wrap--has-hover:hover .thumb--hover,
  .project-card:hover .thumb-wrap--has-hover .thumb--hover,
  .berge-grid > li > a:hover .thumb-wrap--has-hover .thumb--hover {
    opacity: 1;
  }

  .thumb-wrap--has-hover:hover .thumb--default,
  .project-card:hover .thumb-wrap--has-hover .thumb--default,
  .berge-grid > li > a:hover .thumb-wrap--has-hover .thumb--default {
    opacity: 0;
  }
}

.index .thumb-wrap picture,
.index .thumb-wrap .thumb {
  transition: none;
}

.thumb--default,
.thumb--hover {
  object-fit: cover;
}

.project-title {
  position: absolute;
  left: 50%;
  top: 50%;
  display: inline-block;
  padding: 6px 12px;
  color: black;
  line-height: 1.2;
  font-size: 14px;
  background: white;
  border-radius: 999px;
  box-shadow: 0 0px 16px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translate3d(-50%, calc(-50% + 6px), 0);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
  z-index: 4;
}
.berge-grid .project-title{
  box-shadow: none;
}

.project-card:focus-within .project-title {
  opacity: 1;
  transform: translate3d(-50%, -50%, 0);
}

@media (hover: hover) and (pointer: fine) {
  .project-figure:hover .project-title,
  .project-card:hover .project-title {
    opacity: 1;
    transform: translate3d(-50%, -50%, 0);
  }
}

.project-figure--berge .project-title {
  left: 16px;
  top: 16px;
  right: auto;
  bottom: auto;
  padding: 0;
  color: #fff;
  background: none;
  border-radius: 0;
  opacity: 1;
  transform: none !important;
  text-align: left;
  white-space: normal;
  max-width: calc(100% - 32px);
  transition: opacity .15s ease;
}

.project-figure--berge:focus-within .project-title,
.project-card:focus-within .project-figure--berge .project-title {
  transform: none !important;
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .project-figure--berge:hover .project-title,
  .project-card:hover .project-figure--berge .project-title {
    transform: none !important;
    opacity: 1;
  }
}

figcaption {
  text-decoration: none;
}

.berge-item--inactive .thumb-wrap {
  opacity: 0.45;
}

.berge-item--inactive a {
  cursor: default;
}

.berge-item--inactive .project-title {
  color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 640px) and (hover: none) and (pointer: coarse) {
  .project-figure:hover .project-title,
  .project-card:hover .project-title,
  .project-card:focus-within .project-title {
    display: none;
  }

  .project-figure--berge:hover .project-title,
  .project-figure--berge:focus-within .project-title,
  .project-card:hover .project-figure--berge .project-title,
  .project-card:focus-within .project-figure--berge .project-title {
    transform: none !important;
    opacity: 1;
    display: block;
  }
}
