@charset "UTF-8"; 

/* --- Base Styles --- */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --accent-color: #8fa1b3; /* くすみブルー */
    --light-gray: #f4f4f4;
    --transition: all 0.3s ease;
}

body {
    margin: 0;
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    letter-spacing: 0.05em;
    overflow-x: hidden; /* 横揺れ防止 */
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; height: auto; display: block; }

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 120px 0;
}

h2 {
    font-size: 2rem;
    margin-bottom: 50px;
    text-align: center;
    letter-spacing: 0.1em;
    font-weight: 300;
}

/* --- Animation Classes (スクロールでふわっと表示) --- */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }


/* --- Header --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.header-inner {
    display: flex;
    justify-content: space-between; /* PCでは左右に分ける */
    align-items: center;
    height: 70px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo { font-size: 1.2rem; font-weight: bold; letter-spacing: 0.1em; }

nav ul { display: flex; gap: 30px; }
nav a { font-size: 0.85rem; font-weight: 500; letter-spacing: 0.1em; }
nav a:hover { color: var(--accent-color); }

/* --- スマホ用のヘッダー調整（中央揃えに戻す） --- */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;    /* 縦に並べる */
        justify-content: center;   /* 上下中央 */
        text-align: center;        /* 文字を中央 */
        height: auto;
        padding: 15px 0;
    }

    .logo {
        margin-bottom: 10px;      /* ロゴの下に隙間を作る */
    }

    nav ul {
        justify-content: center;   /* メニューを中央に寄せる */
        gap: 20px;
    }
}

/* --- Hero --- */
#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: url('./img/hero_bg.jpg') no-repeat center center / cover; 
    position: relative;
}
#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1; 
}

.hero-content {
    z-index: 2;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 200;
    letter-spacing: 0.05em;
    line-height: 1.2;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5), 0 0 5px rgba(0, 0, 0, 0.3);
}
.hero-content p {
    font-size: 1.1rem;
    color: #ccc;
    margin-bottom: 40px;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.4);
}
.hero-btn {
    display: inline-block;
    padding: 12px 40px;
    border: 1px solid var(--text-color); 
    background: transparent;
    border-radius: 50px;
    transition: all 0.3s;
    font-size: 1rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    color: var(--text-color);
}
#hero .hero-btn {
    border: 1px solid #fff; 
    color: #fff;
}

.hero-btn:hover {
    background: var(--text-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
#hero .hero-btn:hover {
    background: rgba(255, 255, 255, 0.1); 
    color: #fff;
    border-color: #fff;
}


/* --- About --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-img {
    background-color: #eee;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 20px 20px 0px var(--light-gray);
}

.about-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.en-name { font-size: 0.8em; letter-spacing: 0.1em; color: #777; }
.about-text h3 { font-size: 1.4rem; margin-bottom: 20px; }

/* --- About：スマホ --- */
@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr; /* 1カラム */
        gap: 40px;
    }

    .about-img {
        box-shadow: none; /* スマホでは影を軽く（任意） */
    }

    .about-text {
        text-align: left; /* 念のため */
    }
}


/* --- Skill --- */
.skill-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.skill-item {
    background: #fff;
    border: 1px solid #eee;
    padding: 30px 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.02);
    transition: transform 0.3s;
}
.skill-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}
.skill-name { font-weight: bold; margin-bottom: 15px; display: block; font-size: 1.1rem;}

.skill-bar {
    height: 6px;
    background: #eee;
    width: 100%;
    position: relative;
    border-radius: 3px;
    overflow: hidden;
}

.skill-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--accent-color);
    width: 0;
    transition: width 1.5s ease-out;
}

#skill .is-visible .skill-bar::after {
    width: var(--width, 80%); 
}

/* --- Skill：スマホは2カラム --- */
@media (max-width: 768px) {
    .skill-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}


/* --- Filter Buttons --- */
.filter-btn {
    background: none;
    border: 1px solid #ccc;
    color: #555;
    padding: 8px 20px;
    margin: 0 5px;
    cursor: pointer;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.3s;
    letter-spacing: 0.05em;
    font-weight: 500;
}
.filter-btn:hover {
    background: #f0f0f0;
}
.filter-btn.active {
    background: var(--text-color);
    border-color: var(--text-color);
    color: #fff;
}

/* --- Works --- */
.works-wrapper {
    overflow: hidden;
    width: 100%;
    padding: 40px 0;
}

.works-track {
    display: flex;
    gap: 40px;
    width: max-content;
    animation: scroll-loop 50s linear infinite;
    padding: 30px 40px;
}

.works-track:hover {
    animation-play-state: paused;
}

@keyframes scroll-loop {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* グリッド表示モード（カテゴリ選択時） */
.works-track.grid-mode {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px; 
    width: 100%;
    animation: none; 
    padding: 0 20px;
    margin: 30px auto; 
    max-width: 1000px; 
    box-sizing: border-box;
    transition: all 0.5s ease; 
}

.work-item.hidden {
    display: none;
    opacity: 0;
}

.work-item {
    width: 400px; 
    flex-shrink: 0;
    cursor: pointer;
    transition: var(--transition);
}

/* スマホ・Safariでの突き抜け防止 */
.works-track.grid-mode .work-item {
    width: 100% !important;
}

.work-thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
    background-color: #e0e0e0;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
.work-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s;
}
.work-item:hover .work-thumb img { transform: scale(1.1); }
.work-title { font-size: 1.2rem; font-weight: bold; margin-bottom: 5px; }
.work-cat { font-size: 0.8rem; color: #999; text-transform: uppercase; }

@media (max-width: 768px) {
    .works-filter {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        margin-bottom: 30px;
    }
    .works-track.grid-mode {
        grid-template-columns: 1fr;
    }
}


/* --- Contact --- */
form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
}
input, textarea {
    width: 100%;
    padding: 18px;
    background: #fafafa;
    border: 1px solid #eee;
    box-sizing: border-box;
}
button[type="submit"] {
    background: var(--text-color);
    color: #fff;
    padding: 18px;
    border: none;
    cursor: pointer;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 60px 0;
    background: #fff;
    font-size: 0.8rem;
    color: #888;
    border-top: 1px solid #f4f4f4;
}

/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.98); /* 背景を白に */
    z-index: 2000;
    overflow-y: auto; /* モーダル自体をスクロール可能にする */
    align-items: flex-start; /* 上寄せにする（これでスマホでも画像が上から見える） */
    justify-content: center;
    padding: 40px 0;
    -webkit-overflow-scrolling: touch;
}
.modal.open { display: flex; }

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 10px 50px rgba(0,0,0,0.1);
    margin: auto; /* 中央配置の補助 */
}

/* PC表示の設定 */
@media(min-width: 768px) {
    .modal-content {
        flex-direction: row;
        height: 80vh; /* PCでは画面に収める */
    }
    .modal-left, .modal-right {
        height: 100%;
        overflow-y: auto; /* 左右別々にスクロール */
    }
}

.modal-left {
    flex: 1.6;
    background: #f7f9fc;
    padding: 50px;
}

.modal-right {
    flex: 1;
    padding: 50px;
}

/* 閉じるボタンを画面右上に固定 */
.close-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    font-size: 3rem;
    cursor: pointer;
    z-index: 2100;
    color: #333;
    line-height: 1;
}

/* 画像とスライドボタン */
.mockup-container {
    position: relative;
    width: 100%;
}
.mockup-container img {
    width: 100%;
    height: auto;
    display: block;
}

.mockup-container .slide-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.mockup-container .slide-btn.prev {
    left: 10px;
}

.mockup-container .slide-btn.next {
    right: 10px;
}

.slide-btn {
    background: rgba(0,0,0,0.3);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* スマホ用調整 */
@media (max-width: 768px) {
    .modal-left, .modal-right { padding: 30px 20px; }
    .modal-content { height: auto; } /* スマホでは縦に長く伸ばす */
    .close-btn { top: 10px; right: 15px; font-size: 2.5rem; }
}
2. script.js の修正
モーダルを閉じる時の動きをスムーズにするため、closeModal 関数を以下に差し替えてください。

JavaScript
window.closeModal = function(e) {
    // 画面のどこをクリックしても閉じれるように、
    // または閉じるボタンが押された時に実行
    if (e && e.target !== modal && e.target.className !== 'close-btn' && e.target.id !== 'modal') {
        return; 
    }
    
    modal.classList.remove('open');
    setTimeout(() => {
        modal.style.display = 'none';
    }, 400);
    document.body.style.overflow = 'auto'; // スクロール禁止を解除
};