html, body {
  margin: 0;
  padding: 0;
  font-size: 21px;
  font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif;
  letter-spacing: 0.06em;
  line-height: 1.6;
  color: #000;
  background: #fff;
}

html {
  scroll-behavior: smooth;
}



#works {
  scroll-margin-top: 100px;
}

body {
  padding: 40px;
  opacity: 0;
  transition: opacity 1s ease;
}

body.loaded {
  opacity: 1;
}

.wrapper {
  width: 750px;
  margin: 0;
  padding: 0;
}

@media screen and (max-width: 1080px) {
  .wrapper {
    width: 100%;
    padding: 0;
    box-sizing: border-box;
  }
}

h1 {
  position: fixed;
  top: 40px;
  left: 38px;
  font-size: 2rem;
  font-weight: normal;
  margin: 0;
  letter-spacing: 0.02em;
  line-height: 1;
  z-index: 1000;
  color: white; /* default */
  mix-blend-mode: difference;
  pointer-events: none;
  transition: color 0.3s ease;
}

h1 a,
h1 a:visited,
h1 a:hover,
h1 a:active {
  color: inherit;
  text-decoration: none;
  pointer-events: auto;
}




nav {
  margin: 0;
}

a,
a:visited {
  color: #000;
  text-decoration: none;
}

a:hover,
a:active {
  color: rgba(0, 0, 0, 0.6);
}

p {
  margin-bottom: 0;
  word-break: break-word;
  line-break: strict;
}

p:first-of-type {
  margin-top: 80px;
}

hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 2em 0;
}

.half-space {
  display: block;
  height: 0.5em;
}

.figure {
  max-width: 1400px;
  margin: 0 auto 20px auto;
  text-align: left;
}

@media screen and (min-width: 1024px) {
  .horizontal-pair {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto 0 auto;
  }

  .horizontal-pair img {
    width: calc(50% - 10px);
    height: auto;
    display: block;
  }
  
  .horizontal-pair2 {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto 20px auto;
  }

  .horizontal-pair2 img {
    width: calc(50% - 10px);
    height: auto;
    display: block;
  }
}


@media screen and (max-width: 1024px) {
  .horizontal-pair {
    display: block;
    margin-bottom: 0;
  }

  .horizontal-pair img {
    width: 100%;
    display: block;
  }

  .horizontal-pair img:not(:last-child) {
    margin-bottom: 14px;
  }

  .horizontal-pair2 {
    display: block;
    margin-bottom: 14px;
  }

  .horizontal-pair2 img {
    width: 100%;
    display: block;
  }

  .horizontal-pair2 img:not(:last-child) {
    margin-bottom: 14px;
  }
  
}

.figure img,
.figure video {
  display: block;
  width: 100%;
  height: auto;
}

a.figure {
  display: block;
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
  outline: none;
}

a.figure:hover .caption {
  opacity: 0.6;
}

a.figure:focus,
a.figure:focus-visible {
  outline: none;
}

.caption {
  font-size: 1em;
  margin-top: 0.5em;
  margin-bottom: 2.7em;
}

.note {
  font-size: 1em;
  line-height: 1.6;
  margin-top: 1em;
  margin-bottom: 2em;
  max-width: 70%;
  width: 100%;
  text-align: left;
  margin-left: 0;
  margin-right: auto;
}

.footer-note {
  font-size: 1em;
  letter-spacing: 0.06em;
  line-height: 1.6;
  color: #000;
  margin-top: 0;
  margin-bottom: 0;
}

@media screen and (max-width: 768px) {
  body {
    padding: 0;
    font-size: 16px;
  }

  #works {
    scroll-margin-top: 80px;
  }

  .wrapper {
    padding: 0 18px;
  }

  h1 {
    top: 20px;
    left: 17px;
    font-size: 1.5rem;
  }

  .figure {
    width: 100vw;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 14px;
    max-width: none;
  }

  .figure img,
  .figure video {
    width: 100%;
    height: auto;
    display: block;
  }

  .caption {
    font-size: 1em;
    margin-top: 0.5em;
    padding: 0 18px;
    margin-bottom: 2.5em;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .note {
    font-size: 1em;
    max-width: 100%;
    padding: 0 18px;
    box-sizing: border-box;
  }

  .footer-note {
    font-size: 1em;
    padding: 0 18px;
    margin-top: 2em;
    margin-bottom: 18px;
  }
}




/* 2. Optional: fallback for unsupported browsers */
@supports not (mix-blend-mode: difference) {
  h1 {
    color: black; /* fallback color */
  }
}

/* 3. Optional helper if needed for dark/light toggling (can be JS controlled) */
body.dark-background h1 {
  color: white;
  mix-blend-mode: normal;
}

body.light-background h1 {
  color: black;
  mix-blend-mode: normal;
}
