/* One persistent project bar shared by every full case study. */
#project-dialog > .dialog-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  width: 100%;
  min-height: 82px;
  margin: 0 !important;
  padding: 10px max(30px, 4vw);
  gap: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  background: linear-gradient(90deg, rgba(13, 14, 20, .98), rgba(13, 14, 20, .9) 50%, rgba(13, 14, 20, .98));
  color: #f4f1ec;
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  backdrop-filter: blur(20px) saturate(1.2);
  box-shadow: 0 15px 40px rgba(0, 0, 0, .22);
}

#project-dialog .project-nav-brand {
  display: flex;
  align-items: center;
  gap: 17px;
  margin: 0;
  color: #f4f1ec;
  white-space: nowrap;
}

#project-dialog .project-nav-brand b {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
}

#project-dialog .project-nav-brand small {
  position: relative;
  padding-left: 18px;
  color: #858999;
  font-size: 9px;
  letter-spacing: .15em;
}

#project-dialog .project-nav-brand small::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 9px;
  height: 1px;
  background: #ff744d;
}

#project-dialog .project-nav-identity {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  column-gap: 14px;
  row-gap: 3px;
  min-width: 0;
  text-align: left;
}

#project-dialog .project-nav-index {
  grid-row: 1 / 3;
  align-self: stretch;
  display: flex;
  align-items: center;
  padding-right: 14px;
  border-right: 1px solid rgba(255, 255, 255, .17);
  color: #ff8a68;
  font: 500 9px/1.3 'DM Sans', sans-serif;
  letter-spacing: .12em;
  white-space: nowrap;
}

#project-dialog .project-nav-title {
  max-width: 430px;
  overflow: hidden;
  color: #f4f1ec;
  font: 500 clamp(14px, 1.25vw, 18px)/1.15 'Manrope', sans-serif;
  letter-spacing: -.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#project-dialog .project-nav-type {
  color: #7f8493;
  font-size: 8px;
  line-height: 1;
  letter-spacing: .16em;
  white-space: nowrap;
}

#project-dialog .close-dialog {
  position: relative;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 6px 7px 6px 18px;
  overflow: visible;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  background: rgba(9, 10, 16, .72);
  color: #f4f1ec;
  box-shadow: 0 13px 36px rgba(0, 0, 0, .34);
  transition: transform .32s cubic-bezier(.2, .8, .2, 1), border-color .32s ease, background .32s ease;
}

#project-dialog .close-dialog::before {
  content: '';
  position: absolute;
  inset: -4px;
  z-index: -1;
  border: 1px solid rgba(255, 116, 77, .34);
  border-radius: inherit;
  opacity: .62;
  transition: inset .32s cubic-bezier(.2, .8, .2, 1), opacity .32s ease;
}

#project-dialog .close-label {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .11em;
  text-transform: uppercase;
}

#project-dialog .close-icon {
  display: grid;
  width: 38px;
  height: 38px;
  margin: 0;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #ff744d;
  color: #160d0b;
  font-family: Arial, sans-serif;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), background .25s ease;
}

#project-dialog .close-dialog:hover,
#project-dialog .close-dialog:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, .36);
  background: rgba(16, 17, 25, .96);
}

#project-dialog .close-dialog:hover::before,
#project-dialog .close-dialog:focus-visible::before {
  inset: -7px;
  opacity: 1;
}

#project-dialog .close-dialog:hover .close-icon,
#project-dialog .close-dialog:focus-visible .close-icon {
  transform: rotate(90deg);
  background: #ff8a68;
}

@media (min-width: 1700px) {
  #project-dialog > .dialog-header {
    padding-inline: max(4vw, calc((100vw - 1600px) / 2));
  }
  #project-dialog .project-pagination {
    padding-inline: max(5vw, calc((100vw - 1600px) / 2));
  }
}

@media (min-width: 2400px) {
  #project-dialog > .dialog-header {
    padding-inline: max(4vw, calc((100vw - 1720px) / 2));
  }
  #project-dialog .project-pagination {
    padding-inline: max(5vw, calc((100vw - 1720px) / 2));
  }
}

@media (max-width: 900px) {
  #project-dialog > .dialog-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding-inline: 22px;
    gap: 18px;
  }

  #project-dialog .project-nav-brand small,
  #project-dialog .project-nav-type {
    display: none;
  }

  #project-dialog .project-nav-title {
    max-width: 270px;
  }
}

@media (max-width: 700px) {
  #project-dialog > .dialog-header {
    min-height: 68px;
    padding: 8px 13px 8px 16px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  #project-dialog .project-nav-brand {
    display: none;
  }

  #project-dialog .project-nav-identity {
    justify-content: start;
    column-gap: 10px;
  }

  #project-dialog .project-nav-index {
    padding-right: 10px;
    font-size: 8px;
  }

  #project-dialog .project-nav-title {
    max-width: min(48vw, 220px);
    font-size: 13px;
  }

  #project-dialog .close-dialog {
    width: 46px;
    min-height: 46px;
    padding: 4px;
    gap: 0;
  }

  #project-dialog .close-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  #project-dialog .close-icon {
    width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #project-dialog .close-dialog,
  #project-dialog .close-dialog::before,
  #project-dialog .close-icon {
    transition: none;
  }
}
