/* ——— BRANDING OUR WORK ——— */
.brand-work {
  padding: 4rem clamp(1.25rem, 4vw, 3.5rem) 5rem;
  background: var(--black);
}

.brand-work .section-head {
  text-align: start;
  max-width: var(--max);
  margin: 0 auto 2.5rem;
  width: 100%;
}

.brand-work .section-head h2 {
  font-size: clamp(1.85rem, 3.8vw, 2.85rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.brand-work .section-head__lead {
  font-size: 0.98rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.7;
  max-width: 36rem;
  width: 100%;
}

.brand-work__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(0.85rem, 1.6vw, 1.35rem);
  max-width: var(--max);
  margin: 0 auto;
}

.bw-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 2.5rem;
  overflow: hidden;
  cursor: pointer;
  background: #111;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

.bw-card:nth-child(1),
.bw-card:nth-child(2) {
  grid-column: span 3;
  aspect-ratio: 16 / 10;
}

.bw-card:nth-child(n + 3) {
  grid-column: span 2;
  aspect-ratio: 3 / 4;
}

.bw-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s ease;
}

.bw-card__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  background: rgb(0 0 0 / 90%);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.bw-card__logo {
  width: auto;
  height: auto;
  max-width: min(48%, 160px);
  max-height: 56px;
  object-fit: contain;
  transform: translateY(8px) scale(0.94);
  transition: transform 0.35s ease;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.35));
}

.bw-card:hover .bw-card__overlay,
.bw-card:focus-visible .bw-card__overlay {
  opacity: 1;
}

.bw-card:hover .bw-card__logo,
.bw-card:focus-visible .bw-card__logo {
  transform: translateY(0) scale(1);
}

.bw-card:hover .bw-card__img,
.bw-card:focus-visible .bw-card__img {
  transform: scale(1.04);
}

.bw-card:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

/* ——— MODAL PREVIEW ——— */
.bw-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  background: rgba(0, 0, 0, 0.82);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bw-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.bw-modal__dialog {
  position: relative;
  width: min(1120px, 94vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.bw-modal__close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.bw-modal__close svg {
  width: 20px;
  height: 20px;
}

.bw-modal__frame {
  background: #0a0a0a;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(92vh - 2.75rem);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--red) transparent;
}

.bw-modal__frame::-webkit-scrollbar {
  width: 8px;
}

.bw-modal__frame::-webkit-scrollbar-track {
  background: transparent;
}

.bw-modal__frame::-webkit-scrollbar-thumb {
  background: var(--red);
  border-radius: 999px;
}

.bw-modal__frame::-webkit-scrollbar-thumb:hover {
  background: var(--red-soft);
}

.bw-modal__img {
  display: block;
  width: 100%;
  height: auto;
}

body.bw-modal-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .brand-work__grid {
    grid-template-columns: 1fr 1fr;
  }

  .bw-card:nth-child(1),
  .bw-card:nth-child(2),
  .bw-card:nth-child(n + 3) {
    grid-column: span 1;
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 640px) {
  .brand-work {
    padding-top: 3rem;
    padding-bottom: 3.5rem;
  }

  .brand-work__grid {
    grid-template-columns: 1fr;
  }

  .bw-card {
    border-radius: 1.75rem;
  }

  .bw-card:nth-child(1),
  .bw-card:nth-child(2),
  .bw-card:nth-child(n + 3) {
    aspect-ratio: 16 / 11;
  }

  .bw-modal {
    padding: 1rem;
  }

  .bw-modal__dialog {
    width: 100%;
    max-height: 90vh;
  }

  .bw-modal__frame {
    max-height: calc(90vh - 2.5rem);
  }

  .bw-modal__close {
    top: -2.15rem;
  }
}
