html {
    scroll-behavior: smooth;
  }

body {
    margin: 0;
    font-family: sans-serif;
    background: #f5f5f5;
  }
  
  main {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    position: relative;
    padding: 0 2em;
    background: #fff;
    overflow: hidden;
  }
  
  .menu {
    display: flex;
    flex-direction: column;
    gap: 2em;
  }
  
  .menu a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 300px;
    height: 40px;
    background-color: #4e85ff;
    color: #ffffff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.5em;
    transition: background-color 0.2s ease, transform 0.1s ease;
  }
  
  .menu a:hover {
    background-color: #2a60d6; 
    transform: scale(1.05);
  }
  
  .menu.left {
    margin-right: 2em;
    text-align: right;
  }
  
  .menu.right {
    margin-left: 2em;
    text-align: left;
  }
  
  .main-visual img {
    max-width: 30vw;
    object-fit: contain;
    border-radius: 12px;
  }
  
  

  /* セクション */

  section{
    max-width: 1080px;
    margin: 0 auto 2em;
    padding: 1em;
  }

  h2 {
    text-align: center;
    font-size: 1.5em;
    color: #091d4b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1em; /* 線とテキストの間のスペース */
  }
  
  h2::before,
  h2::after {
    content: "";
    flex: 1;
    height: 2px;
    background: #4e85ff;
  }
  
  h2 span {
    white-space: nowrap; /* テキストの折り返し防止 */
  }  
  
  /* フッター */

  .profile {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.profile-img {
    background-color: #fff;
    width: 240px; /* 固定幅 */
    height: 240px; /* 固定高さ */
    border-radius: 50%;
    position: relative;
    overflow: hidden;
}

.profile-img img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

  
  .profile-text {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .profile-text dt {
    width: 100%;
    background-color: #4e85ff;
    color: white;
    padding: 0.5em;
    font-weight: bold;
    border-radius: 5px;
  }
  
  .profile-text dd {
    padding: 0.5em;
    margin: 0; /* ddに余白をなくす */
  }

  .footer {
    padding: 2em;
    background: #ddd;
    display: flex;
    flex-direction: column;
    gap: 1em;
    text-align: center;
  }
  .footer h2 {
    margin-bottom: 0.5em;
  }
  
/* モーダル呼び出しリスト */

.works {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2em;
    justify-items: center;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0;
  }
  
  .works li {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 10px;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }

  .works li:hover{
    opacity: 0.5;
    transition: 0.1s ease;
    transform: scale(1.05);
  }
  
  .works li img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  /* モーダル関連 */
  
  .modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    display: flex;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .modal.show {
    opacity: 1;
    pointer-events: auto;
  }
  
  .modal-content {
    background: #fff;
    padding: 20px;
    width: 800px;         /* ← 横幅を統一 */
    max-width: 95vw;      /* ← スマホや小さい画面対応 */
    max-height: 90vh;     /* ← 高さは画面に収める */
    overflow: auto;
    box-sizing: border-box;
    border-radius: 8px;
    position: relative;
  }

  .modal-annotation{
    font-size: 0.8em;
    text-align: right;
    color: #aaa;
  }

  #modal-main {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    margin: 0 auto 16px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }

  /* メイン画像拡大 */

  .modal-main-container {
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 80vh;
    overflow: hidden;
    position: relative;
    margin-bottom: 1rem;
  }
  
  /* ← ここで実際の縦サイズを固定 */
  .modal-main-wrapper {
    margin-top: 2em;
    height: 70vh;         /* or max-height */
    overflow: hidden;     /* ← 画像がはみ出すのを隠す */
    position: relative;
    width: 100%;
    height: 100%;
    cursor: grab;
  }
  
  /* 拡大対象の画像本体 */
  #modal-main {
    width: auto;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    transform-origin: center center;
    cursor: zoom-in;
    user-select: none;
  }
  
  #modal-main.zoomed {
    cursor: grab;
    transition: transform 0.2s ease;
  }
  
  
  /* サムネ */
  
  .diff-thumbs {
    display: flex;
    flex-wrap: wrap;
    list-style-type: none;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0;
  }
  
  .diff-thumbs img {
    height: 60px;
    cursor: pointer;
    border-radius: 10px;
    transition: opacity 0.3s ease;
  }
  .diff-thumbs img:hover{
    opacity: 0.5;
    transition: 0.1s ease;
  }

  .info strong {
    display: flex;
    align-items: center;
    justify-content: left;
    position: relative;
    padding: 0.5em;
    margin-bottom: 0.25em;
    border-radius: 5px;
    box-sizing: border-box;
    width: 100%;
    background-color: #f5f5f5;
    color: #091d4b;
  }
  
  .info p:first-child strong {
    font-size: 1.5em;
    color: #091d4b;
    background: none;
  }
  
  .info p:first-child strong::before,
  .info p:first-child strong::after {
    content: "";
    flex: 1;
    height: 2px;
    background: #4e85ff;
    margin: 0 0.5em; /* テキストとの間の余白 */
  }
  
  .info p span {
    margin-top: 0.5em;
    margin-left: 0.5em;
  }

  .info p:first-child strong span {
    white-space: nowrap;
    margin: 0 auto;
  }

  .info p .marker {
    margin-top: 0;
    margin-left: 0;
    color: #4e85ff;
    margin-right: 0.25em;
    font-weight: bold;
  }

  #modal-link{
    text-align: center;
    align-items: center;
    justify-content: center;
    padding: 0.5em;
    margin: 0 auto;
    width: 15em;
    background-color: #4e85ff;
    color: #ffffff;
    text-decoration: none;
    border-radius: 10px;
    transition: background-color 0.2s ease;
  }
  #modal-link:hover{
    background-color: #2a60d6;
  }
  
  .close {
    position: absolute;
    top: 10px; right: 10px;
    font-size: 24px;
    cursor: pointer;
  }
  
  .nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    z-index: 1001;
  }
  
  .prev { left: 1rem; }
  .next { right: 1rem; }
  

/* レスポンシブ */

@media (max-width: 768px) {
    main {
      flex-direction: column;
      justify-content: flex-start;
      align-items: center;
      padding: 2em 1em;
      height: auto;
      display: flex;
      text-align: center;
      padding: 0.8em 1em;
      border-radius: 8px;
    }
    .main-visual{
        order: -1;
    }
  
    .main-visual img {
      max-width: 90vw;
      max-height: 40vh;
      margin-bottom: 1.5em;
    }
  
    .menu {
      flex-direction: column;
      align-items: center;
      text-align: center;
      width: 100%;
      gap: 0.5em;
    }
  
    .menu.left,
    .menu.right {
      margin: 0;
      margin-bottom: 0.5em;
    }
    .menu.left{
        order: 0;
    }
    .menu.right{
        order: 1;
    }
  
    .menu.left a,
    .menu.right a {
      width: 100%;
    }
    .menu a:hover{
        background-color: #4e85ff;
        transform: none;
    }

    .profile {
        flex-direction: column; /* スマホでは縦並びにする */
        align-items: center; /* 中央揃え */
      }
    
      .profile-img img {
        width: 100%;
      }
    
      .profile-text {
        align-items: center; /* 中央揃え */
      }
  }
  