:root {
  --paper: #fbfbfa;
  --surface: #ffffff;
  --ink: #202225;
  --muted: #62666c;
  --line: #d9dbde;
  --accent: #1f5fae;
  --accent-soft: #edf3fa;
  --page-width: 1080px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html[data-language-pending] body {
  visibility: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 80%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Hiragino Sans", "Yu Gothic", "YuGothic", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.8;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration-color: #8fafd5;
  text-underline-offset: 0.22em;
}

a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

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

.page-width {
  width: min(calc(100% - 48px), var(--page-width));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--accent);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.site-name {
  display: flex;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
}

.site-name-roman {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  gap: 26px;
  font-size: 0.86rem;
}

.site-nav a {
  text-decoration: none;
}

.github-link,
.github-link-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.github-icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url("./assets/icons/github.svg?v=1") center / contain no-repeat;
  mask: url("./assets/icons/github.svg?v=1") center / contain no-repeat;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 34px);
}

.language-switcher {
  display: inline-flex;
  align-items: stretch;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.language-tab {
  position: relative;
  margin-bottom: -1px;
  color: var(--muted);
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
}

.language-tab span {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 7px 8px 6px;
  border-bottom: 2px solid transparent;
}

.language-option {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.language-tab:hover span {
  color: var(--accent);
}

.language-option:checked + span {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.language-option:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(64px, 10vw, 136px);
  align-items: end;
  padding-block: clamp(96px, 13vw, 152px) clamp(88px, 12vw, 136px);
}

.section-label {
  margin: 0 0 22px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
}

.identity h1 {
  margin: 0;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  font-size: clamp(3.2rem, 5.6vw, 5.7rem);
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.12;
}

html[lang="ja"] .identity h1 {
  font-size: clamp(2.4rem, 4.2vw, 4.275rem);
}

.roman-name {
  margin: 18px 0 38px;
  color: var(--muted);
  font-size: 0.98rem;
  letter-spacing: 0.1em;
}

.affiliation {
  margin: 0;
  font-size: 0.94rem;
}

.introduction {
  padding: 6px 0 7px clamp(24px, 3.5vw, 42px);
  border-left: 3px solid var(--accent);
}

.introduction p {
  max-width: 31em;
  margin: 0;
}

.introduction .introduction-main {
  margin-bottom: 22px;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  font-size: clamp(1.45rem, 1.92vw, 2rem);
  line-height: 1.65;
}

.introduction p:last-child {
  color: var(--muted);
}

.content-section {
  display: grid;
  grid-template-columns: minmax(190px, 0.35fr) minmax(0, 0.65fr);
  gap: clamp(48px, 9vw, 120px);
  padding-block: clamp(80px, 10vw, 120px);
  border-top: 1px solid var(--line);
  scroll-margin-top: 24px;
}

.activity-history {
  padding-block: clamp(80px, 10vw, 120px);
  border-top: 1px solid var(--line);
  scroll-margin-top: 24px;
}

.activity-year {
  display: grid;
  grid-template-columns: minmax(190px, 0.35fr) minmax(0, 0.65fr);
  gap: clamp(48px, 9vw, 120px);
}

.activity-year + .activity-year {
  margin-top: clamp(64px, 8vw, 96px);
  padding-top: clamp(48px, 6vw, 72px);
  border-top: 1px solid var(--line);
}

.section-title h2,
.activity-year-title {
  margin: 0;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  font-size: clamp(2rem, 3.04vw, 3rem);
  font-weight: 500;
  line-height: 1.35;
}

.section-content {
  max-width: 690px;
}

.section-content h3,
.activity-title {
  margin: 0 0 20px;
  font-size: 1.08rem;
  font-weight: 600;
}

.section-content p {
  margin: 0;
}

.research-content > p {
  font-size: 1.04rem;
}

.research-details {
  margin: 48px 0 0;
  border-top: 1px solid var(--line);
}

.research-details div {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.research-details div:last-child {
  border-bottom: 0;
}

.research-details dt {
  color: var(--muted);
  font-size: 0.82rem;
}

.research-details dd {
  margin: 0;
  font-size: 0.92rem;
}

.activity-list {
  border-top: 1px solid var(--line);
}

.activity-list article {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 32px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.activity-list article:last-child {
  border-bottom: 0;
}

.activity-list h3 {
  margin: 0;
}

.activity-list .activity-title {
  margin: 0;
}

.activity-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.35;
}

.activity-title-link {
  text-decoration-thickness: 1px;
}

.activity-brand.activity-title-link {
  text-decoration: none;
}

.activity-brand-name {
  text-decoration: underline;
  text-decoration-color: #8fafd5;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

.activity-brand:hover .activity-brand-name {
  text-decoration-color: currentColor;
}

.organization-logo {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  display: block;
  object-fit: cover;
}

.organization-logo--physikyu {
  background: #98003f;
}

.activity-list p {
  color: var(--muted);
}

.activity-detail {
  min-width: 0;
}

.riken-program {
  margin-top: 16px;
}

.activity-list .riken-program-title {
  color: var(--ink);
}

.activity-list .presentation-title {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.7;
}

.presentation-contribution {
  margin-top: 20px;
}

.activity-list .presentation-event {
  margin-top: 14px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.7;
}

.presentation-event + .presentation-title {
  margin-top: 6px;
}

.activity-detail .presentation-authors,
.activity-detail .presentation-meta {
  margin-top: 10px;
  font-size: 0.84rem;
}

.activity-list .seminar-heading {
  margin-top: 20px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
}

.seminar-list {
  margin: 8px 0 0;
}

.seminar-list > div {
  display: block;
}

.seminar-list > div + div {
  margin-top: 16px;
}

.seminar-list dt {
  font-size: 0.88rem;
  font-weight: 600;
}

.seminar-list dt::before {
  content: "・";
}

.seminar-list dd {
  margin: 4px 0 0 1em;
  color: var(--muted);
  font-size: 0.84rem;
}

.seminar-textbook {
  display: block;
  margin-top: 2px;
}

.seminar-textbook a {
  color: var(--accent);
}

.fund-note {
  margin-top: 24px;
  padding: 16px 18px;
  background: var(--accent-soft);
}

.activity-list .fund-note-title {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
}

.fund-note p + p {
  margin-top: 6px;
  font-size: 0.84rem;
}

.fund-note a {
  display: inline-flex;
  gap: 6px;
  margin-top: 10px;
  color: var(--accent);
  font-size: 0.84rem;
}

.future-section {
  position: relative;
}

.future-section::before {
  position: absolute;
  inset: 40px -28px;
  z-index: -1;
  content: "";
  background: var(--accent-soft);
}

.future-content {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  font-size: clamp(1.12rem, 1.6vw, 1.32rem);
  line-height: 2;
}

.future-content p + p {
  margin-top: 24px;
}

.site-footer {
  padding-block: 48px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
}

.portfolio-page .content-section,
.portfolio-page .activity-history,
.portfolio-page .activity-year + .activity-year,
.portfolio-page .site-footer {
  border-top: 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 40px;
}

.footer-inner p {
  margin: 0;
}

.footer-inner a {
  color: var(--accent);
}

.footer-meta {
  text-align: right;
}

.footer-meta p {
  margin-top: 6px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .page-width {
    width: min(calc(100% - 36px), var(--page-width));
  }

  .header-inner {
    min-height: auto;
    padding-block: 20px;
    align-items: flex-start;
  }

  .site-name {
    display: block;
    line-height: 1.3;
  }

  .site-name span {
    display: block;
  }

  .site-name span + span {
    margin-top: 4px;
  }

  .site-nav {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 7px 20px;
    justify-content: end;
    font-size: 0.78rem;
  }

  .header-actions {
    display: grid;
    gap: 8px;
    justify-items: end;
  }

  .language-tab span {
    min-height: 40px;
    padding-inline: 7px;
  }

  .hero,
  .content-section,
  .activity-year {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 60px;
    padding-block: 80px 88px;
  }

  .identity h1 {
    font-size: clamp(3rem, 12vw, 4.6rem);
  }

  html[lang="ja"] .identity h1 {
    font-size: clamp(2.25rem, 9vw, 3.45rem);
  }

  .introduction {
    padding-left: 22px;
  }

  .content-section {
    gap: 46px;
    padding-block: 76px;
  }

  .activity-history {
    padding-block: 76px;
  }

  .activity-year {
    gap: 46px;
  }

  .activity-year + .activity-year {
    margin-top: 64px;
    padding-top: 64px;
  }

  .section-label {
    margin-bottom: 12px;
  }

  .activity-list article {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .future-section::before {
    inset: 24px -18px;
  }

  .footer-inner {
    display: block;
  }

  .footer-meta {
    margin-top: 28px;
    text-align: left;
    overflow-wrap: anywhere;
  }
}

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

@media print {
  :root {
    --paper: #ffffff;
  }

  .site-header,
  .skip-link {
    display: none;
  }

  .hero,
  .content-section,
  .activity-history {
    padding-block: 48px;
  }

  .future-section::before {
    display: none;
  }
}
