:root {
  --backgroundColor: #f7f8f8;
  --headerColor: #343434;
  --textColor: #343434;
  --lightTextColor: #999;
  --selectionBackgroundColor: cornsilk;
  --linkColor: black;
  --shadowColor: rgba(0, 0, 0, 0.3);
  --codeColor: #444;
  --codeBackgroundColor: #f2f2f2;
  --borderColor: #eee;

  --headerFont: "SF Pro Display", -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  --textFont: "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  --textFontJapanese: Inter, GenJyuuGothicL, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "BIZ UDPGothic", Meiryo, sans-serif;
  --sans-serif: "pt sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Droid Sans", "Helvetica Neue", "Hiragino Sans TC", "Droid Sans Fallback", "Microsoft YaHei", sans-serif;
  --monoFont: SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas, monospace;;
}

@media (prefers-color-scheme: dark) {
  :root {
    --backgroundColor: #08090a;
    --headerColor: #f7f8f8;
    --textColor: #d0d6e0;
    --lightTextColor: #8a8f98;
    --selectionBackgroundColor: midnightblue;
    --linkColor: #717ce1;
    --shadowColor: rgba(0, 0, 0, 0.7);

    --codeColor: white;
    --codeBackgroundColor: #121212;
  }
}

::selection {
  background-color: var(--selectionBackgroundColor);
}

html {
  font-size: 14px;

  @media screen and (max-width: 1080px) {
    font-size: 12px;
  }
}

body {
  background-color: var(--backgroundColor);
  color: var(--textColor);

  font-family: var(--textFont);

  line-height: 1.7;
  padding: 0 2.5em;
  margin: 0;
  font-size: 1.5em;
  word-wrap: break-word;

  code {
    font-size: 1em;
  }
}

body:lang(ja) {
  font-family: var(--textFontJapanese);
}

footer {
  margin-top: 1em;
  margin-bottom: .5em;
}

small {
  color: var(--lightTextColor);
  font-size: .75em;
}

a {
  color: var(--linkColor);
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  text-decoration: underline;
}

small a {
  color: var(--lightTextColor);
  font-weight: 500;
}

nav {
  display: flex;
  flex-wrap: wrap;

  column-gap: 1em;
  margin: .5em 0;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--headerColor);

  font-family: var(--headerFont);
  font-weight: bold;

  margin: 1.4em 0 0 0;
}

h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
  color: var(--headerColor);
}

blockquote {
  box-shadow: inset 0 0 1em -0.5em var(--borderColor);
  color: var(--lightTextColor);
  padding: 0.5em 0.5em 0.5em 2em;
  margin: 0.5em 0 0.5em;
  border-radius: 0.25em;
}

img, figure {
  border-radius: 3px;
  width: 100%;
  margin: 0 auto;
}

figcaption {
  color: var(--lightTextColor);

  width: 100%;
  left: 0;
  margin-top: -.15em;

  font-size: 0.75em;
  font-weight: 400;

  text-align: center;
}

time {
  font-size: 1rem;
  color: var(--lightTextColor);
}

code {
  font-size: 0.8em;
}

pre {
  white-space: pre-wrap;
}

pre code {
  font-size: 0.8em;
}

.code {
  font-family: var(--monoFont);
  font-size: 0.8em;
  color: var(--codeColor);
  background-color: var(--codeBackgroundColor);

  overflow-x: auto;
  overflow-wrap: break-word;

  position: relative;

  margin: 0;
  padding: .6em 1em;

  border-radius: 6px;
  tab-size: 2;
}

.code pre {
  background-color: var(--codeBackgroundColor);
  color: var(--codeColor);

  overflow-x: auto;
  border-radius: 5px;
  font-size: 1em;
  line-height: 1.5;
}

.grid {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
}

.grid-center {
  grid-column: 4 / -4;
  @media screen and (max-width: 1080px) {
    width: 100%;
    grid-column: 1 / -1;
  }
  @media screen and (min-width: 1081px) {
    width: 100%;
    grid-column: 2 / -2;
  }
  @media screen and (min-width: 1536px) {
    grid-column: 8 / -8;
  }
}

.intro {
  font-weight: 400;
  margin-top: -.5em;
  font-size: .75em;
  color: var(--lightTextColor);
}

.margin-bottom {
  margin-bottom: 1em;
}

.margin-bottom-xl {
  margin-bottom: 3em;
}

.margin-bottom-2xl {
  margin-bottom: 6em;
}

.full-width {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-top: 5vh;
  margin-bottom: 5vh;
}

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

