/*
Theme Name: andkou
Author: andkou
Description: Official Website Theme for andkou Design Office.
Version: 1.0.0
*/

/* WordPress標準のスタイル調整 */
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* 横スクロール制御はJSで行うため */
}

/* 以下、プロトタイプのCSSを移植 */
:root {
    --cursor-size: 20px;
    --brand-color: #FDCF39;
}

::selection {
    background: var(--brand-color);
    color: #000;
}

body {
    background-color: #0f0f0f;
    color: #f0f0f0;
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    /* overflow: hidden;  <- JSで制御するため、script.js読み込み後に効かせるか、ここで指定するか。今回はbodyにクラスをつけて制御します */
}

/* カーソル */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--brand-color);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: width 0.2s, height 0.2s, background-color 0.2s, border-color 0.2s;
}

body.hovering .cursor-outline {
    width: 60px;
    height: 60px;
    background-color: rgba(253, 207, 57, 0.1);
    border-color: var(--brand-color);
}

/* スクロールコンテナ */
.scroll-container {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    will-change: transform;
}

/* PC: 横スクロール */
.scroll-container.horizontal-scroll {
    position: fixed;
    flex-direction: row;
}

/* タブレット・スマホ: 縦スクロール */
.scroll-container.vertical-scroll {
    position: relative;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   ファーストビュー背景メディア
   ============================================ */

.hero-section {
    position: relative;
}

/* 背景オーバーレイ */
.hero-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 1;
}

/* 背景画像 */
.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

/* GSAPアニメーション用のクラス */
.hero-background {
    will-change: transform;
}

.section-content {
    will-change: transform, opacity;
}

.hero-title,
.hero-description {
    will-change: transform, opacity, scale;
}

/* 背景動画 */
.hero-bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 0;
    object-fit: cover;
}

/* PC用背景（デスクトップ: 1024px以上） */
.hero-bg-desktop {
    display: none;
}

@media (min-width: 1024px) {
    .hero-bg-desktop {
        display: block;
    }
    .hero-bg-tablet,
    .hero-bg-mobile {
        display: none;
    }
}

/* タブレット用背景（768px - 1023px） */
@media (min-width: 768px) and (max-width: 1023px) {
    .hero-bg-tablet {
        display: block;
    }
    .hero-bg-desktop,
    .hero-bg-mobile {
        display: none;
    }
}

/* スマホ用背景（767px以下） */
@media (max-width: 767px) {
    .hero-bg-mobile {
        display: block;
    }
    .hero-bg-desktop,
    .hero-bg-tablet {
        display: none;
    }
}

/* ソーシャルアイコン */
.social-icons-container {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
    align-items: center !important;
    justify-content: flex-start !important;
}

/* テーブル内のソーシャルアイコンコンテナも横並び */
.company-table td.social-icons-container {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
    align-items: center !important;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    color: currentColor;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.social-icon svg {
    width: 100%;
    height: 100%;
}

.social-icon:hover {
    transform: translateY(-2px);
    color: var(--brand-color);
}

/* noteアイコン（テキスト「n」） */
.social-icon-note {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 1;
}

.note-icon-text {
    display: inline-block;
    font-style: normal;
}

/* セクション間のグラデーション背景 */
.section-gradient {
    position: relative;
    background-size: 200% 200%;
    background-position: center;
    transition: background-position 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 各セクションのグラデーション定義（滑らかな色の変化） */
.section-1 {
    background: linear-gradient(135deg, #0f0f0f 0%, #151515 50%, #0f0f0f 100%);
}

.section-2 {
    background: linear-gradient(135deg, #151515 0%, #1a1a1a 50%, #151515 100%);
}

.section-3 {
    background: linear-gradient(135deg, #1a1a1a 0%, #151515 50%, #1a1a1a 100%);
}

.section-4 {
    background: linear-gradient(135deg, #151515 0%, #0f0f0f 50%, #151515 100%);
}

.section-5 {
    background: linear-gradient(135deg, #1a1a1a 0%, #151515 50%, #1a1a1a 100%);
}

.section-6 {
    background: linear-gradient(135deg, #151515 0%, #1a1a1a 50%, #0f0f0f 100%);
}

.section-7 {
    background: linear-gradient(135deg, #0f0f0f 0%, #0a0a0a 50%, #000000 100%);
}

/* PC横スクロール時のグラデーション遷移 */
@media (min-width: 1024px) {
    .scroll-container {
        position: relative;
    }
    
    .scroll-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(
            to right,
            #0f0f0f 0%,
            #151515 14.3%,
            #1a1a1a 28.6%,
            #151515 42.9%,
            #0f0f0f 57.2%,
            #1a1a1a 71.5%,
            #151515 85.8%,
            #000000 100%
        );
        background-size: 700% 100%;
        z-index: -1;
        transition: background-position 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* タブレット・スマホ縦スクロール時のグラデーション遷移 */
@media (max-width: 1023px) {
    .section-gradient {
        background-size: 100% 200%;
        background-position: center top;
    }
    
    /* セクション間のスムーズな色の変化 */
    .section-1 {
        background: linear-gradient(180deg, #0f0f0f 0%, #151515 100%);
    }
    
    .section-2 {
        background: linear-gradient(180deg, #151515 0%, #1a1a1a 50%, #151515 100%);
    }
    
    .section-3 {
        background: linear-gradient(180deg, #1a1a1a 0%, #151515 50%, #1a1a1a 100%);
    }
    
    .section-4 {
        background: linear-gradient(180deg, #151515 0%, #0f0f0f 50%, #151515 100%);
    }
    
    .section-5 {
        background: linear-gradient(180deg, #1a1a1a 0%, #151515 50%, #1a1a1a 100%);
    }
    
    .section-6 {
        background: linear-gradient(180deg, #151515 0%, #1a1a1a 50%, #0f0f0f 100%);
    }
    
    .section-7 {
        background: linear-gradient(180deg, #0f0f0f 0%, #0a0a0a 50%, #000000 100%);
    }
}

/* レスポンシブ: タブレット以下（1023px以下） */
@media (max-width: 1023px) {
    .scroll-container {
        position: relative;
        flex-direction: row;
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
    }
    
    /* セクションの幅を100%に */
    .scroll-container section {
        width: 100% !important;
        min-width: 100% !important;
        height: auto !important;
        min-height: 100vh;
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* Heroセクション */
    .scroll-container section:first-child h1 {
        font-size: 3rem !important;
        line-height: 1.1;
    }
    
    /* Worksセクションの横スクロールを縦に */
    .scroll-container section .work-item {
        width: 100% !important;
        max-width: 100%;
        margin-bottom: 2rem;
    }
    
    /* Worksセクションのレイアウト */
    .scroll-container section.works-section {
        flex-direction: column !important;
        padding: 3rem 1.5rem !important;
        gap: 2rem !important;
    }
    
    /* 縦書きテキストを横書きに */
    .vertical-text {
        writing-mode: horizontal-tb !important;
        text-orientation: unset !important;
        font-size: 2rem !important;
        opacity: 0.3;
        margin-bottom: 2rem;
    }
    
    /* スクロールインジケーターの位置調整（スマホ・タブレット） */
    .scroll-indicator {
        bottom: 1.5rem !important;
        right: 1.5rem !important;
        left: auto !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .scroll-trigger-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        background-color: rgba(0, 0, 0, 0.5);
    }
    
    /* テーブルのレスポンシブ対応 */
    .company-table {
        font-size: 0.875rem;
    }
    
    .company-table th {
        width: 100px;
        padding: 0.75rem 0;
    }
    
    /* ソーシャルアイコンは常に横並び */
    .social-icons-container {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 1rem !important;
        align-items: center !important;
    }
    
    .company-table td.social-icons-container {
        flex-direction: row !important;
    }
}

/* レスポンシブ: スマホ（767px以下） */
@media (max-width: 767px) {
    .scroll-container section:first-child h1 {
        font-size: 2.5rem !important;
    }
    
    .scroll-container section h3 {
        font-size: 1.75rem !important;
    }
    
    .scroll-container section {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
    
    /* Worksセクションのパディング調整 */
    .scroll-container section.works-section {
        padding: 2rem 1rem !important;
    }
    
    /* 縦書きテキストのサイズ調整 */
    .vertical-text {
        font-size: 1.5rem !important;
    }
}

/* ノイズエフェクト */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9000;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.text-stroke {
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3);
    color: transparent;
}

.vertical-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* Works画像 */
.work-item:hover img {
    transform: scale(1.05);
    filter: grayscale(0%);
}
.work-item img {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
    filter: grayscale(100%);
}

/* Service List */
.service-list li {
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding: 1.5rem 0;
    transition: padding-left 0.3s ease, color 0.3s ease;
}
.service-list li:hover {
    padding-left: 1rem;
    border-color: var(--brand-color);
    color: var(--brand-color);
}

/* Company Table */
.company-table th {
    text-align: left;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-weight: 400;
    color: #888;
    width: 120px;
}
.company-table td {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* ============================================
   アニメーション用CSSクラス
   ============================================ */

/* フェードイン */
[data-animate="fadeIn"] {
    opacity: 0;
    transition: opacity 0.6s ease-out;
}
[data-animate="fadeIn"].animate-active {
    opacity: 1;
}

/* スライドアップ */
[data-animate="slideUp"] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
[data-animate="slideUp"].animate-active {
    opacity: 1;
    transform: translateY(0);
}

/* スライドダウン */
[data-animate="slideDown"] {
    opacity: 0;
    transform: translateY(-30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
[data-animate="slideDown"].animate-active {
    opacity: 1;
    transform: translateY(0);
}

/* スライド左 */
[data-animate="slideLeft"] {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
[data-animate="slideLeft"].animate-active {
    opacity: 1;
    transform: translateX(0);
}

/* スライド右 */
[data-animate="slideRight"] {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
[data-animate="slideRight"].animate-active {
    opacity: 1;
    transform: translateX(0);
}

/* スケールイン */
[data-animate="scaleIn"] {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
[data-animate="scaleIn"].animate-active {
    opacity: 1;
    transform: scale(1);
}

/* 回転 */
[data-animate="rotate"] {
    opacity: 0;
    transform: rotate(-5deg) scale(0.95);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
[data-animate="rotate"].animate-active {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* ブラーから表示 */
[data-animate="blur"] {
    opacity: 0;
    filter: blur(10px);
    transition: opacity 0.6s ease-out, filter 0.6s ease-out;
}
[data-animate="blur"].animate-active {
    opacity: 1;
    filter: blur(0);
}

/* マグネット効果用のトランジション */
[data-magnet] {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-block;
}

/* アニメーション遅延用ユーティリティ */
.animate-delay-100 { animation-delay: 100ms; }
.animate-delay-200 { animation-delay: 200ms; }
.animate-delay-300 { animation-delay: 300ms; }
.animate-delay-500 { animation-delay: 500ms; }
.animate-delay-700 { animation-delay: 700ms; }
.animate-delay-1000 { animation-delay: 1000ms; }

/* プログレスバーアニメーション */
@keyframes progress {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

.progress-bar {
    animation: progress 2s ease-out forwards;
}

/* パルスアニメーション */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* スピナーアニメーション */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}