/* * ==========================================
 * ★ 配色設定 (Color Palette)
 * ==========================================
 */
 :root {
    --bg: #050505;
    --text: #e0e0e0;
    --accent: #555;
}

* { cursor: none !important; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Noto Sans JP', sans-serif;
    margin: 0; padding: 0;
    overflow-x: hidden;
}

canvas { 
    display: block; 
    position: fixed !important;
    top: 0; left: 0;
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

#controls {
    margin: 20px;
    position: absolute;
    top: 0; left: 0;
    color: white;
    z-index: 0;
    pointer-events: none;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}
a:hover {
    color: #fff;
}

/* ノイズエフェクト */
.noise {
    position: fixed; inset: 0; z-index: 999;
    pointer-events: none; opacity: 0.05;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIj48ZmlsdGVyIGlkPSJuIj48ZmVUdXJidWxlbmNlIHR5cGU9ImZyYWN0YWxOb2lzZSIgYmFzZUZyZXF1ZW5jeT0iMC42IiBzdGl0Y2hUaWxlcz0ic3RpdGNoIi8+PC9maWx0ZXI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsdGVyPSJ1cmwoI24pIiBvcGFjaXR5PSIwLjUiLz48L3N2Zz4=');
}

/* カスタムカーソル */
.cursor-dot, .cursor-circle {
    position: fixed; top: 0; left: 0; pointer-events: none; z-index: 10000;
    border-radius: 50%; transform: translate(-50%, -50%);
    mix-blend-mode: exclusion;
}
.cursor-dot { width: 8px; height: 8px; background: white; }
.cursor-circle {
    width: 40px; height: 40px; border: 1px solid white;
    transition: width 0.3s, height 0.3s, background 0.3s;
}
body.hovering .cursor-circle { width: 80px; height: 80px; background: rgba(255,255,255,0.2); border-color: transparent; }

/* コンテナ */
.container { 
    max-width: 1400px; margin: 0 auto; padding: 0 4vw;
    position: relative; 
    z-index: 1; 
}

/* ヘッダーエリア */
.hero {
    height: 100vh; display: flex; flex-direction: column; justify-content: center;
    position: relative;
}
.hero-big {
    font-family: 'Syncopate', sans-serif;
    font-size: 10vw; text-transform: uppercase; line-height: 0.9;
    color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,0.5);
    margin: 0; transition: 0.5s;
}
.hero:hover .hero-big { color: #fff; }

.hero-desc {
    margin-top: 2rem; max-width: 400px; font-size: 0.9rem; line-height: 1.8; color: #ccc;
    margin-left: auto;
    background-color: rgba(15, 15, 15, 0.75);
    backdrop-filter: blur(8px);
    padding: 2rem;
    border: 1px solid #222;
}

/* セクション共通設定 */
.sec { padding: 5rem 0; }
.sec-title {
    font-family: 'Syncopate', sans-serif; font-size: 3rem; margin-bottom: 4rem;
    border-bottom: 1px solid #333; padding-bottom: 1rem; display: inline-block;
}

/* Profileセクション */
#profile {
    background-color: rgba(15, 15, 15, 0.75);
    backdrop-filter: blur(8px);
    padding: 4rem;
    border: 1px solid #222;
    margin-top: 2rem;
}

.ja-sub {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.4em;
    color: #777;
    font-weight: 300;
    margin-left: 1rem;
    letter-spacing: 0.05em;
    vertical-align: middle;
    text-transform: none;
}

/* Expertise (サービスリスト) */
.service-list { border-top: 1px solid #333; }
.srv-item {
    border-bottom: 1px solid #333; padding: 3rem 0;
    display: flex; justify-content: space-between; align-items: center;
    transition: 0.4s; position: relative; overflow: hidden;
    cursor: pointer;
    
    /* 初期状態は透明にしておく（JSでフェードインさせるため） */
    opacity: 0;
    transform: translateY(20px);
}
/* JSで付与するクラス */
.srv-item.visible { animation: fadeIn 0.5s forwards; }

.srv-item:hover { padding-left: 2rem; background: #111; }
.srv-inner { display: flex; align-items: center; } /* 内部要素をまとめるdiv用 */
.srv-num { font-family: 'Syncopate'; color: #555; margin-right: 2rem; }
.srv-name { font-size: 2.5rem; font-weight: 300; }
.srv-arrow { font-size: 2rem; opacity: 0; transition: 0.4s; transform: translateX(-20px); }
.srv-item:hover .srv-arrow { opacity: 1; transform: translateX(0); }

/* Selected Works (画像ギャラリー) */
.gallery {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10vw; margin-top: 2rem;
}
.gal-item { 
    margin-bottom: 4rem;
    opacity: 0; transform: translateY(20px); /* 初期非表示 */
}
.gal-item.loaded { animation: fadeIn 1s ease forwards; }

.gal-item.small-item .img-mask {
    width: 70%; margin: 0 auto;
}

.gal-item:nth-child(even) { 
    margin-top: 6rem;
} 

.img-mask {
    width: 100%; overflow: hidden; position: relative; cursor: pointer;
}
.g-img {
    width: 100%; height: auto; display: block; filter: grayscale(100%);
    transition: 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    transform: scale(1.1);
}
.img-mask:hover .g-img { filter: grayscale(0%); transform: scale(1); }

.click-label {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid #fff;
    color: #fff;
    padding: 0.8rem 2rem;
    font-family: 'Syncopate', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: 0.4s ease;
    pointer-events: none;
    z-index: 2;
}
.img-mask:hover .click-label { opacity: 1; }

.g-title { font-family: 'Syncopate'; font-size: 1.2rem; margin-top: 1rem; display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Profile / Company */
.company-area {
    display: grid; grid-template-columns: 1fr 1fr; gap: 4rem;
    border-top: 1px solid #333; 
    padding-top: 2rem;
}
.co-dl { display: grid; grid-template-columns: 150px 1fr; row-gap: 2rem; margin: 0; align-items: baseline; }
.co-dt { font-family: 'Syncopate'; font-weight: 700; color: #555; }
.co-dd { margin: 0; font-weight: 300; line-height: 1.8; }

/* フッター */
footer {
    padding: 5rem 0; text-align: center; border-top: 1px solid #333; margin-top: 5rem;
}
.f-contact {
    font-size: 5vw; font-weight: 700; text-decoration: none; color: #fff;
    display: inline-block; transition: 0.3s;
}
.f-contact:hover { letter-spacing: 0.1em; color: #888; }

.f-contact .ja-sub {
    display: block; font-size: 1.2rem; margin-left: 0; margin-top: 0.5rem;
}

/* Lightbox */
.lightbox {
    position: fixed; inset: 0; background: rgba(0,0,0,0.98); z-index: 5000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: 0.4s;
    padding: 4vw;
}
.lightbox.active { opacity: 1; pointer-events: auto; }

.lb-content {
    display: flex; width: 100%; max-width: 1400px;
    gap: 4rem;
    align-items: center; justify-content: center;
    transform: scale(0.95); transition: 0.4s;
}
.lightbox.active .lb-content { transform: scale(1); }

.lb-img-wrap { 
    flex: 3; 
    max-height: 90vh;
    display: flex; align-items: center; justify-content: center; position: relative; 
}

.lb-img, .lb-video {
    max-width: 100%; 
    max-height: 90vh;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    display: block; width: auto; height: auto;
}
.lb-video { display: none; width: 100%; aspect-ratio: 16/9; background: #000; }

.lb-info { 
    flex: 2; display: none; flex-direction: column; justify-content: center; 
    text-align: left; opacity: 0; transform: translateX(20px); transition: 0.5s 0.2s;
}
.lightbox.active .lb-info { opacity: 1; transform: translateX(0); }

.lightbox.has-text .lb-info { display: flex; }
.lightbox.has-text .lb-content { max-width: 1400px; }

.lightbox:not(.has-text) .lb-img-wrap { flex: auto; width: 100%; justify-content: center; }
.lightbox:not(.has-text) .lb-content { max-width: auto; justify-content: center; }

.lb-title { font-family: 'Syncopate'; font-size: 2.5rem; margin-bottom: 1.5rem; color: #fff; line-height: 1.1; }
.lb-desc { font-size: 0.95rem; line-height: 1.8; color: #aaa; border-left: 1px solid #333; padding-left: 1.5rem; }

.lb-close {
    position: absolute; top: 30px; right: 30px; font-size: 1.5rem; color: #fff;
    font-family: 'Syncopate'; cursor: pointer; z-index: 10;
}

/* * ==========================================
 * ★ タブレット向けレスポンシブ (769px - 1024px)
 * ==========================================
 */
@media (min-width: 769px) and (max-width: 1024px) {
    .container { padding: 0 40px; } /* common.cssに合わせ余白を調整 */

    /* メインビジュアルの高さを短縮 */
    .hero {
        height: 60vh;       /* 100vhから大幅に短縮 */
        min-height: 500px;  /* コンテンツが収まる最低限の高さを確保 */
    }

    .hero-big { 
        font-size: 13vw; /* PCとスマホの中間サイズ */
        color: #fff; /* タッチデバイス対応: 常時表示 */
    }
    
    .sec-title { font-size: 2.2rem; margin-bottom: 3rem; }

    .service-list .srv-item { padding: 2.5rem 0; }
    .srv-name { font-size: 2rem; }
    .srv-num { font-size: 0.9rem; margin-right: 1.5rem; }

    .gallery { 
        gap: 4vw; /* グリッド間隔を少し狭める */
        margin-top: 2rem;
    }
    .gal-item { margin-bottom: 3rem; }
    .gal-item:nth-child(even) { margin-top: 4rem; }

    .company-area { gap: 2rem; }
    .co-dt { width: 120px; font-size: 0.9rem; }

    /* メインビジュアルのテキストボックス修正 */
    .hero-desc {
        max-width: none;       /* 幅制限を解除してコンテンツ幅いっぱいに */
        width: auto;           /* 100%だとpadding分はみ出すためautoに変更して自動調整させる */
        margin-left: 0;        /* 右寄せを解除 */
        margin-right: 0;
        text-align: center;    /* テキストを中央揃えに */
        box-sizing: border-box; /* パディングを含めたサイズ計算にする */
        font-size: 1.3rem;      /* 文字サイズをさらに大きくして視認性アップ */
    }

    /* タブレットではカスタムカーソルを無効化し、通常の操作性を確保 */
    .cursor-dot, .cursor-circle { display: none; }
    * { cursor: auto !important; }
}

/* * ==========================================
 * ★ スマホ向けレスポンシブ (~768px)
 * ==========================================
 */
@media (max-width: 768px) {
    .hero {
        justify-content: flex-start;
        padding-top: 5vh;
        height: auto;
        padding-bottom: 3rem;
        min-height: auto;
    }

    /* メインビジュアルのテキストボックス修正（スマホ） */
    .hero-desc {
        margin-left: auto;     /* 左右自動調整で中央配置 */
        margin-right: auto;    /* 左右自動調整で中央配置 */
        max-width: none;       /* 幅制限解除 */
        width: 100%;           /* 幅をコンテナ一杯に広げる */
        text-align: center;    /* テキスト中央揃え */
        box-sizing: border-box; /* パディングを含めた計算 */
    }

    .hero-big { 
        font-size: 15vw; 
        color: #fff; /* タッチデバイス対応: 常時表示 */
    }
    
    .gallery { 
        grid-template-columns: 1fr; 
        gap: 2rem; 
        margin-top: 2rem;
    }
    .gal-item:nth-child(even) { margin-top: 0; }
    
    .company-area { grid-template-columns: 1fr; gap: 3rem; }
    .co-dl { display: block; }
    .co-dt { margin-bottom: 0.5rem; margin-top: 1.5rem; font-size: 0.9rem; }
    .co-dd { margin-left: 0; margin-bottom: 1rem; }

    .lb-content { flex-direction: column; gap: 2rem; overflow-y: auto; max-height: 90vh; }
    .lb-img-wrap { width: 100%; flex: none; }
    .lb-img, .lb-video { max-height: 50vh; width: 100%; object-fit: contain; }
    .lb-info { width: 100%; padding-bottom: 2rem; }
    .lb-title { font-size: 1.8rem; }
    
    .ja-sub { 
        display: block; margin-left: 0; margin-top: 0.5rem; 
        font-size: 0.9rem; white-space: normal; line-height: 1.4;
    }
    
    .f-contact { font-size: 13vw; }
    .f-contact .ja-sub { font-size: 1rem; }

    .srv-item {
        padding: 2rem;
        background-color: rgba(15, 15, 15, 0.75);
        backdrop-filter: blur(8px);
        border: 1px solid #222;
        margin-bottom: 1rem;
    }
    .srv-num { margin-right: 1rem; font-size: 1rem; }
    .srv-name { font-size: 1.6rem; white-space: nowrap; }
    .srv-arrow { font-size: 1rem; margin-left: 1rem; }

    .g-img { filter: grayscale(0%); transform: scale(1); }

    .cursor-dot, .cursor-circle { display: none; }
    * { cursor: auto !important; }

    canvas { opacity: 0.3; }
    #profile { padding: 2rem; }
    
    /* フッターの高さを短縮 */
    footer { padding-bottom: 5rem; }
}