/* ==========================================================================
   1. Appleミニマリズム・共通定義＆変数
   ========================================================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
:root {
    --apple-black: #1d1d1f;       /* Apple標準の文字の黒 */
    --apple-dark: #000000;
    --apple-gray: #f5f5f7;        /* 製品背景のようなプロダクトグレー */
    --apple-text-gray: #86868b;   /* 洗練されたサブテキストグレー */
    --apple-blue: #0066cc;        /* リンク用の鮮やかなブルー */
    --accent-gradient: linear-gradient(90deg, #2a9d8f, #1b4965); /* 先進的なメディカルグラデーション */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", sans-serif;
    color: var(--apple-black);
    background-color: #ffffff;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased; /* 文字の輪郭を滑らかにする効果 */
}

.container { max-width: 1000px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 680px; margin: 0 auto; padding: 0 20px; }
.text-center { text-align: center; }

/* ==========================================================================
   2. スマートヘッダー
   ========================================================================== */
.apple-header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 9999;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.header-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 18px 20px; 
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    flex-direction: row; 
    align-items: center;
    gap: 16px;          
    flex-wrap: nowrap;   
}

.logo-group {
    display: flex;
    flex-direction: column; 
    gap: 2px;
}

.logo-group + .logo-group {
    position: relative;
    padding-left: 16px;
}
.logo-group + .logo-group::before {
    content: "";
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 1px;
    background-color: rgba(0, 0, 0, 0.15); 
}

.sub-logo {
    font-size: 12px;             
    font-weight: 500;            
    color: var(--apple-text-gray); 
    letter-spacing: 0.02em;      
    line-height: 1.2;
}

.logo-area h1,
.logo-area h2 {
    font-size: 16px;             
    font-weight: 700;            
    color: var(--apple-dark);    
    letter-spacing: -0.01em;     
    line-height: 1.2;
}

.apple-nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
    align-items: center;
}
.apple-nav a {
    text-decoration: none;
    color: var(--apple-black);
    font-size: 14px;
    font-weight: 500;
    opacity: 0.7;
    transition: opacity 0.2s, color 0.2s;
}
.apple-nav a:hover, .apple-nav a.active {
    opacity: 1;
    color: var(--apple-blue);
}

/* ==========================================================================
   3. レイアウト・余白・タイポグラフィ
   ========================================================================= */
.apple-main section {
    padding: 80px 0; 
}

.section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--apple-text-gray);
    margin-bottom: 12px;
    font-weight: 600;
}

.apple-headline {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--apple-dark);
}
.apple-headline-small {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 60px;
    color: var(--apple-dark);
}

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cta-wrapper {
    margin-top: 35px;
}
.apple-link {
    font-size: 17px;
    color: var(--apple-blue);
    text-decoration: none;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.apple-link:hover .arrow {
    transform: translateX(4px);
}
.apple-link .arrow {
    display: inline-block;
    transition: transform 0.2s ease;
}

/* ==========================================================================
   4. 各セクション詳細
   ========================================================================= */

/* --- Hero --- */
.hero-section {
    position: relative;
    height: 80vh; 
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 !important;
    overflow: hidden;
    background-color: var(--apple-dark);
}

/* index以外の各下層ページのヒーローセクションの高さを半分（40vh）にする */
.hero-section.research-hero,
.hero-section.members-hero,
.hero-section.publications-hero,
.hero-section.recruit-hero {
    height: 40vh;
}

.hero-media-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-media {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
    
    /* 待機状態の動画・画像は完全に非表示にし、背面（z-index: 1）に配置 */
    opacity: 0; 
    visibility: hidden;
    pointer-events: none; 
    z-index: 1;
    
    /* 滑らかにクロスフェードさせる設定（1秒かけて変化） */
    transition: opacity 1.0s ease-in-out, visibility 1.0s ease-in-out; 
    will-change: opacity;
}

.hero-media.active {
    /* アクティブになったら前面（z-index: 2）に出して完全に表示 */
    opacity: 1;
    visibility: visible;
    pointer-events: auto; 
    z-index: 2;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 均一な縦グラデーションから、文字の背景だけを薄くカバーする放射状グラデーションに変更 */
    background: radial-gradient(
        circle at center,
        rgba(0, 0, 0, 0.45) 0%,
        rgba(0, 0, 0, 0.25) 40%,
        rgba(0, 0, 0, 0.0) 70%
    );
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    padding: 0 20px;
}
.hero-title {
    font-size: 54px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 16px;
    color: #ffffff !important;
    /* 影を多層に重ねることで、背景を暗くせずに文字の輪郭だけを際立たせます */
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.3),
        0 10px 30px rgba(0, 0, 0, 0.25);
}

.hero-subtitle {
    font-size: 20px;
    color: #f5f5f7 !important;
    font-weight: 400;
    /* サブタイトルにも同様の処理を施します */
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.3);
}

/* --- 技術（独自のプラットフォーム・カード） --- */
.apple-grid-3 {
    display: flex;
    flex-direction: column;
    gap: 70px;
}

/* PC表示時の最適化調整 */
@media (min-width: 769px) {
.grid-section .apple-grid-3 {
        display: grid;
        grid-template-columns: repeat(3, 1fr); 
        gap: 30px;                             
    }

    .grid-section .apple-card {
        height: 320px;                         
        display: flex;
        flex-direction: column;
        justify-content: center;               
        align-items: center;
    }
	
    /* --- 【再修正】画像にスペースを与えつつ、文字幅を極限まで絞る --- */
.grid-section .apple-grid-3 {
        display: grid;
        grid-template-columns: repeat(3, 1fr); 
        gap: 30px;                             
    }

    .grid-section .apple-card {
        height: 320px;                         
        display: flex;
        flex-direction: column;
        justify-content: center;               
        align-items: center;
    }
	
    .platform-row {
        display: grid;
        max-width: 700px; 
        margin: 0 auto;
        grid-template-columns: 1fr 1.3fr; 
        grid-template-areas: "text img";
        /* --- 【修正】画像と文章の間のスペースを12px（半分以下）に縮小 --- */
        gap: 12px; 
        align-items: center;
        justify-content: center; 
    }

    .platform-img-wrapper {
        grid-area: img;
        width: 100%;
        max-width: 360px; 
        margin: 0 0 0 auto; 
    }

    .platform-img-wrapper img {
        object-fit: contain !important; 
        width: 100%;
        height: auto;
        display: block;
    }

    .platform-text-wrapper {
        grid-area: text;
        width: 100%;
        max-width: 240px; 
        margin: 0 auto 0 0; 
        text-align: left; 
    }

    .platform-text-wrapper h5 {
        font-size: 21px !important; 
        margin-bottom: 14px !important;
    }

    .platform-text-wrapper p {
        font-size: 16.5px !important;  
        line-height: 1.85 !important;  
        color: var(--apple-black);     
        font-weight: 400;              
        letter-spacing: -0.01em;       
    }
}

.apple-card {
    position: relative;
    background-color: var(--apple-gray);
    padding: 60px 20px;
    border-radius: 22px;
    text-align: center;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

/* 【調整】文字を大きくしたため、背景レイヤーを0.4→0.52に少し濃くして文字の視認性をUP */
.apple-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(29, 29, 31, 0.52); 
    z-index: -1;
}

/* 【変更】PCでのキーワードサイズを 14px -> 16px に拡大（余白も微微調整） */
.card-keyword {
    font-size: 16px;             
    font-weight: 700;
    color: #fff;
    background: var(--apple-blue);
    padding: 5px 16px;           
    border-radius: 14px;
    display: inline-block;
    margin-bottom: 20px;         
    letter-spacing: 0.05em;
    position: relative;
    z-index: 2;
}

/* 【変更】PCでのプラットフォームタイトルを 24px -> 28px に拡大 */
.apple-card h5 {
    font-size: 28px;             
    font-weight: 700;            
    color: #ffffff; 
    line-height: 1.3;
    position: relative;
    z-index: 2;
}
.apple-card:hover {
    transform: translateY(-4px);
}

/* --- プロジェクト --- */
.apple-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 40px;
    margin-bottom: 40px;
}
.project-strip {
    border-bottom: 1px solid #e5e5e7;
    padding: 28px 0;
    display: flex;
    gap: 24px;
    align-items: baseline;
}
.project-strip .num {
    font-size: 13px;
    font-weight: 600;
    color: var(--apple-text-gray);
    font-family: monospace;
}
.project-strip h5 {
    font-size: 20px;
    font-weight: 600;
    color: var(--apple-black);
    line-height: 1.4;
}

/* --- リクルート --- */
.recruit-section {
    background: linear-gradient(135deg, rgba(255,255,255,0.88), rgba(255,255,255,0.88)), 
                var(--accent-gradient);
    color: var(--apple-black); 
}
.white-text { color: var(--apple-dark) !important; } 

.recruit-sub-text {
    font-size: 18px;
    color: var(--apple-black); 
    margin-top: 15px;
    margin-bottom: 35px;
    word-break: keep-all;     
    overflow-wrap: break-word; 
}
.apple-btn-white {
    display: inline-block;
    background-color: var(--apple-blue); /* 黒（var(--apple-dark)）から青に変更 */
    color: #ffffff;
    text-decoration: none;
    padding: 14px 32px;
    border-radius: 26px;
    font-size: 15px;
    font-weight: 600;
    transition: background-color 0.2s, transform 0.2s;
}
.apple-btn-white:hover {
    background-color: #0055b3; /* ホバー時は少し濃い青にして変化を出す */
    transform: scale(1.02);
}

/* --- トピックス --- */
.apple-news-list {
    list-style: none;
    margin-top: 20px;
}
.apple-news-list li {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 18px 0;
    border-bottom: 1px solid #e5e5e7;
}
.apple-news-list .date {
    font-size: 14px;
    color: var(--apple-text-gray);
    font-family: monospace;
}
.apple-news-list .tag {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    background-color: var(--apple-gray);
    border-radius: 4px;
    display: inline-block;
    height: fit-content;
    width: max-content;
    flex-shrink: 0;
}
.apple-news-list .tag.rec {
    background-color: #ffe5ec;
    color: #d90429;
}
.apple-news-list .title {
    font-size: 15px;
    color: var(--apple-black);
}

/* --- 教育・強みセクション --- */
.skills-future-section {
    background-color: var(--apple-gray); 
    border-top: 1px solid #e5e5e7; 
    padding: 80px 0;
}

/* ==========================================================================
   5. フッター
   ========================================================================= */
.apple-footer {
    background-color: var(--apple-gray);
    padding: 50px 0;
    font-size: 11.5px;
    color: var(--apple-text-gray);
    border-top: 1px solid #e5e5e7;
}

/* ==========================================================================
   6. スマートフォン最適化
   ========================================================================== */
@media (max-width: 768px) {

/* スマホ時かつトップページ（.hero-section に下層用クラスがない場合）の高さ指定 */
    .hero-section {
        height: 80vh !important;    /* 現在の高さから、スマホで見やすい「画面の40%」程度に縮小 */
        min-height: 200px;         /* 文字がはみ出さないためのセーフティ最低高 */
    }
    /* -------------------- */
	
.platform-row {
        display: flex;
        flex-direction: column-reverse; /* 縦並びにして、HTMLの並び順を逆転（文章が上、画像が下） */
        gap: 16px;                     /* 画像と文章の間の余白調整 */
    }
    .platform-img-wrapper {
        margin-top: 12px;              /* 画像の上の余白を少し調整 */
    }
	
    /* セクション余白 */
    .apple-main section {
        padding: 50px 0;
    }
    
/* 各下層ページ（Research, Members, Publications, Recruit）のスマホ表示時のみ高さを小さくする */
    .hero-section.research-hero,
    .hero-section.members-hero,
    .hero-section.publications-hero,
    .hero-section.recruit-hero {
	height: 25vh !important;       /* ← !important を追加 */
    min-height: 150px !important;  /* ← !important を追加 */
}
	
    /* ヘッダー・ナビゲーション */
    .header-container {
        padding: 12px 12px; 
        flex-direction: column;  
        gap: 12px;               
        align-items: center;     
    }
    .apple-nav {
        width: 100%;
        display: flex;
        justify-content: center; 
    }
    .apple-nav ul {
        gap: 16px;              
        justify-content: center;
    }
    .apple-nav a {
        font-size: 13px;        
    }
    
    /* ロゴエリア */
    .logo-area {
        gap: 8px; 
    }
    .logo-group {
        gap: 3px; 
    }
    .logo-group + .logo-group {
        padding-left: 8px;
    }
    .sub-logo {
        font-size: 9px; 
    }
    .logo-area h1,
    .logo-area h2 {
        font-size: 12px; 
    }
    
    /* タイポグラフィ */
    .hero-title {
        font-size: 36px;
    }
    .hero-subtitle {
        font-size: 16px;
    }
    .apple-headline {
        font-size: 28px;
    }
    .apple-headline-small {
        font-size: 26px;
        margin-bottom: 35px;
    }
    
    /* 独自プラットフォーム（3つのカード設定・サイズ微調整） */
    .apple-grid-3 {
        gap: 50px; 
    }
    .grid-section .apple-card {
        padding: 45px 20px;
        cursor: pointer;
    }
    .grid-section .apple-card:active {
        opacity: 0.8; 
    }
    
    /* 【変更】スマートフォン表示時の文字サイズも連動してワンサイズ大きく拡大 */
    .card-keyword {
        font-size: 15px;      /* 13px -> 15px */
        padding: 4px 14px;
        margin-bottom: 16px;
    }
    .apple-card h5 {
        font-size: 24px;      /* 21px -> 24px */
    }
    
    /* プロジェクト・リクルート */
    .apple-grid-2 {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .project-strip {
        padding: 18px 0;
    }
    .recruit-sub-text {
        font-size: 17px;
    }

    /* トピックス（ニュースリスト） */
    .apple-news-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 14px 0;
    }
    .topics-section .apple-news-list li {
        border-bottom: 1px solid #ffffff; 
    }

    /* スキル・その他 */
    .skills-vertical-list p {
        word-break: normal;       
        overflow-wrap: anywhere;  
    }
    #access .container > div[style*="display: grid"] {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
        padding: 30px 20px !important; 
    }
    #access div[style*="min-height: 340px"] {
        min-height: 250px !important;
    }
}

/* ==========================================================================
   7. アニメーション & 背景設定
   ========================================================================= */
.animate-fade {
    animation: fadeInUp 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.animate-fade-delay {
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.25, 1, 0.5, 1) 0.2s forwards;
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-miru { background-image: url('images/miru-bg.jpg'); }
.card-hakaru { background-image: url('images/hakaru-bg.jpg'); }
.card-ayatsuru { background-image: url('images/ayatsuru-bg.jpg'); }

.hero-section.index-hero,
.hero-section.research-hero,
.hero-section.members-hero,
.hero-section.publications-hero,
.hero-section.recruit-hero {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

.hero-section.index-hero::before,
.hero-section.research-hero::before,
.hero-section.members-hero::before,
.hero-section.publications-hero::before,
.hero-section.recruit-hero::before {
    content: "";
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background-color: rgba(255, 255, 255, 0.65); 
    z-index: -1;
}

.hero-section.index-hero { background-image: url('images/blank.jpg'); }
.hero-section.research-hero { background-image: url('images/lab.jpg'); }
.hero-section.members-hero { background-image: url('images/members-bg.jpg'); }
.hero-section.publications-hero { background-image: url('images/publications-bg.jpg'); }
.hero-section.recruit-hero { background-image: url('images/recruit-bg.jpg'); }

.hero-content .apple-link { color: #51a7ff; }
.hero-content .apple-link:hover { color: #85c2ff; text-decoration: underline; }

.grid-section { background-color: var(--apple-gray); }
.grid-section .apple-card { background-color: #ffffff; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02); }
.topics-section { background-color: var(--apple-gray); border-top: 1px solid #e5e5e7; }

/* --- スクロール挙動の修正 --- */
/* デフォルト（PC表示）はパッと瞬時に切り替わる仕様にする */
html { 
    scroll-behavior: auto; 
}

/* スマホ表示（画面幅768px以下）の時だけ、お好みのスムーズスクロールを有効にする */
@media (max-width: 768px) {
    html { 
        scroll-behavior: smooth; 
    }
}

/* リンク先のIDをすべてここに集約する */
#research-overview, #treatment-concept, #platforms, #projects, #visualize, #quantify, #manipulate { 
    scroll-margin-top: 90px; 
}

.journal-name {
    font-style: italic;
    font-weight: bold;
    color: var(--apple-black) !important; 
}

.org-link, .footer-org-link {
    text-decoration: none;
    color: inherit; 
    transition: color 0.2s ease, opacity 0.2s ease;
}

/* 一般の組織リンク・ニュース内リンク等 */
.org-link {
    color: var(--apple-blue);      /* 最初からリンク色（青）にして目立たせる */
    border-bottom: none;           /* 下線を完全に消去 */
    padding-bottom: 0;
    font-weight: 500;              /* テキストをやや太くして視認性を向上 */
}

.org-link:hover {
    color: #004499;                /* ホバー時は少し濃い青にして変化を出す */
    border-bottom: none;           /* ホバー時も下線は表示しない */
    opacity: 1;
}

/* フッター内の組織リンク */
.footer-org-link {
    color: var(--apple-blue);
    border-bottom: none;           /* 下線を消去 */
    padding-bottom: 0;
}

.footer-org-link:hover {
    color: var(--apple-blue);      /* ホバー時にリンク色（青）に変化 */
    border-bottom: none;
}