.portfolio-gallery {
  --portfolio-accent: #0acfa5;
  --portfolio-surface: #151515;
  --portfolio-muted: #9c9c9c;
  margin-top: 2rem;
}

.legacy-project-grid {
  display: none;
}

.portfolio-gallery-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.portfolio-gallery-heading {
  margin: 0;
  color: var(--_color---white, #fff);
  font-family: var(--fonts-family--inter-tight, "Inter Tight", sans-serif);
  font-size: clamp(2.25rem, 5vw, 4.75rem);
  font-weight: 500;
  line-height: .98;
  letter-spacing: -.045em;
}

.portfolio-gallery-copy {
  max-width: 24rem;
  margin: 0;
  color: var(--portfolio-muted);
  font-family: var(--fonts-family--geist, Geist, sans-serif);
  font-size: .95rem;
  line-height: 1.6;
}

.portfolio-tabs {
  display: flex;
  gap: .6rem;
  overflow-x: auto;
  padding: .25rem 0 1.5rem;
  scrollbar-width: none;
}

.portfolio-tabs::-webkit-scrollbar {
  display: none;
}

.portfolio-tab {
  flex: 0 0 auto;
  padding: .8rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: transparent;
  color: #b7b7b7;
  font: 500 .82rem/1 var(--fonts-family--geist, Geist, sans-serif);
  transition: color .2s ease, background-color .2s ease, border-color .2s ease;
  cursor: pointer;
}

.portfolio-tab:hover,
.portfolio-tab[aria-selected="true"] {
  border-color: var(--portfolio-accent);
  background: var(--portfolio-accent);
  color: #07110f;
}

.portfolio-tab:focus-visible,
.portfolio-arrow:focus-visible,
.portfolio-card__open:focus-visible,
.portfolio-lightbox__close:focus-visible {
  outline: 2px solid var(--portfolio-accent);
  outline-offset: 4px;
}

.portfolio-panel {
  margin-bottom: 5rem;
}

.portfolio-panel[hidden] {
  display: none;
}

.portfolio-panel__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.4rem;
}

.portfolio-panel__title {
  margin: 0;
  color: var(--_color---white, #fff);
  font-family: var(--fonts-family--inter-tight, "Inter Tight", sans-serif);
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.035em;
}

.portfolio-panel__note {
  margin: .55rem 0 0;
  color: var(--portfolio-muted);
  font: 400 .9rem/1.5 var(--fonts-family--geist, Geist, sans-serif);
}

.portfolio-panel__controls {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: 0 0 auto;
}

.portfolio-panel__count {
  min-width: 3.5rem;
  color: var(--portfolio-muted);
  font: 400 .8rem/1 var(--fonts-family--geist, Geist, sans-serif);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.portfolio-arrow {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, opacity .2s ease;
  cursor: pointer;
}

.portfolio-arrow:hover:not(:disabled) {
  border-color: var(--portfolio-accent);
  background: var(--portfolio-accent);
  color: #07110f;
}

.portfolio-arrow:disabled {
  opacity: .35;
  cursor: default;
}

.portfolio-arrow svg {
  width: 1rem;
  height: 1rem;
}

.portfolio-track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding: .15rem .15rem 1.25rem;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-color: rgba(255, 255, 255, .28) transparent;
  scrollbar-width: thin;
}

.portfolio-card {
  flex: 0 0 min(68vw, 22rem);
  min-width: 0;
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 1.15rem;
  background: var(--portfolio-surface);
}

.portfolio-card__open {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #202020;
  cursor: zoom-in;
}

.portfolio-card__image {
  display: block;
  width: 100%;
  height: clamp(17rem, 38vw, 29rem);
  object-fit: cover;
  transition: transform .55s cubic-bezier(.2, .7, .2, 1);
}

.portfolio-card__image--contained {
  object-fit: contain;
  padding: 2.5rem;
  background: #101010;
}

.portfolio-card__open:hover .portfolio-card__image {
  transform: scale(1.025);
}

.portfolio-card__open::after {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  background: rgba(10, 10, 10, .58);
  color: #fff;
  content: "+";
  font: 300 1.65rem/1 var(--fonts-family--geist, Geist, sans-serif);
  transition: background-color .2s ease, color .2s ease;
}

.portfolio-card__open:hover::after {
  background: var(--portfolio-accent);
  color: #07110f;
}

.portfolio-card__details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.3rem 1.35rem;
}

.portfolio-card__title {
  margin: 0;
  color: #f5f5f5;
  font: 500 1rem/1.3 var(--fonts-family--geist, Geist, sans-serif);
}

.portfolio-card__type {
  color: var(--portfolio-muted);
  font: 400 .74rem/1.2 var(--fonts-family--geist, Geist, sans-serif);
  text-align: right;
}

.portfolio-card--video .portfolio-card__image {
  aspect-ratio: 16 / 10;
  height: auto;
  min-height: 30em;
  object-fit: cover;
}

.portfolio-lightbox {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  padding: 5rem 2rem 2rem;
  overflow: hidden;
  border: 0;
  background: #080808;
  color: #fff;
}

.portfolio-lightbox::backdrop {
  background: #080808;
}

.portfolio-lightbox__close {
  position: fixed;
  z-index: 1;
  top: 1.25rem;
  left: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-height: 2.9rem;
  padding: 0 1.1rem;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font: 500 .85rem/1 var(--fonts-family--geist, Geist, sans-serif);
  cursor: pointer;
}

.portfolio-lightbox__close:hover {
  border-color: var(--portfolio-accent);
  background: var(--portfolio-accent);
  color: #07110f;
}

.portfolio-lightbox__close svg {
  width: 1rem;
  height: 1rem;
}

.portfolio-lightbox__content {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.portfolio-lightbox__media {
  display: block;
  width: auto;
  max-width: min(100%, 88rem);
  height: auto;
  max-height: calc(100% - 3.5rem);
  object-fit: contain;
  border-radius: .35rem;
}

.portfolio-lightbox__media--video {
  width: min(100%, 88rem);
}

.portfolio-lightbox__caption {
  margin: 0;
  color: #b8b8b8;
  font: 400 .85rem/1.3 var(--fonts-family--geist, Geist, sans-serif);
  text-align: center;
}

@media (max-width: 767px) {
  .portfolio-gallery-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.75rem;
  }

  .portfolio-gallery-copy {
    max-width: 32rem;
  }

  .portfolio-tabs {
    margin-right: -1.25rem;
    margin-left: -1.25rem;
    padding-right: 1.25rem;
    padding-left: 1.25rem;
  }

  .portfolio-panel {
    margin-bottom: 3.5rem;
  }

  .portfolio-panel__header {
    align-items: center;
  }

  .portfolio-panel__note {
    max-width: 20rem;
  }

  .portfolio-card {
    flex-basis: min(50vw, 34rem);
  }

  .portfolio-card__image {
    height: 62vw;
    min-height: 15rem;
    max-height: 25rem;
  }

  .portfolio-card--video .portfolio-card__image {
    min-height: 20rem;
  }

  .portfolio-lightbox {
    padding: 5rem 1rem 1rem;
  }

  .portfolio-lightbox__close {
    top: .85rem;
    left: .85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-track {
    scroll-behavior: auto;
  }

  .portfolio-card__image,
  .portfolio-tab,
  .portfolio-arrow,
  .portfolio-card__open::after {
    transition: none;
  }
}
