/* ============================================
   CSS変数 (カラー・フォント設定)
============================================ */
:root {
    --bg-color: #ffffff;
    --bg-light: #f5f5f5;
    --bg-dark: #1a1a1a;
    --text-main: #222222;
    --text-light: #ffffff;
    --text-muted: #888888;
    --border-color: #e0e0e0;
    
    --font-en: 'Montserrat', sans-serif;
    --font-jp: 'Noto Sans JP', sans-serif;
}

/* ============================================
   ベース設定・リセット
============================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-jp);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ローディング中のスクロール制御 */
body.is-loading {
    height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

/* ユーティリティクラス */
.mt-4 { margin-top: 2rem; }
.mt-8 { margin-top: 4rem; }
.text-light { color: var(--text-light); }


/* ============================================
   ローディング画面
============================================ */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--bg-dark);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 1s cubic-bezier(0.8, 0, 0.2, 1);
    overflow-y: scroll;
}

/* スクロールバーの非表示設定（背景と同化） */
.loading-screen::-webkit-scrollbar {
    width: 16px;
    background-color: var(--bg-dark);
}
.loading-screen::-webkit-scrollbar-thumb {
    background-color: var(--bg-dark);
}

.loading-screen.is-loaded {
    transform: translateY(-100%);
}

.loading-content {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    color: #fff;
}

.loading-text {
    font-family: var(--font-en);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.2em;
}

.loading-count {
    font-family: var(--font-en);
    font-size: 4rem;
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.loading-percent {
    font-family: var(--font-en);
    font-size: 1.5rem;
    font-weight: 700;
}


/* ============================================
   共通アニメーション定義
============================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* スクロール連動フェードイン */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* タイピングアニメーション設定 */
.typing-title {
    position: relative;
    display: inline-block;
}

.typing-char {
    opacity: 0;
    display: inline-block;
}

/* タイピングカーソルの点滅 */
.typing-title::after {
    content: '';
    display: inline-block;
    width: 0.1em;
    height: 0.9em;
    background-color: currentColor;
    margin-left: 0.1em;
    vertical-align: baseline;
    animation: blinkCursor 0.8s step-end infinite;
    opacity: 0;
}

.typing-title.is-typing::after {
    opacity: 1;
}

.typing-title.is-complete::after {
    animation: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

@keyframes blinkCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}


/* ============================================
   ヘッダー
============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: background-color 0.4s ease, padding 0.4s ease;
}

/* スクロール時のヘッダー背景色変更 */
.header.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-en);
    font-weight: 900;
    font-size: 1.5rem;
    color: #fff;
    letter-spacing: 0.05em;
    transition: color 0.4s ease;
}

.header.scrolled .logo {
    color: var(--text-main);
}

.header-nav {
    display: flex;
    gap: 2.5rem;
}

.header-nav a {
    font-family: var(--font-en);
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    letter-spacing: 0.1em;
    position: relative;
    transition: color 0.4s ease;
}

.header.scrolled .header-nav a {
    color: var(--text-main);
}

.header-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: currentColor;
    transition: width 0.3s ease;
}

.header-nav a:hover::after {
    width: 100%;
}


/* ============================================
   メインビジュアル
============================================ */
.main-visual-wrapper {
    position: relative;
    width: 100%;
    height: 300vh;
}

.main-visual {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
    background-color: #000;
}

/* 背景画像レイヤー設定 */
.mv-bg-layers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    will-change: opacity;
}

/* 背景画像の暗色オーバーレイ */
.bg-layer::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
}

.bg-layer.layer-1 {
    opacity: 1;
}

/* 背景枠線テキスト設定 */
.mv-bg-text-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.mv-bg-text-row {
    display: flex;
    justify-content: center;
    white-space: nowrap;
}

.row-1 {
    transform: translateX(-5%);
}

.row-2 {
    transform: translateX(5%);
}

.mv-bg-text-row span {
    font-family: var(--font-en);
    font-size: 15vw;
    font-weight: 900;
    line-height: 0.8;
    color: transparent;
    -webkit-text-stroke: 2px rgba(255, 255, 255, 0.4);
    padding: 0 1.5rem;
}

/* 前面テキストレイヤー設定 */
.main-visual-overlay {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    z-index: 10;
    pointer-events: none;
}

.text-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 0 10%;
    transform: translateY(calc(-50% + var(--y-offset, 0px)));
    opacity: 0;
    will-change: opacity, transform;
}

.text-layer.layer-1 { text-align: center; }
.text-layer.layer-2 { text-align: left; padding-left: 15%; }
.text-layer.layer-3 { text-align: right; padding-right: 15%; }

/* メインビジュアルのテキスト表示アニメーション (ローディング完了後発火) */
.mv-title-main {
    font-family: var(--font-en);
    font-weight: 900;
    font-size: 8rem;
    color: #fff;
    line-height: 1;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
    opacity: 0;
}
body.is-ready .mv-title-main {
    animation: fadeInUp 1s ease 0.2s forwards;
}

.mv-subtitle-jp {
    font-family: var(--font-jp);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    opacity: 0;
}
body.is-ready .mv-subtitle-jp {
    animation: fadeInUp 1s ease 0.4s forwards;
}

.mv-title-sub {
    font-family: var(--font-en);
    font-weight: 900;
    font-size: 10rem;
    color: #fff;
    line-height: 1;
    letter-spacing: 0.02em;
    text-shadow: 0 4px 30px rgba(0,0,0,0.3);
    opacity: 0;
}
body.is-ready .mv-title-sub {
    animation: fadeInUp 1s ease 0.6s forwards;
}


/* ============================================
   共通コンテンツレイアウト
============================================ */
.content-wrapper {
    position: relative;
    z-index: 10;
    background-color: var(--bg-color);
}

.section-container {
    padding: 10rem 0;
}

.bg-light { background-color: var(--bg-light); }
.bg-dark { background-color: var(--bg-dark); }

.inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* セクション見出し設定 */
.section-header {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.section-title-en {
    font-family: var(--font-en);
    font-weight: 900;
    font-size: 4rem;
    letter-spacing: 0.02em;
    line-height: 1;
    margin-bottom: 0;
    white-space: nowrap;
}

.section-title-jp {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

/* 共通ボタン設定 */
.btn-primary-inverse {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background-color: #fff;
    color: var(--text-main);
    font-family: var(--font-en);
    font-weight: 700;
    letter-spacing: 0.1em;
    border-radius: 50px;
    transition: background-color 0.3s ease;
}

.btn-primary-inverse:hover {
    background-color: #e0e0e0;
}


/* ============================================
   SERVICE セクション
============================================ */
.service-content {
    display: flex;
    align-items: stretch;
    gap: 4rem;
}

.service-text-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.service-desc {
    font-size: 1rem;
    margin-bottom: 3rem;
}

.service-list li {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
}

.service-list li:last-child {
    border-bottom: 1px solid var(--border-color);
}

.service-list h3 {
    font-family: var(--font-en);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.service-list p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.service-img-box {
    flex: 1;
}

.service-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 4/3;
}


/* ============================================
   COMPANY セクション
============================================ */
.company-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 6rem;
    align-items: center;
}

.company-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.grid-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1/1;
}

.company-text .section-header {
    margin-bottom: 2rem;
}

.company-desc {
    margin-bottom: 3rem;
}


/* ============================================
   WORKS セクション
============================================ */
.works-layout {
    display: flex;
    align-items: center;
    gap: 6rem;
}

/* ギャラリースクロールエリア */
.works-gallery-wrapper {
    flex: 1;
    height: 750px;
    overflow: hidden;
    position: relative;
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
}

.works-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    height: 100%;
}

.gallery-col {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* ギャラリーカラムごとの配置調整 */
#gallery-col-1 { margin-top: 0; }
#gallery-col-2 { margin-top: -120px; }
#gallery-col-3 { margin-top: -60px; }

/* ギャラリーアニメーションの方向指定 */
.col-up {
    animation: scrollGalleryUp 60s linear infinite;
}

.col-down {
    animation: scrollGalleryDown 60s linear infinite;
}

.gallery-item {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background-color: #333;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

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

@keyframes scrollGalleryUp {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(0, -50%, 0); }
}

@keyframes scrollGalleryDown {
    from { transform: translate3d(0, -50%, 0); }
    to { transform: translate3d(0, 0, 0); }
}

/* テキストエリア設定 */
.works-title-area {
    width: 350px;
    flex-shrink: 0;
}

.works-desc {
    font-size: 0.95rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.7);
}


/* ============================================
   RECRUIT セクション
============================================ */
.recruit-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 4rem;
    padding-bottom: 6rem;
}

/* スクロール追従ヘッダー */
.recruit-header {
    flex: 1;
    position: sticky;
    top: 120px;
}

.recruit-desc {
    max-width: 400px;
    line-height: 1.8;
}

.recruit-contents {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.recruit-block-title {
    font-family: var(--font-en);
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: baseline;
    border-bottom: 2px solid var(--text-main);
    padding-bottom: 0.5rem;
}

.recruit-block-title .jp {
    font-family: var(--font-jp);
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-left: 1rem;
}

.recruit-block-text {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-main);
}

/* 募集要項テーブル */
.recruit-table {
    width: 100%;
    border-collapse: collapse;
}

.recruit-table th, .recruit-table td {
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.6;
}

.recruit-table th {
    width: 25%;
    font-weight: 700;
    vertical-align: top;
}

.recruit-table td small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* アシンメトリー画像配置レイアウト */
.recruit-visual {
    position: relative;
    height: 500px;
    margin-bottom: 4rem;
}

.rv-img-1, .rv-img-2, .rv-img-3 {
    position: absolute;
    overflow: hidden;
}

.rv-img-1 {
    top: 5%;
    left: 0;
    width: 28%;
    height: 65%;
    border-radius: 200px 0 0 200px;
}

.rv-img-2 {
    bottom: 0;
    right: 0;
    width: 28%;
    height: 75%;
    border-radius: 0 200px 200px 0;
}

.rv-img-3 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 38%;
    height: 45%;
    border-radius: 0;
    z-index: 1;
}

.rv-img-1 img, .rv-img-2 img, .rv-img-3 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* タイポグラフィティッカー設定 */
.recruit-ticker-wrapper {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 2rem;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 2rem;
    white-space: nowrap;
    font-family: var(--font-en);
    font-size: 8rem;
    font-weight: 900;
    line-height: 1;
    color: var(--text-main);
}

.ticker-item.row-1 { transform: translateX(-5%); }
.ticker-item.row-2 { transform: translateX(5%); }

.text-outline {
    color: transparent;
    -webkit-text-stroke: 2px var(--text-main);
}

.text-solid {
    color: var(--text-main);
}

.ticker-arrows {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ticker-arrows .material-symbols-outlined {
    font-size: 6rem;
}


/* ============================================
   CONTACT & FOOTER セクション
============================================ */
#contact {
    padding-bottom: 0;
}

.contact-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.contact-desc {
    margin-bottom: 2rem;
}

.footer {
    padding: 4rem 0;
}

.footer .inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.footer-logo {
    font-family: var(--font-en);
    font-weight: 900;
    font-size: 2rem;
    color: rgba(255,255,255,0.2);
    margin-bottom: 2rem;
}

.footer-nav ul {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-nav a {
    font-family: var(--font-en);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

.copyright {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-en);
}


/* ============================================
   レスポンシブ対応: タブレット (1024px以下)
============================================ */
@media (max-width: 1024px) {
    /* メインビジュアル */
    .mv-title-main { font-size: 6.5rem !important; }
    .mv-title-sub { font-size: 8rem !important; }
    .section-title-en { font-size: 3rem; }
    
    /* サービス・カンパニー */
    .service-content {
        flex-direction: column;
    }
    
    .company-grid {
        grid-template-columns: 1fr;
    }
    
    .company-text {
        order: 1;
    }
    
    .company-images {
        order: 2;
    }

    /* ギャラリーレイアウト */
    .works-layout {
        flex-direction: column-reverse;
        gap: 2rem;
    }

    .works-title-area {
        width: 100%;
        text-align: center;
    }
    
    .works-title-area .section-header {
        justify-content: center;
    }

    .works-gallery-wrapper {
        width: 100%;
        flex: none; 
        min-height: 0;
        max-height: 450px;
        height: 450px;
        -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 20%, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
        mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 20%, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
    }
    
    /* スライダーアイテムの余白調整 */
    .gallery-col {
        gap: 0;
    }
    .gallery-item {
        margin-bottom: 2rem;
    }

    /* カラムの段差オフセットをリセット */
    #gallery-col-1, #gallery-col-2, #gallery-col-3 {
        margin-top: 0;
    }

    /* ギャラリースクロール方向の再定義 */
    #gallery-col-1, #gallery-col-3 {
        animation: scrollGalleryDown 60s linear infinite;
    }
    
    #gallery-col-2 {
        animation: scrollGalleryUp 60s linear infinite;
    }
    
    /* 採用情報レイアウト */
    .recruit-layout {
        flex-direction: column;
        gap: 4rem;
    }
    
    .recruit-header {
        position: static;
    }

    .recruit-contents {
        width: 100%;
    }
    
    .recruit-visual {
        height: 400px;
    }
    
    .ticker-item {
        font-size: 5rem;
    }
    
    .ticker-arrows .material-symbols-outlined {
        font-size: 4rem;
    }
    
    /* コンタクトレイアウト */
    .contact-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 3rem;
    }
}


/* ============================================
   レスポンシブ対応: スマートフォン (768px以下)
============================================ */
@media (max-width: 768px) {
    /* ナビゲーション非表示設定 */
    .header-nav { display: none; }
    
    /* メインビジュアル */
    .main-visual-wrapper {
        height: 200vh;
    }

    .text-layer {
        padding: 0 5%;
    }
    
    .text-layer.layer-2, .text-layer.layer-3 { 
        padding-left: 5%;
        padding-right: 5%;
        text-align: center; 
    }

    .mv-title-main { font-size: 3.5rem !important; }
    .mv-title-sub { font-size: 4.5rem !important; }
    
    .section-container { padding: 6rem 0; }
    
    /* コンテンツ余白調整 */
    .works-layout {
        gap: 1.5rem; 
    }
    
    .section-header {
        align-items: flex-end;
        gap: 1rem;
    }
    
    .section-title-en { font-size: 2.5rem; }
    .section-title-jp { font-size: 0.8rem; }
    
    .company-images {
        grid-template-columns: 1fr;
    }

    /* ギャラリースマートフォン表示調整 */
    .works-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .gallery-col {
        gap: 0; 
    }
    .gallery-item {
        margin-bottom: 1rem;
    }

    #gallery-col-3 {
        display: none;
    }

    .works-gallery-wrapper {
        flex: none;
        min-height: 0;
        max-height: 250px; 
        height: 250px; 
        -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 20%, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
        mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 20%, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
    }
    
    /* 採用情報スマートフォン表示調整 */
    .recruit-block-title {
        font-size: 1.5rem;
    }

    .recruit-table th, .recruit-table td {
        display: block;
        width: 100%;
    }
    
    .recruit-table th {
        padding-bottom: 0.2rem;
        border-bottom: none;
    }
    
    .recruit-table td {
        padding-top: 0;
        padding-bottom: 1.5rem;
    }

    .recruit-visual {
        height: 300px;
    }
    
    .rv-img-1, .rv-img-2, .rv-img-3 {
        border-radius: 0;
    }
    .rv-img-1 { top: 0; left: 0; width: 45%; height: 40%; border-radius: 100px 0 0 100px; }
    .rv-img-2 { bottom: 0; right: 0; width: 45%; height: 45%; border-radius: 0 100px 100px 0; }
    .rv-img-3 { top: 50%; left: 50%; width: 60%; height: 35%; border-radius: 0; }
    
    .ticker-item {
        font-size: 3.5rem;
        gap: 1rem;
    }
    
    .ticker-arrows .material-symbols-outlined {
        font-size: 3rem;
    }
    
    .ticker-item.row-1 {
        transform: translateX(-10%);
    }
    .ticker-item.row-2 {
        transform: translateX(0%);
    }
}