/* Kobe University personal site - static CSS */
:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #5f6b7a;
  --line: #d9e1ec;
  --accent: #1f4b99;
  --accent-soft: #eaf1ff;
  /* 研究カード用ブリック DIC 2494（CMYK C23 M100 Y100 K0 / RGB #c40000） */
  --research-brick: #c40000;
  --research-brick-soft: rgba(196, 0, 0, 0.08);
  --research-brick-line: rgba(196, 0, 0, 0.22);
  --maxw: 1080px;
  --shadow: 0 8px 24px rgba(20, 31, 61, 0.06);
  --sticky-topbar-h: 88px;
  --topbar-h: 58px;
  /* トップバー直下から画面下端まで＝常に残りビューポートいっぱい（隙間なし） */
  --hero-visual-h: calc(100svh - var(--topbar-h));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans",
    "Yu Gothic", "Noto Sans JP", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 8px 12px;
  z-index: 300;
}

/* topbar は body 直下に置き sticky。header 内だとヘッダ終端で一緒に消えるため */
.site-header {
  background: transparent;
}

.site-topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  font-family: Meiryo, "Yu Gothic UI", "Hiragino Sans", "Yu Gothic", "MS PGothic", sans-serif;
  background: rgba(22, 34, 58, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  transition:
    background 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    backdrop-filter 0.35s ease,
    -webkit-backdrop-filter 0.35s ease;
}

/* ヒーロー直上ではやや透過（layout.js でトグル） */
.site-topbar--at-top {
  background: rgba(18, 28, 50, 0.78);
  border-bottom-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.18);
}

.site-topbar .site-title,
.site-topbar a.site-title {
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.site-topbar a.site-title:hover {
  color: #c8dcff;
  text-decoration: none;
}

.site-topbar .nav a {
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.site-topbar .nav a:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  text-decoration: none;
}

/* トップバー直下〜ヒーロー下端まで＝.hero-stage と同じ帯。画像とキャッチの縦中央を一致させる */
.hero-fixed-bg {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  height: var(--hero-visual-h);
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: linear-gradient(135deg, #1a3a78 0%, #3d5a9e 45%, #6b8fd4 100%);
}

.hero-fixed-bg picture {
  position: absolute;
  inset: 0;
  display: block;
  margin: 0;
  padding: 0;
}

.hero-fixed-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center center;
  display: block;
  /* サブピクセルで端が空く環境向けにわずかに拡大 */
  transform: scale(1.02);
  transform-origin: center center;
}

/* 狭い幅では cover が左右を切り落とすため、画像全体を収めて脳図が端まで見えるようにする */
@media (max-width: 1024px) {
  .hero-fixed-bg img {
    object-fit: contain;
    object-position: center center;
    transform: none;
  }
}

.hero-stage {
  position: relative;
  z-index: 1;
  height: var(--hero-visual-h);
  min-height: var(--hero-visual-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3.2vh, 2.75rem) clamp(0.75rem, 4vw, 1.5rem);
  padding-left: max(clamp(0.75rem, 4vw, 1.5rem), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(0.75rem, 4vw, 1.5rem), env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}

.hero-eyecatch {
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero-eyecatch__inner {
  position: relative;
  z-index: 1;
  isolation: isolate;
  width: fit-content;
  max-width: min(52rem, 92vw);
  margin: 0 auto;
  text-align: center;
  padding: clamp(1rem, 2.8vh, 1.85rem) clamp(1.35rem, 4.5vw, 2.75rem);
  border-radius: clamp(14px, 2.2vw, 22px);
  background: transparent;
}

/* すりガラスは疑似要素に載せ、mask で外周をフェード（エッジが角ばらない） */
.hero-eyecatch__inner::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: clamp(-18px, -3vw, -28px);
  border-radius: clamp(22px, 4vw, 38px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, transparent 42%),
    rgba(16, 36, 78, 0.44);
  backdrop-filter: blur(16px) saturate(118%);
  -webkit-backdrop-filter: blur(16px) saturate(118%);
  pointer-events: none;
  -webkit-mask-image: radial-gradient(
    ellipse 78% 84% at 50% 50%,
    #000 0%,
    #000 40%,
    rgba(0, 0, 0, 0.42) 66%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse 78% 84% at 50% 50%,
    #000 0%,
    #000 40%,
    rgba(0, 0, 0, 0.42) 66%,
    transparent 100%
  );
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

@keyframes hero-tagline-in {
  from {
    opacity: 0;
    transform: translateY(1.1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-tagline-ja {
  margin: 0;
  font-size: clamp(1.55rem, 0.65rem + 4.2vmin + 1.4vw, 4.15rem);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: clamp(0.04em, 0.06em + 0.2vw, 0.14em);
  word-break: keep-all;
  overflow-wrap: break-word;
  color: #fff;
  text-shadow:
    0 0 2px rgba(0, 0, 0, 0.85),
    0 1px 3px rgba(0, 0, 0, 0.75),
    0 clamp(2px, 0.45vmin, 5px) clamp(1.1rem, 2.8vmin, 1.85rem) rgba(0, 0, 0, 0.58),
    0 0 clamp(1.75rem, 4.5vmin, 3.25rem) rgba(0, 0, 0, 0.32);
  animation: hero-tagline-in 0.95s ease-out 0.12s both;
}

.hero-tagline-en {
  margin: clamp(0.6rem, 1.5vh + 0.4rem, 2.4rem) 0 0;
  font-size: clamp(0.78rem, 0.45rem + 1.15vmin + 0.45vw, 1.42rem);
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: clamp(0.03em, 0.045em + 0.18vw, 0.11em);
  color: rgba(255, 255, 255, 0.96);
  text-shadow:
    0 0 1px rgba(0, 0, 0, 0.8),
    0 1px 2px rgba(0, 0, 0, 0.7),
    0 2px clamp(0.85rem, 2.8vmin, 1.35rem) rgba(0, 0, 0, 0.55),
    0 0 clamp(1.25rem, 3.5vmin, 2rem) rgba(0, 0, 0, 0.28);
  animation: hero-tagline-in 0.95s ease-out 0.38s both;
}

@media (prefers-reduced-motion: reduce) {
  .hero-tagline-ja,
  .hero-tagline-en {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  flex-wrap: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(10px, 2.5vw, 20px);
  flex: 1 1 auto;
  min-width: 0;
}

/* 広い幅: スロットは display:contents で nav が flex 子になる */
.topbar-nav-slot {
  display: contents;
}

/* ナビを伸ばし、メニューリンクを右寄せ → その右端に JP|EN（ハンバーガーは常に最右） */
.site-topbar .topbar-actions .nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.lang-switch--topbar {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  white-space: nowrap;
  flex-shrink: 0;
}

.lang-switch--topbar .lang-switch__sep {
  color: rgba(255, 255, 255, 0.28);
  font-weight: 500;
  letter-spacing: 0;
  user-select: none;
}

/* NCD 風：現在言語は背景塗りつぶしで強調 */
.lang-switch--topbar .lang-switch__item--current {
  display: inline-block;
  padding: 0.32rem 0.62rem;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.94);
  color: #1a2744;
  line-height: 1.2;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.lang-switch--topbar a.lang-switch__item {
  display: inline-block;
  padding: 0.32rem 0.62rem;
  border-radius: 3px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  line-height: 1.2;
  transition: color 0.15s ease, background 0.15s ease;
}

.lang-switch--topbar a.lang-switch__item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.site-title {
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--text);
}

a.site-title {
  text-decoration: none;
}
a.site-title:hover {
  color: var(--accent);
  text-decoration: none;
}

.hero-intro-wrap {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, #edf3ff 0%, #f5f7fb 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 -6px 28px rgba(20, 31, 61, 0.1);
}

section[id],
#main {
  scroll-margin-top: var(--sticky-topbar-h);
}

#hero {
  scroll-margin-top: var(--sticky-topbar-h);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.nav a {
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.95rem;
}
.nav a:hover {
  background: var(--accent-soft);
  text-decoration: none;
}

.nav-tools-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  line-height: 0;
}

.nav-tools-link__icon {
  display: block;
  flex-shrink: 0;
}

.nav-menu-toggle {
  display: none;
  flex-shrink: 0;
  order: 3;
}

.nav-backdrop {
  display: none;
}

@media (max-width: 900px) {
  body.nav-drawer-open {
    overflow: hidden;
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 199;
    background: rgba(20, 31, 61, 0.42);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
  }

  .site-topbar.nav-is-open .nav-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0.5rem;
    width: 2.65rem;
    height: 2.65rem;
    font: inherit;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
  }

  .nav-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.5);
  }

  .nav-menu-toggle__bars {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 1.28rem;
  }

  .nav-menu-toggle__bars span {
    display: block;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    width: 100%;
  }

  .nav-menu-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
  }

  .topbar .nav {
    position: fixed;
    top: var(--topbar-h);
    right: 0;
    left: auto;
    width: min(19.5rem, 90vw);
    max-height: calc(100svh - var(--topbar-h));
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
    margin: 0;
    padding: 0.35rem 0;
    background: rgba(253, 254, 255, 0.98);
    border: 1px solid var(--line);
    border-right: none;
    border-radius: 0 0 0 14px;
    box-shadow: -10px 16px 40px rgba(20, 31, 61, 0.14);
    z-index: 210;
    transform: translateX(102%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.3s ease, visibility 0.3s ease;
  }

  .site-topbar.nav-is-open .topbar .nav {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  /* ドロワーは白背景（トップバー上のリンク色を上書き） */
  .topbar .nav a {
    border-radius: 0;
    padding: 0.88rem 1.2rem;
    font-size: 0.94rem;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    text-shadow: none;
  }

  .topbar .nav a:hover {
    background: var(--accent-soft);
    color: var(--text);
  }

  .topbar .nav a:last-child {
    border-bottom: none;
  }

  .topbar .nav .nav-tools-link {
    justify-content: flex-start;
  }

  .topbar .site-title {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 0.25rem;
  }

  /* 狭い幅：トップバーはタイトル＋（JP|EN＋メニューが右端）。スロットだけ幅0、nav の width は維持 */
  .topbar-actions {
    flex: 0 0 auto;
    gap: 10px;
  }

  .topbar-nav-slot {
    display: block;
    flex: 0 0 0;
    width: 0;
    min-width: 0;
    overflow: visible;
  }

  .site-topbar .topbar-actions .nav {
    flex: none;
    gap: 0;
    justify-content: flex-start;
  }

  .lang-switch--topbar {
    order: 2;
  }
}

@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .nav-backdrop,
  .topbar .nav {
    transition: none;
  }
}

.hero {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  grid-template-rows: auto auto;
  /* 横 32px / 縦は名前と所属の間だけ詰める */
  gap: 8px 32px;
  align-items: start;
  padding: 36px 0 44px;
}

.hero > .portrait {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: center;
}

.hero-profile-head {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

@media (min-width: 721px) {
  /* 広い画面：名前ブロックを下寄せ＆下マージンを詰めて所属に近づける（スマホレイアウトは維持） */
  .hero-profile-head {
    align-self: end;
  }
  .hero-profile-head > :last-child {
    margin-bottom: 0;
  }
  .hero-profile-body {
    margin-top: -6px;
  }
}

.hero-profile-body {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
}

.hero.hero--no-portrait {
  grid-template-columns: 1fr;
}

.hero.hero--no-portrait > .portrait,
.hero.hero--no-portrait .hero-profile-head,
.hero.hero--no-portrait .hero-profile-body {
  grid-column: auto;
  grid-row: auto;
  align-self: stretch;
}

.portrait {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: #dfe8f7;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.9rem;
  box-shadow:
    0 4px 16px rgba(31, 75, 153, 0.14),
    0 10px 36px rgba(20, 31, 61, 0.1);
}

.portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.hero-figure {
  margin: 0;
}

.hero-figure--tools {
  position: relative;
  width: 100%;
  max-width: 220px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: #dfe8f7;
  overflow: hidden;
  box-shadow:
    0 4px 16px rgba(31, 75, 153, 0.14),
    0 10px 36px rgba(20, 31, 61, 0.1);
}

.hero-figure--tools img {
  display: block;
  width: 100%;
  height: auto;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 2.2rem;
  line-height: 1.15;
}
.hero .name-ja,
.hero .name-en {
  color: var(--muted);
  font-size: 1.02rem;
  margin-bottom: 10px;
}
.hero .affiliation {
  margin-bottom: 14px;
  font-size: 1rem;
  line-height: 1.55;
}

.hero .affiliation a {
  font-weight: 600;
}
.hero .intro {
  margin: 0;
  max-width: 760px;
}

.quick-links {
  --quick-links-icon-h: clamp(2rem, 5.2vmin, 2.75rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(14px, 3vw, 22px);
  margin-top: 16px;
}

.quick-links__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--accent);
  transition: opacity 0.15s ease;
}

.quick-links__link:hover {
  opacity: 0.78;
}

.quick-links__link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

.quick-links__logo {
  display: block;
  object-fit: contain;
}

.quick-links__logo--researchmap {
  height: var(--quick-links-icon-h);
  width: auto;
  max-width: min(14rem, 90vw);
  object-fit: contain;
  object-position: left center;
}

.quick-links__logo--scholar {
  width: var(--quick-links-icon-h);
  height: var(--quick-links-icon-h);
  border-radius: 50%;
  object-fit: contain;
}

.quick-links__glyph {
  width: var(--quick-links-icon-h);
  height: var(--quick-links-icon-h);
  flex-shrink: 0;
  display: block;
}

.pill {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid #cfddff;
  font-size: 0.93rem;
  color: var(--accent);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

a.pill:hover {
  background: #dce8ff;
  border-color: #b8cefb;
  color: #163a78;
}

.pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

main {
  position: relative;
  z-index: 1;
  padding: 28px 0 56px;
  background: var(--bg);
}

main section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

h2 {
  margin: 0 0 18px;
  font-size: 1.3rem;
  border-left: 5px solid var(--accent);
  padding-left: 12px;
}
h3 {
  margin: 0 0 10px;
  line-height: 1.35;
}

ul, ol { margin-top: 0; }
.news-list li,
.pub-list li { margin-bottom: 10px; }

/* お知らせ：枠内スクロール（神戸大学サーバ上の研究室ページに近い見え方） */
.news-scroll {
  max-height: min(20rem, 50svh);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  padding: 14px 12px 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  scrollbar-width: thin;
  scrollbar-color: rgba(31, 75, 153, 0.35) rgba(31, 75, 153, 0.08);
}

.news-scroll .news-list {
  margin: 0;
  padding-left: 1.2rem;
}

.news-scroll .news-list li:last-child {
  margin-bottom: 0;
}

.news-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.news-scroll::-webkit-scrollbar {
  width: 9px;
}

.news-scroll::-webkit-scrollbar-track {
  background: rgba(31, 75, 153, 0.06);
  border-radius: 6px;
}

.news-scroll::-webkit-scrollbar-thumb {
  background: rgba(31, 75, 153, 0.3);
  border-radius: 6px;
}

.news-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(31, 75, 153, 0.45);
}

.date {
  color: var(--muted);
  font-weight: 700;
  margin-right: 8px;
  white-space: nowrap;
}

/* ----- 研究セクション：大枠の対比 + トピックカード ----- */
.research-subsection {
  margin-top: 28px;
}

.research-subsection:first-of-type {
  margin-top: 22px;
}

.research-subheading {
  margin: 0 0 16px;
  font-size: 1.12rem;
  line-height: 1.35;
  padding-left: 10px;
  border-left: 4px solid var(--accent);
  color: var(--text);
}

.research-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.research-compare__col {
  padding: 18px 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, #f8fafc 0%, #f0f4fb 100%);
}

.research-compare__col--traditional {
  border-top: 3px solid #3b6fd4;
}

.research-compare__col--new {
  border-top: 3px solid #2f9d6a;
}

.research-compare__title {
  margin: 0 0 14px;
  font-size: 1.02rem;
  font-weight: 700;
}

.research-compare__col--traditional .research-compare__title {
  color: #2d5bb8;
}

.research-compare__col--new .research-compare__title {
  color: #247a52;
}

.research-compare__illu {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px dashed rgba(31, 75, 153, 0.18);
}

.research-compare__illu-img {
  display: block;
  width: 100%;
  max-width: 240px;
  height: auto;
}

.research-compare__icons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
  color: rgba(31, 45, 75, 0.72);
}

.research-compare__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
}

.research-compare__lead {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.45;
}

.research-compare__note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}

.research-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

/* 開閉カード同士を行の高さで引き伸ばさない（閉じた側が空の大きな箱に見えないようにする） */
.research-card-grid.research-card-grid--accordion {
  align-items: start;
}

.research-topics-hint {
  margin: -6px 0 14px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.research-card--expandable {
  padding: 0;
}

.research-card--expandable > .research-card__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.research-card--expandable > .research-card__summary::-webkit-details-marker {
  display: none;
}

.research-card--expandable > .research-card__summary::marker {
  content: "";
}

.research-card__summary .research-card__title {
  flex: 1;
  margin: 0;
  min-width: 0;
  text-align: left;
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
}

.research-card__summary-chevron {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: var(--muted);
  transition: transform 0.22s ease;
}

.research-card--expandable[open] .research-card__summary-chevron {
  transform: rotate(180deg);
}

.research-card--expandable > .research-card__summary:hover {
  background: rgba(31, 75, 153, 0.07);
}

.research-card--brick.research-card--expandable > .research-card__summary:hover {
  background: rgba(196, 0, 0, 0.07);
}

.research-card--expandable > .research-card__summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.research-card--brick.research-card--expandable > .research-card__summary:focus-visible {
  outline-color: var(--research-brick);
}

.research-card__panel {
  border-top: 1px solid rgba(31, 75, 153, 0.18);
}

.research-card--brick .research-card__panel {
  border-top-color: rgba(196, 0, 0, 0.18);
}

.research-card--expandable .research-card__body {
  padding-bottom: 14px;
}

.research-card__close {
  margin-top: 4px;
  align-self: flex-start;
  padding: 0.45rem 1rem;
  font: inherit;
  font-size: 0.88rem;
  color: var(--accent);
  background: transparent;
  border: 1px solid rgba(31, 75, 153, 0.38);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.research-card__close:hover {
  background: var(--accent-soft);
}

.research-card--brick .research-card__close {
  color: var(--research-brick);
  border-color: rgba(196, 0, 0, 0.38);
}

.research-card--brick .research-card__close:hover {
  background: var(--research-brick-soft);
}

.research-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid rgba(31, 75, 153, 0.22);
  border-top: 4px solid var(--accent);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #eef4fc 0%, #f7f9ff 45%, #fffefd 100%);
  box-shadow: 0 3px 18px rgba(31, 75, 153, 0.1);
}

.research-card__media {
  background: transparent;
}

.research-card__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  padding: 12px;
  box-sizing: border-box;
}

.research-card__body {
  padding: 16px 18px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.research-card__title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--accent);
}

.research-card__body > p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--text);
  max-width: 100%;
  column-count: 1;
}

.research-card__refs {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(31, 75, 153, 0.18);
}

.research-card__refs-heading {
  margin: 0 0 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.research-card__refs .pub-list--compact a {
  color: var(--text);
}

.research-card__refs .pub-list--compact a:hover {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(31, 41, 55, 0.35);
}

.research-card:not(.research-card--brick) .research-card__refs .pub-list--compact em {
  color: var(--accent);
  font-style: italic;
}

.research-card--brick .research-card__refs .pub-list--compact em {
  color: var(--research-brick);
  font-style: italic;
}

/* 大規模脳画像統合・精神疾患マーカー枠：ブリック（#c40000）基調 */
.research-card--brick {
  border: 1px solid var(--research-brick-line);
  border-top: 4px solid var(--research-brick);
  background: linear-gradient(180deg, #fbeded 0%, #fff6f6 45%, #fffefd 100%);
  box-shadow: 0 3px 18px rgba(196, 0, 0, 0.1);
}

.research-card--brick .research-card__title {
  color: var(--research-brick);
}

.research-card--brick .research-card__refs {
  border-top-color: rgba(196, 0, 0, 0.18);
}

.pub-list--compact {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.88rem;
  line-height: 1.5;
}

.pub-list--compact li {
  margin-bottom: 8px;
}

.pub-list--compact li:last-child {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .research-compare {
    grid-template-columns: 1fr;
  }

  .research-card-grid {
    grid-template-columns: 1fr;
  }

  .research-card__summary {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .research-card__summary-chevron {
    margin-left: auto;
  }
}

.topic-list {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.topic-panel {
  border: 1px solid var(--line);
  background: #fbfcfe;
  border-radius: 18px;
  overflow: hidden;
}

.topic-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.topic-image {
  align-self: start;
  border-right: 1px solid var(--line);
}

.topic-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.topic-content {
  padding: 20px 22px 18px;
}

.topic-content p {
  margin-top: 0;
}

.topic-publications {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.topic-publications h4 {
  margin: 0 0 10px;
  font-size: 0.98rem;
  color: var(--accent);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.tool-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfe;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.tool-card__media {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 268px;
  box-sizing: border-box;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.tool-card__media img {
  display: block;
  max-width: 100%;
  max-height: 240px;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  object-fit: contain;
  object-position: center;
}

.tool-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px;
}

.tool-body__lead {
  flex: 0 0 auto;
}

.tool-body__lead p:last-child {
  margin-bottom: 0;
}

.tool-body h3 {
  margin-top: 0;
  color: var(--accent);
}

.tool-refs {
  flex-shrink: 0;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(31, 75, 153, 0.15);
}

.tool-refs__heading {
  margin: 0 0 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.tool-refs .pub-list--compact {
  font-size: 0.86rem;
}

.tool-refs .pub-list--compact a {
  color: var(--text);
}

.tool-refs .pub-list--compact a:hover {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(31, 41, 55, 0.35);
}

.tool-refs .pub-list--compact em {
  color: var(--accent);
  font-style: italic;
}

.tool-refs .pub-list--compact a strong {
  font-weight: 700;
  color: inherit;
}

.cv-contact-map-shell {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.cv-contact-map-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 38%);
  gap: 28px;
  align-items: start;
}

.cv-contact-main > section {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 0;
  box-shadow: none;
}

.cv-contact-main > section + section {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.map-embed-wrap {
  position: sticky;
  top: calc(var(--sticky-topbar-h) + 20px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e8eef8;
  min-height: 0;
}

.map-embed-wrap iframe {
  display: block;
  width: 100%;
  height: min(360px, 42vh);
  min-height: 260px;
  border: 0;
}

.cv-table {
  width: 100%;
  border-collapse: collapse;
}
.cv-table th,
.cv-table td {
  border-top: 1px solid var(--line);
  padding: 12px 8px;
  text-align: left;
  vertical-align: top;
}
.cv-table th {
  width: 140px;
  color: var(--muted);
  font-weight: 700;
}

.note,
.small {
  color: var(--muted);
  font-size: 0.94rem;
}

footer {
  position: relative;
  z-index: 1;
  padding: 20px 0 40px;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  background: var(--bg);
}

/* プロフィール内など、トップバー以外の言語切替（未使用時も残す） */
.lang-switch:not(.lang-switch--topbar) {
  margin-top: 14px;
}
.lang-switch:not(.lang-switch--topbar) a {
  font-weight: 600;
}

@media (max-width: 980px) {
  .topic-layout {
    grid-template-columns: 1fr;
  }
  .topic-image {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .topic-image img {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
  }
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .cv-contact-map-row {
    grid-template-columns: 1fr;
  }

  .map-embed-wrap {
    position: static;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 8px 24px;
  }
  .hero.hero--no-portrait {
    grid-template-columns: 1fr;
  }
  .portrait {
    width: 160px;
    height: 160px;
  }

  .hero-figure--tools {
    max-width: 160px;
  }
}

@media (max-width: 720px) {
  .wrap { padding: 0 14px; }

  .site-title {
    font-size: 1rem;
  }

  /* プロフィール：写真＋名前2行だけ横並び、所属・リンクは下段いっぱい */
  .hero:not(.hero--tools) {
    grid-template-columns: 132px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 18px;
    padding: 24px 0 30px;
    align-items: start;
  }

  .hero:not(.hero--tools) > .portrait {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }

  .hero-profile-head {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }

  .hero-profile-body {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .hero.hero--tools {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 18px;
    padding: 24px 0 30px;
  }

  .portrait {
    width: 132px;
    height: 132px;
    border-radius: 50%;
  }

  .hero h1 { font-size: 1.75rem; }

  .hero .name-ja,
  .hero .name-en,
  .hero .affiliation,
  .hero .intro {
    font-size: 0.96rem;
  }

  main section {
    padding: 18px 16px;
    border-radius: 16px;
  }

  h2 {
    font-size: 1.12rem;
    margin-bottom: 14px;
  }

  .topic-content {
    padding: 16px 14px;
  }

  .tool-body {
    padding: 16px 14px;
  }

  .hero.hero--tools .hero-figure--tools {
    margin-left: auto;
    margin-right: auto;
    max-width: 200px;
  }

  .tool-card__media {
    min-height: 240px;
    padding: 8px 10px;
  }

  .tool-card__media img {
    max-height: 210px;
  }

  .cv-table th,
  .cv-table td {
    display: block;
    width: 100%;
    padding: 8px 0;
  }
  .cv-table th {
    border-top: 1px solid var(--line);
    padding-top: 14px;
  }
}
