/* --- 全体の基本設定 --- */
body {
    margin: 0;
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    background-color: #1a1a1a; /* 少し柔らかい黒 */
    color: #f0f0f0; /* 少し柔らかい白 */
    overflow-x: hidden; /* 横スクロールを防止 */
}

/* --- オープニングアニメーション --- */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    animation: fadeOut 3.5s ease-in-out forwards;
}

.splash-logo {
    font-size: 3rem;
    color: #f0f0f0;
    animation: fadeInOut 3.5s ease-in-out forwards;
}

@keyframes fadeInOut {
    0%   { opacity: 0; transform: scale(0.95); }
    30%  { opacity: 1; transform: scale(1); }
    80%  { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.95); }
}

@keyframes fadeOut {
    0%   { opacity: 1; }
    80%  { opacity: 1; }
    100% { opacity: 0; pointer-events: none; }
}

/* --- ヘッダーとナビゲーション --- */
header {
    padding: 20px;
}

.main-title {
    text-align: center;
    font-size: 2.5rem;
    margin: 40px 0;
}

/* --- 作品一覧のレイアウト --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: 0 40px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 20;
}

.project-item {
    background-color: #2c2c2c;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: #f0f0f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.project-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.project-item h3 {
    margin: 0;
    padding: 20px;
    font-size: 1.2rem;
}

/* --- プロフィールページのスタイル --- */
main {
    position: relative;
    z-index: 20;
    text-align: center;
}
main h1 {
    text-align: center;
    margin-bottom: 50px;
}
main section {
    max-width: 800px;
    margin: 0 auto 40px;
    padding: 0 20px;
    text-align: left;
}
main h2 {
    font-size: 2rem;
}
main h3 {
    border-bottom: 2px solid #555;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
main ul {
    list-style: none;
    padding: 0;
}
main li {
    margin-bottom: 10px;
    font-size: 1.1rem;
}
main a {
    color: #61dafb;
    text-decoration: none;
}
main a:hover {
    text-decoration: underline;
}

/* --- ハンバーガーメニューのスタイル --- */
.hamburger-menu {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.hamburger-menu span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #f0f0f0;
    border-radius: 2px;
    transition: all 0.4s;
}

.hamburger-menu.is-active span:nth-child(1) {
    transform: translateY(12px) rotate(45deg);
}
.hamburger-menu.is-active span:nth-child(2) {
    opacity: 0;
}
.hamburger-menu.is-active span:nth-child(3) {
    transform: translateY(-12px) rotate(-45deg);
}

.nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(26, 26, 26, 0.95);
    z-index: 50;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

.nav-menu.is-active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.nav-menu ul {
    list-style: none;
    padding: 0;
    text-align: center;
}
.nav-menu li {
    margin: 30px 0;
}
.nav-menu a {
    color: #f0f0f0;
    text-decoration: none;
    font-size: 2rem;
    font-weight: bold;
}

/* --- index.html用 背景アニメーション --- */
.background-lines span {
    position: absolute;
    top: -250px;
    width: 2px;
    background-color: rgba(68, 68, 68, 0.3);
    animation: fall linear infinite;
    z-index: -1;
}

@keyframes fall {
    to {
        transform: translateY(120vh);
    }
}

.background-lines span:nth-child(1) { left: 5%; animation-duration: 12s; animation-delay: -5s; height: 150px; }
.background-lines span:nth-child(2) { left: 15%; animation-duration: 9s; animation-delay: -12s; height: 200px; }
.background-lines span:nth-child(3) { left: 25%; animation-duration: 15s; animation-delay: -3s; height: 100px; }
.background-lines span:nth-child(4) { left: 35%; animation-duration: 10s; animation-delay: -8s; height: 250px; }
.background-lines span:nth-child(5) { left: 45%; animation-duration: 18s; animation-delay: -1s; height: 120px; }
.background-lines span:nth-child(6) { left: 55%; animation-duration: 11s; animation-delay: -15s; height: 180px; }
.background-lines span:nth-child(7) { left: 65%; animation-duration: 14s; animation-delay: -6s; height: 220px; }
.background-lines span:nth-child(8) { left: 75%; animation-duration: 8s; animation-delay: -10s; height: 130px; }
.background-lines span:nth-child(9) { left: 85%; animation-duration: 16s; animation-delay: -4s; height: 190px; }
.background-lines span:nth-child(10) { left: 95%; animation-duration: 13s; animation-delay: -9s; height: 160px; }

/* --- ▼▼▼ Profileタイトル Circuit Trace & Disperse エフェクト ▼▼▼ --- */
.title-container {
    position: relative;
    text-align: center;
    margin-bottom: 50px;
}

.title-effect {
    font-size: 4rem;
    font-weight: bold;
    display: inline-block;
    margin: 0;
    z-index: 1;
    position: relative;
}

.circuit-trace {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* JavaScriptで生成される光の線のスタイル */
.trace-segment {
    position: absolute;
    /* ▼▼▼ 初期位置をコンテナの左上に固定 ▼▼▼ */
    top: 0;
    left: 0;
    width: 20px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #61dafb, transparent);
    box-shadow: 0 0 5px #61dafb, 0 0 10px #61dafb;
    opacity: 0;
    transform-origin: center left;
}

/* --- ▼▼▼ 作品詳細ページのスタイル ▼▼▼ --- */

.project-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 60px;
}

.project-detail-container {
    display: flex; /* ← これが超重要！左右に並べる命令 */
    flex-wrap: wrap; /* スマホなどで幅が狭くなったら縦並びにする */
    gap: 40px; /* 画像と説明の間の隙間 */
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    align-items: flex-start; /* 上揃えで配置 */
}

/* 左側の画像エリア */
.project-image {
    flex: 1; /* 比率1で幅を確保 */
    min-width: 300px; /* 最小幅を指定して潰れないように */
    max-width: 450px; /* ← ★この数値を調整してください！ */
}

.project-image img {
    width: 100%;
    border-radius: 8px; /* 画像の角を少し丸く */
}

/* 右側の説明エリア */
.project-description {
    flex: 1.5; /* 比率1.5で、画像より少し広い幅を確保 */
    min-width: 300px;
}

.project-description section {
    margin-bottom: 30px;
}

.project-description h3 {
    border-bottom: 2px solid #555;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.project-description p,
.project-description li {
    font-size: 1.1rem;
    line-height: 1.8; /* 行間を少し広げて読みやすく */
}

.project-description ul {
    list-style: none;
    padding: 0;
}