/* 全要素のリセットとボックスモデルの設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    /* cursor: none; を削除 */
}
  
  
/*ロード画面*/ 
.loader {
    --path: #2f3545;
    --dot: #5628ee;
    --duration: 3s;
    width: 44px;
    height: 44px;
    position: relative;
    width: 100vw;
    height: 100vh;
    transition: opacity 0.6s;
    background-color: #ffffff;
  
    /* 以下のコードを追加 */
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
  }
  
  .loader:before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    position: absolute;
    display: block;
    background: var(--dot);
    top: 37px;
    left: 19px;
    transform: translate(-18px, -18px);
    animation: dotRect var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86)
      infinite;
  }
  
  .loader svg {
    display: block;
    width: 100%;
    height: 100%;
  }
  
  .loader svg rect,
  .loader svg polygon,
  .loader svg circle {
    fill: none;
    stroke: var(--path);
    stroke-width: 10px;
    stroke-linejoin: round;
    stroke-linecap: round;
  }
  
  .loader svg polygon {
    stroke-dasharray: 145 76 145 76;
    stroke-dashoffset: 0;
    animation: pathTriangle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86)
      infinite;
  }
  
  .loader svg rect {
    stroke-dasharray: 192 64 192 64;
    stroke-dashoffset: 0;
    animation: pathRect 3s cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
  }
  
  .loader svg circle {
    stroke-dasharray: 150 50 150 50;
    stroke-dashoffset: 75;
    animation: pathCircle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86)
      infinite;
  }
  
  .loader.triangle {
    width: 48px;
  }
  
  .loader.triangle:before {
    left: 21px;
    transform: translate(-10px, -18px);
    animation: dotTriangle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86)
      infinite;
  }
  
  @keyframes pathTriangle {
    33% {
      stroke-dashoffset: 74;
    }
  
    66% {
      stroke-dashoffset: 147;
    }
  
    100% {
      stroke-dashoffset: 221;
    }
  }
  
  @keyframes dotTriangle {
    33% {
      transform: translate(0, 0);
    }
  
    66% {
      transform: translate(10px, -18px);
    }
  
    100% {
      transform: translate(-10px, -18px);
    }
  }
  
  @keyframes pathRect {
    25% {
      stroke-dashoffset: 64;
    }
  
    50% {
      stroke-dashoffset: 128;
    }
  
    75% {
      stroke-dashoffset: 192;
    }
  
    100% {
      stroke-dashoffset: 256;
    }
  }
  
  @keyframes dotRect {
    25% {
      transform: translate(0, 0);
    }
  
    50% {
      transform: translate(18px, -18px);
    }
  
    75% {
      transform: translate(0, -36px);
    }
  
    100% {
      transform: translate(-18px, -18px);
    }
  }
  
  @keyframes pathCircle {
    25% {
      stroke-dashoffset: 125;
    }
  
    50% {
      stroke-dashoffset: 175;
    }
  
    75% {
      stroke-dashoffset: 225;
    }
  
    100% {
      stroke-dashoffset: 275;
    }
  }
  
  .loader {
    display: inline-block;
    margin: 0 16px;
  }
  

/* 背景テキストのスタイル */
.background-text {
    position: fixed;
    font-size: 120px;
    font-weight: bold;
    color: #000;
    white-space: nowrap;
    opacity: 0.05;
    z-index: -1;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.background-text.top {
    top: 70px;  /* ヘッダーから10px下 */
    transform: translateX(100vw);
    animation: floatTextRight 120s linear infinite;  /* アニメーション速度を60秒に変更 */
}

.background-text.bottom {
    bottom: 130px;  /* Scroll/Swipeの位置から30px下に移動 */
    transform: translateX(100vw);
    animation: floatTextRight 120s linear infinite;
}

/* 背景テキストのアニメーション */
@keyframes floatTextRight {
    0% {
        transform: translateX(100vw);
    }
    100% {
        transform: translateX(-100%);
    }
}

@keyframes floatTextLeft {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100vw);
    }
}

/* ページ全体のベーススタイル */
html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    position: relative;
    touch-action: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: auto;
    overscroll-behavior-y: auto;
    overscroll-behavior-x: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body {
    background-color: #ffffff;
    background-image: 
        linear-gradient(rgba(240, 240, 240, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(240, 240, 240, 0.3) 1px, transparent 1px);
    background-size: 30px 30px;
    min-height: 100vh;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    position: relative;
    width: 100%;
    color: #333333;
}

/* トップページのスクロール制御 */
body.top-page {
    overflow: hidden !important;
    height: 100vh;
    position: fixed;
    width: 100%;
    touch-action: none;
    -webkit-overflow-scrolling: none;
    overscroll-behavior: none;
    overscroll-behavior-y: none;
    overscroll-behavior-x: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* グラデーションオーバーレイ */
body::before {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50vh;
    background: linear-gradient(to top, rgba(248, 248, 248, 0.2), transparent);
    pointer-events: none;
    z-index: -1;
}

/* ヘッダースタイル - 画面上部に固定表示 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 40px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

/* ナビゲーションの配置設定 */
.nav {
    display: flex;
    justify-content: space-between;  /* ロゴとメニューを両端に配置 */
    align-items: center;
    max-width: 1200px;  /* 最大幅を設定 */
    margin: 0 auto;  /* 中央寄せ */
}

/* ロゴコンテナのレイアウト */
.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;  /* ロゴ画像とテキストの間隔 */
}

/* ロゴコンテナ内のリンクスタイル */
.logo-container a {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

/* ロゴ画像のサイズ設定 */
.logo-image {
    height: 30px;
    width: auto;
    object-fit: contain;  /* アスペクト比を維持 */
}

/* ロゴテキストのスタイル */
.logo {
    font-size: 24px;
    font-weight: 500;
    color: #333333;
    margin: 0;
    letter-spacing: 0.5px;
}

.name-large {
    display: block;
}

.name-small {
    display: none;
}

@media (min-width: 900px) {
    .name-large {
        display: block;
    }

    .name-small {
        display: none;
    }
}

/* ナビゲーションリンクのレイアウト */
.nav-links {
    display: flex;
    list-style: none;
    gap: 40px;  /* リンク間の間隔 */
    align-items: center;
}

/* ナビゲーションリンクのスタイル */
.nav-links a {
    text-decoration: none;
    color: #333333;
    font-weight: 400;
    transition: color 0.3s ease;
    font-size: 15px;
    letter-spacing: 0.3px;
}

/* ナビゲーションリンクのホバー効果 */
.nav-links a:hover {
    color: #666666;
}

/* インスタグラムアイコンのスタイル */
.instagram-icon {
    font-size: 20px;
    display: flex;
    align-items: center;
}

/* ポートフォリオセクションのレイアウト */
.portfolio {
    padding-top: 0px;  /* 100pxから60pxに変更して上に移動 */
    min-height: 100vh;
    display: flex;
    align-items: center;  /* 縦方向の中央揃え */
}

/* カルーセルコンテナの設定 */
.carousel-container {
    width: 100%;
    height: 400px;  /* 500pxから400pxに変更して上に移動 */
    position: relative;
    perspective: 2500px;  /* 3D効果の深さ */
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
}

/* カルーセル本体の設定 */
.carousel {
    position: relative;
    width: 300px;
    height: 360px;
    transform-style: preserve-3d;  /* 3D変換を有効化 */
}

/* カードのベーススタイル */
.card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: transparent;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    backface-visibility: hidden;
    transform-origin: center center;
    transition: transform 0.6s ease-out, box-shadow 0.3s ease;
    overflow: hidden;
}

/* カードのホバー効果 */
.card:hover {
    box-shadow: none;
    transform: scale(1.02) translateZ(600px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* カード内の画像スタイル */
.card-image {
    width: 100%;
    height: 80%;  /* 85%から80%に変更してテキストエリアを確保 */
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* カード画像のホバー効果 */
.card:hover .card-image {
    transform: scale(1.05);  /* 画像を少し拡大 */
}

/* カード内のコンテンツ領域 */
.card-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;  /* タイトルと説明文の間の余白を4pxに設定 */
    height: 20%;
    background: white;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

/* カードタイトルのスタイル */
.card-title {
    font-size: 15px !important;
    font-weight: 700;
    margin: 0;
    color: #333333;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.4;
    letter-spacing: 0.3px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    padding-bottom: 4px;  /* タイトルの下部に4pxの余白を追加 */
}

.card-title a {
    color: #333333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.card-title a:hover {
    color: #666666;
}

/* OTTOのリンクスタイル */
.card-title a[href="https://www.yu-meijin1995.com/"] {
    color: #333333;
    text-decoration: none;
}

.card-title a[href="https://www.yu-meijin1995.com/"]:hover {
    color: #666666;
}

/* カード説明文のスタイル */
.card-description {
    font-size: 12px;
    color: #666666;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    max-width: 100%;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.2px;
    line-height: 1.6;
    padding-bottom: 8px;  /* 説明文の下部に8pxの余白を追加 */
}

/* スクロールアニメーションのキーフレーム */
@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* スクロールインジケーターのスタイル */
.scroll-indicator {
    position: absolute;
    top: calc(100px + (100% - 60px) * 1.2 + 12px);  /* 34pxから24pxに変更して位置を上に調整 */
    left: 50%;
    transform: translateX(-50%);  /* 中央揃え */
    display: flex;
    align-items: center;
    gap: 20px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: #888888;  /* より濃いグレーに変更 */
}

/* スクロールテキストのスタイル */
.scroll-text {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 1px;
    color: #888888;  /* より濃いグレーに変更 */
}

/* 矢印ボタンのスタイル */
.arrow {
    font-size: 20px;
    line-height: 1;
    text-decoration: none;
    color: #888888;  /* ScrollやSwipeと同じ濃いグレーに統一 */
    cursor: pointer;
    transition: color 0.3s ease;
}

/* 矢印ボタンのホバー効果 */
.arrow:hover {
    color: #555;
}

/* ハンバーガーメニューのベーススタイル */
.hamburger {
    display: none;  /* デフォルトでは非表示 */
    width: 30px;
    height: 20px;
    position: relative;
    cursor: pointer;
    z-index: 1001;
}

/* ハンバーガーメニューの線のスタイル */
.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #333;
    position: absolute;
    transition: all 0.3s;
}

/* ハンバーガーメニューの各線の位置 */
.hamburger span:nth-child(1) {
    top: 0;
}

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

.hamburger span:nth-child(3) {
    bottom: 0;
}

/* ハンバーガーメニューがアクティブ時の線のアニメーション */
.hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

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

.hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* タブレットサイズ（834px以下）のスタイル */
@media screen and (max-width: 834px) {
    body.top-page {
        overflow: hidden;
    }
    .carousel {
        width: 40vw;  /* デバイス幅の40% */
        height: calc(40vw * 1.2);  /* 現在の縦横比（1.2）を維持 */
    }

    .logo-image {
        height: 30px;  /* ロゴ画像は表示したまま */
    }

    .card-image {
        height: 75%;  /* 80%から75%に変更してテキストエリアを確保 */
    }

    .card-content {
        height: 25%;  /* テキストエリアを大きく */
        padding: 10px;
        gap: 3px;  /* 0pxから3pxに変更してタイトルと説明文の間隔を少し広げる */
    }

    .card-title {
        font-size: 15px !important;
        font-weight: 700;
    }
    
    .card-description {
        font-size: max(10px, calc(40vw * 0.033));
        line-height: 1.8;
        padding-bottom: 12px;
    }

    .scroll-text {
        font-size: 16px;
        font-weight: 500;
        letter-spacing: 1px;
    }

    .scroll-text::before {
        content: "Swipe";
        display: inline-block;
    }

    .scroll-text span {
        display: none;
    }
}

/* タブレットサイズ（900px以下）のスタイル */
@media screen and (max-width: 900px) {
    body {
        overflow-y: hidden !important;
    }
    body.top-page {
        overflow: hidden !important;
    }
    .carousel {
        width: 40vw;  /* デバイス幅の40% */
        height: calc(40vw * 1.2);  /* 現在の縦横比（1.2）を維持 */
    }

    .logo-image {
        height: 30px;  /* ロゴ画像は表示したまま */
    }

    .card-image {
        height: 70%;  /* 75%から70%に変更してテキストエリアを確保 */
    }

    .card-content {
        height: 30%;  /* テキストエリアをさらに大きく */
        padding: 12px 10px;
        gap: 4px;  /* 0pxから4pxに変更してタイトルと説明文の間隔を少し広げる */
    }

    .card-title {
        font-size: 15px !important;
    }
    
    .card-description {
        font-size: max(10px, calc(40vw * 0.033));
        line-height: 1.4;
        margin: 0;
        -webkit-line-clamp: 2;  /* 2行まで表示可能に */
        padding-bottom: 12px;
    }

    .scroll-text {
        font-size: 16px;
        font-weight: 500;
        letter-spacing: 1px;
    }

    .scroll-text::before {
        content: "Swipe";
        display: inline-block;
    }

    .scroll-text span {
        display: none;
    }
}

/* タブレット・スマホサイズ（500px以下）のスタイル */
@media screen and (max-width: 500px) {
    html, body {
        overflow-x: hidden;
        position: relative;
        touch-action: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: auto;
        overscroll-behavior-y: auto;
        overscroll-behavior-x: none;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }

    body.top-page {
        overflow: hidden !important;
        height: 100vh;
        position: fixed;
        width: 100%;
        touch-action: none;
        -webkit-overflow-scrolling: none;
        overscroll-behavior: none;
        overscroll-behavior-y: none;
        overscroll-behavior-x: none;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }

    /* カルーセルのスタイル */
    .carousel-container {
        height: 250px;  /* 500pxから250pxに変更 */
        perspective: 2000px;
    }

    .carousel {
        width: 150px;  /* 300pxから150pxに変更 */
        height: 180px;  /* 360pxから180pxに変更 */
        transform-style: preserve-3d;
        perspective: 2000px;
    }

    .card {
        transform-style: preserve-3d;
        backface-visibility: hidden;
    }

    .card-image {
        height: 75%;  /* 80%から75%に変更してコンテンツエリアを広げる */
    }

    .card-content {
        height: 25%;  /* 20%から25%に変更してコンテンツエリアを広げる */
        padding: 8px;  /* 6pxから8pxに変更して余白を増やす */
        gap: 4px;  /* 2pxから4pxに変更してタイトルと説明文の間隔を広げる */
    }

    .card-title {
        font-size: 12px !important;
        font-weight: 700;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: normal;
        padding-bottom: 3px;  /* 2pxから3pxに変更して余白を増やす */
        line-height: 1.3;  /* 行間を調整 */
    }

    .card-description {
        font-size: 10px;
        line-height: 1.3;  /* 1.4から1.3に変更して行間を調整 */
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: normal;
        padding-bottom: 3px;  /* 4pxから3pxに変更して余白を調整 */
    }

    /* スクロールインジケーター */
    .scroll-indicator {
        top: calc(100px + 180px + 74px);  /* 48pxから60pxに変更して位置を下に調整 */
        position: fixed;
    }

    /* ハンバーガーメニュー */
    .hamburger {
        display: block;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        right: -100%;
        width: 250px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        padding: 100px 30px;
        gap: 30px;
        transition: right 0.3s ease;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        align-items: flex-start;
        z-index: 1000;
    }

    .nav-links.active {
        display: flex;
        right: 0;
    }

    .nav-links a {
        width: 100%;
        display: flex;
        justify-content: flex-start;
        font-size: 16px;
    }

    .instagram-icon {
        justify-content: flex-start;
        font-size: 20px;
    }

    .scroll-text::before {
        content: "Swipe";
    }

    /* 画像切り替え矢印を非表示 */
    .image-nav-arrow {
        display: none;
    }
}

/* 480px以下のスタイル - ヘッダーと背景のみ */
@media screen and (max-width: 480px) {
    html, body {
        overflow-x: hidden;
        position: relative;
        touch-action: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: auto;
        overscroll-behavior-y: auto;
        overscroll-behavior-x: none;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }

    body.top-page {
        overflow: hidden !important;
        height: 100vh;
        position: fixed;
        width: 100%;
        touch-action: none;
        -webkit-overflow-scrolling: none;
        overscroll-behavior: none;
        overscroll-behavior-y: none;
        overscroll-behavior-x: none;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    .header {
        padding: 15px 20px;
    }
    
    .logo {
        font-size: 20px;
    }
}

/* 360px以下のスタイル - ヘッダーと背景のみ */
@media screen and (max-width: 360px) {
    html, body {
        overflow-x: hidden;
        position: relative;
        touch-action: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: auto;
        overscroll-behavior-y: auto;
        overscroll-behavior-x: none;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }

    body.top-page {
        overflow: hidden !important;
        height: 100vh;
        position: fixed;
        width: 100%;
        touch-action: none;
        -webkit-overflow-scrolling: none;
        overscroll-behavior: none;
        overscroll-behavior-y: none;
        overscroll-behavior-x: none;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    .header {
        padding: 12px 15px;
    }
    
    .logo {
        font-size: 18px;
    }
}

/* 画面幅表示 
.screen-width-display {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 1000;
}*/

/* ヘッダー */
#header {
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #fff;
  z-index: 10;
}

.site-title a {
  display: block;
  line-height: 1px;
}

.site-title img {
  height: 40px;
  width: auto;
}

#navi {
  display: flex;
  align-items: center;
}

.nav-menu {
  display: flex;
  gap: 30px;
}

.nav-menu a {
  font-weight: bold;
  color: #333;
  text-decoration: none;
  transition: color 0.3s;
}

.nav-menu a:hover {
  color: #666;
}

@media screen and (min-width: 901px) {
    .scroll-text::before {
        content: "Scroll";
        display: inline-block;
    }

    .scroll-text span {
        display: none;
    }
}

#bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: none;
}

.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.background-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card:empty,
.card[data-empty="true"] {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: none;
}

.card:empty:hover,
.card[data-empty="true"]:hover {
    transform: scale(1) translateZ(600px);
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.card:empty .card-content,
.card[data-empty="true"] .card-content {
    background: transparent;
    height: 0;
    padding: 0;
    border-radius: 0;
}

.card:empty .card-image,
.card[data-empty="true"] .card-image {
    display: none;
}

.card:empty .card-title,
.card[data-empty="true"] .card-title,
.card:empty .card-description,
.card[data-empty="true"] .card-description {
    display: none;
}

.transparent-card {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
}

.transparent-card:hover {
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: none !important;
    transform: scale(1) translateZ(600px);
}

.transparent-card .card-image,
.transparent-card .card-content,
.transparent-card .card-title,
.transparent-card .card-description {
    display: none !important;
    height: 0 !important;
    width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0 !important;
}

/* 作品詳細ポップアップ（モーダル） */
.work-modal {
    position: fixed;
    z-index: 2000;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.work-modal[style*="display:none"] {
    pointer-events: none;
}

.work-modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: transparent !important;
    z-index: 0;
}

.work-modal-content {
    position: relative;
    max-width: 900px;
    width: 90vw;
    max-height: 90vh;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    background: #fff;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.work-modal-close {
    position: absolute;
    top: 18px;
    right: 24px;
    background: none;
    border: none;
    color: #333;
    font-size: 2.2rem;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    line-height: 1;
    padding: 0;
}

.work-modal-close:hover {
    color: #555;
    background: none;
}

.work-modal-inner {
    display: flex;
    flex-direction: row;
    height: 100%;
    min-height: 340px;
    align-items: center;  /* 縦方向の中央揃えを追加 */
}

.work-modal-image-area {
    height: 40vh;
    min-height: 240px;
    max-height: 40vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 40px 0 40px;
    background: #fff;
    position: relative;  /* 矢印の位置決めのため追加 */
}

.work-modal-image-area img {
    max-width: 95%;
    max-height: 40vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin: 0 auto;
    display: block;
}

.work-modal-desc-area {
    padding: 40px;
    width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;  /* 中央揃えに変更 */
}

#work-modal-title {
    font-size: 1.5em;
    margin: 20px 0 0 0 !important;
    font-weight: 900;
    color: #333;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    text-align: left;
}

#work-modal-category {
    font-size: 1.1rem;
    color: #888;
    margin-bottom: 1.2em;
    text-align: left;
}

#work-modal-description {
    font-size: 1.1rem;
    color: #444;
    margin: 16px 0 0 0;
    line-height: 1.7;
    text-align: left;
}

#work-modal-tools {
    font-size: 1rem;
    color: #666;
}

#work-modal-tools ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

#work-modal-tools li {
    background: #f0f0f0;
    border-radius: 16px;
    padding: 6px 16px;
    font-size: 0.98em;
}

@media (max-width: 700px) {
    .work-modal-content {
        max-width: 85vw;
        width: 85vw;
        max-height: 85vh;
    }
    .work-modal-inner {
        flex-direction: column;
        min-height: 0;
    }
    .work-modal-image-area {
        height: auto;
        min-height: auto;
        max-height: none;
        padding: 40px 20px 0 20px;
        position: relative;@media (max-width: 700px) {
  h2 {
    margin-bottom: 10px;
  }
}
        margin-bottom: 20px;
    }
    .work-modal-desc-area {
        padding: 0 20px 24px 20px;
    }
    .work-modal-image-area img {
        max-width: 100%;
        max-height: 45vh;
        object-fit: contain;
        height: auto;
        width: auto;
        display: block;
        margin: 0 auto;
        position: relative;
        opacity: 1;
    }
    .slide-indicators {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        margin: 0;
        gap: 8px;
        position: absolute;
        bottom: -8px;
        left: 0;
        padding: 0 20px;
    }
    #work-modal-title {
        font-size: 1.2em;
        margin: 20px 0 8px 0 !important;
        font-weight: 900;
        font-family: 'Helvetica Neue', Arial, sans-serif;
    }
    #work-modal-category {
        font-size: 0.9rem;
        margin-bottom: 0.8em;
    }
    #work-modal-description {
        font-size: 0.9rem;
        margin: 8px 0 0 0;
        line-height: 1.5;
    }
}

/* ローダーのスタイル */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  background: #fff;
  transition: opacity 1.2s; /* 背景のフェードアウト時間を長く */
}

.loader {
  --path: #2f3545;
  --dot: #5628ee;
  --duration: 3s;
  width: 44px;
  height: 44px;
  position: relative;
  display: inline-block;
  margin: 0 16px;
  transition: opacity 0.6s; /* オブジェクトのフェードアウト時間を短く */
}

.loading.loaded {
  opacity: 0;
  visibility: hidden;
}

.loading.loaded .loader {
  opacity: 0;
}

/* スライドショーのインジケーター */
.slide-indicators {
  margin-top: 20px;
  margin-bottom: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  position: static;  /* 絶対位置指定を解除 */
}

.slide-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background-color 0.3s;
}

.slide-indicator.active {
  background: rgba(0, 0, 0, 0.6);
}

/* 画像切り替え矢印のスタイル */
.image-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.image-nav-arrow:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-nav-arrow.prev {
    left: 20px;
}

.image-nav-arrow.next {
    right: 20px;
}

.image-nav-arrow::before {
    content: '';
    width: 12px;
    height: 12px;
    border-top: 2px solid #333;
    border-right: 2px solid #333;
    display: block;
}

.image-nav-arrow.prev::before {
    transform: rotate(-135deg);
    margin-left: 4px;
}

.image-nav-arrow.next::before {
    transform: rotate(45deg);
    margin-right: 4px;
}

/* TOPに戻るボタン */
.back-to-top-btn-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0 120px 0; /* 下部に40pxの余白を追加 */
}

.back-to-top-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1.5px solid #E0E0E0;
    border-radius: 32px;
    box-shadow: 0 2px 8px 0 rgba(0,0,0,0.12);
    padding: 10px 36px 10px 60px;
    font-size: 1.1rem;
    font-weight: 500;
    color: #222;
    text-decoration: none;
    transition: box-shadow 0.2s, border 0.2s, background 0.2s;
    position: relative;
    min-width: 170px;
    min-height: 48px;
    letter-spacing: 0.02em;
    outline: none;
    cursor: pointer;
    user-select: none;
}

.back-to-top-btn:hover {
    box-shadow: 0 4px 16px 0 rgba(0,0,0,0.18);
    border: 1.5px solid #bdbdbd;
    background: #fafafa;
}

.back-to-top-btn span {
    font-size: 1.05em;
    font-weight: 500;
    color: #222;
    margin-right: 16px;
    letter-spacing: 0.02em;
}

.back-to-top-btn .arrow-icon {
    display: inline-block;
    width: 22px;
    height: 22px;
    position: relative;
    background: none;
    border-radius: 0;
    box-shadow: none;
}

.back-to-top-btn .arrow-icon::after {
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-right: 2.5px solid #222;
    border-bottom: 2.5px solid #222;
    transform: translate(-50%, -50%) rotate(-45deg);
}

html, body {
    width: 100%;
    overflow-x: hidden !important;
}

.profile, .profile-content, .profile-hero, .timeline, .skills, .awards, .hobbies {
    max-width: 100vw;
    overflow-x: hidden;
}

/* プロフィールページのスタイル */
.profile {
    padding-top: 100px;
    min-height: 100vh;
    background: #ffffff;
    position: relative;
    overflow-x: hidden;
}

.profile-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.profile-hero {
    text-align: center;
    margin-bottom: 80px;
}

.profile-hero h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #333333;
}

.profile-hero p {
    font-size: 1.2em;
    color: #666666;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.timeline {
    margin: 80px 0;
}

.timeline h2 {
    font-size: 2em;
    margin-bottom: 40px;
    color: #333333;
}

.work-modal-desc-area a {
    color: #000000;
    text-decoration: underline;  /* 常に下線を表示 */
    text-underline-offset: 2px;  /* 下線とテキストの間隔を調整 */
    transition: color 0.3s ease;
}

.work-modal-desc-area a:hover {
    color: #333333;
    text-decoration: underline;  /* ホバー時も下線を維持 */
    opacity: 0.8;  /* ホバー時に少し透明度を下げる */
}

.background-image {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  overflow: hidden;
}

.bg-slide {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 0.5s;
}

.bg-01 {
  background-image: url('images/haikei_6.jpg');
  animation: bg-fade-01 28s infinite;
}
.bg-02 {
  background-image: url('images/haikei_7.jpg');
  animation: bg-fade-02 28s infinite;
}

@keyframes bg-fade-01 {
  0%     { opacity: 1; }
  35.71% { opacity: 1; }
  42.86% { opacity: 0; }
  50%    { opacity: 0; }
  85.71% { opacity: 0; }
  92.86% { opacity: 1; }
  100%   { opacity: 1; }
}
@keyframes bg-fade-02 {
  0%     { opacity: 0; }
  35.71% { opacity: 0; }
  42.86% { opacity: 1; }
  50%    { opacity: 1; }
  85.71% { opacity: 1; }
  92.86% { opacity: 0; }
  100%   { opacity: 0; }
}
