/*
  このリセットは以下を参考にしています：

  A Modern CSS Reset
  https://www.joshwcomeau.com/css/custom-css-reset/
*/
*, *::before, *::after {
  box-sizing: border-box;
}

*:not(dialog) {
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
  font-weight: inherit;
}

/**
  CSS Variables
*/
:root {
  --color-primary: #594e52;
  --color-secondary: #2f4f9d;
  --color-background: #fffff9;
  --color-background-dark: #f0efd8;
  --color-text: #333333;
  --color-white: #ffffff;
}

/**
  Common
*/
body {
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 400;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.3s ease;
}
a:hover {
  opacity: 0.7;
}

ul {
  padding-inline-start: 0;
}

li {
  list-style: none;
}

.sp-only {
  display: none;
}

.container {
  width: min(1080px, 100%);
  padding: 80px 40px;
  margin: 0 auto;
}

/* Button */
/** HOMEに戻るボタン */
.home-back-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 180px;
  height: 48px;
  color: var(--color-secondary);
  background-color: var(--color-white);
  border: 1px solid var(--color-secondary);
  border-radius: 24px;
  font-size: 18px;
}

.home-back-button::before {
  content: "\f015";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 14px;
  color: var(--color-secondary);
}

/* Section */
section {
  scroll-margin-top: 80px;
}

.section__title {
  font-size: 36px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 60px;
}

/**
  Header
*/
.header {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: 60px;
  padding-right: 60px;
  height: 80px;
  background-color: var(--color-primary);
  color: var(--color-white);
}

.header__title {
  font-size: 36px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.header__hamburger {
  display: none;
}

.header__nav-list {
  display: flex;
  gap: 30px;
  font-size: 20px;
}

/**
  Hero
*/
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 752px;
  background-color: var(--color-background-dark);
}

.hero__title {
  font-size: clamp(48px, 10vw, 128px);
  font-family: "Caveat", cursive;
  margin-bottom: 80px;
}

.hero__body {
  text-align: center;
}

.hero__text {
  font-size: 32px;
  line-height: 1.75;
}

/**
  About
*/
.about__text {
  font-size: 18px;
  line-height: 1.75;
}

/**
  Skills
*/
.skills .container {
  padding-bottom: 10px;
}

.skills__category {
  margin-bottom: 50px;
}

.skills__title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
}

.skills__item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding: 20px 0;
}

.skills__item.skills__item--simple {
  display: block;
  padding-left: 20px;
}

.skills__sub-title {
  font-weight: 400;
  font-size: 20px;
  padding-left: 20px;
}

.skills__text {
  font-size: 18px;
}

/**
  Works
*/
.works .container {
  padding-bottom: 160px;
}

.works__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  justify-items: center;
}

/* work-card */
.work-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  background-color: var(--color-background-dark);
  padding: 40px;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

.work-card__image {
  width: 100%;
  margin-bottom: 30px;
}

.work-card__title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 30px;
}

.work-card__list {
  padding-inline-start: 20px;
  margin-bottom: 30px;
}

.work-card__item {
  font-size: 18px;
  list-style: disc;
}

.work-card__button {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: auto auto 0;
  font-size: 18px;
  background-color: var(--color-secondary);
  color: var(--color-white);
  width: 160px;
  height: 48px;
  border-radius: 24px;
}

/**
  Footer
*/
.footer {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--color-primary);
  gap: 8px;
  padding-top: 24px;
  padding-bottom: 24px;
}

.footer__github-link {
  color: var(--color-white);
  font-size: 24px;
  line-height: 1;
}

.footer__text {
  font-size: 14px;
  color: var(--color-white);
}

/**
  Responsive
*/
@media screen and (max-width: 767px) {
  /**
    SP - Common
  */
  .sp-only {
    display: block;
  }

  .container {
    padding: 40px 30px;
  }

  /* Section */
  .section__title {
    font-size: 24px;
    margin-bottom: 30px;
  }

  /**
    SP - Header
  */
  .header {
    padding: 0 20px;
  }

  .header__title {
    font-size: 24px;
  }

  .header__hamburger {
    display: block;
    position: relative;
    z-index: 100;
    width: 32px;
    height: 24px;
    cursor: pointer;
    background-color: transparent;
    border: none;
    padding: 0;
  }

  .header__hamburger span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-white);
    transition: transform 0.3s ease, opacity 0.3s ease, top 0.3s ease;
  }

  .header__hamburger span:nth-child(1) {
    top: 0;
  }

  .header__hamburger span:nth-child(2) {
    top: 11px;
  }

  .header__hamburger span:nth-child(3) {
    top: 22px;
  }

  .header__hamburger.active span:nth-child(1) {
    top: 11px;
    transform: rotate(45deg);
  }

  .header__hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .header__hamburger.active span:nth-child(3) {
    top: 11px;
    transform: rotate(-45deg);
  }

  .header__nav {
    position: fixed;
    inset: 0;

    width: 100%;
    height: 100vh;

    background-color: rgba(89, 78, 82, 0.9);

    display: flex;
    justify-content: center;
    align-items: center;

    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);

    transition:
      opacity 0.3s ease,
      transform 0.3s ease,
      visibility 0.3s ease;
  }

  .header__nav.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .header__nav-list {
    flex-direction: column;
    align-items: center;
    gap: 32px;
    font-size: 24px;
  }

  /**
    SP - Hero
  */
  .hero__title {
    font-size: 48px;
  }

  .hero__text {
    font-size: 18px;
  }

  /**
    SP - About
  */
  .about__text {
    font-size: 16px;
  }

  /**
    SP - Skills
  */
  .skills__category {
    margin-bottom: 30px;
  }

  .skills__title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
  }
  .skills__item {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 16px 0;
  }

  .skills__item.skills__item--simple {
    padding-left: 0;
  }

  .skills__sub-title {
    font-weight: 700;
    font-size: 18px;
  }

  .skills__text {
    font-size: 16px;
    padding-left: 20px;
  }
  /**
    SP - Works
  */
  .works__list {
    grid-template-columns: 1fr;
  }

  .work-card__title {
    font-size: 20px;
  }

  .work-card__list{
    padding-inline-start: 16px;
  }

  .work-card__item {
    font-size: 16px;
  }
}