@layer common {
  :root {
    --base: white;
    --sub-base: whitesmoke;
    --sub-base-border: rgb(211, 211, 211);
    --accent-color: rgb(78, 114, 134);
    --main-text: rgb(48, 48, 48);
    --sub-text: rgb(88, 88, 88);
    color: var(--main-text);
    word-break: break-all;
    font-size: 16px;

    font-family: Yu Gothic, san-serif;
    font-feature-setting: "palt";

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

  .dark {
    --base: rgb(28, 28, 29);
    --sub-base: rgb(64, 66, 71);
    --sub-base-border: rgb(46, 46, 46);
    --main-text: rgb(241, 241, 241);
    --sub-text: rgb(184, 184, 184);
    color: var(--main-text);
    & a:visited {
      color: rgb(216, 149, 229);
    }
    & a:link {
      color: rgb(149, 161, 229);
    }
  }

  *::selection {
    color: white;
    background: var(--accent-color);
  }

  h2 a {
    transition: all 0.1s ease-out;
  }

  body {
    margin: 0;
    position: relative;
    background: var(--base);
    display: flex;
    min-height: 100vh;
    flex-flow: column;
    overflow-y: scroll;
    & header,
    & footer {
      flex-shrink: 0;
      flex-grow: 0;
    }
    & main {
      flex-shrink: 0;
      min-height: 100%;
      flex-grow: 1;
    }
  }
  header {
    background: var(--sub-base);
    border-bottom: 0.1rem var(--sub-base-border) solid;
    padding: 0.4rem 0.5rem 0.3rem;
    color: var(--main-text);
    font-family: "Kiwi Maru", serif;
  }
  .header {
    & nav {
      margin: auto;
      max-width: 720px;
      display: flex;
      justify-content: space-between;
    }

    & a:any-link {
      color: var(--main-text);
      text-decoration: none;
    }

    & ul {
      list-style-type: none;
      display: flex;
      padding: 0;
      gap: 1rem;
      margin: 0;
      place-items: center;
      place-content: center;
    }

    & button,
    & a {
      &:focus-visible,
      &:hover {
        outline: none;
        color: var(--base);
        background: var(--accent-color);
        color: white;
      }
    }
  }

  footer {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 144px;
    overflow: hidden;
    & img {
      transform: rotateZ(10deg);
      width: 64px;
      height: 64px;
    }
  }

  li:has(.dark-button) {
    width: 1.6rem;
    height: 1.6rem;
  }
  .dark-button {
    cursor: pointer;
    background: none;
    border: none;
    width: 1.6rem;
    height: 1.6rem;
    padding: 0;
    color: var(--main-text);

    & svg {
      width: 1.6rem;
      height: 1.6rem;
    }
    .moon {
      display: none;
    }
    .sun {
      display: block;
    }
  }
  .sun {
    display: none;
  }

  main {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1rem;
    padding-top: 2rem;
    padding-bottom: 3rem;
  }
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p {
    margin: 0;
    font-size: 1rem;
  }
  h1 {
    font-size: 2rem;
  }
}
