/* ==========================================================================
   Profile site stylesheet
   Design tokens (light/dark) + layout. No external assets.
   ========================================================================== */

:root {
  color-scheme: light dark;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #dbeafe;
  --border: #e2e8f0;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.06);
  --monogram-fg: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #60a5fa;
    --accent-strong: #93c5fd;
    --accent-soft: rgba(59, 130, 246, 0.16);
    --border: #2e3b52;
    /* none はカンマ区切りの box-shadow リスト内で不正なため透明シャドウで打ち消す */
    --shadow: 0 0 #0000;
    /* 明色アクセント上で白文字はコントラスト不足 (2.5:1) のため暗色に反転 */
    --monogram-fg: #0f172a;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
    "Yu Gothic UI", "Meiryo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "palt";
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

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

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg); /* color-mix 非対応ブラウザ用フォールバック */
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}

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

.nav-links a.active {
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Hero (index)
   -------------------------------------------------------------------------- */

.hero {
  background:
    radial-gradient(60rem 24rem at 85% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(40rem 20rem at 0% 110%, var(--accent-soft), transparent 55%);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) 1.25rem;
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 2.5rem);
}

.hero-avatar img,
.hero-avatar .monogram {
  width: clamp(96px, 16vw, 136px);
  height: clamp(96px, 16vw, 136px);
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px var(--accent), var(--shadow);
}

.hero-avatar .monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--monogram-fg);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.hero-kicker {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.hero h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.hero-sub {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color 0.15s, color 0.15s, transform 0.15s;
}

.social-links a:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  transform: translateY(-1px);
}

.social-links svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
}

/* --------------------------------------------------------------------------
   Page header (subpages)
   -------------------------------------------------------------------------- */

.page-header {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3rem) 1.25rem 0;
}

.page-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   Main content sections
   -------------------------------------------------------------------------- */

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

section {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}

section:last-child { border-bottom: none; }

section h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.2rem;
  margin-bottom: 1.1rem;
}

section h2::before {
  content: "";
  width: 4px;
  height: 1.15em;
  border-radius: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

.count-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
}

/* Affiliation */

.affiliation { margin-bottom: 0.9rem; }
.affiliation:last-child { margin-bottom: 0; }
.affiliation strong { display: block; }
.affiliation span { font-size: 0.88rem; color: var(--text-muted); }

/* Research keywords */

.keyword-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.keyword-list li {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 500;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

/* Timeline (education & career) */

.timeline {
  list-style: none;
  position: relative;
  padding-left: 1.4rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.32rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--border);
}

.timeline li {
  position: relative;
  padding: 0.35rem 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -1.4rem;
  top: 0.95rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--accent);
  border: 2.5px solid var(--bg);
}

.timeline .tl-year {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-strong);
  line-height: 1.4;
}

.timeline .sub {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Generic definition-style lists (awards, patents, talks, service, press) */

.entry-list { list-style: none; }

.entry-list li {
  display: flex;
  gap: 1rem;
  padding: 0.45rem 0;
  align-items: baseline;
}

.entry-list .year {
  flex-shrink: 0;
  min-width: 4.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.entry-list .detail { flex: 1; }

.entry-list .sub {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Societies */

.society-list { list-style: none; }
.society-list > li { padding: 0.25rem 0; }
.society-list ul {
  list-style: none;
  padding-left: 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.society-list ul li::before { content: "— "; }

/* Personal projects */

.project-list { list-style: none; }
.project-list li { padding: 0.35rem 0; }
.project-list .sub {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.more-link {
  margin-top: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Publications
   -------------------------------------------------------------------------- */

.pub-entry {
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--border);
}

.pub-entry:last-child { border-bottom: none; }

.pub-title { font-weight: 600; line-height: 1.6; }

.pub-authors { font-size: 0.88rem; color: var(--text-muted); }

.pub-venue { font-size: 0.88rem; font-style: italic; color: var(--text-muted); }

.pub-links { margin-top: 0.3rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }

.pub-links a,
.pub-links span {
  display: inline-block;
  font-size: 0.78rem;
  text-decoration: none;
  color: var(--accent-strong);
  background: var(--accent-soft);
  padding: 0.1rem 0.65rem;
  border-radius: 999px;
  transition: filter 0.15s;
}

.pub-links a:hover { filter: brightness(0.95); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 620px) {
  .hero-inner {
    flex-direction: column;
    text-align: center;
  }
  .social-links { justify-content: center; }
  .entry-list li { flex-direction: column; gap: 0; }
  .entry-list .year { min-width: 0; }
}
