/* 変数定義 */
:root {
    --primary-color: #7d44c9;
    /* メインのパープル */
    --primary-light: #9f6ee8;
    --background-light: #f4f7f6;
    --background-dark: #222831;
    --text-color-dark: #333;
    --text-color-light: #fff;
    --gradient-hero: linear-gradient(135deg, #f0f0ff 0%, #d8ccff 100%);
    --gradient-hero-bg: radial-gradient(circle at 50% 50%, rgba(200, 150, 255, 0.4) 0%, rgba(255, 255, 255, 0) 70%);
}

/* --- リセットと基本スタイル --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    color: var(--text-color-dark);
    background-color: var(--background-light);
    line-height: 1.6;
    scroll-behavior: smooth;
    /* スムーススクロールを有効にする */
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-light);
}

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

.section-padding {
    padding: 80px 0;
}

.section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5em;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    color: var(--text-color-dark);
}

.section-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 50px;
}

/* --- ボタンの共通スタイル --- */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
}

.primary-btn {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    border: 2px solid var(--primary-color);
}

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

.secondary-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.secondary-btn:hover {
    background-color: rgba(125, 68, 201, 0.1);
    /* 薄いパープルの背景 */
}


/* --- 1. ヘッダー (ナビゲーションバー) --- */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.9);
    /* 半透明の白 */
    backdrop-filter: blur(10px);
    /* ぼかし効果 */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo a {
    font-family: 'Poppins', cursive;
    /* ロゴのフォントを調整 */
    font-size: 1.8em;
    font-weight: 700;
    color: var(--background-dark);
    /* ロゴ画像を適用する場合: */
    /* background-image: url('logo.svg'); */
}

nav a {
    margin-left: 30px;
    font-weight: 600;
    color: #555;
    position: relative;
}

nav a:hover,
nav a.active {
    color: var(--primary-color);
}


/* --- 2. メインビジュアル (ヒーローセクション) --- */
.hero-section {
    min-height: 100vh;
    display: flex;
    /* 修正: コンテンツを垂直方向で中央に保ちつつ、水平方向は中央にリセット */
    align-items: center;
    justify-content: center;
    /* ★修正: 中央配置に戻す ★*/
    text-align: left;
    /* テキストの揃えは左寄せを維持 */

    padding-top: 80px;
    /* ヘッダーの高さ分 */
    /*background: var(--gradient-hero);*/
    /* 背景のグラデーション */
    background:
        linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3)),
        /* 黒を30%透過して重ねる */
        url('img/hero-background.png');
    /* その下に画像を配置 */

    background-size: cover;
    /* 要素全体を覆うように拡大縮小 */
    background-position: center center;
    /* 画像を中央に配置 */
    background-repeat: no-repeat;
    /* 画像を繰り返さない */
    position: relative;
    overflow: hidden;
}

/* ヒーローセクションの波状グラデーション（画像のような効果） */
.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-hero-bg);
    pointer-events: none;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 50px 0;

    /* 調整ポイント: 左に寄せる */
    max-width: 500px;
    /* コンテンツの幅を制限 */
    width: 100%;

    /* ★修正点: 左に固定マージン、右に自動マージンを設定し、左に寄せる★ */
    margin-left: 100px;
    /* 左側に固定の余白（100pxは調整可能） */
    margin-right: auto;
    /* 残りの空間を右側に押しやる */
    margin-top: 0;
    margin-bottom: 0;

    text-align: left;
    /* テキストは左揃えを維持 */
}

/* --- ヒーローセクションの色をカスタマイズ --- */
.hero-content .highlight-name {
    color: #7d44c9;
    /* ★ここに希望の色コードを指定してください★ (例: 鮮やかな緑) */
    font-weight: 700;
    /* usagisan の太字を維持 */
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;

    /* 修正: 自動マージンを削除し、左寄せにする */
    margin: 0 0 20px 0;
    /* margin: 0 auto 20px; */
    background-color: #fff;
    border: 5px solid var(--primary-light);
    overflow: hidden;
    /* アバター画像のスタイルを適用 */
    background-image: url('img/usagisan_avatar.png');
    background-size: 111% 111%;
    /* ★画像を要素いっぱいに引き伸ばして表示★ */
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.0);
}

.hero-content h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 3.5em;
    font-weight: 700;
    margin-bottom: 10px;
}

.hero-content h1 strong {
    color: var(--primary-color);
}

.hero-content p {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 30px;
}

.hero-buttons a {
    /* margin: 0 10px; */
    /* 修正: 自動マージンを削除し、左寄せにする */
    margin-top: 30px;
    text-align: left;
    /* ★ボタンの親要素を左寄せにする★ */
}

/* --- 3. About Meセクション --- */
.about-section {
    background-color: #fff;
}

.about-flex {
    display: flex;
    align-items: center;
    gap: 50px;
}

.about-image-box {
    flex: 1;
    max-width: 50%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    /* background-color: #a052ff; */
    /* 画像の背景のパープル */
}

.about-image-box img {
    width: 100%;
    height: auto;
    display: block;
    mix-blend-mode: multiply;
    /* 画像をパープル系に馴染ませる */
    opacity: 0.9;
}

.about-text {
    flex: 1;
    max-width: 50%;
}

.about-text h3 {
    font-size: 1.8em;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.about-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding: 20px 0;
    border-top: 1px solid #eee;
}

.about-stats div {
    text-align: center;
}

.about-stats span {
    display: block;
    font-size: 2em;
    font-weight: 700;
    color: var(--primary-color);
}

/* About Meセクション内のすべての <p> タグの下にマージンを設定 */
.about-text p {
    /* 1行分の余白を追加 (フォントサイズと同じ高さ) */
    margin-bottom: 1em;
}

/* 最後の段落や、直後に要素がない場合はマージンをリセットすると綺麗です */
.about-text p:last-of-type {
    margin-bottom: 0;
}

/* --- 4. Worksセクション (作品カード) --- */
.works-section {
    background-color: var(--background-light);
}

.filter-buttons {
    text-align: center;
    margin-bottom: 30px;
}

.filter-btn {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 20px;
    margin: 0 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* 変更点: work-card全体をラップするリンクのスタイル */
.work-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.work-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    /* 親リンクの高さに合わせる */
}

/* ホバー効果を<a>タグに移す */
.work-card-link:hover .work-card {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

.work-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.work-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    font-weight: bold;
    color: var(--primary-color);
}

.category-type {
    display: inline-block;
    background-color: #eee;
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    margin-right: 5px;
    font-weight: bold;
}

.work-card-content {
    padding: 20px;
}

.work-card-content h3 {
    margin-top: 0;
    font-size: 1.2em;
    margin-bottom: 5px;
}

.work-card-content p {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    min-height: 50px;
}

.tool-tags .tool-tag {
    display: inline-block;
    background: #e9e9e9;
    color: #555;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-right: 5px;
    margin-bottom: 5px;
}

/* --- 5. Skills & Toolsセクション --- */
.skills-section {
    background-color: #fff;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.skill-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    position: relative;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--primary-light), #fff);
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    opacity: 0.5;
}

.skill-card h4 {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.skill-card p {
    font-size: 0.9em;
    color: #888;
    margin-bottom: 15px;
}

.progress-bar {
    width: calc(100% - 60px);
    height: 5px;
    background-color: #eee;
    border-radius: 5px;
    display: inline-block;
}

.progress {
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--primary-light));
    border-radius: 5px;
}

.skill-card span {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--primary-color);
    float: right;
    margin-top: -10px;
}

/* 学習バナー */
.learning-banner {
    background: linear-gradient(90deg, #7d44c9 0%, #a052ff 100%);
    color: var(--text-color-light);
    border-radius: 15px;
    padding: 40px;
    display: flex;
    align-items: center;
    gap: 40px;
}

.learning-text {
    flex: 2;
}

.learning-text h3 {
    font-size: 1.8em;
    margin-bottom: 10px;
}

.learning-stats {
    flex: 1;
    display: flex;
    gap: 20px;
    text-align: center;
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    padding-left: 40px;
}

.stat-box {
    flex: 1;
}

.stat-number {
    font-size: 2.2em;
    font-weight: 700;
    display: block;
}


/* --- 6. Contactセクション --- */
.contact-section {
    background-color: var(--background-light);
}

.contact-flex {
    display: flex;
    gap: 50px;
}

.contact-info {
    flex: 1;
}

.contact-info h3 {
    font-size: 1.8em;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.contact-info p {
    margin-bottom: 30px;
}

.info-item {
    margin-bottom: 15px;
}

.info-label {
    display: block;
    font-weight: 600;
    color: #888;
    margin-bottom: 3px;
}

.info-item a {
    color: var(--text-color-dark);
    font-weight: 500;
}

.contact-form-box {
    flex: 1;
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    transition: border-color 0.3s;
}

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

.submit-btn {
    width: 100%;
    border: none;
    cursor: pointer;
    margin-top: 10px;
}

.char-count {
    display: block;
    text-align: right;
    font-size: 0.8em;
    color: #888;
}

/* --- 7. フッター --- */
.main-footer {
    background-color: var(--background-dark);
    color: #e0e0e0;
    padding-top: 50px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    padding-bottom: 30px;
    border-bottom: 1px solid #333;
}

.footer-col {
    width: 25%;
}

.logo-footer {
    font-family: 'Poppins', cursive;
    font-size: 1.8em;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 10px;
}

.footer-col p {
    font-size: 0.9em;
    line-height: 1.5;
}

.footer-col h4 {
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-color-light);
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul li a {
    color: #e0e0e0;
}

.footer-col ul li a:hover {
    color: var(--primary-light);
}

.social-links {
    display: flex;
    gap: 10px;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #444;
    color: #fff;
    /* SVGのfill色 */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    text-decoration: none;
    /* 下線を消す */
}

.social-icon:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
    /* 少し浮き上がる */
}

.social-icon.youtube:hover {
    background-color: #FF0000;
}

.social-icon.x-twitter:hover {
    background-color: #000;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* レスポンシブ対応の調整 */
@media (max-width: 900px) {

    .about-flex,
    .contact-flex,
    .learning-banner,
    .footer-content {
        flex-direction: column;
    }

    .about-image-box,
    .about-text,
    .contact-info,
    .contact-form-box,
    .footer-col {
        max-width: 100%;
        width: 100%;
    }

    .about-image-box {
        order: 2;
        /* モバイルで画像を下に */
    }

    .learning-stats {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.5);
        padding-top: 20px;
        margin-top: 20px;
    }

    .footer-col {
        margin-bottom: 20px;
    }
}

/* --- ロゴ画像サイズ設定 --- */

/* ヘッダーロゴのサイズ調整 */
.header-logo {
    height: 48px;
    /* ★ロゴの高さを調整（例: 24px）★ */
    width: auto;
    display: block;
}

/* フッターロゴのサイズ調整 */
.footer-logo {
    height: 48px;
    /* フッターロゴの高さ */
    width: auto;
    display: block;
}

/* 既存のロゴコンテナのテキスト設定を画像用にリセット */
.logo a {
    /* 元々テキストの font-size などがあったため、画像用にリセット */
    display: block;
    font-size: 0;
    /* テキストの代替として、不要なフォントサイズの影響をなくす */
}

@media (max-width: 600px) {
    .header-content {
        padding: 10px 20px;
    }

    nav a {
        margin-left: 15px;
    }

    .hero-content h1 {
        font-size: 2.5em;
    }
}

/* --- 5.5. Workflowセクション --- */
.workflow-section {
    background-color: #f9f9f9;
}

.workflow-steps {
    display: flex;
    /* 横並び */
    align-items: center;
    /* 垂直方向中央揃え */
    justify-content: space-between;
    gap: 15px;
    /* 隙間 */
    flex-wrap: nowrap;
    /* 折り返さない */
    overflow-x: auto;
    /* スマホで横スクロール可能にする場合に備える */
    padding-bottom: 20px;
    /* スクロールバーのための余白 */
}

/* ステップカードの基本スタイル */
.step-card {
    flex: 1;
    min-width: 200px;
    /* 最小幅を確保 */
    background: #fff;
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 1;
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(125, 68, 201, 0.15);
    border-color: var(--primary-light);
}

/* ステップ番号 */
.step-number {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 15px;
    box-shadow: 0 3px 8px rgba(125, 68, 201, 0.3);
}

/* タイトルと説明 */
.step-card h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.step-desc {
    font-size: 0.9rem;
    color: #888;
    font-weight: 600;
    margin-bottom: 15px;
    border-bottom: 1px dashed #ddd;
    /* 区切り線 */
    padding-bottom: 10px;
}

.step-card p:not(.step-desc) {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #555;
    margin-bottom: 15px;
    min-height: 4.5em;
    /* 高さを揃えるための最小高 */
}

/* 使用ツールバッジ */
.step-tools {
    display: inline-block;
    background: #f0f0ff;
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 4px;
}

/* 矢印スタイル */
.step-arrow {
    flex-shrink: 0;
    color: #ccc;
    font-size: 1.5rem;
    font-weight: bold;
    animation: fadeInArrow 1s ease-in-out infinite alternate;
}

@keyframes fadeInArrow {
    from {
        opacity: 0.5;
        transform: translateX(0);
    }

    to {
        opacity: 1;
        transform: translateX(3px);
    }
}

/* --- レスポンシブ対応 (Workflow) --- */
@media (max-width: 900px) {
    .workflow-steps {
        flex-direction: column;
        /* スマホでは縦並び */
        gap: 30px;
    }

    .step-arrow {
        transform: rotate(90deg);
        /* 矢印を下向きに */
        margin: -10px 0;
        /* 余白調整 */
        animation: none;
        /* アニメーションオフ（または縦方向にする） */
    }

    .step-card {
        width: 100%;
        max-width: 500px;
        /* 幅広すぎないように */
    }
}