/* CSS変数（カラーパレットとフォント） */
:root {
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --primary-text-color: #e0e0e0;
    --secondary-text-color: #a0a0a0;
    --accent-color: #c83a3a;
    --accent-hover-color: #e04f4f;
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Noto Sans JP', sans-serif;
}

/* 基本設定 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--primary-text-color);
    font-family: var(--font-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ヘッダー */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: rgba(18, 18, 18, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    transition: background-color 0.3s ease;
}

header .logo a {
    display: flex;
    align-items: center;
}

header .logo img {
    height: 50px;
    width: auto;
    transition: opacity 0.3s ease;
}

header .logo a:hover img {
    opacity: 0.8;
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

header nav a {
    font-family: var(--font-primary);
    font-weight: 400;
    position: relative;
    padding-bottom: 0.25rem;
}

header nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

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

/* ヒーローセクション */
#hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden; /* はみ出した部分は隠す */
}

/* 動画の基本設定（これが新しい、より強力なコードです） */
.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* アスペクト比を保ったまま、親要素を完全に覆う（最重要） */
    object-fit: cover; 
    z-index: -2;
}

.hero-video-desktop {
    display: block; /* デフォルトで表示 */
}
.hero-video-mobile {
    display: none; /* デフォルトで非表示 */
}

/* 画面幅が768px以下の場合 */
@media (max-width: 768px) {
    .hero-video-desktop {
        display: none; /* PC用を非表示 */
    }
    .hero-video-mobile {
        display: block; /* モバイル用を表示 */
    }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.hero-text {
    z-index: 1;
    /* 最初は非表示 */
    opacity: 0;
    transform: translateY(20px);
    /* 1.5秒かけてフェードイン。動画終了後0.5秒のタメを作る */
    transition: opacity 1.5s ease-out 0.5s, transform 1.5s ease-out 0.5s;
}

/* JavaScriptによってこのクラスが付与されると表示される */
.hero-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-text h1 {
    font-family: var(--font-primary);
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.hero-text p {
    font-family: var(--font-primary);
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: var(--secondary-text-color);
    font-weight: 300;
}

/* 共通コンテナとセクションタイトル */
.container {
    padding: 6rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-family: var(--font-primary);
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: var(--accent-color);
}

/* Worksセクション */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.grid-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background-color: var(--surface-color);
    aspect-ratio: 16 / 9;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.grid-item .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 60%);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.grid-item .overlay h3 {
    color: #fff;
    font-family: var(--font-primary);
    transform: translateY(10px);
    transition: transform 0.4s ease;
}

.grid-item a:hover img {
    transform: scale(1.05);
    filter: brightness(0.8);
}

.grid-item a:hover .overlay {
    opacity: 1;
}

.grid-item a:hover .overlay h3 {
    transform: translateY(0);
}

.grid-item .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 70px;
    height: 70px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
    backdrop-filter: blur(5px);
}

.grid-item .play-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 52%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent var(--bg-color);
}

.grid-item a:hover .play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Moreボタンと戻るボタンの共通スタイル */
.more-button-container,
.back-button-container {
    text-align: center;
    margin-top: 3rem;
}

/* Aboutセクション */
.about-content {
    display: grid;
    grid-template-columns: 1fr 300px; /* PCでは左側が可変、右側が300pxの2カラム */
    grid-template-areas:
        "title title"   /* ←【最重要】タイトルが2カラムをまたぐように修正 */
        "desc  image";
    align-items: center;
    gap: 2rem 3rem;
}

.about-title {
    grid-area: title;
}

.about-image {
    grid-area: image;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.about-description {
    grid-area: desc;
    text-align: left;
}

.about-image img {
    width: 100%;
    height: auto;
    border-radius: 50%;
    object-fit: cover;
    aspect-ratio: 1 / 1;
}

/* 画面幅が768px以下の場合 (スマートフォン表示) */
@media (max-width: 768px) {
    .about-content {
        grid-template-columns: 1fr; /* 1カラムにする */
        grid-template-areas: /* 表示順をここで定義 */
            "title"
            "image"
            "desc";
        gap: 2rem;
    }

    .about-title .section-title {
        text-align: center; /* タイトルは中央揃えを維持 */
    }

    .about-description {
         text-align: left; /* 本文は左揃えを維持 */
    }
}

/* Contactセクション */
#contact p {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--secondary-text-color);
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background-color: var(--surface-color);
    border: 1px solid #333;
    border-radius: 4px;
    color: var(--primary-text-color);
    font-family: var(--font-secondary);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.btn {
    padding: 0.8rem 1.5rem;
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    align-self: center;
}

.btn:hover {
    background-color: var(--accent-hover-color);
}

/* フッター */
footer {
    text-align: center;
    padding: 2rem 5%;
    background-color: var(--surface-color);
    color: var(--secondary-text-color);
    font-size: 0.9rem;
}

/* フェードインアニメーション */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Works Archiveページ用のスタイル */
#archive {
    padding-top: 120px;
}

.archive-list {
    max-width: 800px;
    margin: 0 auto;
}

.archive-item {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--accent-color);
}

.archive-title {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--primary-text-color);
}

.archive-meta {
    color: var(--secondary-text-color);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.archive-description {
    line-height: 1.8;
}

/* --- CSV表示用の新しいスタイルを追加 --- */

.archive-category-title {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    color: var(--primary-text-color);
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #444;
}

/* 最初のカテゴリタイトルの上のマージンは不要なので削除 */
.archive-category-title:first-of-type {
    margin-top: 0;
}

.archive-item-simple {
    display: flex;
    align-items: baseline;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--surface-color);
    flex-wrap: wrap; /* 画面が狭い時に折り返す */
}

.archive-year {
    color: var(--secondary-text-color);
    font-size: 1rem;
    width: 60px; /* 年の幅を固定 */
    flex-shrink: 0; /* 縮まないようにする */
}

.archive-work-title {
    color: var(--primary-text-color);
    font-size: 1.1rem;
    font-weight: 400;
}

.archive-note {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

/* --- 「他 多数」用のスタイルをここから追加 --- */
.archive-footer-text {
    text-align: center;
    margin-top: 3rem;
    color: var(--secondary-text-color);
    font-size: 1.1rem;
}
/* --- ここまで追加 --- */


/* レスポンシブ対応 */
@media (max-width: 768px) {
    header {
        padding: 1rem 3%;
    }
   .container {
        padding: 4rem 3%;
    }
   .about-content {
        flex-direction: column;
        text-align: center;
    }
   .about-text .section-title {
        text-align: center;
    }
   .about-text .section-title::after {
        left: 50%;
        transform: translateX(-50%);
    }

    /* モバイル用の動画に切り替え */
    .hero-video-desktop {
        display: none;
    }
    .hero-video-mobile {
        display: block;
    }
}


