:root {
    --bg-white: #ffffff;
    --text-main: #111111;
    --text-sub: #555555;
    --grid-color: #e8e8e8;
    --dot-mogu: #ff4a4a;
    --dot-nook: #3b4b7c;
    --dot-dear: #e2b7c3;
    --blob-purple: rgba(135, 126, 164, 0.7);
    --blob-pink: rgba(214, 172, 179, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", sans-serif;
    background-color: var(--bg-white);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
}

/* --- 背景：方眼紙グリッド（線） --- */
.grid-container {
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 30px 30px;
    padding: 0 10%;
    position: relative;
    width: 100%;
}

/* --- 背景：有機的な流体シェイプ（まる） --- */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(10px);
    z-index: 0;
    pointer-events: none;
}
.b1 { width: 350px; height: 350px; background: var(--blob-purple); top: -80px; left: -100px; border-radius: 40% 60% 60% 40% / 40% 40% 60% 60%; }
.b2 { width: 400px; height: 500px; background: var(--blob-pink); top: 150px; right: -150px; border-radius: 60% 40% 40% 60% / 50% 60% 40% 50%; }
.b3 { width: 450px; height: 450px; background: var(--blob-purple); top: 1100px; right: -100px; border-radius: 50%; }
.b4 { width: 300px; height: 400px; background: var(--blob-purple); top: 1800px; left: -150px; border-radius: 30% 70% 50% 50% / 40% 40% 60% 60%; }

/* コンテンツを前面に配置 */
header, section {
    position: relative;
    z-index: 1;
    padding: 100px 0;
}

/* --- スクロールアニメーション効果 --- */
.fade-in {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* --- HERO --- */
.hero {
    height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}
.section-tag {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}
.hero-title {
    font-size: clamp(2rem, 5vw, 3.8rem);
    font-weight: 700;
    letter-spacing: 0.02em;
}
.line-text {
    font-family: serif;
    font-weight: 500;
    color: #6a6385;
    border-bottom: 2px solid #6a6385;
    padding-bottom: 2px;
}
.circle-text {
    color: #c99ca4;
    position: relative;
}

/* --- SECTION GENERAL --- */
.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4rem;
    letter-spacing: -0.01em;
}

/* --- TIMELINE V2 (My Journey おしゃれ版) --- */
.section-tag-mini {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #6a6385;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.journey-timeline-v2 {
    position: relative;
    max-width: 900px;
    margin: 4rem auto 0 auto;
    padding: 20px 0;
}

/* 中央の洗練された細い1本の「線」 */
.timeline-axis {
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    background: var(--text-main);
    transform: translateX(-50%);
    z-index: 1;
}

/* 左右交互に並ぶ行のベース構造 */
.timeline-row {
    display: flex;
    width: 100%;
    margin-bottom: 5rem;
    position: relative;
    z-index: 2;
}

/* 左側の行は、中身を右寄せにして左半分に収める */
.left-side {
    flex-direction: row-reverse;
    padding-right: 50%;
}

/* 右側の行は、中身を左寄せにして右半分に収める */
.right-side {
    padding-left: 50%;
}

/* 線の上に配置される絶対的な「まる（Figmaのピンク）」 */
.timeline-node {
    position: absolute;
    left: 50%;
    top: 24px;
    width: 12px;
    height: 12px;
    background: #c99ca4; /* Figmaのまるの色 */
    border: 2px solid var(--bg-white);
    border-radius: 50%;
    transform: translateX(-50%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s;
}

/* ホバーした行の「まる」が大きく、中心が黒くなるインタラクション */
.timeline-row:hover .timeline-node {
    transform: translateX(-50%) scale(1.4);
    background: var(--text-main);
}

/* 年号のボックス */
.timeline-date-box {
    width: 90px;
    padding: 8px 0;
    text-align: center;
}

.left-side .timeline-date-box { margin-right: 20px; text-align: right; }
.right-side .timeline-date-box { margin-left: 20px; text-align: left; }

.t-year {
    font-family: monospace;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-main);
    position: relative;
    margin-top: 8px;
}

/* カードコンテンツ：Figmaのグリッドになじむミニマルデザイン */
.timeline-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--grid-color);
    padding: 1.8rem;
    border-radius: 16px;
    max-width: 360px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.01);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.left-side .timeline-card { margin-right: 30px; }
.right-side .timeline-card { margin-left: 30px; }

/* ホバー時にカードが少し浮き上がり、境界線が黒に近づく */
.timeline-row:hover .timeline-card {
    transform: translateY(-5px);
    border-color: var(--text-main);
    box-shadow: 0 15px 30px rgba(0,0,0,0.04);
}

.timeline-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    letter-spacing: -0.01em;
}

.timeline-card p {
    font-size: 0.85rem;
    color: var(--text-sub);
    line-height: 1.6;
}

/* 📱 レスポンシブ：スマホ画面（768px以下）では、線を左側に寄せて縦一列に */
@media (max-width: 768px) {
    .timeline-axis {
        left: 30px;
    }
    .timeline-row {
        flex-direction: row !important;
        padding-left: 60px !important;
        padding-right: 0 !important;
        margin-bottom: 3.5rem;
    }
    .timeline-node {
        left: 30px;
        top: 20px;
    }
    .timeline-date-box {
        width: auto;
        padding: 0;
        margin: 0 0 0.5rem 0 !important;
        text-align: left !important;
    }
    .timeline-card {
        max-width: 100%;
        margin: 0 !important;
    }
    .timeline-row:hover .timeline-node {
        transform: scale(1.3);
    }
}
/* --- WORKS CARDS (横スライド・カルーセル化) --- */
#works {
    padding: 100px 0;
}
#works .section-title {
    text-align: left;
    padding-left: 10%;
    margin-bottom: 2rem;
}
.cards-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 3rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 60px 10%;
    width: 100%;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.cards-container::-webkit-scrollbar {
    display: none; /* スクロールバー非表示でミニマルに */
}
.work-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 2.5rem 2rem;
    width: 320px;
    min-width: 320px;
    min-height: 420px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 15px 35px rgba(0,0,0,0.06);
    scroll-snap-align: center;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
}

/* カードごとの絶妙な傾き */
.card-mogu { transform: rotate(-3deg); border: 2px solid var(--dot-mogu); }
.card-nook { transform: rotate(1deg); border: 2px solid var(--dot-nook); margin-top: -10px; }
.card-dear { transform: rotate(2deg); border: 2px solid var(--dot-dear); }

/* ホバー時の浮き上がりインタラクション */
.work-card:hover {
    transform: scale(1.03) rotate(0deg) translateY(-10px);
    box-shadow: 0 30px 50px rgba(0,0,0,0.12);
    z-index: 10;
}
.tag-outline {
    border: 1px solid var(--text-main);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 6px;
}
.card-title { font-size: 1.8rem; font-weight: 700; margin: 1.5rem 0 0.2rem 0; }
.card-sub { font-size: 0.85rem; color: var(--text-sub); margin-bottom: 2rem; }
.card-img-placeholder {
    width: 100%;
    height: 180px;
    background: #fcfcfc;
    border: 1px dashed #ddd;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}
.emoji-crown { position: absolute; top: 10px; right: 10px; font-size: 1.2rem; }
.mock-text { font-size: 0.8rem; color: #aaa; font-family: monospace; }

/* --- LIST STRUCTURE (Internship / Experiences) --- */
.list-container {
    max-width: 700px;
    margin: 0 auto;
}
.list-item {
    display: flex;
    padding: 1.8rem 0;
    border-bottom: 1px solid #eee;
}
.list-date {
    width: 120px;
    font-family: monospace;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-main);
}
.list-content { flex: 1; }
.list-content h3 { font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.list-tag {
    font-size: 0.7rem;
    background: #f2f2f2;
    padding: 2px 8px;
    border-radius: 4px;
    color: #666;
    font-weight: normal;
}
.list-tag.color-pink { background: #fdf0f2; color: #c99ca4; font-weight: 600; }
.list-content p { font-size: 0.85rem; color: var(--text-sub); margin-top: 0.5rem; line-height: 1.6; }

/* --- DETAIL PAGE (作品詳細ページ用スタイル) --- */
.detail-page {
    min-height: 100vh;
    padding-top: 40px;
    padding-bottom: 140px;
}
.detail-nav { margin-bottom: 60px; }
.back-link {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    transition: opacity 0.3s;
}
.back-link:hover { opacity: 0.6; }
.work-detail-header { max-width: 800px; margin: 0 auto 3rem auto; padding: 0; }
.detail-title { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 700; margin: 1.5rem 0; letter-spacing: -0.02em; }
.detail-intro { font-size: 1.2rem; line-height: 1.7; color: var(--text-sub); }

/* --- ACTION BUTTONS (外部リンクボタンエリア) --- */
.action-links-section { padding: 2rem 0 4rem 0 !important; }
.action-links-container { max-width: 800px; margin: 0 auto; display: flex; gap: 1.5rem; flex-wrap: wrap; }
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid var(--text-main);
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-circle { width: 8px; height: 8px; background: var(--text-main); border-radius: 50%; transition: transform 0.4s; }
.btn-lp:hover .btn-circle { background: var(--dot-nook); }
.btn-youtube:hover .btn-circle { background: var(--dot-mogu); }
.btn-pdf:hover .btn-circle { background: #6a6385; }
.action-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}
.action-btn:hover .btn-circle { transform: scale(1.5); }

/* --- META GRID (詳細スペック) --- */
.work-meta-section { padding: 0 !important; border-top: none !important; }
.detail-meta-grid {
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 3rem;
    padding: 40px 0;
    border-top: 1px solid var(--grid-color);
}
.meta-block h4 { font-size: 0.8rem; color: #999; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.6rem; }
.meta-block p { font-size: 0.95rem; font-weight: 500; color: var(--text-main); }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .grid-container { padding: 0 5%; }
    .timeline-line { left: 65px; }
    .j-year { width: 60px; font-size: 0.95rem; }
    .j-dot { left: 65px; }
    .list-item { flex-direction: column; gap: 8px; }
    .work-card { transform: rotate(0deg) !important; margin-top: 0 !important; }
}
/* --- CONTACT & SNS SECTION STYLE (絶対整列版) --- */
#sns-links {
    padding: 140px 0 180px 0; /* 上下の余白を少し広げてゆったりさせる */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4rem; /* テキストとボタンの間の余白を広げて呼吸させる */
    border-top: 1px solid var(--grid-color);
}

.sns-intro {
    text-align: center;
}

.contact-lead {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);
    line-height: 2; /* 行間を少し広げてより洗練された印象に */
    margin-top: 1rem;
    letter-spacing: 0.03em;
}

/* ボタンを美しく横一列に並べるコンテナ */
.sns-container {
    display: flex;
    gap: 3.5rem; /* ★重要：ボタン同士の間隔を広げてグリッドに馴染ませる */
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1000px;
    padding: 0 5%;
}

.sns-item {
    display: inline-flex;
    align-items: center; /* ★重要：縦方向の中心を完全に揃える */
    justify-content: center;
    gap: 12px; /* まると文字の間の隙間 */
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 0;
    position: relative;
    transition: opacity 0.3s;
}

.sns-item:hover {
    opacity: 0.8;
}

/* 「まる」の初期状態（サイズと位置を完璧に固定） */
.sns-circle {
    width: 6px;
    height: 6px;
    background: var(--text-main);
    border-radius: 50%;
    display: inline-block; /* 高判定を正確にする */
    flex-shrink: 0; /* 文字が長くなっても丸が潰れないように固定 */
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s;
}

/* ホバーした時に「まる」が綺麗に拡大するインタラクション */
.sns-item:hover .sns-circle {
    transform: scale(1.6);
}

/* 各ボタン独自のホバーカラーアクセント */
.sns-item:nth-child(1):hover .sns-circle { background: #3b4b7c; } /* Mail */
.sns-item:nth-child(2):hover .sns-circle { background: #ff4a4a; } /* ReDesigner */
.sns-item:nth-child(3):hover .sns-circle { background: #111111; } /* X */
.sns-item:nth-child(4):hover .sns-circle { background: #6a6385; } /* GitHub */
.sns-item:nth-child(5):hover .sns-circle { background: #23c175; } /* note */

.sns-text {
    letter-spacing: 0.03em;
    line-height: 1; /* ★重要：文字の上下の余計な隙間を消して丸と高さを揃える */
}

/* 📱 スマホ画面の調整 */
@media (max-width: 768px) {
    #sns-links {
        padding: 100px 0 120px 0;
        gap: 3rem;
    }
    .contact-lead {
        font-size: 0.9rem;
        padding: 0 5%;
    }
    .sns-container {
        gap: 1.5rem 2.5rem; /* スマホでも窮屈にならないように */
    }
}
/* --- ABOUT ME SECTION --- */
#about {
    padding: 120px 0;
    border-bottom: 1px solid var(--grid-color);
}

.about-container {
    display: flex;
    justify-content: space-between;
    gap: 4rem;
    max-width: 900px;
    margin: 0 auto;
}

/* 左側のプロファイル */
.about-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.about-profile {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.profile-en {
    font-size: 0.9rem;
    color: var(--text-sub);
    font-family: monospace;
}

.about-tags {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
}

/* 丸みを帯びたプロフィールタグ */
.tag-circle {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    border: 1px solid var(--text-main);
    padding: 6px 16px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
    transition: transform 0.3s;
}

.tag-circle:hover {
    transform: translateX(5px);
}

/* 右側の文章 */
.about-right {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    justify-content: center;
}

.about-text {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.8;
    color: var(--text-main);
}

.about-text-sub {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-sub);
}

/* レスポンシブ（スマホでは縦並びに） */
@media (max-width: 768px) {
    .about-container {
        flex-direction: column;
        gap: 3rem;
    }
    .about-tags {
        flex-direction: row;
        flex-wrap: wrap;
    }
}
/* --- CARD IMAGE CONTAINER (新しく追加した画像枠) --- */
.card-img-container {
    width: 100%;
    height: 180px;
    background: #fcfcfc;
    border-radius: 12px;
    position: relative;
    overflow: hidden; /* 画像が枠からはみ出た部分をきれいにカットする */
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05); /* うっすら内側に境界線を入れる */
}

/* カードの中のモックアップ画像自体 */
.card-mock-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 枠線に合わせて画像を縦横比を保ったまま綺麗にフィットさせる */
    object-position: center top; /* アプリ画面なので、上基準で切り取る（ヘッダーが見えるように） */
    transition: transform 0.5s ease;
}

/* カードをホバーしたときに、中の画像も少しだけズームするおしゃれな演出 */
.work-card:hover .card-mock-img {
    transform: scale(1.05);
}
/* --- NEWS SECTION --- */
#news {
    padding: 100px 0;
}

.news-container {
    max-width: 850px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

/* ニュースの1行（横長の線ベースの構造） */
.news-row {
    display: flex;
    align-items: center;
    padding: 1.8rem 1rem;
    border-bottom: 1px solid var(--grid-color);
    text-decoration: none;
    color: var(--text-main);
    transition: background-color 0.3s, padding-left 0.3s;
}

/* 1行目だけ上にも境界線を引いて綺麗に囲う */
.news-row:first-child {
    border-top: 1px solid var(--grid-color);
}

/* ホバーした時に少し左に隙間が空いて、背景がうっすらグレーになる洗練されたインタラクション */
.news-row:hover {
    background-color: rgba(245, 245, 245, 0.5);
    padding-left: 2rem;
}

/* 日付とバッジのエリア */
.news-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 240px;
    min-width: 240px;
}

.news-date {
    font-family: monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-sub);
}

/* 丸みを帯びたバッジ（まるの要素） */
.news-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-note { background: #e6f9f0; color: #23c175; }
.badge-x { background: #f0f0f0; color: #111111; }
.badge-info { background: #eef2ff; color: #3b4b7c; }
.badge-works { background: #ffeef4; color: #c98696; }

/* タイトルと矢印のエリア */
.news-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.news-content h3 {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* 長いテキストは自動で「...」にする */
}

.news-arrow {
    font-size: 1.2rem;
    color: var(--text-sub);
    transition: transform 0.3s;
}

/* ホバーした時に右矢印がシュッと右に動く */
.news-row:hover .news-arrow {
    transform: translateX(6px);
    color: var(--text-main);
}

/* 📱 スマホ対応 */
@media (max-width: 768px) {
    .news-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
        padding: 1.5rem 0.5rem;
    }
    .news-meta {
        width: 100%;
        gap: 1rem;
    }
    .news-content {
        width: 100%;
    }
    .news-content h3 {
        white-space: normal; /* スマホでは「...」にせず改行させる */
    }
    .news-arrow {
        display: none; /* スマホでは矢印を非表示にしてスッキリ */
    }
}