:root {
  --ink: #24282d;
  --muted: #68727d;
  --line: #dfe4e8;
  --paper: #ffffff;
  --soft: #f3f6f7;
  --accent: #176b63;
  --accent-dark: #0e4d48;
  --accent-pale: #e5f2ef;
  --sidebar: 270px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Yu Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.75;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
.skip-link { position: fixed; top: -80px; left: 1rem; z-index: 100; padding: .6rem 1rem; color: white; background: var(--accent-dark); }
.skip-link:focus { top: 1rem; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  min-height: 68px;
  padding: 0 max(24px, calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
}
.site-title { margin-right: auto; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 1.13rem; font-weight: 700; white-space: nowrap; text-decoration: none; }
.site-menu { display: flex; align-items: stretch; gap: 1.35rem; }
.site-menu a { position: relative; padding: 21px 0 18px; color: var(--muted); font-size: .9rem; font-weight: 650; text-decoration: none; }
.site-menu a.active, .site-menu a:hover { color: var(--ink); }
.site-menu a.active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; content: ""; background: var(--accent); }
.menu-button { display: none; padding: .45rem .75rem; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: white; font: inherit; }

.page-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); gap: 72px; width: min(calc(100% - 48px), var(--max)); margin: 0 auto; padding: 64px 0 86px; }
.profile { align-self: start; position: sticky; top: 112px; }
.avatar { display: grid; place-items: center; width: 150px; height: 150px; margin-bottom: 24px; border-radius: 50%; color: white; background: linear-gradient(145deg, #124e49, #31978d); font-family: Georgia, serif; font-size: 2.75rem; letter-spacing: -.06em; box-shadow: 0 18px 34px rgba(18,78,73,.16); }
.avatar-photo { display: block; object-fit: cover; object-position: center 32%; border: 4px solid white; background: var(--soft); }
.profile h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; line-height: 1.3; }
.profile-jp { margin: .15rem 0 1.1rem; color: var(--muted); font-weight: 650; }
.profile > p:not(.profile-jp) { color: var(--muted); font-size: .92rem; line-height: 1.65; }
.profile-links { margin: 1.4rem 0 0; padding: 0; list-style: none; }
.profile-links li { border-top: 1px solid var(--line); }
.profile-links li:last-child { border-bottom: 1px solid var(--line); }
.profile-links a { display: block; padding: .55rem 0; font-size: .9rem; font-weight: 650; text-decoration: none; }

.content { min-width: 0; max-width: 820px; }
.eyebrow { margin: 0 0 .7rem; color: var(--accent); font-size: .75rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.content h2 { max-width: 760px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.3rem, 5vw, 4.15rem); font-weight: 500; letter-spacing: -.035em; line-height: 1.05; }
.lead { max-width: 720px; margin: 1.6rem 0 4.5rem; color: #454d55; font-family: Georgia, "Yu Mincho", serif; font-size: 1.35rem; line-height: 1.8; }
.lead-en { margin-bottom: .45rem; }
.lead-ja { margin-top: 0; color: var(--muted); font-size: 1.05rem; }
.lead.compact { margin-bottom: 3.2rem; }
.content section { margin-top: 4.8rem; }
.content h3 { margin: 0 0 1.5rem; font-family: Georgia, "Times New Roman", serif; font-size: 1.75rem; font-weight: 500; }
.content h4 { margin: 0 0 .35rem; font-size: 1rem; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
.section-heading h3 { margin-bottom: .8rem; }
.section-heading a { font-size: .88rem; font-weight: 700; text-decoration: none; }
.section-count { color: var(--muted); font-size: .82rem; font-weight: 700; }

.topic-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.topic-card { padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(180deg, white, #fafcfc); }
.topic-card h4 { font-family: Georgia, serif; font-size: 1.15rem; }
.topic-card p { margin: .7rem 0 0; color: #4f5962; font-size: .9rem; }
.topic-card .jp { color: var(--muted); font-size: .82rem; }
.interest-list { margin: 1rem 0 0; padding-left: 1.2rem; color: #4f5962; font-size: .9rem; }
.interest-list li { margin: .45rem 0; }

.publication-list { margin: 0; padding: 0; list-style: none; }
.publication-list li { display: grid; grid-template-columns: 64px 1fr; gap: 20px; padding: 1.35rem 0; border-bottom: 1px solid var(--line); color: #4f5962; }
.publication-list strong { color: var(--ink); font-weight: 680; }
.year { color: var(--accent); font-family: Georgia, serif; font-size: 1.05rem; font-weight: 700; }
.long-list li { padding: 1.05rem 0; }
.pub-links { display: flex; flex-wrap: wrap; gap: .35rem .8rem; margin-top: .45rem; }
.pub-links a { font-size: .82rem; font-weight: 700; }
.migration-summary { display: flex; flex-wrap: wrap; gap: 12px; margin: 2rem 0 3rem; }
.migration-summary span { padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--soft); font-size: .82rem; }
.migration-summary strong { margin-right: .25rem; color: var(--accent); font-family: Georgia, serif; font-size: 1.1rem; }

.timeline { margin: 2.5rem 0 0; padding: 0; list-style: none; }
.timeline li { display: grid; grid-template-columns: 72px 1fr; gap: 24px; padding: 1.3rem 0; border-bottom: 1px solid var(--line); }
.timeline time { color: var(--accent); font-family: Georgia, serif; font-size: 1.05rem; font-weight: 700; }
.timeline p { margin: .25rem 0 0; color: var(--muted); }
.archive-note { margin-top: 2rem; padding: 1rem 1.2rem; border-left: 3px solid var(--accent); background: var(--soft); color: var(--muted); font-size: .9rem; }

.project-list { border-top: 1px solid var(--line); }
.grant-group-title { margin: 2.2rem 0 .7rem; color: var(--accent); font-family: inherit; font-size: 1rem; font-weight: 750; }
.project-list article { display: grid; grid-template-columns: 110px 1fr; gap: 24px; padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.project-list article > span { color: var(--accent); font-family: Georgia, serif; font-weight: 700; }
.project-list p { margin: .2rem 0 0; color: var(--muted); font-size: .9rem; }
.project-list .grant-entry { margin: 0; color: #4f5962; line-height: 1.7; }
.notice { padding: 28px; border-radius: 8px; background: var(--accent-pale); }
.notice p { color: #475753; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2.2rem; }
.button { display: inline-block; padding: .7rem 1rem; border: 1px solid var(--accent); border-radius: 4px; color: white; background: var(--accent); font-size: .9rem; font-weight: 700; text-decoration: none; }
.button:hover { color: white; background: var(--accent-dark); }
.button.secondary { color: var(--accent); background: white; }
.resource-links { padding-left: 1.2rem; }
.resource-links li { margin: .65rem 0; }
.archive-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 0; padding: 0; list-style: none; }
.archive-cards a { display: flex; flex-direction: column; min-height: 130px; padding: 24px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: linear-gradient(180deg, white, #fafcfc); text-decoration: none; }
.archive-cards a:hover { border-color: var(--accent); color: var(--accent-dark); }
.archive-cards strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; }
.archive-cards span { margin-top: .55rem; color: var(--muted); font-size: .85rem; }

footer { padding: 28px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; text-align: center; }

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; padding: 0 20px; }
  .site-title { min-height: 62px; display: flex; align-items: center; }
  .menu-button { display: block; }
  .site-menu { display: none; flex: 0 0 100%; gap: 0; padding-bottom: 10px; }
  .site-menu.open { display: grid; }
  .site-menu a { padding: 10px 4px; border-top: 1px solid var(--line); }
  .site-menu a.active::after { display: none; }
  .page-shell { grid-template-columns: 1fr; gap: 50px; width: min(calc(100% - 36px), 720px); padding-top: 42px; }
  .profile { position: static; display: grid; grid-template-columns: 108px 1fr; column-gap: 22px; }
  .avatar { grid-row: 1 / span 3; width: 108px; height: 108px; margin: 0; font-size: 2rem; }
  .profile-links { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; }
  .topic-grid { grid-template-columns: 1fr; }
  .archive-cards { grid-template-columns: 1fr; }
  .content h2 { font-size: clamp(2.2rem, 11vw, 3.5rem); }
  .lead { margin-bottom: 3.2rem; font-size: 1.15rem; }
  .lead-en { margin-bottom: .45rem; }
  .lead-ja { margin-top: 0; font-size: .98rem; }
}

@media (max-width: 520px) {
  .site-title { max-width: none; font-size: clamp(.76rem, 3.5vw, .9rem); line-height: 1; white-space: nowrap; }
  .menu-button { margin-left: 10px; padding: .4rem .6rem; font-size: .82rem; }
  .profile { display: block; text-align: center; }
  .avatar { margin: 0 auto 20px; }
  .profile-links { display: grid; text-align: left; }
  .publication-list li, .timeline li, .project-list article { grid-template-columns: 1fr; gap: 6px; }
  .content section { margin-top: 3.8rem; }
}
