div#header {
  overflow: hidden;
  color: #fff;
  background-color: #42484E;
  background-image: url(background.jpg);
  clear: both;
  align-items: center;
  max-width: 1000px;
  min-width: 300px;
  height: auto;
  min-height: 250px;
  padding: 0;
  margin: 0 auto;
  display: flex;
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

html.dark div#header::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-image: url(background.jpg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1; /* 🔸背景を完全に後ろへ */
  filter: invert(100%) hue-rotate(180deg); /* 元の反転を打ち消す */
  pointer-events: none;
}