:root {
  --paper: #ffffff;
  --paper-raised: #fafafa;
  --paper-line: #e2e2e2;
  --ink: #111111;
  --ink-soft: #333333;
  --ink-faint: #767676;
  --accent: #00a86b;
  --accent-soft: #d7f2e6;
  --accent-line: #3fbf8f;
  --hero-glow: #bfe6d3;
  --rust: #00a86b;
  --rust-soft: #d7f2e6;
  --focus: #00a86b;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 24px -18px rgba(0, 0, 0, 0.25);

  --font-display: "Hiragino Maru Gothic ProN", "Hiragino Maru Gothic Pro", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic Medium", "Noto Sans JP", "Segoe UI", sans-serif;
  --font-body: "Hiragino Maru Gothic ProN", "Hiragino Maru Gothic Pro", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic Medium", "Noto Sans JP", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, "Noto Sans Mono CJK JP", monospace;

  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; text-wrap: balance; margin: 0; }
strong, b { font-weight: 400; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }

/* ---------- nav ---------- */
.topnav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--paper-line);
}
.topnav-inner {
  max-width: 1120px; margin: 0 auto; padding: 0.7rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.topnav-name { font-family: var(--font-display); font-size: 1rem; font-weight: 400; white-space: nowrap; text-decoration: none; color: var(--ink); }
.topnav-links {
  display: flex; gap: 1.1rem; overflow-x: auto; scrollbar-width: none;
  font-size: 0.8rem; letter-spacing: 0.04em;
}
.topnav-links::-webkit-scrollbar { display: none; }
.topnav-links a { color: var(--ink-soft); text-decoration: none; white-space: nowrap; }
.topnav-links a:hover { color: var(--accent); }
.topnav-links a.active { color: var(--accent); font-weight: 400; }
.lang-link { display: inline-flex; align-items: center; gap: 0.4rem; }
.flag-uk {
  display: inline-block; width: 20px; height: 14px; flex: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3Crect width='60' height='30' fill='%2300247d'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' stroke='%23cf142b' stroke-width='2'/%3E%3Cpath d='M30,0 V30 M0,15 H60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30,0 V30 M0,15 H60' stroke='%23cf142b' stroke-width='6'/%3E%3C/svg%3E");
  background-size: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.flag-jp {
  display: inline-block; width: 20px; height: 14px; flex: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3Crect width='60' height='30' fill='%23fff'/%3E%3Ccircle cx='30' cy='15' r='9' fill='%23bc002d'/%3E%3C/svg%3E");
  background-size: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

/* ---------- hero (home) ---------- */
.hero {
  position: relative; padding: 2.8rem 0 2rem; overflow: hidden;
  background: var(--paper);
}
.hero--lego { background: var(--paper); padding-bottom: 1rem; }
.hero--lego .hero-inner {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.2) 70%, var(--paper) 100%), url("lego.jpg");
  background-size: cover;
  background-position: center 35%;
  background-repeat: no-repeat;
  padding-top: 2.8rem;
  padding-bottom: 2.96rem;
  border-radius: 14px;
  overflow: hidden;
}
.hero--lego .eyebrow,
.hero--lego h1,
.hero--lego .en-name,
.hero--lego .role,
.hero--lego .hero-meta,
.hero--lego .hero-meta a { color: #ffffff !important; font-weight: 700 !important; }
.hero--lego .links-container { margin-top: 6.5rem; }
.hero canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0.6; pointer-events: none;
}
.hero-inner { position: relative; }
.eyebrow {
  font-size: 1.11rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink); font-weight: 400; margin: 0 0 0.9rem;
}
.hero h1 { font-size: clamp(2.1rem, 5.6vw, 3rem); line-height: 1.25; }
.hero .en-name {
  display: block; font-family: var(--font-mono); font-size: 0.95rem;
  letter-spacing: 0.08em; color: var(--ink-faint); margin-top: 0.6rem; font-weight: 400;
}
.hero .role { margin: 0.9rem 0 0; color: var(--ink-soft); font-size: 1.02rem; max-width: 34em; }
.hero .tagline {
  margin: 1.1rem 0 0; font-family: var(--font-display); font-size: 1.2rem;
  color: var(--ink); max-width: 30em; line-height: 1.7;
}
.hero-meta {
  margin-top: 1.3rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem;
  font-size: 0.88rem; color: var(--ink-soft);
}
.hero-meta a { color: var(--ink-soft); }
.hero-meta a:hover { color: var(--accent); }

.hero:not(.hero--sub) .eyebrow { color: var(--ink); font-weight: 400; }
.hero:not(.hero--sub) h1 { font-weight: 400; color: var(--ink); }
.hero:not(.hero--sub) .en-name { color: var(--ink); }
.hero:not(.hero--sub) .role { color: var(--ink); font-weight: 400; }
.hero:not(.hero--sub) .hero-meta,
.hero:not(.hero--sub) .hero-meta a { color: var(--ink); font-weight: 400; }

.hero-inner--split { display: flex; align-items: flex-start; justify-content: space-between; gap: 2.5rem; }
.hero-inner--split .hero-text { flex: 1 1 auto; min-width: 0; }
.hero-photo {
  flex: none; width: 168px; height: 168px; border-radius: 14px; object-fit: cover;
  box-shadow: var(--shadow-card); border: 3px solid var(--paper);
  outline: 1px solid var(--accent-line);
}
@media (max-width: 640px) {
  .hero-inner--split { flex-direction: column-reverse; align-items: center; text-align: center; gap: 1.5rem; }
  .hero-photo { width: 128px; height: 128px; }
  .hero-meta { justify-content: center; }
}

/* ---------- hero (sub-page) ---------- */
.hero--sub { padding: 2rem 0 1rem; }
.hero--sub h1 { font-size: clamp(1.7rem, 4.4vw, 2.3rem); }
.hero--sub .profile-split { margin-top: 1.3rem; }
.hero--sub .tagline { font-size: 1.05rem; margin-top: 1rem; }
.hero--sub .hero-inner--split { align-items: center; justify-content: flex-start; gap: 1.6rem; }
.hero--sub .hero-photo { width: 187px; height: 187px; border-radius: 16px; }

.profile-split { display: flex; align-items: flex-start; gap: 2.5rem; }
.profile-split-left { flex: 0 0 187px; display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; }
.profile-split-right { flex: 1 1 auto; min-width: 0; }
@media (max-width: 640px) {
  .profile-split { flex-direction: column; align-items: center; text-align: center; gap: 1.2rem; }
  .profile-split-left { align-items: center; }
}
#concurrent { padding-left: 14.1875rem; }
@media (max-width: 640px) { #concurrent { padding-left: 0; } }

section { padding: 2rem 0; border-top: 1px solid var(--paper-line); }
section:first-of-type { border-top: none; }
#career { padding-top: 0.8rem; }
#research { padding-top: 1rem; }
.section-head { display: flex; align-items: baseline; gap: 0.9rem; margin-bottom: 1.1rem; }
.section-head h2 { font-size: 1.5rem; }
.section-head .sub { font-size: 0.82rem; color: var(--ink-faint); font-family: var(--font-mono); letter-spacing: 0.03em; }

p { margin: 0 0 0.9rem; color: var(--ink-soft); }
p:last-child { margin-bottom: 0; }

/* ---------- research cards ---------- */
.research-band {
  background: #0f1f3d; border-radius: 14px; box-shadow: var(--shadow-card);
  padding: 1.3rem;
  margin: 0 -1.5rem; width: calc(100% + 3rem);
}
.research-band .section-head { margin-bottom: 1.1rem; }
.research-band .section-head h2 { color: #ffffff; }
.research-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
@media (max-width: 640px) { .research-grid { grid-template-columns: 1fr; } }
.research-card {
  padding: 0 1.3rem; border-left: 1px solid rgba(255, 255, 255, 0.14);
}
.research-card:first-child { border-left: none; padding-left: 0; }
.research-card:last-child { padding-right: 0; }
@media (max-width: 640px) {
  .research-card { border-left: none; padding: 1.1rem 0 0; border-top: 1px solid rgba(255, 255, 255, 0.14); }
  .research-card:first-child { border-top: none; padding-top: 0; }
}
.research-photo {
  display: block; width: 100%; height: 140px; object-fit: contain;
  border-radius: 8px; margin-bottom: 0.9rem;
  -webkit-mask-image: radial-gradient(ellipse 75% 75% at center, black 55%, transparent 100%);
  mask-image: radial-gradient(ellipse 75% 75% at center, black 55%, transparent 100%);
}
.research-card h3 { font-size: 1.02rem; margin-bottom: 0.5rem; color: #ffffff; }
.research-card .en { display: block; font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent-line); letter-spacing: 0.03em; margin-bottom: 0.5rem; }
.research-card p { font-size: 0.92rem; margin: 0; color: #dbe3f0; }

.callout {
  margin-top: 1.5rem; padding: 1.2rem 1.4rem; border-left: 3px solid var(--rust);
  background: var(--rust-soft); border-radius: 0 14px 14px 0; font-size: 0.94rem;
}
.callout strong { color: var(--ink); }

/* ---------- sitemap cards (home) ---------- */
.site-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.9rem; }
@media (max-width: 640px) { .site-grid { grid-template-columns: 1fr; } }
.site-card {
  display: block; background: var(--paper-raised); border: 1px solid var(--paper-line);
  border-radius: 14px; padding: 1.1rem 1.3rem; box-shadow: var(--shadow-card);
  text-decoration: none; transition: transform 0.15s ease;
}
.site-card:hover { transform: translateY(-2px); }
.site-card .en { display: block; font-family: var(--font-mono); font-size: 0.7rem; color: var(--accent); letter-spacing: 0.03em; margin-bottom: 0.35rem; }
.site-card h3 { font-size: 1rem; color: var(--ink); margin-bottom: 0; }
.site-card p { font-size: 0.86rem; margin: 0; }

/* ---------- timeline ---------- */
.timeline { position: relative; }
.tl-row { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; position: relative; padding-bottom: 0.9rem; }
.tl-row:last-child { padding-bottom: 0; }
.tl-row::before {
  content: ""; position: absolute; left: 10rem; margin-left: -1px;
  top: 0.45rem; bottom: -0.2rem; width: 2px; background: var(--paper-line);
}
.tl-row:last-child::before { display: none; }
.tl-row::after {
  content: ""; position: absolute; left: 10rem; margin-left: -4.5px;
  top: 0.35rem; width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
}
.tl-date { font-family: var(--font-mono); font-size: 0.82rem; color: var(--ink-faint); padding-top: 0.15rem; text-align: right; white-space: nowrap; }
.tl-body { position: relative; padding-left: 1.3rem; }
.tl-body h3 { font-size: 0.98rem; margin-bottom: 0.15rem; }
.tl-body .detail { font-size: 0.88rem; color: var(--ink-soft); }

/* ---------- awards ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chip {
  display: flex; align-items: baseline; gap: 0.5rem; background: var(--paper-raised);
  border: 1px solid var(--paper-line); border-radius: 999px; padding: 0.45rem 0.95rem 0.45rem 0.75rem;
  font-size: 0.86rem;
}
.chip .yr { font-family: var(--font-mono); color: var(--accent); font-size: 0.78rem; }
.societies { margin-top: 1.6rem; font-size: 0.86rem; color: var(--ink-faint); }
.societies span { color: var(--ink-soft); }

/* ---------- tech groups / bullet lists ---------- */
.tech-columns { column-count: 2; column-gap: 2.5rem; }
@media (max-width: 640px) { .tech-columns { column-count: 1; } }
.tech-group { margin-bottom: 1.4rem; break-inside: avoid; }
#societies .tech-group { margin-bottom: 0.35rem; }
.tech-group:last-child { margin-bottom: 0; }
.tech-group h3 { font-size: 0.98rem; margin-bottom: 0.5rem; color: var(--ink); }
.bullet-list { list-style: none; padding: 0; margin: 0 0 1.1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.bullet-list:last-child { margin-bottom: 0; }
.bullet-list li { font-size: 0.9rem; color: var(--ink-soft); padding-left: 1.1rem; position: relative; }
.bullet-list li::before {
  content: ""; position: absolute; left: 0; top: 0.55em; width: 5px; height: 5px;
  border-radius: 50%; background: var(--accent-line);
}
.societies-split > ul.bullet-list li { padding-left: 0; }
.societies-split > ul.bullet-list li::before { display: none; }
.societies-split { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
@media (max-width: 640px) { .societies-split { grid-template-columns: 1fr; gap: 1.5rem; } }

/* ---------- external links ---------- */
.links-container {
  display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.6rem;
}
.external-link {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.44rem 1.2rem; background: var(--accent); color: #ffffff;
  border: 1px solid var(--accent); border-radius: 8px;
  font-size: 0.9rem; font-weight: 400; text-decoration: none;
  transition: all 0.2s ease;
}
.external-link:hover {
  background: var(--accent-line); color: #ffffff; text-decoration: none;
}

/* ---------- publications ---------- */
.pub-list { display: flex; flex-direction: column; gap: 1rem; }
.pub { font-size: 0.94rem; line-height: 1.75; }
.pub .authors { color: var(--ink); font-weight: 400; }
.pub .yr { font-family: var(--font-mono); color: var(--ink-faint); }
.pub .title { color: var(--ink-soft); }
.pub .journal { color: var(--accent); font-style: italic; }
.pub .cite { font-family: var(--font-mono); font-size: 0.82rem; color: var(--ink-faint); }
.pub-note { margin-top: 1.6rem; font-size: 0.85rem; color: var(--ink-faint); border-top: 1px dashed var(--paper-line); padding-top: 1.1rem; }
.pub-collapsed[hidden] { display: none; }
.show-all-link {
  display: inline-flex; align-items: center; margin-top: 1.2rem;
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--font-body); font-size: 0.9rem; color: var(--accent);
  text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px;
}
.show-all-link:hover { text-decoration-color: currentColor; }

.pub-full-list { display: flex; flex-direction: column; gap: 0.65rem; }
.pub-full-list .pub { display: flex; gap: 0.7rem; align-items: baseline; font-size: 0.87rem; line-height: 1.7; }
.pub-full-list .pub-num { flex: none; min-width: 2.6rem; text-align: right; color: var(--accent); font-size: 0.78rem; }
.pub-full-list .pub-body { color: var(--ink-soft); }
.pub-full-list .pub-body strong { color: var(--ink); font-weight: 700; }

/* ---------- software ---------- */
.soft-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
@media (max-width: 640px) { .soft-grid { grid-template-columns: 1fr; } }
.soft-card { background: var(--paper-raised); border: 1px solid var(--paper-line); border-radius: 14px; padding: 1.2rem; display: flex; flex-direction: column; gap: 0.55rem; box-shadow: var(--shadow-card); }
.soft-card .name { font-family: var(--font-mono); font-size: 0.95rem; font-weight: 400; }
.soft-card .beta { font-size: 0.68rem; color: var(--rust); border: 1px solid var(--rust); border-radius: 4px; padding: 0.05rem 0.4rem; margin-left: 0.4rem; letter-spacing: 0.05em; }
.soft-card p { font-size: 0.86rem; margin: 0; }
.soft-card .spec { font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink-faint); }

/* ---------- flat lists (media / lectures) ---------- */
.flat-list { display: flex; flex-direction: column; gap: 0.55rem; padding: 0; margin: 0; }
.flat-list li { list-style: none; font-size: 0.94rem; display: grid; grid-template-columns: 5.6rem 1fr; gap: 0.8rem; }
.flat-list .d { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-faint); padding-top: 0.1rem; }
.flat-list--plain li { grid-template-columns: 1fr; }
.flat-list .outlet { color: var(--ink); font-weight: 400; }
.flat-list .desc { color: var(--ink-soft); }
.flat-list .desc a { white-space: nowrap; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; gap: 2rem; } }
.two-col h3 { font-size: 0.95rem; margin-bottom: 0.9rem; color: var(--ink); }

.journal-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; font-size: 0.78rem; }
.journal-tags span { background: var(--accent); color: #ffffff; border-radius: 4px; padding: 0.15rem 0.5rem; }

/* ---------- etc / info cards ---------- */
.info-card {
  background: var(--paper-raised); border: 1px solid var(--paper-line); border-radius: 14px;
  padding: 1.3rem 1.4rem; box-shadow: var(--shadow-card); margin-bottom: 1.1rem;
}
.info-card:last-child { margin-bottom: 0; }
.info-card h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.info-card p { font-size: 0.9rem; margin: 0; }

footer { padding: 2rem 0 2.5rem; }
.contact-card {
  background: var(--paper-raised); border: 1px solid var(--paper-line); border-radius: 16px;
  padding: 1.8rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; align-items: center;
  box-shadow: var(--shadow-card);
}
.contact-card h2 { font-size: 1.2rem; margin-bottom: 0.3rem; }
.contact-card p { margin: 0; font-size: 0.88rem; }
.contact-card .email { font-family: var(--font-mono); font-size: 0.95rem; }
.foot-links { margin-top: 1.6rem; font-size: 0.82rem; color: var(--ink-faint); display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.foot-note { margin-top: 2.5rem; font-size: 0.76rem; color: var(--ink-faint); }

/* ---------- single-page merge anchors ---------- */
.page-block { scroll-margin-top: 3.2rem; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
