/* ============================================================
   北村研究室 スタイルシート
   ------------------------------------------------------------
   ▼ 色やフォントを変えたいときは、まず下の「デザイントークン」
     （:root の変数）だけを触ってください。サイト全体に反映されます。
   ▼ セクションごとにコメントで区切ってあります。
   ============================================================ */

/* ---------- デザイントークン（サイト全体の設定値） ---------- */
:root {
  color-scheme: light;
  /* 白テーマ（標準） */
  --bg-0: #f1f5f8;
  --bg-1: #fbfdff;
  --bg-2: #ffffff;

  /* 文字色 */
  --text: #102336;
  --text-sub: #587084;

  /* アクセントカラー（変えるならここ） */
  --accent: #087f9d;
  --accent-bright: #54cfe8;
  --accent-dim: rgba(8, 127, 157, .10);

  /* Newsカテゴリごとの色（タグの色分け） */
  --cat-award: #e8b45a;     /* AWARD: 琥珀色 */
  --cat-event: #54cfe8;     /* EVENT: シアン */
  --cat-lab:   #7ee0a8;     /* LAB:   緑 */
  --cat-media: #b49cf0;     /* MEDIA: 薄紫 */

  /* 罫線・影 */
  --line: rgba(29, 74, 105, .16);
  --shadow: 0 12px 34px rgba(30, 64, 86, .11);

  /* フォント（読み込み失敗時はOS標準にフォールバック） */
  --font-body: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --font-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;

  /* レイアウト */
  --container: 1100px;      /* コンテンツの最大幅 */
  --radius: 14px;           /* 角丸の基本値 */
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg-0: #030711;
  --bg-1: #080f1d;
  --bg-2: #101b2c;
  --text: #e8f0f6;
  --text-sub: #9db2c4;
  --accent: #54cfe8;
  --accent-bright: #54cfe8;
  --accent-dim: rgba(84, 207, 232, .12);
  --line: rgba(140, 180, 210, .16);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

/* ---------- リセット・基本設定 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;               /* アンカーリンクを滑らかに */
  scroll-padding-top: 84px;              /* 固定ヘッダー分だけ着地位置をずらす */
}

body {
  margin: 0;
  background: var(--bg-1);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  word-break: normal;
  line-break: strict;
  transition: background-color .25s ease, color .25s ease;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* キーボード操作時のフォーカスを見えるように（アクセシビリティ） */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.center { text-align: center; }

/* スマホ・PCでの改行制御（index.html内の<br>用） */
.sp-only { display: none; }
@media (max-width: 640px) {
  .sp-only { display: inline; }
  .pc-only { display: none; }
}

/* スキップリンク（通常は画面外、フォーカス時のみ表示） */
.skip-link {
  position: absolute;
  left: 8px; top: -48px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: #04121a;
  border-radius: 6px;
  transition: top .2s;
}
.skip-link:focus { top: 8px; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background-color .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
/* スクロールするとJSが .is-scrolled を付け、背景が付く */
.site-header.is-scrolled {
  background: rgba(251, 253, 255, .88);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
  box-shadow: 0 8px 28px rgba(30, 64, 86, .06);
}
html[data-theme="dark"] .site-header.is-scrolled { background: rgba(6, 13, 22, .82); box-shadow: none; }

.header-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; flex-direction: column; line-height: 1.3; }
.brand:hover { text-decoration: none; }
.brand-en {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: .02em;
  color: var(--text);
}
.brand-ja { font-size: .72rem; color: var(--text-sub); letter-spacing: .12em; }

.nav { display: flex; gap: clamp(13px, 1.55vw, 26px); }
.nav a {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: .95rem;
  color: var(--text);
  letter-spacing: .04em;
  position: relative;
  padding: 4px 0;
}
.nav a:hover { text-decoration: none; color: var(--accent); }
/* 現在表示中のセクションに下線（JSが aria-current を付与） */
.nav a[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* ハンバーガーメニュー（スマホのみ表示） */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav-toggle span {
  width: 22px; height: 2px;
  background: var(--text);
  transition: transform .25s, opacity .25s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 言語・テーマ切替 */
.site-controls { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.control-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  color: var(--text);
  font: 700 .72rem/1 var(--font-mono);
  cursor: pointer;
  transition: border-color .2s, background-color .2s, color .2s, transform .2s;
}
.control-button:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.theme-icon { width: 15px; height: 15px; border-radius: 50%; background: currentColor; box-shadow: inset -5px -3px 0 var(--bg-2); }
html[data-theme="dark"] .theme-icon { box-shadow: none; }

/* ヒーローは両テーマ共通のダークなビジュアル領域 */
.hero { color: #e8f0f6; }
.hero .hero-title, .hero .btn-ghost { color: #e8f0f6; }
.hero .hero-lead { color: #9db2c4; }
.hero .eyebrow { color: #54cfe8; }
.hero .btn { background: #54cfe8; color: #04121a; }
.hero .btn.btn-ghost { background: transparent; color: #e8f0f6; }
.site-header:not(.is-scrolled) .brand-en,
.site-header:not(.is-scrolled) .nav a { color: #e8f0f6; }
.site-header:not(.is-scrolled) .brand-ja { color: #9db2c4; }
.site-header:not(.is-scrolled) .nav-toggle span { background: #e8f0f6; }
.site-header:not(.is-scrolled) .control-button { color: #e8f0f6; border-color: rgba(232,240,246,.24); background: rgba(3,7,17,.28); }
.site-header:not(.is-scrolled) .theme-icon { box-shadow: inset -5px -3px 0 #08101d; }
html[data-theme="dark"] .site-header:not(.is-scrolled) .theme-icon { box-shadow: none; }

@media (max-width: 880px) {
  .nav-toggle { display: flex; }
  .nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(251, 253, 255, .97);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 16px;
    display: none;                      /* JSが .is-open で開閉 */
  }
  html[data-theme="dark"] .nav { background: rgba(6, 13, 22, .96); }
  html:not([data-theme="dark"]) .site-header:not(.is-scrolled) .nav.is-open a { color: var(--text); }
  .site-controls { margin-left: auto; }
  .nav-toggle { order: 3; }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid rgba(140,180,210,.08); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, rgba(64, 109, 160, .10), transparent 48%),
    #030711;
}

/* 流れ場アニメーションのキャンバス（背面に敷く） */
#particle-canvas,
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#particle-canvas {
  z-index: 0;
  pointer-events: none;
  background: #030711;
  opacity: .62;
}
#flow-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  background: transparent;
  mix-blend-mode: screen;
  opacity: 1;
}
#flow-canvas[data-surface="light"] { mix-blend-mode: multiply; }
html[data-theme="dark"] #flow-canvas { mix-blend-mode: screen; filter: none; opacity: 1; }

/* 下端を本文背景へ滑らかにつなぐグラデーション */
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 30%;
  background: linear-gradient(to bottom, transparent, var(--bg-1));
  z-index: 2;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 120px 24px 80px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .28em;
  color: var(--accent);
  margin: 0 0 20px;
  text-shadow: 0 2px 12px #000, 0 0 26px #000;
}

.hero-title {
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.35;
  margin: 0 0 22px;
  text-shadow:
    0 2px 8px rgba(0, 0, 0, .95),
    0 4px 24px rgba(0, 0, 0, .90),
    0 0 48px rgba(0, 0, 0, .75);
  text-wrap: balance;
}

.hero-lead {
  color: var(--text-sub);
  font-size: clamp(.95rem, 2vw, 1.1rem);
  text-shadow: 0 2px 8px #000, 0 0 22px #000;
  margin: 0 0 36px;
  text-wrap: balance;
}

.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ボタン共通 */
.btn {
  display: inline-block;
  padding: 13px 30px;
  border-radius: 999px;
  background: var(--accent);
  color: #04121a;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .05em;
  transition: transform .2s, box-shadow .2s, background-color .2s;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(84, 207, 232, .25);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }

/* スクロール誘導（Hero下部の小さな表示） */
.scroll-cue {
  position: absolute;
  z-index: 2;
  bottom: 26px; left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  font-family: var(--font-mono);
  font-size: .65rem;
  letter-spacing: .3em;
  color: #9db2c4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.scroll-cue span {
  width: 1px; height: 34px;
  background: linear-gradient(var(--accent), transparent);
  animation: cue 2.2s ease-in-out infinite;
}
@keyframes cue {
  0%   { transform: scaleY(0); transform-origin: top; }
  45%  { transform: scaleY(1); transform-origin: top; }
  55%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------- セクション共通 ---------- */
.section { padding: 100px 0; }
.section > .container,
.footer-inner {
  position: relative;
  z-index: 2;
}
.section-alt { background: var(--bg-0); }   /* 交互に背景色を変えてリズムを作る */

.section-head { margin-bottom: 48px; }
.section-head h2 {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
}
.sec-en {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  letter-spacing: .01em;
}
.sec-ja {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .25em;
  color: var(--accent);
}
/* 見出し下の短いライン */
.section-head::after {
  content: "";
  display: block;
  width: 56px; height: 2px;
  margin-top: 16px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

/* ---------- データ読み込みエラー表示（file://で開いた場合など） ---------- */
.notice {
  padding: 18px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--text-sub);
  font-size: .9rem;
  background: var(--bg-2);
}
.notice code {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: .85em;
}

/* ---------- News ---------- */
.news-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.filter-btn {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .12em;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-sub);
  cursor: pointer;
  transition: color .2s, border-color .2s, background-color .2s;
}
.filter-btn:hover { color: var(--text); border-color: var(--accent); }
.filter-btn[aria-pressed="true"] {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 36px;
}
.news-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.news-pagination [hidden] { display: none; }
.news-pagination .more-btn {
  min-width: 132px;
}
.news-close::before,
.news-more::after {
  display: inline-block;
  font-family: var(--font-mono);
}
.news-close::before { content: "↑"; margin-right: 7px; }
.news-more::after { content: "↓"; margin-left: 7px; }

.news-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s, border-color .25s;
}
.news-card:hover { transform: translateY(-4px); border-color: rgba(84,207,232,.4); }

/* サムネイル。画像が無い/読み込めない場合は .no-image でグラデ表示 */
.thumb {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #0d2233, #123146);
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.no-image {
  display: grid;
  place-items: center;
  color: rgba(140, 180, 210, .35);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: .1em;
}

.news-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 10px; }

.news-meta { display: flex; align-items: center; gap: 12px; }
.date {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--text-sub);
  letter-spacing: .06em;
}

/* カテゴリタグ（色分け） */
.chip {
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .14em;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
  color: var(--text-sub);
}
.chip.cat-award { color: var(--cat-award); background: rgba(232, 180, 90, .08); }
.chip.cat-research { color: var(--cat-event); background: rgba(84, 207, 232, .08); }
.chip.cat-outreach { color: #c5b5ff; background: rgba(180, 156, 240, .08); }
.chip.cat-lab   { color: var(--cat-lab);   background: rgba(126, 224, 168, .08); }
.chip.cat-media { color: var(--cat-media); background: rgba(180, 156, 240, .08); }

.news-title { margin: 0; font-size: .95rem; font-weight: 500; line-height: 1.75; }

/* ---------- Media ---------- */
.media-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px);
  justify-content: center;
  gap: 24px;
}
.media-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  transition: transform .25s, border-color .25s;
}
.media-card:hover {
  text-decoration: none;
  transform: translateY(-4px);
  border-color: rgba(84,207,232,.4);
}
.media-card .news-title { color: var(--text); }
.media-card .ext {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--accent);
  letter-spacing: .1em;
}

/* ---------- Research ---------- */
.research-lead { width: 100%; margin-bottom: 56px; color: var(--text); }
.research-lead p { margin: 0; font-size: 1.02rem; text-wrap: wrap; }
.research-lead p + p { margin-top: 1.1em; }

.research-film {
  width: min(100%, 760px);
  margin: 0 auto 52px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: #020611;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .32);
}
.research-film video {
  display: block;
  width: 100%;
  max-height: 70vh;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #020611;
}
.research-life {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  width: min(100%, 1040px);
  margin: 0 auto 64px;
}
.research-life figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}
.research-life img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
@media (max-width: 680px) {
  .research-life { grid-template-columns: 1fr; }
}

.approach-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0;
  margin: 4px 0 44px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.approach {
  min-width: 0;
  padding: 30px 32px 34px;
}
.approach + .approach {
  border-left: 1px solid var(--line);
}
.approach-icon {
  width: 34px;
  height: 34px;
  color: var(--accent);
  margin-bottom: 22px;
}
.approach-icon svg { width: 100%; height: 100%; }
.approach h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.approach h3 span {
  font-family: var(--font-body);
  font-size: .78rem;
  color: var(--text-sub);
  font-weight: 500;
}
.approach p { margin: 0; font-size: .9rem; color: var(--text-sub); line-height: 1.9; }
@media (max-width: 760px) {
  .approach-cards { grid-template-columns: 1fr; }
  .approach { padding: 26px 0 28px; }
  .approach + .approach {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

.research-invitation {
  width: 100%;
  padding: 30px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 27, 44, .88);
}
.research-invitation-label {
  margin: 0 0 8px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.research-invitation h3 {
  margin: 0 0 14px;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  text-wrap: balance;
}
.research-invitation p:not(.research-invitation-label) {
  margin: 0;
  color: var(--text-sub);
  font-size: .92rem;
}
.research-invitation p + p { margin-top: 10px; }

.tag {
  font-size: .82rem;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--accent-dim);
  color: var(--text);
}

/* ---------- Research Support / Funding ---------- */
.funding-lead {
  width: 100%;
  margin: 0 0 38px;
  color: var(--text-sub);
}
.funding-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  width: min(100%, 920px);
  margin-inline: auto;
  border-top: 1px solid var(--line);
}
.funding-card,
.funding-empty {
  position: relative;
  margin: 0;
  padding: 22px 20px 22px 40px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.funding-card::before {
  content: "";
  position: absolute;
  top: 30px;
  left: 14px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(84, 207, 232, .45);
}
.funding-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .1em;
}
.funding-category {
  color: #7454aa;
}
html[data-theme="dark"] .funding-category { color: #c5b5ff; }
.funding-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  line-height: 1.65;
}
.funding-card p,
.funding-empty {
  color: var(--text-sub);
  font-size: .88rem;
}
.funding-card p { margin: 0 0 16px; }
.funding-link {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .06em;
}

/* ---------- Join Us ---------- */
.join-message {
  padding: 0 0 34px;
  border-bottom: 1px solid var(--line);
}
.join-card-en {
  margin: 0 0 12px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .12em;
}
.join-message blockquote {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  font-weight: 700;
  line-height: 1.45;
}
.join-lead {
  margin: 22px 0 0;
  color: var(--text-sub);
  font-size: 1rem;
  line-height: 1.9;
}
.join-call {
  margin: 16px 0 0;
  color: var(--text-sub);
  font-size: 1rem;
}
.join-paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px;
  margin-top: 34px;
}
.join-card {
  padding: 0;
}
.join-card-en { margin-bottom: 12px; }
.join-card h3 {
  margin: 0 0 14px;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  line-height: 1.5;
}
.join-card p:not(.join-card-en) {
  margin: 0;
  color: var(--text-sub);
}
.join-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .76rem;
  letter-spacing: .06em;
}
@media (max-width: 720px) {
  .join-paths { grid-template-columns: 1fr; gap: 34px; }
  .join-message blockquote { font-size: 1.55rem; }
}

/* ---------- Student Life ---------- */
.lab-life {
  min-width: 0;
  margin-top: 72px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.lab-life-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 30px 0;
  cursor: pointer;
  list-style: none;
  transition: background-color .2s;
}
.lab-life-summary::-webkit-details-marker { display: none; }
.lab-life-summary:hover .lab-life-summary-action { color: var(--accent-bright); }
.lab-life[open] .lab-life-summary { border-bottom: 1px solid var(--line); }
.lab-life-summary-copy { min-width: 0; }
.lab-life-summary-action {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .03em;
  white-space: nowrap;
}
.lab-life-chevron {
  width: 8px;
  height: 8px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .2s;
}
.lab-life .when-open { display: none; }
.lab-life[open] .when-closed { display: none; }
.lab-life[open] .when-open { display: inline; }
.lab-life[open] .lab-life-chevron { transform: rotate(225deg) translate(-2px, -2px); }
.lab-life-content {
  padding: 40px 0 10px;
  background: transparent;
}
.lab-life-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .16em;
}
.lab-life-summary h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  line-height: 1.4;
}
.lab-life-intro {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--text-sub);
  font-size: .86rem;
}
.day-grid {
  display: grid;
  grid-template-columns: minmax(0, 780px);
  justify-content: center;
  min-width: 0;
}
.day-card {
  min-width: 0;
  padding: 8px 0 24px;
}
.life-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}
.life-timeline li {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  min-height: 52px;
}
.life-timeline time {
  color: var(--text-sub);
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .02em;
}
.life-timeline li > span {
  position: relative;
  min-height: 52px;
  padding: 11px 10px 11px 26px;
  border-left: 1px solid var(--line);
  font-size: .84rem;
  line-height: 1.55;
}
.life-timeline li > span::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-sub);
  transform: translateY(-50%);
}
.life-timeline li.is-focus > span {
  border-left-color: var(--accent);
  color: var(--text);
  font-weight: 700;
}
.life-timeline li.is-focus > span::before {
  left: -4px;
  width: 7px;
  height: 7px;
  background: var(--accent);
  box-shadow: none;
}
.student-voice {
  width: min(100%, 860px);
  margin: 54px auto 0;
  padding: 42px 0 8px;
  border-top: 1px solid var(--line);
}
.student-voice h4 {
  max-width: 780px;
  margin: 0 0 22px;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.85rem);
  line-height: 1.5;
}
.student-voice-body > p {
  margin: 0;
  color: var(--text-sub);
  font-size: .94rem;
}
.student-voice-body > p + p { margin-top: 14px; }
@media (max-width: 760px) {
  .lab-life { margin-top: 56px; }
  .lab-life-summary { grid-template-columns: 1fr; gap: 16px; padding: 24px 0; }
  .lab-life-summary-action { justify-self: start; }
  .lab-life-content { padding: 30px 0 8px; }
  .day-card { padding: 0 0 20px; }
  .student-voice { margin-top: 40px; padding: 32px 0 4px; }
}
@media (max-width: 420px) {
  .life-timeline li { grid-template-columns: 102px minmax(0, 1fr); }
  .life-timeline time { font-size: .65rem; }
}

/* ---------- Member ---------- */
.photo-gallery {
  width: min(100%, 920px);
  margin-inline: auto;
  margin-bottom: 56px;
}
.photo-gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: var(--bg-2);
}
.photo-gallery-track::-webkit-scrollbar { display: none; }
.photo-gallery-item {
  flex: 0 0 100%;
  scroll-snap-align: start;
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--bg-2);
}
.photo-gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center 68%;
}
.photo-gallery-item figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 30px 16px 12px;
  background: linear-gradient(to bottom, transparent, rgba(3, 7, 17, .90));
  color: #e8f0f6;
  font-size: .82rem;
  letter-spacing: .04em;
}
.photo-gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 16px;
}
.photo-gallery-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  transition: border-color .2s, color .2s, transform .2s;
}
.photo-gallery-button:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.photo-gallery-status {
  min-width: 48px;
  color: var(--text-sub);
  font-family: var(--font-mono);
  font-size: .72rem;
  text-align: center;
  letter-spacing: .12em;
}
@media (max-width: 640px) {
  .photo-gallery-item img { aspect-ratio: 4 / 3; }
}

/* 学年見出し（Doctor 1st Grade など） */
.group-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: .04em;
  width: min(100%, 1080px);
  margin: 54px auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}
.group-title::before,
.group-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.group-title .ja {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--text-sub);
  letter-spacing: .2em;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 26px;
  width: min(100%, 1080px);
  margin-inline: auto;
}
.faculty-grid {
  grid-template-columns: repeat(2, minmax(270px, 330px));
  justify-content: center;
}
.student-grid {
  grid-template-columns: repeat(auto-fill, minmax(270px, 330px));
  justify-content: center;
}
.member-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
  padding-bottom: 18px;
}
.member-card .thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
}
.member-name {
  margin: 14px 0 2px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .06em;
}
.member-role, .member-theme {
  margin: 0;
  font-size: .8rem;
  color: var(--text-sub);
  padding: 0 14px;
}
.member-role { font-family: var(--font-mono); letter-spacing: .1em; }
.member-career {
  margin: 10px auto 0;
  padding: 0 18px;
  max-width: 290px;
  color: var(--text-sub);
  font-size: .72rem;
  line-height: 1.7;
}
@media (max-width: 680px) {
  .faculty-grid,
  .member-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* researchmapリンク（JSONにURLがあるときだけ表示される） */
.rm-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .08em;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
}
.rm-link:hover { border-color: var(--accent); text-decoration: none; background: var(--accent-dim); }
.rm-link svg { width: 11px; height: 11px; }

/* ---------- Career（卒業生・進路） ---------- */
.career-lead { width: 100%; color: var(--text-sub); margin-bottom: 46px; }
.career-block + .career-block { margin-top: 56px; }
.career-subtitle { margin: 0 0 8px; font-size: clamp(1.25rem, 2vw, 1.65rem); }
.career-note { margin: 0 0 24px; color: var(--text-sub); font-size: .88rem; }

.alumni-year {
  font-family: var(--font-mono);
  font-size: .85rem;
  letter-spacing: .15em;
  color: var(--accent);
  margin: 36px 0 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.alumni-year::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.alumni-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  margin-bottom: 8px;
}
.deg-chip {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .1em;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-sub);
  flex-shrink: 0;
}
.alumni-details { display: grid; gap: 4px; min-width: 0; }
.alumni-thesis { color: var(--text-sub); line-height: 1.7; overflow-wrap: anywhere; }
.career-destinations {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.career-destination {
  position: relative;
  min-width: 0;
  padding-left: 15px;
  color: var(--text-sub);
  font-size: .94rem;
  line-height: 1.65;
}
.career-destination::before {
  content: "";
  position: absolute;
  top: .68em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
@media (max-width: 560px) {
  .career-destinations { grid-template-columns: 1fr; }
}
@media (min-width: 561px) and (max-width: 900px) {
  .career-destinations { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Contact ---------- */
.campus-photo {
  width: min(100%, 360px);
  margin: 28px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}
.campus-photo img {
  display: block;
  width: 100%;
  height: auto;
}
.contact-grid {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(460px, 1.7fr);
  gap: 46px;
  align-items: stretch;
}
@media (max-width: 780px) {
  .contact-grid { grid-template-columns: 1fr; }
  .map-wrap { min-height: 360px; }
}
.contact-info h3 {
  font-size: 1.2rem;
  margin: 0 0 14px;
  letter-spacing: .08em;
}
.address { color: var(--text-sub); margin: 0 0 18px; }
.contact-email {
  margin: 0 0 26px;
  color: var(--text-sub);
  font-family: var(--font-mono);
  font-size: .82rem;
  overflow-wrap: anywhere;
}
.contact-email-label {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
}
/* @は画面上だけに表示し、コピーされる本文には含めない */
.email-at::before {
  content: "@";
  user-select: none;
}
.map-wrap iframe {
  width: 100%;
  height: 100%;
  min-height: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: block;
}

/* ---------- フッター ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 46px 0 38px;
  background:
    radial-gradient(circle at 12% 0%, rgba(84, 207, 232, .08), transparent 34%),
    radial-gradient(circle at 88% 100%, rgba(179, 150, 255, .07), transparent 36%),
    var(--bg-0);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-sub);
}
.footer-university {
  display: grid;
  gap: 8px;
}
.university-wordmark {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 42px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  background: rgba(255, 255, 255, .96);
}
.university-wordmark:hover {
  text-decoration: none;
  border-color: rgba(84, 207, 232, .5);
}
.university-wordmark img {
  display: block;
  width: auto;
  max-width: min(360px, 72vw);
  max-height: 78px;
}
.footer-university p {
  margin: 0;
  color: var(--text-sub);
  font-family: var(--font-mono);
  font-size: .64rem;
  letter-spacing: .12em;
}
.footer-meta {
  display: grid;
  justify-items: end;
  gap: 7px;
  text-align: right;
}
.footer-meta small {
  font-family: var(--font-mono);
  font-size: .62rem;
  line-height: 1.7;
}
@media (max-width: 680px) {
  .footer-inner { align-items: flex-start; }
  .footer-meta {
    width: 100%;
    justify-items: start;
    text-align: left;
    padding-top: 18px;
    border-top: 1px solid var(--line);
  }
}

/* ---------- スクロール時のフェードイン演出 ----------
   体験を阻害しないよう「短く・控えめに」。
   JSが画面に入った要素へ .is-visible を付けます。 */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* OSで「視差効果を減らす」設定の人にはアニメーションを止める */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue span { animation: none; }
  .btn, .news-card, .media-card { transition: none; }
}
