@charset "utf-8";

body {
  background: #fafafa;
}

body {
  display: flex;
  flex-direction: column;
  font-family: "Poppins", "Noto Sans JP", sans-serif;
  font-weight: 400;
  line-height: 1.4;

  img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
  }

  .footer {
    padding:  2rem;

    a {
      color: inherit;
      text-decoration: none;
    }
  }
}

.projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 4rem 2rem;
  margin: 4rem auto;

  @media (max-width: 1000px) {
    grid-template-columns: 1fr 1fr;
  }

  @media (max-width: 600px) {
    grid-gap: 2rem 1rem;
  }

  .project {
    color: inherit;
    text-decoration: none;

    &:first-child {
      @media (max-width: 600px) {
        grid-column-start: 1;
        grid-column-end: 3;
      }
    }

    &:hover {
      .project-image {
        img {
          transform: scale(1.2);
        }
      }
    }

    .project-image {
      aspect-ratio: 1.6;
      width: 100%;
      overflow: hidden;

      img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: .2s;
      }
    }
    .project-title {
      margin-top: 8px;
      font-weight: 500;

      @media (max-width: 600px) {
        font-size: 12px;
      }
    }
    .project-tagline {
      margin-top: .5rem;
      color: #888;
      font-size: .8rem;
    }
    .project-description {
      margin-top: 1rem;
      color: #aaa;
      font-size: .9rem;
    }
  }
}

.episodes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 4rem;
  margin: 4rem auto;

  @media (max-width: calc(1400px + 8rem)) {
    grid-gap: 4rem 2rem;
  }

  @media (max-width: 1000px) {
    grid-template-columns: 1fr 1fr;
    grid-template-columns: repeat(3, 1fr);
  }

  @media (max-width: 800px) {
    grid-gap: 4px;
  }

  .episode {
    color: inherit;
    text-decoration: none;

    &:hover {
      .episode-image {
        img {
          transform: scale(1.2);
        }
      }
    }

    .episode-image {
      aspect-ratio: 1;
      width: 100%;
      overflow: hidden;

      img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: .2s;
      }
    }
    .episode-title {
      margin-top: 8px;
      font-weight: 500;

      @media (max-width: 800px) {
        display: none;
      }
    }
  }
}

.page {
  margin: auto;
  width: 1000px;
  max-width: calc(100% - 4rem);

  &.home {
    width: 1400px;
  }

  &.project {
    width: 1400px;

    .page-header {
      .page-header-image {
        display: block;
        aspect-ratio: 1;
        margin: auto;
        width: 200px;

        img {
          width: 100%;
          height: 100%;
          object-fit: cover;
          border-radius: 50%;
        }
      }

      .project-title {
        margin-top: 2rem;
        font-size: 1rem;
        font-weight: 500;
      }

      .project-tagline {
        margin-top: .5rem;
        color: #888;
        font-size: .8rem;
      }
    }
  }

  &.episode {

  }

  .page-header {
    margin: calc(2rem + 3rem + 4rem) 0 4rem;
    text-align: center;

    a {
      color: inherit;
      text-decoration: none;
    }

    .episode-title {
      margin-top: .5rem;
      font-size: 2rem;
      font-weight: 500;
    }
  }

  .page-body {
    margin: 4rem 0;
  }

  .episode-content {
    line-height: 1.6;

    & > * + * {
      margin-top: 1rem;
    }

    h2 {
      margin: 2rem 0 1rem;
      font-size: 1.2rem;
      font-weight: 500;

      &:first-child {
        margin-top: 0;
      }
    }

    img {
      border: 1px solid #ddd;
    }

    figcaption {
      margin-top: .5rem;
      color: #888;
      font-size: .9rem;
      font-style: italic;
      text-align: right;
    }

    blockquote {
      padding: 1rem;
      background: #fafafa;
      border: 1px solid #ddd;
    }
  }
}

/*

  header

*/

.header-site-title {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: inherit;
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;

  .header-site-title-image {
    display: flex;
    width: 1.2rem;
    height: auto;

    img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      vertical-align: baseline;
    }
  }
}

.header-nav-btn {
  position: fixed;
  z-index: 200;
  top: 0;
  right: 0;
  display: none;
  aspect-ratio: 1;
  height: 80px;
  cursor: pointer;
  
  @media (max-width: 1000px) {
    display: block;
  }

  &:before,
  &:after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    display: block;
    margin: auto;
    width: 2rem;
    height: 4px;
    background: #fff;
    transition: .4s;
  }

  &:before {
    top: calc((100% - 1rem) / 2);
  }
  &:after {
    bottom: calc((100% - 1rem) / 2);
  }

  &.active {
    &:before {
      top: calc(50% - 2px);
      transform: rotate(225deg);
    }
    &:after {
      bottom: calc(50% - 2px);
      transform: rotate(-225deg);
    }
  }
}

.header-nav {
  position: fixed;
  z-index: 150;
  top: 0;
  left: 100vw;
  right: -100vw;
  bottom: 0;
  padding:  calc(2rem + 3rem + 2rem) 2rem 4rem;
  background: #fafafafa;
  transition: .4s;

  &.active {
    left: 10%;
    right: 0;
  }

  nav {
    ul {
      flex-direction: column;
      align-items: flex-start;

      &:not(:first-child) {
        margin-top: 2rem;
      }

      li {
        font-size: 1.6rem;
        font-weight: 600;

        a {
          img {
            width: 3rem;
          }
        }
      }
    }
  }

  .list-icon {
    display: flex;
    gap: 1rem;

    a {
      display: flex;
      align-items: center;
      justify-content: center;
      aspect-ratio: 1;
      padding: 30%;
      width: 3rem;
      background: #eee;
      border-radius: 50%;
      
      img {
        width: 100%;
        height: 100%;
        object-fit: contain;
      }
    }
  }
}

/*

  footer

*/

.footer-nav {
  position: fixed;
  z-index: 100;
  left: 1rem;
  bottom: 2rem;
}


/*
  PWA
*/

.pwa {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  &.active {
    @media (max-width: 600px) {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }
  }
}

.pwa-version-area {
  margin-top: 4rem;
  .pwa-version {
    margin-top: .5rem;
    font-size: .8rem;
    font-weight: 500;
    text-align: center;
  }
}

.update-btn {
  display: block;
  padding: 1rem;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 3rem;
}


.btn-nav {
  position: fixed;
  z-index: 1000;
  top: 2rem;
  right: 2rem;
  aspect-ratio: 1;
  width: 3rem;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 50%;
  cursor: pointer;
  transition: .2s;

  &:hover {
    transform: scale(1.1);
  }

  &.active {
    &:before {
      top: calc(50% - .5px);
      transform: rotate(225deg) scale(1.2);
    }
    &:after {
      bottom: calc(50% - .5px);
      transform: rotate(-225deg) scale(1.2);
    }
  }

  &:before,
  &:after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    margin: auto;
    width: 1rem;
    height: 1px;
    background: #000;
    transition: .2s;
  }

  &:before {
    top: 40%;
  }

  &:after {
    bottom: 40%;
  }
}


/* page */
.page-nav {
  .btn {
    position: fixed;
    z-index: 1000;
    top: 2rem;
    left: 2rem;
    aspect-ratio: 1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 3rem;
    background: #fafafa;
    color: inherit;
    border: 1px solid #ddd;
    border-radius: 50%;
    text-decoration: none;
    transition: .2s;

    &:hover {
      background: #eee;
    }
  }
  .btn-back {
    position: fixed;
    z-index: 1000;
    top: 2rem;
    left: 2rem;
    aspect-ratio: 1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 3rem;
    background: #fafafa;
    color: inherit;
    border: 1px solid #ddd;
    border-radius: 50%;
    text-decoration: none;
    transition: .2s;

    &:hover {
      background: #eee;
    }
  }
}