@charset "utf-8";

/* ============================================================
   Kohki Uno — personal website
   単一の共通スタイルシート(全ページこれ1枚を読み込む)

   ◆ 色やフォントを変えたいとき → 下の :root の変数を書き換える
   ◆ レイアウトの幅を変えたいとき → --content-width
   ============================================================ */

:root {
    /* --- カラーパレット (ライトテーマ・可読性重視) --- */
    --bg:            #f6f5f1;   /* ページ背景 (穏やかなオフホワイト) */
    --bg-elevated:   #edebe5;   /* カード・パネル背景 */
    --bg-header:     rgba(30, 34, 40, 0.95);  /* 固定ヘッダー (ダーク・半透明) */
    --text:          #1f2733;   /* 基本の文字色 (ほぼ黒) */
    --text-muted:    #4d5866;   /* 補足的な文字色 */
    --accent:        #1c5d99;   /* アクセント (リンク・見出し) */
    --accent-strong: #2e6cb0;   /* 濃いアクセント */
    --link-hover:    #123f6e;   /* リンクのホバー色 */
    --border:        rgba(31, 41, 55, 0.16);  /* 罫線 */
    color-scheme: light;

    /* --- タイポグラフィ --- */
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont,
                 "Hiragino Kaku Gothic ProN", "Hiragino Sans",
                 "Yu Gothic", "Noto Sans JP", sans-serif;
    --font-display: "Newsreader", "Hiragino Mincho ProN",
                    "Yu Mincho", Georgia, serif;

    /* --- レイアウト --- */
    --content-width: 920px;
    --header-height: 60px;
}

/* ============================================================
   リセット・ベース
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
    margin: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.75;
    /* antialiased はライト背景では文字が細く見えるため無効化 */
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

::selection { background: var(--accent-strong); color: #fff; }

/* --- リンク --- */
/* テキストリンク: 常に下線付き。通常時は周囲の文字と同じ色、ホバーで青字に。
   (強調の青字テキストと区別するため) */
a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}
a:hover { color: var(--accent); }

/* ボタン型のリンクには下線を付けない (色は各ボタンの定義に従う) */
.site-brand,
.site-nav a,
.hero-links a,
.page-toc a,
.page-toc-external a,
.to-top { text-decoration: none; }

/* ============================================================
   銀河画像の帯 (ヒーロー・タイトル帯・フッター) はダーク配色を維持
   → この中だけ文字色などの変数を上書きする
   ============================================================ */
.site-header, .hero, .page-hero, .site-footer {
    --text:          #f2f4f7;
    --text-muted:    #c2c9d3;
    --accent:        #a8cff5;
    --accent-strong: #6da2d9;
    --link-hover:    #d4e6fa;
    --border:        rgba(190, 197, 206, 0.3);
    color: var(--text);
}

/* 本文中の外部リンク (点線下線) */
a.url-link {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

/* --- 見出し --- */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}

/* --- 共通コンテナ --- */
.container {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================================
   ヘッダー / ナビゲーション
   ============================================================ */
/* ヘッダーは透明にして背後にヒーローの銀河画像を通す。
   スクロールすると js/site.js が .scrolled を付与し、ダーク背景+区切り線が現れる */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    margin-bottom: calc(-1 * var(--header-height));  /* 下のヒーローを背後に敷く */
    background: transparent;
    border-bottom: 1px solid var(--border);  /* 最上部でも区切り線を表示 */
    transition: background 0.25s ease;
}
.site-header.scrolled {
    background: var(--bg-header);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.site-header .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-brand {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text);
    white-space: nowrap;
}
.site-brand:hover { color: var(--accent); }

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

/* ナビはボタンとしてはっきり見せる */
.site-nav a {
    display: block;
    padding: 5px 14px;
    border: 1px solid rgba(190, 197, 206, 0.35);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.site-nav a:hover { color: var(--text); border-color: var(--accent); background: rgba(255, 255, 255, 0.1); }
.site-nav a.active {
    color: #eaf3fc;
    border-color: var(--accent);
    background: rgba(168, 207, 245, 0.18);
}
/* ============================================================
   ヒーロー (トップページ)
   ============================================================ */
.hero {
    position: relative;
    /* ヘッダー分だけ上に余白を足す (画像はヘッダー背後まで届く) */
    padding: calc(96px + var(--header-height)) 0 88px;
    background-image:
        linear-gradient(rgba(30, 33, 38, 0.5), rgba(36, 39, 44, 0.85)),
        url(../img/galaxy-main-min.jpeg);
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--border);
}

.hero-inner {
    display: flex;
    align-items: center;
    gap: 48px;
}

.hero-photo img {
    width: 210px;
    height: 210px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid rgba(231, 237, 246, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.hero-text h1 {
    margin: 0 0 4px;
    font-size: 2.6rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.hero-text .hero-sub {
    margin: 0 0 18px;
    font-size: 1.02rem;
    color: var(--accent);
    font-weight: 500;
}

.hero-text p { margin: 0 0 16px; color: var(--text); max-width: 560px; }

/* ヒーロー内のボタン風リンク */
.hero-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.hero-links a {
    display: inline-block;
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    background: rgba(45, 49, 56, 0.6);
}
.hero-links a:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   サブページのタイトル帯
   ============================================================ */
.page-hero {
    padding: calc(56px + var(--header-height)) 0 40px;
    background-image:
        linear-gradient(rgba(30, 33, 38, 0.55), rgba(36, 39, 44, 0.88)),
        url(../img/galaxy-nav-min.jpeg);
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.page-hero h1 { margin: 0 0 8px; font-size: 2.1rem; }
.page-hero p  { margin: 0; color: var(--text-muted); }

/* ページ内目次 (Publications / CV の冒頭リンク列)
   ボタンの幅を揃えて整然と並べる */
.page-toc {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.page-toc a {
    flex: 0 0 auto;
    min-width: 148px;
    text-align: center;
    white-space: nowrap;
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.83rem;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(45, 49, 56, 0.55);
    transition: color 0.15s ease, border-color 0.15s ease;
}
.page-toc a:hover { color: var(--accent); border-color: var(--accent); }

/* 外部リンク列 (ADSなど) — ページ内リンクと区別して表示 */
.page-toc-external {
    max-width: 500px;   /* 区切り線をページ内リンク列の幅に合わせる */
    margin: 12px auto 0;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.page-toc-external a {
    min-width: 148px;
    text-align: center;
    white-space: nowrap;
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.83rem;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(45, 49, 56, 0.55);
    transition: color 0.15s ease, border-color 0.15s ease;
}
.page-toc-external a:hover { color: var(--accent); border-color: var(--accent); }

/* ============================================================
   セクション共通
   ============================================================ */
.section { padding: 64px 0 8px; }

.section > .container > h1,
.section-title {
    font-size: 1.9rem;
    text-align: center;
    margin: 0 0 12px;
}

/* 見出し下の飾り線 */
.section-title::after {
    content: "";
    display: block;
    width: 48px;
    height: 2px;
    margin: 14px auto 0;
    background: var(--accent-strong);
    border-radius: 2px;
}

.lead {
    max-width: 760px;
    margin: 24px auto 8px;
    color: var(--text-muted);
    text-align: justify;
}
.lead b, .lead strong { color: var(--text); font-weight: 600; }

/* ============================================================
   研究トピック (画像 + テキストの横並び)
   ============================================================ */
.topic {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 40px;
    align-items: center;
    padding: 40px 0;
    border-bottom: 1px solid var(--border);
}
.topic:last-of-type { border-bottom: none; }

/* 偶数番目は画像を右側に */
.topic.reverse { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.topic.reverse .topic-image { order: 2; }

.topic-image img {
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.14);
}

.topic-text h2 { margin: 0 0 12px; font-size: 1.45rem; color: var(--accent); }
.topic-text p  { margin: 0 0 12px; text-align: justify; }

/* 関連論文: 普段は閉じておき、ボタンで開閉する (details/summary) */
.topic-papers { margin-top: 8px; }

.topic-papers summary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    user-select: none;
    list-style: none;                 /* 標準の ▶ マーカーを消す */
    padding: 4px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-elevated);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.15s ease, border-color 0.15s ease;
}
.topic-papers summary::-webkit-details-marker { display: none; }
.topic-papers summary::before {
    content: "▸";
    font-size: 0.9em;
    transition: transform 0.15s ease;
}
.topic-papers[open] summary::before { transform: rotate(90deg); }
.topic-papers summary:hover { color: var(--accent); border-color: var(--accent); }

.papers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.papers-list a {
    display: inline-block;
    padding: 3px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-elevated);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.papers-list a::after { content: "↗"; margin-left: 5px; font-size: 0.9em; opacity: 0.55; }
.papers-list a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* ============================================================
   進行中プロジェクトのカード
   ============================================================ */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 32px 0 48px;
}

.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px 22px;
}

.card h3 { margin: 0 0 10px; font-size: 1.08rem; color: var(--text); font-family: var(--font-sans); font-weight: 600; }
.card p  { margin: 0; font-size: 0.9rem; color: var(--text-muted); text-align: justify; }
.card .card-note {
    display: inline-block;
    margin-bottom: 10px;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(80, 95, 115, 0.1);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* ============================================================
   リスト系ページ (Publications / Presentations / CV)
   ============================================================ */
.list-section { padding: 48px 0 8px; }

.list-section h1 {
    font-size: 1.6rem;
    margin: 0 0 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.list-section h3 {
    font-size: 1.05rem;
    margin: 28px 0 4px;
    color: var(--text);
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* 逆順番号付きリスト */
.entry-list {
    margin: 12px 0;
    padding-left: 1.6em;
}
.entry-list > li {
    margin-bottom: 20px;
    font-size: 0.92rem;
    color: var(--text);   /* 黒がメイン、グレーはサブ情報 */
}
.entry-list > li::marker { color: var(--text); font-weight: 600; }

/* 論文・発表タイトル */
.entry-title { color: var(--accent); font-weight: 600; }
.entry-list b:not(.entry-title) { color: var(--text); font-weight: 600; }

/* 補足行 (受賞歴・詳細など) はグレーのサブ情報 */
.entry-detail { margin-left: 0.1em; font-size: 0.88rem; color: var(--text-muted); }

/* 論文の著者一覧 (グレーのサブ情報、Uno, K. のみ黒太字で強調) */
.authors { color: var(--text-muted); }
.authors b { color: var(--text); font-weight: 600; }

/* --- CV 用: 左に役職、右に期間 --- */
.cv-item { margin-bottom: 22px; }

/* CV冒頭の現職表示 (少し大きめに) */
.cv-item.cv-lead .cv-item-title { font-size: 1.35rem; }
.cv-item.cv-lead .place { font-size: 1.1rem; }
.cv-item-title { color: var(--accent); font-weight: 600; font-size: 1.0rem; }
.cv-item-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 16px;
}
.cv-item-row .place { color: var(--text); }
.cv-item-row .period { color: var(--text-muted); font-size: 0.88rem; }
.cv-item .entry-detail { color: var(--text-muted); }

.plain-list { margin: 12px 0; padding-left: 1.4em; }
.plain-list > li { margin-bottom: 10px; font-size: 0.92rem; color: var(--text); }
.plain-list > li::marker { color: var(--text); }

/* ============================================================
   フッター
   ============================================================ */
.site-footer {
    margin-top: 72px;
    padding: 36px 0;
    background-image:
        linear-gradient(rgba(30, 33, 38, 0.65), rgba(30, 33, 38, 0.9)),
        url(../img/galaxy-nav-min.jpeg);
    background-size: cover;
    background-position: center;
    border-top: 1px solid var(--border);
}

.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-text { font-size: 0.82rem; color: var(--text-muted); line-height: 1.9; }
.footer-text a { color: var(--text-muted); }
.footer-text a:hover { color: var(--accent); }

.to-top {
    font-size: 0.85rem;
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    white-space: nowrap;
}
.to-top:hover { color: var(--accent); border-color: var(--accent); }

/* ============================================================
   記事ページ (memo_article) 用
   ============================================================ */
.article { max-width: 760px; }
.article h2 {
    font-size: 1.3rem;
    margin: 40px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--accent);
}
.article h3 { font-size: 1.05rem; margin: 24px 0 8px; }
.article ul { padding-left: 1.4em; }
.article li { margin-bottom: 8px; color: var(--text-muted); }
.article li::marker { color: var(--text); }
.article p, .article > div { color: var(--text-muted); }
.article .note { font-size: 0.85rem; }

.callout {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent-strong);
    border-radius: 8px;
    padding: 14px 18px;
    margin: 20px 0;
    color: var(--text);
    font-size: 0.95rem;
}

/* ============================================================
   レスポンシブ (スマートフォン)
   ============================================================ */
@media screen and (max-width: 760px) {
    body { font-size: 15px; }

    /* モバイルはヘッダーが2段になるため、ページ内リンクの着地位置を深めに取る */
    html { scroll-padding-top: 112px; }

    /* モバイルはヘッダー高さが可変なので、重ねずに通常のダーク帯に戻す */
    .site-header,
    .site-header.scrolled {
        height: auto;
        margin-bottom: 0;
        background: var(--bg-header);
        border-bottom: 1px solid var(--border);
    }
    .site-header .container {
        flex-direction: column;
        align-items: flex-start;
        padding-top: 10px;
        padding-bottom: 10px;
        gap: 6px;
    }
    .site-nav ul { flex-wrap: wrap; gap: 0; }
    .site-nav a { padding: 4px 10px; font-size: 0.85rem; }

    .hero { padding: 56px 0; }
    .hero-inner { flex-direction: column; text-align: center; gap: 28px; }
    .hero-photo img { width: 160px; height: 160px; }
    .hero-text h1 { font-size: 2rem; }
    .hero-text p { text-align: justify; }
    .hero-links { justify-content: center; }

    .topic,
    .topic.reverse { grid-template-columns: 1fr; gap: 20px; padding: 32px 0; }
    .topic.reverse .topic-image { order: 0; }
    .topic-image { max-width: 420px; margin: 0 auto; }

    .section { padding: 44px 0 8px; }
    .page-hero { padding: 40px 0 32px; }
    .page-toc a, .page-toc-external a { min-width: 124px; }

    .site-footer .container { flex-direction: column; align-items: flex-start; }
}
