:root {
  --text: #111;
  --muted: #666;
  --faint: #999;
  --link: #0047ab;
  --link-hover: #0066ff;
  --rule: #e5e5e5;
}

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

html {
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans", "Yu Gothic", sans-serif;
  font-weight: 400;
  color: var(--text);
  background: #fff;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  max-width: 680px;
  margin: 0 auto;
  padding: 4rem 1.5rem 4rem;
}

/* Language toggle: default visible = en. Switch hides .en, shows .ja */
.ja { display: none; }
html.lang-ja .en { display: none; }
html.lang-ja .ja { display: revert; }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 3rem;
}

.name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.lang-switch button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
  letter-spacing: 0.02em;
}

.lang-switch button.active {
  color: var(--text);
  font-weight: 600;
}

.lang-switch button:hover:not(.active) {
  color: var(--text);
}

header {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-bottom: 3rem;
}

.avatar {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.header-text {
  min-width: 0;
}

h1 {
  font-family: Georgia, "Times New Roman", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 1.85rem;
  font-weight: 400;
  letter-spacing: -0.005em;
  margin-bottom: 0.25rem;
}

.name-ja {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.affiliation {
  font-size: 0.95rem;
  color: var(--text);
}

.social {
  display: flex;
  gap: 0.75rem;
}

.social a {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  border-bottom: none;
}

.social a:hover {
  color: var(--text);
  border-bottom: none;
}

section {
  margin-bottom: 3rem;
}

h2 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.25rem;
}

h3.subhead {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

p {
  font-size: 0.95rem;
}

section p.en + p.en,
section p.ja + p.ja {
  margin-top: 0.85rem;
}

ul, ol {
  list-style: none;
}

section ul li,
section ol li {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.entries li {
  padding-left: 0;
  margin-bottom: 1.25rem;
}

.entries .title {
  font-weight: 500;
}

.entries em {
  font-style: italic;
  color: var(--muted);
}

.muted {
  color: var(--faint);
  font-size: 0.85rem;
}

:target {
  scroll-margin-top: 2rem;
}

.awards li {
  display: flex;
  gap: 1rem;
  align-items: baseline;
}

.awards .year {
  flex-shrink: 0;
  width: 3rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
}

.awards.earlier li {
  color: var(--faint);
  font-size: 0.875rem;
}

.awards.earlier .year {
  color: var(--faint);
  font-size: 0.8rem;
}

.contact {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 1.5rem;
  row-gap: 0.5rem;
}

.contact li {
  display: contents;
  font-size: 0.95rem;
}

.contact .label {
  color: var(--muted);
  font-size: 0.875rem;
}

.contact a,
.contact li > span:not(.label) {
  justify-self: start;
}

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

.links li {
  margin-bottom: 0;
}

footer {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8rem;
  color: var(--faint);
}

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

a:hover {
  color: var(--link-hover);
  border-bottom-color: currentColor;
}

@media (max-width: 540px) {
  main {
    padding: 2.5rem 1.25rem 3rem;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .avatar {
    width: 96px;
    height: 96px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .awards li {
    flex-direction: column;
    gap: 0.1rem;
  }

  .awards .year {
    width: auto;
  }

  .contact {
    grid-template-columns: 1fr;
    row-gap: 0.25rem;
  }
}
