:root {
  --white: #FFFFFF;
  --text: #24292E;
  --dark: #2B3137;
  --border: #C8C8C8;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  color: var(--text);
  line-height: 1.7;
  margin: 0;
}

a {
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.header {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 4%;
  display: flex;
  justify-content: space-between;
  align-items: center;

  .logo {
    margin: 0;
    font-size: 28px;

    a {
      color: var(--white);
      background: var(--dark);
      padding: 8px 16px;
      font-weight: bold;
      display: inline-block;
    }
  }

  nav {
    ul {
      display: flex;
      gap: 20px;
      align-items: center;
    }

    a {
      color: var(--text);

      &:hover {
        opacity: 0.7;
      }
    }

    .icon {
      width: 20px;
    }
  }
}

.mainvisual {
  margin-bottom: 40px;

  img {
    width: 100%;
    height: 420px;
    object-fit: cover;
  }
}

.about {
  max-width: 960px;
  margin: 0 auto 80px;
  padding: 0 4%;
  font-size: 14.4px;

  h2 {
    font-size: 24px;
    text-align: center;
    margin-bottom: 65px;
  }

  ul {
    margin-bottom: 30px;

    li {
      &:first-child {
        margin-bottom: 30px;
      }
    }
  }

  p {
    text-align: justify;
  }
}

.works {
  max-width: 960px;
  margin: 0 auto 80px;
  padding: 0 4%;
  font-size: 14.4px;

  h2 {
    font-size: 24px;
    text-align: center;
    margin-bottom: 65px;
  }

  ul {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 50px;
  }

  li {
    width: 31%;
    margin-bottom: 23px;
  }
}

.news {
  max-width: 960px;
  margin: 0 auto 80px;
  padding: 0 4%;
  font-size: 14.4px;

  h2 {
    font-size: 24px;
    text-align: center;
    margin-bottom: 65px;
  }

  dl {
    display: flex;
    flex-wrap: wrap;
    border-top: 1px solid var(--border);
    margin-bottom: 20px;
  }

  dt {
    width: 20%;
    padding: 15px;
    border-bottom: 1px solid var(--border);
  }

  dd {
    width: 80%;
    padding: 15px;
    border-bottom: 1px solid var(--border);
    margin: 0;
  }
}

.contact {
  max-width: 960px;
  margin: 0 auto 80px;
  padding: 0 4%;
  font-size: 14.4px;
}

h2 {
  font-size: 24px;
  text-align: center;
  margin-bottom: 65px;
}

form {
  max-width: 900px;
  margin: 0 auto;
}

.contact form > div {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
}


label {
  width: 160px;
  padding-top: 12px;
  font-size: 14px;
  letter-spacing: 0.05em;
}

input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}

textarea {
  width: 100%;
  height: 260px;
  resize: none;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  height: 260px;
  resize: none;
}

.contact__button {
  display: block;
  width: 220px;
  margin: 40px auto 0;
  padding: 18px 0;
  background: var(--dark);
  color: var(--white);
  border: none;
  font-size: 14px;
  cursor: pointer;
}

#footer {
  background: var(--dark);
  color: var(--white);
  font-size: 8px; 
  padding: 10px 20px;
  text-align: center;
}

@media (max-width: 768px) {
  header.header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  header.header nav {
    width: 100%;
  }

  header.header nav ul {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    padding: 6px 6px 10px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  header.header nav li {
    flex: 0 0 auto;
  }

  header.header nav .icon {
    width: 20px;
    height: 20px;
    display: block;
  }

  .mainvisual img {
    width: 100%;
    height: auto;
  }

  .about, .works, .news, .contact {
    padding: 36px 16px;
  }

  .about ul {
    line-height: 1.8;
    word-break: break-word;
  }

  .works ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .works li img {
    width: 100%;
    height: auto;
    display: block;
  }

  .news dl {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .news dt {
    font-weight: 700;
  }

  .news dd {
    margin: 0 0 8px;
  }

  .contact form > div {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
  }

  .contact label {
    font-size: 14px;
  }

  .contact input,
  .contact textarea {
    width: 100%;
  }

  .contact textarea {
    min-height: 140px;
  }

  .contact__button {
    width: 100%;
  }
  .works li {
    width: auto;
    margin-bottom: 0;
  }
}

@media (max-width: 420px) {
  .works ul {
    grid-template-columns: 1fr;
  }
}
