/* --- 変数定義: 色とフォントの設計 --- */
:root {
    --bg-color: #fdfdfb;       /* 温かみのあるアイボリー背景 */
    --card-bg: #ffffff;        /* カードは純白で清潔感を */
    --text-main: #444444;      /* 柔らかいダークグレー */
    --text-bright: #1a1a1a;    /* 見出し用の濃いグレー */
    --accent: #4a90e2;         /* 知性と優しさを両立するブルー */
    --accent-soft: #e3f2fd;    /* 補助的な薄いブルー */
    --accent-green: #52b788;   /* セキュリティの安心感を示す緑 */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* --- 基本設定 --- */
* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.7; /* 行間を広げて読みやすく */
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

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

/* --- ヘッダー・ナビゲーション --- */
header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px); /* すりガラス効果 */
    position: fixed;
    width: 100%;
    z-index: 100;
    border-bottom: 1px solid #eeeeee;
}

/* --- ナビゲーションの微調整 --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    max-width: 1000px; /* containerと同じ幅に固定 */
    margin: 0 auto;
}

/* メニュー項目が増えたため、間隔を 24px から 20px に微調整 */
nav ul {
    list-style: none;
    display: flex;
    gap: 20px; 
    margin: 0;
    padding: 0;
    align-items: center; /* 垂直方向の中央揃え */
}

/* Join Us ボタンの特別ルール（優秀な3年生をキャッチするため） */
nav ul li:last-child a {
    color: var(--accent);
    font-weight: 700;
    border: 1.5px solid var(--accent);
    padding: 6px 16px;
    border-radius: 8px; /* カードの角丸と統一感をもたせる */
    transition: all 0.3s ease;
}

nav ul li:last-child a:hover {
    background-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
}

.logo {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text-bright);
}

.logo span {
    color: var(--accent);
    font-size: 0.95rem;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 24px;
    margin: 0;
    padding: 0;
}

nav a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--accent);
}

/* --- ヒーローセクション (第一印象) --- */
.hero {
    padding: 160px 0 100px;
    background: linear-gradient(135deg, #f0f7ff 0%, #fdfdfb 100%);
    text-align: center;
}

h1 {
    font-size: 2.8rem;
    color: var(--text-bright);
    margin-bottom: 1.2rem;
    line-height: 1.2;
}

.highlight {
    color: var(--accent);
    font-family: var(--font-mono); /* ここだけ少しエンジニアっぽく */
}

.subtitle {
    font-size: 1.4rem;
    color: #5c6bc0; /* 落ち着いた藍色 */
    font-weight: 700;
    margin-bottom: 2rem;
}

.description {
    max-width: 700px;
    margin: 0 auto 2.5rem;
    font-size: 1.1rem;
    color: #666;
}

/* --- ボタン --- */
/* ボタンの基本サイズとレイアウトを更新 */
.cta-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3列に固定 */
    gap: 15px;
    max-width: 960px; /* ボタンのサイズに合わせて調整 */
    margin: 40px auto 0;
}

.btn {
    display: flex;
    flex-direction: column; /* 上下に並べる */
    align-items: center;
    justify-content: center;
    padding: 20px 30px; /* サイズを大きく */
    min-width: 200px;   /* 横幅を確保 */
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 英語部分（上段） */
.btn .en {
    font-size: 1.2rem;
    font-family: var(--font-mono);
    display: block;
    margin-bottom: 4px;
}

/* 日本語部分（下段） */
.btn .jp {
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.9;
}

.btn.primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.2);
}

.btn.primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
}

.btn.secondary {
    border: 2px solid var(--accent);
    color: var(--accent);
    background: #fff;
}

.btn.secondary:hover {
    background: var(--accent-soft);
    transform: translateY(-5px); /* 他のボタンと同じ浮き上がり量 */
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.2); /* 柔らかい影を追加 */
    border-color: var(--accent);
}

/* --- 研究の柱 (カードレイアウト) --- */
.features {
    padding: 80px 0;
}

h2 {
    text-align: center;
    font-size: 2rem;
    color: var(--text-bright);
    margin-bottom: 50px;
}

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

.card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(74, 144, 226, 0.12);
    border-color: var(--accent-soft);
}

.card h3 {
    color: var(--accent);
    margin-top: 0;
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.card p {
    font-size: 1rem;
    color: #555;
    margin-bottom: 0;
}

/* 画像を枠いっぱいに綺麗に表示する設定 */
.photo-frame {
    margin-bottom: 30px;
    background: #fff;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.life-photo {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    object-fit: cover; /* 比率を保ったまま枠に収める */
}

.photo-caption {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
}

/* --- フッター --- */
footer {
    padding: 50px 0;
    text-align: center;
    border-top: 1px solid #eeeeee;
    color: #888;
    font-size: 0.9rem;
}

/* --- 研究テーマ紹介ページ共通：レスポンシブ・テーブル --- */

/* PC・スマホ共通の基本設定 */
.history-section table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

/* PC用：横並びの表形式 */
.history-section th {
    text-align: left;
    padding: 20px 15px;
    color: var(--accent);
    border-bottom: 1px solid #eee;
    width: 30%;
    vertical-align: top;
    font-weight: 700;
}

.history-section td {
    padding: 20px 15px;
    border-bottom: 1px solid #eee;
    color: var(--text-main);
    line-height: 1.6;
}

/* スマホ用：カード形式への変換（画面幅 768px 以下） */
@media (max-width: 768px) {
    .history-section table, 
    .history-section thead, 
    .history-section tbody, 
    .history-section th, 
    .history-section td, 
    .history-section tr {
        display: block;
        width: 100%;
    }

    .history-section tr {
        margin-bottom: 25px;
        border: 1px solid #eee;
        border-radius: 12px;
        background: #fff;
        padding: 15px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    }

    .history-section th {
        border-bottom: none;
        padding: 0 0 10px 0;
        font-size: 1.1rem;
        color: var(--accent); /* 各ページの --accent が適用されます */
    }

    .history-section td {
        border-bottom: none;
        padding: 0;
        font-size: 0.95rem;
        color: #555;
    }
	
	.cta-buttons {
        grid-template-columns: repeat(2, 1fr); /* 768px以下では3列から2列に変更 */
        gap: 10px; /* 隙間を少し狭くして画面幅を有効活用 */
    }
	
	/* ナビゲーションメニュー全体の隙間を狭める */
    nav ul {
        gap: 12px; /* 24px から半分に縮小 */
    }

    /* メニュー全体の文字サイズを少し下げる */
    nav ul li a {
        font-size: 0.85rem;
    }

    /* 「Join Us」ボタンの個別調整 */
    nav ul li:last-child a {
        padding: 4px 10px !important; /* 内側の余白を削って幅を圧縮 */
        white-space: nowrap;          /* 絶対に改行させない */
    }
	
	@media (max-width: 480px) {
	    .logo span {
	        display: none; /* スマホでは @ TMU を消してロゴを短くする */
	    }
	    .cta-buttons {
	        grid-template-columns: 1fr;
	    }
	}
}

