@font-face {
  font-family: "Local Noto Sans JP";
  src: local("Noto Sans JP");
}

:root {
  --text-color: #111;
  --background-color: #FAFAFA;
  --border-color: #555;
  --link-text-color: #0096FA;
  --visited-text-color: #8247B9;
  --active-text-color: #F55151;

  @media (prefers-color-scheme: dark) {
    --text-color: #EEE;
    --background-color: #101010;
    --border-color: #AAA;
    --link-text-color: #9E9EFF;
    --visited-text-color: #D0ADF0;
    --active-text-color: #FF9E9E;
  }
}

body {
  font-family: "Local Noto Sans JP", "Noto Sans JP", sans-serif;
  font-synthesis: none;
  font-feature-settings: "palt";
  letter-spacing: 0.03em;
  color: var(--text-color);
  background: var(--background-color);

  :any-link, :any-link:active {
    text-underline-position: from-font;
  }
}

header, section {
  margin-block: 10px;
  margin-inline: 20px;

  @media (width < 600px) {
    margin-inline: 10px;
  }

  @media (width >= 1040px) {
    width: 1000px;
    margin-inline: auto;
  }

  img {
    display: inline flow;
  }
}

ul {
  padding-inline-start: 30px;
  line-height: 1.75em;
  -webkit-hyphens: auto;
  hyphens: auto;
}

p {
  margin-inline: 1em;
  text-align: justify;
  text-justify: inter-character;
  line-height: 1.75em;
  -webkit-hyphens: auto;
  hyphens: auto;

  @media (width < 600px) {
    margin-inline: 0;
  }
}

img {
  display: block flow;
  margin-inline: 1em;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  -webkit-hyphens: auto;
  hyphens: auto;
  scroll-margin-block-start: 15px;

  :any-link, :any-link:active {
    color: var(--text-color);
    text-decoration: unset;

    &:hover {
      -webkit-text-decoration: underline solid;
      text-decoration: underline solid;
      text-decoration-thickness: from-font;
    }
  }
}

body > hr {
  margin-block: 3em;
  border-block-start: 1px dashed var(--border-color);

  &::after {
    content: "\002702";
    display: inline flow-root;
    position: relative;
    inset-block-start: 50%;
    inset-inline-start: 15%;
    transform: translateY(-55%);
    color: var(--border-color);
    background: var(--background-color);
    font-size: 20px;
  }
}

details {
  margin-block: 2em;
  margin-inline: 20px;

  > p {
    margin-inline: 0;
  }

  > hr {
    width: 4em;
    margin-block: 2em 0;
  }
}

em {
  font-style: normal;
  quotes: "“" "”";

  &::before {
    content: open-quote;
  }

  &::after {
    content: close-quote;
  }
}

.spacing:not(.first-words)::before, .spacing:not(.last-words)::after {
  content: "\2006";
  font-size: 75%;
}

@media (width < 600px) {
  .indent {
    padding-inline-start: 1em;
  }
}

:link {
  color: var(--link-text-color);
}

:visited {
  color: var(--visited-text-color);
}

:any-link:active {
  color: var(--active-text-color);
}
