@charset "UTF-8";

/* =========================================
   基本設定 (配色・フォント)
   ========================================= */
:root {
    --bg: #d6e6de;           /* 背景色：やわらかいセージグリーン */
    --card-bg: #fbfdf9;      /* カード背景：柔らかいアイボリー */
    --text: #3d5248;         /* 基本文字色：やわらかいグリーングレー */
    --text-soft: #4d6459;    /* 補助文字色 */
    --line: #c8dbd1;         /* 区切り線 */
    --accent: #7fa08f;       /* アクセントカラー */
    --accent-deep: #6b8c7a;  /* CTAや強調用 */
    --accent-pale: #e4f0e9;  /* 淡い背景用 */
    
    /* PC初期設定 */
    --sidebar-width: 420px;
}

/* htmlタグの指定は削除（スクロール設定解除のため） */

body {
    background:
        radial-gradient(circle at 12% 18%, rgba(160, 200, 180, 0.28), transparent 24%),
        radial-gradient(circle at 82% 14%, rgba(170, 205, 188, 0.18), transparent 20%),
        radial-gradient(circle at 84% 78%, rgba(210, 232, 220, 0.18), transparent 16%),
        linear-gradient(135deg, #c8ddd4 0%, var(--bg) 42%, #bdd2c9 100%);
    color: var(--text);
    font-family: 'Noto Sans JP', sans-serif;
    margin: 0; padding: 0;
    letter-spacing: 0.03em;
    -webkit-font-smoothing: antialiased; /* 文字の表示を滑らかに */
}

/* =========================================
   レイアウト共通設定 (PCベース)
   ========================================= */
.wrapper { 
    display: flex; 
    min-height: 100vh;
    width: 100%;
}

/* --- 左サイドバー --- */
.sidebar {
    width: var(--sidebar-width); 
    height: 100vh;
    position: sticky; top: 0;
    /* パディングをさらに縮小して全体を上に上げる */
    padding: 1rem 3rem; 
    box-sizing: border-box;
    display: flex; flex-direction: column; 
    z-index: 100;
    flex-shrink: 0; /* サイドバーの幅が潰れないようにする */
    overflow-y: auto; /* 画面サイズが小さい場合にスクロールできるように修正 */
    border-right: 1px solid rgba(80, 130, 108, 0.4);
    background: linear-gradient(180deg, rgba(72, 118, 98, 0.88) 0%, rgba(58, 100, 82, 0.82) 100%);
    backdrop-filter: blur(14px);
}

.logo {
    margin-bottom: 0;
    padding: 0.75rem 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.logo-text {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
    display: block;
}

.logo-name {
    font-family: 'Fraunces', serif;
    font-size: 2.8rem;
    font-weight: 300;
    letter-spacing: 0.04em;
    color: #ffffff;
    display: block;
    line-height: 1.1;
}

.sidebar-desc {
    font-size: 0.9rem;
    line-height: 2.1;
    color: rgba(240, 252, 246, 0.92);
    white-space: pre-wrap;
    /* ロゴとの距離をさらに詰める（マイナスマージンで食い込ませる） */
    margin-top: -0.5rem; 
    max-width: 23rem;
}

/* PC/タブレット用サイドバー内の情報ラップ */
.pc-only-info {
    display: block;
}

.sns-microcopy {
    font-size: 0.8rem;
    text-align: center;
    color: rgba(240, 252, 246, 0.75);
    /* 上部マージンを詰める */
    margin-top: 1rem;
    margin-bottom: 0.2rem;
}

.sns-btn {
    display: block;
    margin: 0 auto;
    width: 90px;
    transition: opacity 0.3s, transform 0.3s, filter 0.3s;
}
.sns-btn:hover {
    opacity: 0.8;
    transform: translateY(-2px);
    filter: saturate(0.8);
}
.sns-btn img {
    width: 100%;
    height: auto;
    display: block;
}

.contact-info { 
    font-size: 0.85rem; 
    color: rgba(240, 252, 246, 0.72);
    line-height: 1.8; 
    /* 連絡先情報の位置を上げる */
    margin-top: 1rem; 
    text-align: center;
}

/* --- 右メインコンテンツエリア --- */
.main { 
    flex: 1; 
    padding: 4rem 4.5rem 5rem; 
    max-width: 1200px; /* コンテンツが広がりすぎないように制限 */
    width: 100%;      /* スマホ対策 */
    box-sizing: border-box;
}

/* カード共通デザイン */
.sticky-card {
    background: linear-gradient(180deg, rgba(251, 253, 249, 0.98) 0%, rgba(242, 247, 243, 0.98) 100%);
    padding: 5rem;
    margin-bottom: 4rem;
    min-height: 80vh;
    box-shadow: 0 22px 44px rgba(7, 11, 10, 0.24);
    display: flex; flex-direction: column;
    position: sticky; top: 2rem;
    box-sizing: border-box;
    border: 1px solid rgba(223, 233, 226, 0.24);
    border-radius: 30px;
    overflow: hidden;
    will-change: transform;
    transform: translateZ(0);
}

/* セクション個別設定 */
#intro {
    top: 2rem; z-index: 1;
    justify-content: flex-start; 
    background-image: url('../img/main.jpg'); 
    background-size: cover; background-position: center;
    color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    isolation: isolate;
}
#intro::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(45, 64, 56, 0.74) 0%, rgba(66, 84, 77, 0.25) 42%, rgba(238, 243, 239, 0.08) 100%),
        radial-gradient(circle at top right, rgba(194, 214, 201, 0.28), transparent 28%);
    z-index: -1;
}
#philosophy { top: 4rem; z-index: 2; border-top: 1px solid var(--line); }
#company { top: 5rem; z-index: 3; border-top: 1px solid var(--line); }
#projects { 
    position: relative; top: auto; z-index: 4; 
    border-top: 1px solid var(--line); margin-top: -3rem; margin-bottom: 0; 
    padding-bottom: 8rem; min-height: auto; 
}
#contact {
    position: relative; top: auto; z-index: 5;
    background: linear-gradient(135deg, #8db5a3 0%, #7a9f8d 100%);
    color: #f7fbf8; border: none;
    margin-top: -4rem; margin-bottom: 0;
    min-height: 50vh;
}
#contact .card-header {
    border-bottom-color: rgba(247, 251, 248, 0.34);
}
#contact .card-label {
    color: #f7fbf8;
    border-color: rgba(247, 251, 248, 0.46);
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 10px 24px rgba(39, 55, 48, 0.14);
}

.hero-title { font-size: 4.5rem; font-weight: 300; line-height: 1.1; margin: 0; }
.hero-title { 
    font-family: 'Fraunces', serif;
    max-width: 8.2em;
    letter-spacing: 0.01em;
}
.hero-title strong { font-weight: 600; display: block; }

.card-header {
    display: flex; justify-content: space-between; margin-bottom: 1rem;
    border-bottom: 1px solid rgba(111, 141, 127, 0.24);
    padding-bottom: 1rem;
}
.card-label {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.18em;
    color: var(--accent);
    padding: 0.4rem 0.9rem;
    border: 1px solid rgba(111, 141, 127, 0.22);
    border-radius: 999px;
    background: rgba(219, 232, 223, 0.28);
}
.card-body p { font-size: 1.05rem; line-height: 2.15; opacity: 0.95; max-width: 700px; }
.card-body h2,
.contact-btn,
.hero-title {
    font-family: 'Fraunces', serif;
}

/* 会社概要テーブル */
.company-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(111, 141, 127, 0.15);
    border-radius: 22px;
    overflow: hidden;
}
.company-table th, .company-table td { text-align: left; padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.company-table th, .company-table td {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
.company-table tr:last-child th,
.company-table tr:last-child td {
    border-bottom: none;
}
.company-table th {
    width: 30%;
    opacity: 0.8;
    font-weight: 500;
    background: rgba(219, 232, 223, 0.22);
}

/* 制作実績グリッド */
.proj-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; margin-top: 3rem;
}
.proj-item {
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s, opacity 0.3s;
    position: relative;
    display: block;
    background: rgba(255, 255, 255, 0.64);
    padding: 0.9rem;
    border-radius: 24px;
    border: 1px solid rgba(111, 141, 127, 0.12);
    will-change: transform;
}
.proj-item:hover {
    opacity: 0.94;
    transform: translateY(-7px);
    box-shadow: 0 16px 26px rgba(66, 84, 77, 0.12);
}
.proj-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    background: var(--accent-pale);
    display: block;
    border-radius: 18px;
    filter: saturate(0.86) contrast(0.98);
}
.proj-title {
    font-weight: 700;
    margin-top: 1rem;
    display: block;
    font-size: 1.1rem;
    font-family: 'Fraunces', serif;
}
.proj-loc { font-size: 0.85rem; color: var(--accent); font-style: italic; }

.contact-btn {
    color: #f7fbf8;
    font-size: 1.25rem;
    margin-top: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    border: 1px solid rgba(247, 251, 248, 0.4);
    padding: 0.95rem 1.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    transition: opacity 0.3s, transform 0.3s, background 0.3s;
}
.contact-btn::after {
    content: "→";
    font-size: 1rem;
}
.contact-btn:hover {
    opacity: 0.95;
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.14);
}

/* ライトボックス */
.lightbox {
    display: none; position: fixed; z-index: 2000; left: 0; top: 0;
    width: 100%; height: 100%; overflow: hidden;
    background-color: rgba(80, 115, 98, 0.92);
    justify-content: center; align-items: center; flex-direction: column;
}
.lightbox-content { max-width: 90%; max-height: 80vh; object-fit: contain; animation: fadein 0.3s; }
.lb-controls {
    position: absolute; width: 100%; top: 50%; transform: translateY(-50%);
    display: flex; justify-content: space-between; padding: 0 2rem; box-sizing: border-box; pointer-events: none;
}
.lb-btn {
    pointer-events: auto; cursor: pointer; color: #fff; font-size: 3rem; user-select: none;
    background: rgba(219, 232, 223, 0.18); width: 60px; height: 60px;
    display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: 0.3s; font-family: sans-serif;
}
.lb-btn:hover { background: rgba(219, 232, 223, 0.32); }
.close {
    position: absolute; top: 20px; right: 35px; color: #f1f1f1; font-size: 40px; font-weight: bold; cursor: pointer; z-index: 2001; font-family: sans-serif;
}
@keyframes fadein { from {opacity:0} to {opacity:1} }

/* スマホ用フッター（デフォルトは非表示） */
.mobile-footer {
    display: none;
}


/* =========================================
   レスポンシブ対応 (common.css準拠)
   ========================================= */

/* --- タブレット (769px 〜 1024px) --- */
@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --sidebar-width: 300px; /* サイドバーを少し細くしてメイン領域を確保 */
    }

    .sidebar {
        padding: 3rem 2rem; /* 余白を縮小 */
    }
    
    .main {
        padding: 2rem; /* メインエリアの余白を縮小 */
    }

    /* === 修正箇所：タブレット表示の調整 === */
    .sticky-card {
        padding: 3rem 2rem; /* 左右の余白を少し詰める */
        min-height: auto;   /* 80vhを解除して、中身の量に合わせる（間延び防止） */
        margin-bottom: 0;   /* 修正: 隙間をなくして連結させる (3rem -> 0) */
        border-radius: 24px;
    }

    /* トップ画像だけはある程度の高さを確保する */
    #intro {
        min-height: 50vh; 
    }
    /* ==================================== */

    /* 文字サイズ拡大調整 */
    .sidebar-desc {
        font-size: 1rem; /* 0.85remから拡大 */
    }
    .contact-info {
        font-size: 1rem; /* 0.85remから拡大 */
    }
    .hero-title {
        font-size: 4.2rem; /* 3.5remから拡大 */
    }
    .card-label { 
        font-size: 1.3rem; /* 1.2remから拡大 */
    }
    .card-body p { 
        font-size: 1.25rem; /* 1.15remから拡大 */
    }
    .company-table th, .company-table td {
        font-size: 1.1rem; /* テーブル内も拡大 */
    }
    
    .proj-grid {
        grid-template-columns: repeat(2, 1fr); /* 明示的に2列を指定して維持する */
        gap: 1.5rem; /* グリッド間隔調整 */
    }
    
    .proj-img {
        height: 220px; /* 画像高さ調整 */
    }
}

/* --- スマートフォン (〜 768px) --- */
@media (max-width: 768px) {
    .wrapper {
        flex-direction: column; /* 縦積みに変更 */
        /* overflow-x: hidden;  <-- Stickyを効かせるために削除 */
    }

    /* サイドバー → トップヘッダー的な扱いに */
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        /* パディングの上部を3remから1remに変更してロゴを上げる */
        padding: 1rem 1.5rem 1rem 1.5rem;
        border-right: none;
        background: linear-gradient(180deg, rgba(72, 118, 98, 0.88) 0%, rgba(72, 118, 98, 0.45) 100%);
        backdrop-filter: blur(10px);
    }

    /* サイドバー内のInstagramと連絡先情報を非表示にする */
    .pc-only-info {
        display: none;
    }
    
    .logo {
        display: flex;
        justify-content: center;
        /* margin-bottomを1.5remから0に変更してロゴとテキストの間隔を詰める */
        margin-bottom: 0;
    }
    
    .logo-img {
        max-width: 250px; /* スマホではロゴを少し小さく */
    }
    
    .sidebar-desc {
        text-align: center; /* 説明文を中央寄せで見やすく */
        /* margin-topを0から-0.5remに変更してさらに食い込ませる */
        margin-top: -0.5rem;
    }
    
    /* メインコンテンツエリア */
    .main {
        padding: 0 1.5rem 4rem 1.5rem; /* 横幅いっぱいに使うためPadding調整 */
    }

    /* スマホでもセクションが重なるアニメーション（Sticky）を有効化 */
    .sticky-card {
        padding: 2.5rem 1.5rem;
        /* Stickyを有効化 */
        position: sticky !important;
        /* 重なり効果を出すために高さを確保 */
        min-height: 80vh;
        margin-bottom: 4rem !important;
        /* 上部に影をつけて重なりを強調 */
        box-shadow: 0 -5px 12px rgba(66, 84, 77, 0.08);
        border-radius: 26px;
    }

    /* 各セクションの重なり位置（top）を少しずつずらして設定 */
    #intro { 
        top: 2rem !important; 
        
        /* 修正: JSで高さを固定するため、CSSはJS無効時等のフォールバックとして設定 */
        min-height: 60vh;
    }
    #philosophy { top: 3.5rem !important; }
    #company { top: 5rem !important; }
    
    #projects {
        padding: 2.5rem 1.5rem;
        position: sticky !important;
        top: 6.5rem !important;
        margin-top: -2rem !important; /* 重なり調整 */
        margin-bottom: 0 !important;
        min-height: auto;
        padding-bottom: 8rem;
    }

    #contact {
        padding: 2.5rem 1.5rem;
        position: sticky !important;
        top: 8rem !important;
        margin-top: -2rem !important;
        margin-bottom: 0 !important;
        min-height: 50vh;
    }
    
    /* スマホ用フッターを表示 */
    .mobile-footer {
        display: block;
        padding: 4rem 1.5rem;
        text-align: center;
        margin-top: -2rem;
        position: relative;
        z-index: 20; /* 最前面に */
        background: linear-gradient(180deg, rgba(195, 220, 208, 0) 0%, rgba(195, 220, 208, 0.9) 16%, #bdd2c9 100%);
    }

    /* ----------------------------------------------------- */

    .hero-title {
        font-size: 2.8rem;
        word-break: normal;
    }
    
    /* カード内の文字調整 */
    .card-label { font-size: 1rem; }
    .card-body p { font-size: 1rem; }

    /* 実績グリッドを1列に */
    .proj-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    .proj-img {
        height: 250px; /* スマホで見やすい高さに */
    }
    
    /* テーブル調整 */
    .company-table th { width: 35%; font-size: 0.9rem; }
    .company-table td { font-size: 0.9rem; }

    .company-table th,
    .company-table td {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* 連絡先情報 */
    .contact-info {
        margin-top: 2rem;
        margin-bottom: 2rem;
    }
}
