/* 日本語文字のみ0.85倍に縮小して見せるフォント定義 */
@font-face {
    font-family: 'SpaceMonoJP';
    src: local('Space Mono');
    unicode-range: U+3000-9FFF, U+F900-FAFF, U+FF00-FFEF;
    size-adjust: 78%;
}

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

body {
    font-family: 'Space Mono', monospace;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

/* グローバルナビゲーション（初期表示の板） */
.global-nav {
    position: fixed;
    bottom: 100px;
    left: 0;
    width: 100%;
    height: calc(100vh - 100px);
    background: #E1E1D9;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: calc(40px + env(safe-area-inset-top, 0px)) 30px 40px;
    transition: transform 0.5s ease-out;
}

/* スクロール連動時はtransitionを無効化 */
.global-nav.scrolling {
    transition: none;
}

.global-nav.hidden {
    transform: translateY(calc(-100% + 108px));
}

.global-nav.showing {
    transform: translateY(0) !important;
}

/* 左上：SNSリンク */
.sns-links {
    position: absolute;
    top: calc(40px + env(safe-area-inset-top, 0px));
    left: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.sns-links.fade-in {
    opacity: 1;
}

.sns-links a {
    font-size: 10px;
    letter-spacing: 0.1em;
    color: #191919;
    text-decoration: none;
    font-weight: 400;
    transition: opacity 0.3s;
}

.sns-links a:hover {
    opacity: 0.6;
}

/* 左下：メインメニュー */
.main-menu {
    position: absolute;
    bottom: 48px;
    left: 30px;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: flex-start;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    /* ロゴ（right:30px, ~110px幅）との最低30px間隔を確保 */
    max-width: calc(100% - 200px);
}

.main-menu.fade-in {
    opacity: 1;
}

.global-nav.hidden .main-menu {
    opacity: 0;
}

.menu-item {
    font-size: 16px;
    color: #191919;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    font-weight: 400;
    line-height: 1;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    margin-bottom: 24px;
}

.menu-item:last-child {
    margin-bottom: 0;
}

.menu-item.current span,
.sub-menu-item.current span {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.menu-item .dot {
    width: 10px;
    height: 10px;
    display: block;
    flex-shrink: 0;
    margin-bottom: 0.15em;
    object-fit: contain;
}

/* 右下：ロゴ */
.logo-large {
    position: absolute;
    bottom: 44px;
    right: 30px;
    font-size: 42px;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: #191919;
    line-height: 1;
    display: flex;
    align-items: flex-end;
}

/* 画面下中央：スクロール誘導 */
.scroll-indicator {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    cursor: pointer;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.5s ease-in-out, transform 0.3s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounce 2s infinite;
}

.scroll-indicator img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease-in-out;
}

/* 上向き（グロナビが開いている状態） */
.scroll-indicator.upward img {
    transform: rotate(180deg);
}

@keyframes bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(4px);
    }
}

/* 固定ヘッダー（スクロール後） */
.fixed-header {
    position: absolute;
    bottom: 48px;
    left: 30px;
    width: auto;
    height: auto;
    background: transparent;
    z-index: 1001;
    display: flex;
    align-items: flex-end;
    padding: 0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;
}

.fixed-header.visible {
    opacity: 1;
    pointer-events: auto;
}

.hamburger {
    width: 180px;
    height: 34px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.fixed-header.visible .hamburger {
    opacity: 1;
}

.hamburger span {
    width: 100%;
    height: 0.8px;
    background: #85857F;
    transition: all 0.3s;
}

.header-logo {
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: #191919;
}

/* メインコンテンツ（ギャラリー） */
.main-content {
    background: #fff;
    /* グロナビの直下から始まるように調整 */
    margin-top: calc(100vh - 100px);
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    transform: translateY(0);
    will-change: transform;
}

.main-content.fade-in {
    opacity: 1;
}

body.scroll-locked {
    overflow: hidden;
}

.gallery {
    display: flex;
    flex-direction: column;
}

/* プロジェクトブロック */
.project {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* 見出し画像（メインビジュアル） */
.project-top-image {
    width: 100%;
    overflow: hidden;
}

.project-top-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* 下段：プロジェクト名 + サブ画像群 */
.project-bottom {
    width: 100%;
    padding: 30px 20px;
    padding-right: 0;
    position: relative;
    overflow: visible;
}

/* プロジェクト名（project-gallery-rowの上に重ねる） */
.project-name {
    font-size: 14px;
    color: #191919;
    font-weight: 400;
    line-height: 1.4;
    width: 28%;
    padding-top: 4px;
    background: transparent;
    position: absolute;
    left: 20px;
    top: 30px;
    z-index: 2;
}

/* サブ画像群（画面幅いっぱい、project-nameの下に重なる） */
.project-gallery-row {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    /* 画面幅いっぱいに広げる */
    margin-right: -20px;
    padding-right: 20px;
    padding-left: 20px;
    /* 初期表示でproject-nameの幅分だけ左に余白を開ける */
    padding-left: calc(28% + 20px);
}

.project-gallery-row::-webkit-scrollbar {
    display: none;
}

/* ギャラリーアイテム */
.gallery-item {
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    height: 200px;
    overflow: hidden;
}

.gallery-item img {
    height: 200px;
    width: auto;
    display: block;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* 動画アイテム */
.gallery-item-video {
    position: relative;
}

.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    pointer-events: none;
    transition: background 0.3s ease;
}

.gallery-item-video:hover .video-play-icon {
    background: rgba(0, 0, 0, 0.8);
}

/* ライトボックス */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    cursor: pointer;
    transition: background 0.4s ease-in-out;
}

.lightbox.active .lightbox-overlay {
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
    position: relative;
    z-index: 2001;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.4s ease-in-out 0.1s,
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

.lightbox.active .lightbox-content {
    opacity: 1;
    transform: scale(1);
}

/* コンテンツのフェードアニメーション */
.lightbox-content.fading-out {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.lightbox-content.fading-in {
    opacity: 0;
    animation: fadeInContent 0.4s ease-in-out forwards;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.lightbox-video {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2002;
    width: auto;
    height: auto;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    opacity: 0;
    padding: 8px;
}

.lightbox.active .lightbox-close {
    opacity: 1;
    transition-delay: 0.2s;
}

.lightbox-close:hover {
    opacity: 0.7;
}

.lightbox-close img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* ライトボックスナビゲーション */
.lightbox-nav-container {
    position: relative;
    z-index: 2002;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 90vw;
    max-width: 90vw;
    opacity: 0;
    transition: opacity 0.3s ease;
    transition-delay: 0s;
}

.lightbox.active .lightbox-nav-container {
    opacity: 1;
    transition-delay: 0.2s;
}

.lightbox-nav {
    z-index: 2002;
    width: auto;
    height: auto;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    user-select: none;
    padding: 12px;
}

.lightbox-nav:hover:not(.disabled) {
    opacity: 0.7;
}

.lightbox-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.lightbox-nav img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* SP版のみ：main-contentのmargin-top変化をアニメーション */
@media (max-width: 1279px) {
    .main-content {
        transition: margin-top 0.4s ease;
    }
}

/* PC版レイアウト（1280px以上） */
@media (min-width: 1280px) {
    html, body {
        height: 100%;
        overflow-x: hidden;
        overflow-y: hidden;
    }

    body {
        position: relative;
    }

    /* グローバルナビゲーション（左側固定） */
    .global-nav {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 40%;
        height: 100vh;
        transform: none !important;
        transition: none;
        padding: 60px 50px;
        box-sizing: border-box;
        overflow-y: hidden;
        overflow-x: hidden;
    }

    .global-nav.hidden {
        transform: none !important;
    }

    .global-nav.showing {
        transform: none !important;
    }

    .global-nav.scrolling {
        transition: none;
    }

    /* SNSリンク */
    .sns-links {
        top: 60px;
        left: 50px;
    }

    /* メインメニュー */
    .main-menu {
        bottom: 60px;
        left: 50px;
        max-width: none;
    }

    /* ロゴ */
    .logo-large {
        bottom: 60px;
        right: 50px;
    }

    /* スクロール誘導（PC版では非表示） */
    .scroll-indicator {
        display: none;
    }

    /* 固定ヘッダー（PC版では非表示） */
    .fixed-header {
        display: none;
    }

    /* メインコンテンツ（右側スクロール可能） */
    .main-content {
        margin-left: 40%;
        margin-top: 0;
        width: calc(100% - 40%);
        height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
        transform: none !important;
        box-sizing: border-box;
    }

    /* プロジェクトブロック（横並びレイアウト） */
    .project {
        display: flex;
        flex-direction: row;
        align-items: flex-end;
        width: 100%;
        padding-left: 30px;
        padding-top: 30px;
        padding-bottom: 80px;
    }

    /* 見出し画像（左側固定） */
    .project-top-image {
        position: sticky;
        top: 0;
        width: 296px;
        flex-shrink: 0;
        overflow: visible;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
    }

    .project-top-image img {
        width: 100%;
        height: auto;
        display: block;
        object-fit: contain;
    }

    /* プロジェクト名（PC版：project-top-imageの左下に配置） */
    .project-top-image .project-name {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        font-size: 20px;
        font-family: 'SpaceMonoJP', 'Space Mono', monospace;
        line-height: 1.4;
        white-space: normal;
        word-break: break-word;
        background: transparent;
        z-index: 2;
    }

    /* 下段：サブ画像群（右側） */
    .project-bottom {
        flex: 1;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        padding: 30px 40px 0;
        height: auto;
    }

    /* サブ画像群（横スクロール可能、下揃え） */
    .project-gallery-row {
        width: 100%;
        display: flex;
        align-items: flex-end;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 0;
        padding-left: 0;
        max-height: 300px;
        margin-top: 0;
    }

    .gallery-item {
        height: auto;
        max-height: 300px;
    }

    .gallery-item img {
        height: auto;
        max-height: 300px;
        width: auto;
    }

    .lightbox-nav-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        pointer-events: none;
        z-index: 2002;
    }

    .lightbox-nav {
        pointer-events: auto;
        padding: 20px 30px;
    }
}

/* スマホ対応 */
@media (max-width: 768px) {
    .lightbox-nav {
        width: 44px;
        height: 44px;
        font-size: 24px;
    }
}

/* ===== フッター ===== */
.global-footer {
    background: #E1E1D9;
    padding: 60px 30px calc(40px + env(safe-area-inset-bottom, 0px));
    position: relative;
    font-family: 'Space Mono', monospace;
}

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 48px;
}

.footer-menu-item {
    font-size: 18px;
    color: #191919;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    font-weight: 400;
    line-height: 1;
    margin-bottom: 18px;
}

.footer-menu-item .dot {
    width: 10px;
    height: 10px;
    display: block;
    flex-shrink: 0;
    margin-bottom: 0.15em;
    object-fit: contain;
}

.footer-menu-item:hover span {
    opacity: 0.6;
}

.footer-sns {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 60px;
}

.footer-sns a {
    font-size: 10px;
    letter-spacing: 0.1em;
    color: #191919;
    text-decoration: none;
    font-weight: 400;
    transition: opacity 0.3s;
}

.footer-sns a:hover {
    opacity: 0.6;
}

.footer-logo {
    position: absolute;
    bottom: 80px;
    right: 30px;
    font-size: 42px;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: #191919;
    line-height: 1;
    font-family: 'Space Mono', monospace;
}

.footer-copyright {
    font-size: 10px;
    color: #191919;
    letter-spacing: 0.05em;
    text-align: center;
    margin-top: 40px;
    font-weight: 400;
}

@media (min-width: 1280px) {
    .global-footer {
        padding: 80px 50px 50px;
    }

    .footer-logo {
        font-size: 56px;
        bottom: 90px;
        right: 50px;
    }

    .footer-copyright {
        font-size: 11px;
    }
}


.sns-coming-soon {
    font-size: 10px;
    letter-spacing: 0.1em;
    color: #191919;
    font-weight: 400;
    opacity: 0.5;
    cursor: default;
}

.footer-coming-soon {
    font-size: 10px;
    letter-spacing: 0.1em;
    color: #191919;
    font-weight: 400;
    opacity: 0.5;
    cursor: default;
}
