/* Tablet / mobile layout */
@media screen and (max-width: 959px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body.nav-open {
    overflow: hidden;
  }

  .container {
    height: auto;
    min-height: 100%;
  }

  main {
    position: relative;
    width: 100%;
    display: block;
    overflow: hidden;
  }

  /* Header */
  header {
    width: 100%;
    height: 72px;
    background-color: rgba(255, 255, 255, 0.92);
    opacity: 1;
    backdrop-filter: blur(8px);
  }

  .header__inner {
    padding: 0 16px;
  }

  .header__title {
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    width: auto;
    max-width: calc(100% - 56px);
    min-width: 0;
    margin-left: 0;
  }

  .Versear {
    position: relative;
    flex: 0 0 auto;
    padding-right: 13px;
    font-size: 28px;
  }

  .Versear::after {
    top: 10%;
    right: 0;
    height: 80%;
    margin-left: 0;
  }

  .middleline {
    font-size: 11px;
  }

  .header__nav {
    position: fixed;
    height: 100vh;
    height: 100dvh;
    padding: 72px 24px 32px;
    background-color: rgba(255, 255, 255, 0.98);
    overflow-y: auto;
    visibility: hidden;
    transition: transform .4s ease, visibility .4s;
  }

  .header__nav.active {
    visibility: visible;
  }

  .nav__items {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    width: 100%;
  }

  .nav-items__item {
    height: auto;
  }

  .nav-items__item a {
    margin-bottom: 0;
    font-size: 22px;
  }

  header .joinbtn {
    display: block;
    padding: 14px 42px;
  }

  .header__hamburger {
    box-sizing: border-box;
    flex: 0 0 auto;
    width: 40px;
    height: 48px;
    padding: 8px 4px;
  }

  .hamburger span {
    width: 32px;
  }

  .hamburger.active span:nth-child(1) {
    top: 9px;
  }

  .hamburger.active span:nth-child(3) {
    top: -9px;
  }

  /* Hero */
  .home {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh;
    min-height: 560px;
    padding: 72px 16px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
  }

  .home::after {
    position: absolute;
    inset: 0;
    z-index: 1;
    content: "";
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0.12));
  }

  .home h1,
  .home p {
    position: relative;
    z-index: 2;
  }

  .home h1 {
    font-size: clamp(46px, 15.2vw, 72px);
  }

  .home p {
    max-width: 100%;
    margin: 14px 0 0;
    font-size: clamp(11px, 3.2vw, 16px);
    line-height: 1.5;
    letter-spacing: 0.12em;
  }

  .scrolldown {
    top: 0;
    z-index: 2;
    height: 100vh;
    height: 100svh;
    min-height: 560px;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 16px 32px;
    font-size: 14px;
    pointer-events: none;
  }

  /* Let content determine section height on small screens. */
  .area {
    position: relative;
    top: auto;
    width: 100%;
    height: auto;
    min-height: 100svh;
  }

  /* About */
  .about {
    top: auto;
    padding: 104px 24px 64px;
  }

  .about h2 {
    padding: 0 0 8px;
    font-size: 20px;
  }

  .about h1 {
    padding: 0;
    font-size: clamp(29px, 8.5vw, 42px);
  }

  .about p {
    width: 100%;
    padding: 24px 0 0;
    font-size: 16px;
    line-height: 1.8;
  }

  .aboutpic {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    height: auto;
    max-height: 52vh;
    margin-top: 32px;
    object-position: center;
  }

  /* Projects */
  .projects {
    top: auto;
    height: auto;
    min-height: 100svh;
    padding: 96px 0 64px;
  }

  .projects .title,
  .projects .subtitle {
    padding-left: 24px;
  }

  .projects h1 {
    padding-bottom: 8px;
    font-size: 20px;
  }

  .projects h2 {
    font-size: clamp(42px, 13vw, 60px);
  }

  .contents {
    position: relative;
    top: auto;
    width: 100%;
    height: auto;
    margin-top: 28px;
    padding: 0;
    display: block;
  }

  .projects ul {
    display: flex;
    align-items: stretch;
    gap: 16px;
    width: 100%;
    height: auto;
    padding: 12px 24px 32px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 24px;
    -webkit-overflow-scrolling: touch;
  }

  .projects li {
    display: flex;
    flex: 0 0 min(82vw, 340px);
    width: auto;
    height: auto;
    scroll-snap-align: start;
  }

  .projects .content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    height: auto;
    min-height: 430px;
    padding: 16px;
    border: 0;
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
    white-space: normal;
  }

  .projects .sur {
    width: 100%;
    height: auto;
    padding: 0;
    aspect-ratio: 584 / 326;
  }

  .projects .sur a,
  .projects .pic {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 12px;
  }

  .projects .date {
    padding: 16px 0 6px;
    font-size: 13px;
  }

  .projects .minititle {
    padding-bottom: 12px;
    font-size: 25px;
  }

  .projects .sentence {
    flex: 1 1 auto;
    height: auto;
    font-size: 15px;
    line-height: 1.65;
  }

  /* Join */
  .back {
    position: relative;
    top: auto;
    width: 100%;
    height: auto;
    min-height: 100svh;
    background-position: center;
  }

  .join {
    width: 100%;
    height: auto;
    min-height: 100svh;
    padding: 104px 24px 64px;
    justify-content: center;
  }

  .join .char {
    width: 100%;
    margin-bottom: 40px;
  }

  .join .title {
    padding: 0 0 10px;
    font-size: 19px;
    letter-spacing: 0.35em;
  }

  .join .subtitle {
    padding: 0 0 28px;
    font-size: clamp(52px, 16vw, 76px);
  }

  .join h3 {
    font-size: 16px;
    line-height: 1.8;
  }

  .btnbox {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    width: 100%;
    max-width: 320px;
  }

  .btn {
    flex: 0 0 60px;
    width: 100%;
    height: 60px;
    margin: 0;
  }

  .atext {
    inset: 0;
    width: auto;
    height: auto;
    font-size: 20px;
  }

  /* Footer */
  footer {
    position: relative;
    top: auto;
    width: 100%;
    height: 88px;
  }

  footer div {
    height: 100%;
    margin-top: 0;
  }

  footer .icon {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    padding: 0 20px;
  }

  footer i {
    float: none;
    padding-right: 0;
    font-size: 40px;
  }
}

@media screen and (max-width: 374px) {
  .middleline {
    display: none;
  }

  .about,
  .join {
    padding-right: 20px;
    padding-left: 20px;
  }
}
