:root {
  --paper:      #ffffff;
  --ink:        #1c2230;
  --ink-soft:   #555e70;
  --indigo:     #2e4a7d;
  --indigo-soft:#eaeef6;
  --rule:       #e1e5ec;
  --side:       #f4f6fa;
  --side-rule:  #dde2ea;

  --mincho: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", "Noto Serif CJK JP", serif;
  --gothic: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", "Meiryo", "Noto Sans JP", "Noto Sans CJK JP", sans-serif;

  --side-width: 17rem;
  color-scheme: light;
}

/* ---------- 基本 ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--paper); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--gothic);
  font-size: 1rem;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--indigo);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--indigo);
  color: var(--paper);
  padding: 0.5rem 1rem;
  z-index: 10;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- 全体レイアウト ---------- */

.layout {
  display: grid;
  grid-template-columns: var(--side-width) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "side title"
    "side main";
  min-height: 100vh;
}

/* ---------- 左側：基本情報と目次 ---------- */

.identity {
  grid-area: side;
  align-self: start;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 4.9rem 2rem 3rem 2.25rem;
  background: var(--side);
  border-right: 1px solid var(--side-rule);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 1.75rem;
  overflow-y: auto;
}

.role {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.affiliation {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.7;
}


.toc {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--side-rule);
  font-size: 0.9rem;
}
.toc a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.15rem 0;
}
.toc a:hover { color: var(--indigo); }

/* ---------- 右側：本文 ---------- */

.content {
  grid-area: main;
  max-width: 46rem;
  padding: 0 4rem 3rem;
}

.page-title {
  grid-area: title;
  max-width: 46rem;
  padding: 4.5rem 4rem 3.5rem;
}
.page-title h1 {
  font-family: var(--mincho);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.12em;
  margin: 0;
}
.page-title .name-en {
  margin: 0.25rem 0 0;
  font-family: var(--mincho);
  font-size: 1rem;
  color: var(--indigo);
  letter-spacing: 0.04em;
}

.section {
  padding-bottom: 3.5rem;
  margin-bottom: 3.5rem;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 2rem;
}
.section:last-of-type { border-bottom: none; }

h2 {
  font-family: var(--mincho);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.06em;
  margin: 0 0 1.5rem;
}

h3 {
  font-family: var(--gothic);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.6;
  margin: 0 0 0.5rem;
}

p { margin: 0 0 1rem; }

.lead {
  font-family: var(--mincho);
  font-size: 1.2rem;
  line-height: 1.95;
  font-weight: 500;
}

.note {
  font-size: 0.875rem;
  color: var(--ink-soft);
}

/* キーワード */
.keywords {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin: 1.75rem 0 0;
}
.keywords dt {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin-right: 0.5rem;
}
.keywords dd {
  margin: 0;
  font-size: 0.875rem;
  background: var(--indigo-soft);
  padding: 0.1rem 0.75rem;
  border-radius: 999px;
}

/* 研究テーマ */
.topic {
  padding-left: 1.25rem;
  border-left: 3px solid var(--indigo);
  margin-bottom: 2rem;
}
.topic:last-child { margin-bottom: 0; }
.topic p { color: var(--ink-soft); margin: 0; }

/* 業績 */
.year-group {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1.75rem;
}

.year {
  font-family: var(--mincho);
  font-size: 1.15rem;
  color: var(--indigo);
  margin: 0;
  line-height: 1.7;
}

.pubs {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pubs li {
  padding-bottom: 1.1rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px dashed var(--rule);
  line-height: 1.7;
}
.pubs li:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.pubs .title,
.pubs .venue { display: block; }

.pubs .title { font-weight: 500; }
.pubs .venue { font-size: 0.9rem; color: var(--ink-soft); font-style: italic; }
.pubs .doi { font-size: 0.85rem; word-break: break-all; }

.subhead { margin-top: 2rem; }
.section > .subhead:first-of-type { margin-top: 0; }
.note + .subhead { margin-top: 1.25rem; }

/* 研究費・学歴 */
.grants {
  list-style: none;
  margin: 0;
  padding: 0;
}
.grants li {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  column-gap: 1.25rem;
  padding: 0.4rem 0;
}
.grants .when {
  font-size: 0.9rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.societies { color: var(--ink-soft); margin: 0; }

/* リンク */
.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.link-list li {
  display: grid;
  grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
  column-gap: 1.25rem;
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--rule);
}
.link-list li:last-child { border-bottom: none; }
.link-list a { font-weight: 500; }
.link-list span { font-size: 0.9rem; color: var(--ink-soft); }

/* 連絡先 */
.mail {
  font-size: 1.15rem;
  font-weight: 500;
}
address {
  font-style: normal;
  margin: 0;
  line-height: 1.9;
}

/* フッター */
.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.footer p { margin: 0; }

/* ---------- タブレット・スマートフォン ---------- */

@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas: "title" "side" "main";
  }

  .page-title { padding: 2.5rem 1.25rem 1.5rem; }
  .page-title h1 { font-size: 2rem; }

  .identity {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--side-rule);
    border-top: 1px solid var(--side-rule);
    padding: 1.25rem 1.25rem 1.25rem;
    gap: 1rem;
  }

  .toc {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    padding-top: 1rem;
  }

  .content { padding: 2.5rem 1.25rem 2rem; max-width: none; }
  .section { padding-bottom: 2.5rem; margin-bottom: 2.5rem; }

  .year-group { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
}

@media (max-width: 480px) {
  .link-list li { grid-template-columns: minmax(0, 1fr); }
  .grants li { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .lead { font-size: 1.1rem; }
}

/* ---------- 印刷 ---------- */

@media print {
  .layout { display: block; }
  .identity { position: static; height: auto; border: none; padding: 0 0 1rem; }
  .toc, .skip { display: none; }
  .content { max-width: none; padding: 0; }
  a { color: inherit; }
}
