/*
style.css
目次
1.  基本設定・リセット
2.  変数定義 (色、フォントなど)
3.  汎用クラス (セクション、ボタンなど)
4.  ヘッダー
5.  ヒーローセクション
6.  Aboutセクション
7.  Worksセクション (トップページ)
8.  Skillセクション
9.  Contactセクション
10. フッター
11. 下層ページ用スタイル (New!)
12. アニメーション
13. レスポンシブ対応 (メディアクエリ)
*/

/* ======== 1. 基本設定・リセット ======== */
*, *::before, *::after {
    box-sizing: border-box;
}

body, h1, h2, h3, h4, p, ul {
    margin: 0;
    padding: 0;
}

ul {
    list-style: none;
}

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

img, video {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    line-height: 1.8;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ======== 2. 変数定義 ======== */
:root {
    --color-bg: #111111;
    --color-text: #e0e0e0;
    --color-primary: #ffffff; /* アクセントカラー (白) */
    --color-secondary: #aaaaaa; /* やや薄いグレー */
    --color-bg-section: #1a1a1a; /* セクション背景 */

    --font-family-base: 'Noto Sans JP', sans-serif;
    --font-family-heading: 'Poppins', sans-serif; /* 英語の見出し用 */
    
    --header-height: 80px;
}


/* ======== 3. 汎用クラス ======== */
.section {
    padding: 120px 0;
}

.section:nth-of-type(odd) {
    background-color: var(--color-bg-section);
}

.section__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 40px;
}

.section__title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 80px;
    position: relative;
    padding-bottom: 20px;
}
/* 英語のサブタイトル */
.section__title::before {
    content: attr(data-en);
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-secondary);
    font-family: var(--font-family-heading);
    font-size: 1rem;
    letter-spacing: 0.1em;
    opacity: 0.5;
}
/* 下線 */
.section__title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--color-primary);
}

.btn {
    display: inline-block;
    padding: 12px 40px;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
}

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

.btn--large {
    padding: 15px 50px;
    font-size: 1.1rem;
}


/* ======== 4. ヘッダー ======== */
.header {
    width: 100%;
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background-color: rgba(17, 17, 17, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: top 0.3s;
}

.header__inner {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
}

.header__logo {
    font-family: var(--font-family-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.header__nav-list {
    display: flex;
    gap: 40px;
}

.header__nav-item a {
    position: relative;
    font-family: var(--font-family-heading);
    letter-spacing: 0.05em;
}
.header__nav-item a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--color-primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}
.header__nav-item a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.header__hamburger {
    display: none; /* スマホ以外では非表示 */
}

/* ======== 5. ヒーローセクション ======== */
.hero {
    height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero__video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}
.hero__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.hero__content {
    text-align: center;
    color: var(--color-primary);
}

.hero__title {
    font-family: var(--font-family-heading);
    font-size: 4rem;
    letter-spacing: 0.1em;
    animation: fadeIn 2s ease-out forwards;
}

.hero__subtitle {
    font-family: var(--font-family-base);
    font-size: 1.2rem;
    opacity: 0;
    animation: fadeIn 2s 0.5s ease-out forwards;
}

.hero__scroll {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    writing-mode: vertical-rl;
    opacity: 0;
    animation: fadeIn 1s 1.5s ease-out forwards;
}
.hero__scroll::after {
    content: '';
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 50px;
    background: white;
    animation: scroll-line 1.5s infinite ease-out;
}
@keyframes scroll-line {
    0% { transform: scaleY(0); transform-origin: top; }
    50% { transform: scaleY(1); transform-origin: top; }
    51% { transform: scaleY(1); transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ======== 6. Aboutセクション ======== */
.about__content {
    display: flex;
    gap: 60px;
    align-items: center;
}
.about__image-wrapper {
    flex: 1;
    max-width: 400px;
}
.about__text-wrapper {
    flex: 1.5;
}
.about__lead {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 20px;
}
.about__text {
    margin-bottom: 40px;
}

/* ======== 7. Worksセクション (トップページ) ======== */
.works__category-container {
    display: flex;
    flex-direction: column;
    gap: 80px;
}

.works__category-title {
    font-size: 1.5rem;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-secondary);
    margin-bottom: 30px;
}

.works__item-info--static {
    padding: 25px 30px;
}

.works__item-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: bold;
}

.works__item-desc {
    font-size: 1rem;
    color: var(--color-secondary);
}

.works__category-more {
    text-align: center;
    margin-top: 40px;
}

/* ======== 8. Skillセクション ======== */
.skill__container {
    display: flex;
    justify-content: space-around;
    gap: 40px;
    text-align: center;
}
.skill__category {
    flex: 1;
    background-color: var(--color-bg);
    padding: 40px 20px;
    border-radius: 8px;
}
/* works__category-title との競合を避ける */
section.skill .skill__category-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    border-bottom: none;
}
.skill__category-title i {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 10px;
}
.skill__list li {
    line-height: 2;
}

/* ======== 9. Contactセクション ======== */
.contact {
    text-align: center;
}
.contact__text {
    margin-bottom: 40px;
    font-size: 1.1rem;
}
.contact .btn i {
    margin-right: 10px;
}

/* ======== 10. フッター ======== */
.footer {
    padding: 40px;
    background-color: #000;
    text-align: center;
    font-size: 0.9rem;
}
.footer__nav-list {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}
.footer__nav-item a:hover {
    color: var(--color-primary);
    transition: color 0.3s;
}
.footer__copyright {
    color: var(--color-secondary);
}

/* ======== 11. 下層ページ用スタイル ======== */
/* 下層ページのmain要素の開始位置を調整 */
.subpage main {
    padding-top: var(--header-height);
}

.page-header {
    background-color: var(--color-bg-section);
    padding: 80px 0;
    text-align: center;
}
.page-header__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 40px;
}
.page-header__title {
    font-family: var(--font-family-heading);
    font-size: 2.8rem;
    margin-bottom: 10px;
}
.page-header__subtitle {
    color: var(--color-secondary);
    font-size: 1.1rem;
}

.breadcrumb {
    background-color: var(--color-bg-section);
    padding-bottom: 20px;
    font-size: 0.9rem;
}
.breadcrumb__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 40px;
    color: var(--color-secondary);
}
.breadcrumb__inner a {
    transition: color 0.3s;
}
.breadcrumb__inner a:hover {
    color: var(--color-primary);
}
.breadcrumb__inner span {
    margin: 0 10px;
}

.works-list {
    padding-top: 80px;
}

/* 作品一覧ページのグリッドレイアウト */
.works__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.works__item {
    position: relative;
    overflow: hidden;
    display: block;
    border-radius: 8px; 
    background-color: var(--color-bg); 
}

.works__item-image-wrapper {
    display: block;
    line-height: 0;
    aspect-ratio: 16 / 9; /* アスペクト比を16:9に固定 */
    background-color: #333; /* 画像読み込み中の背景色 */
}

.works__item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* コンテナに合わせて画像をトリミング */
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.works__item:hover img {
    transform: scale(1.05);
}

/* 作品情報 (デフォルトで表示) */
.works__item-info {
    padding: 20px;
}

.works__item-info .works__item-title {
    font-size: 1.2rem;
}

.works__item-info .works__item-category {
    font-size: 0.9rem;
    color: var(--color-secondary);
}


.back-to-top-link {
    text-align: center;
    margin-top: 80px;
}

/* ======== 12. アニメーション ======== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* JSで付与するクラス */
.fade-in-target {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s, transform 1s;
}
.fade-in-target.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ======== 13. レスポンシブ対応 (〜768px) ======== */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .section {
        padding: 80px 0;
    }
    .section__inner {
        padding: 0 20px;
    }
    .section__title {
        font-size: 2rem;
        margin-bottom: 60px;
    }

    /* --- ヘッダー & ハンバーガー --- */
    .header__nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--color-bg);
        display: flex;
        justify-content: center;
        align-items: center;
        transform: translateX(100%);
        transition: transform 0.5s;
    }
    .header__nav.is-active {
        transform: translateX(0);
    }
    .header__nav-list {
        flex-direction: column;
        text-align: center;
        gap: 50px;
    }
    .header__nav-item a {
        font-size: 1.5rem;
    }

    .header__hamburger {
        display: block;
        width: 30px;
        height: 20px;
        position: relative;
        z-index: 1001;
        background: none;
        border: none;
        cursor: pointer;
    }
    .header__hamburger span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: var(--color-primary);
        position: absolute;
        left: 0;
        transition: transform 0.3s, top 0.3s, opacity 0.3s;
    }
    .header__hamburger span:nth-child(1) { top: 0; }
    .header__hamburger span:nth-child(2) { top: 9px; }
    .header__hamburger span:nth-child(3) { top: 18px; }

    .header__hamburger.is-active span:nth-child(1) {
        top: 9px;
        transform: rotate(45deg);
    }
    .header__hamburger.is-active span:nth-child(2) {
        opacity: 0;
    }
    .header__hamburger.is-active span:nth-child(3) {
        top: 9px;
        transform: rotate(-45deg);
    }

    /* --- ヒーロー --- */
    .hero__title {
        font-size: 2.5rem;
    }
    .hero__subtitle {
        font-size: 1rem;
    }

    /* --- About --- */
    .about__content {
        flex-direction: column;
    }
    .about__image-wrapper {
        max-width: 250px;
    }

    /* --- Works (トップ) --- */
    .works__category-title {
        font-size: 1.3rem;
    }
    .works__item-info--static {
        padding: 20px;
    }

    /* --- Skill --- */
    .skill__container {
        flex-direction: column;
    }
    
    /* --- 下層ページ --- */
    .page-header {
        padding: 60px 20px;
    }
    .page-header__title {
        font-size: 2rem;
    }
    .page-header__subtitle {
        font-size: 1rem;
    }
    .breadcrumb__inner, .section__inner {
        padding: 0 20px;
    }
    .works__grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}
