/* カラーパレット */
:root {
    --dark-purple: #3A2B50; /* メインの暗い紫 */
    --medium-purple: #5D3C8C; /* アクセントの紫 */
    --light-purple: #9B6DC9; /* 明るめの紫（強調用） */
    --text-color: #333; /* 本文色 */
    --light-text-color: #EAEAEA; /* 明るいテキスト色 */
    --bg-color: #f8f8f8; /* 薄い背景色 */
    --card-bg: #ffffff; /* カード背景色 */
}

body {
    font-family: 'Noto Sans JP', sans-serif; /* 日本語フォントを優先 */
    line-height: 1.7;
    margin: 0;
    padding: 0;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 16px;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', 'Noto Sans JP', serif; /* タイトルは英字フォント */
    color: var(--dark-purple);
    margin-top: 0;
    margin-bottom: 20px;
    line-height: 1.3;
}

a {
    color: var(--medium-purple);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover {
    color: var(--light-purple);
    text-decoration: underline;
}

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

/* Header / Hero Section */
.hero {
    background: var(--dark-purple); /* 暗い紫 */
    color: var(--light-text-color);
    padding: 80px 20px;
    text-align: center;
}
.hero h1 {
    font-size: 3.5em; /* 大きく強調 */
    margin: 0;
    color: var(--light-text-color);
    letter-spacing: 2px;
}
.hero p {
    font-size: 1.4em;
    margin: 15px 0 30px;
    font-weight: 300;
}
.social-links a {
    color: var(--light-text-color);
    text-decoration: none;
    margin: 0 15px;
    font-size: 1.2em;
    border: 1px solid var(--light-text-color);
    padding: 8px 20px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.social-links a:hover {
    background-color: var(--medium-purple);
    color: var(--light-text-color);
    text-decoration: none;
    border-color: var(--medium-purple);
}


/* Sections */
section {
    background: var(--card-bg); /* 白い背景 */
    margin-bottom: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); /* 影で立体感を */
}
h2 {
    text-align: center;
    font-size: 2.2em;
    padding-top: 20px;
    padding-bottom: 20px;
    margin-bottom: 30px;
    position: relative;
}
h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--medium-purple); /* アクセント紫のアンダーライン */
    border-radius: 2px;
}

/* About Me */
#about p {
    text-align: center;
    font-size: 1.1em;
    max-width: 700px;
    margin: 0 auto;
}

/* Skills */
.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    padding: 20px 0;
}
.skill-category {
    background: var(--bg-color); /* 薄い背景色 */
    padding: 20px;
    border-radius: 8px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05); /* 内側に影 */
}
.skill-category h3 {
    border-bottom: 2px solid var(--light-purple); /* 明るい紫のアンダーライン */
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.3em;
    color: var(--dark-purple);
    text-align: center;
}
.skill-category ul {
    list-style: none;
    padding: 0;
    text-align: center; /* 中央寄せ */
}
.skill-category li {
    margin-bottom: 8px;
    font-size: 1.0em;
}

/* Works */
.work-item {
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px dashed var(--medium-purple); /* 点線で区切り */
}
.work-item:last-child {
    border-bottom: none; /* 最後は点線なし */
}
.work-item h3 {
    text-align: center;
    background: var(--medium-purple); /* アクセント紫 */
    color: var(--light-text-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 30px;
    font-size: 1.8em;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.work-content {
    display: flex;
    gap: 40px;
    flex-wrap: wrap; /* レスポンシブ対応 */
    align-items: flex-start; /* 上揃え */
}
.work-image {
    flex: 1;
    min-width: 300px; /* 小さくなったら折り返す */
    max-width: 45%; /* 大きな画面での幅調整 */
    text-align: center;
}
.work-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 2px solid var(--medium-purple);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.work-description {
    flex: 2;
    min-width: 400px; /* 小さくなったら折り返す */
}
.work-description h4 {
    margin-top: 0;
    border-left: 5px solid var(--light-purple); /* 明るい紫の左線 */
    padding-left: 15px;
    font-size: 1.4em;
    color: var(--dark-purple);
}
.work-description p {
    margin-bottom: 1em;
}
.diagram {
    max-width: 100%;
    border: 1px solid #ddd;
    padding: 5px;
    margin-top: 15px;
}
.work-description a {
    display: inline-block; /* リンクをブロック化してマージン */
    margin-top: 5px;
}

/* Contact */
#contact {
    text-align: center;
    padding-bottom: 40px;
}
.email {
    font-weight: bold;
    font-size: 1.5em;
    color: var(--dark-purple);
    margin-top: 20px;
}

/* Footer */
footer {
    text-align: center;
    padding: 25px;
    background: var(--dark-purple); /* 暗い紫 */
    color: var(--light-text-color);
    font-size: 0.9em;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5em;
    }
    .hero p {
        font-size: 1em;
    }
    h2 {
        font-size: 1.8em;
    }
    .container {
        padding: 30px 15px;
    }
    .work-content {
        flex-direction: column; /* スマートフォンでは縦並び */
        align-items: center;
    }
    .work-image, .work-description {
        min-width: unset;
        width: 100%;
    }
}
/* ▼▼▼ JavaScript用に追加 ▼▼▼ */

/* アニメーションの初期状態（透明で、少し下にいる） */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* 画面に入ったときに適用するクラス（不透明で、元の位置に戻る） */
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}