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

:root {
  --color-bg: #f8f9fa;
  --color-surface: #ffffff;
  --color-primary: #1a365d;
  --color-primary-light: #2b6cb0;
  --color-accent: #3182ce;
  --color-text: #2d3748;
  --color-text-light: #718096;
  --color-border: #e2e8f0;
  --color-tag-bg: #ebf4ff;
  --color-tag-text: #2b6cb0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --radius: 8px;
  --font-ja: "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-en: "Inter", var(--font-ja);
  --progress-inset-left: 14px;
  --progress-size: 14px;
  --progress-reserved: calc(var(--progress-inset-left) + var(--progress-size));
  --progress-gap: 16px;
  /* Breakpoint md: 768px — keep in sync with script.js MOBILE_BREAKPOINT */
}

/* ====== Utilities ====== */

.list-plain {
  list-style: none;
  margin: 0;
  padding: 0;
}

.btn-icon {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.btn-icon:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

.pill {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
}

.pill--tag {
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
}

.pill--hero {
  font-family: var(--font-en);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: background 0.25s, border-color 0.25s, width 0.2s, padding 0.2s;
}

.pill--hero:hover,
.pill--hero:focus-visible {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
}

.link-accent,
.about-text a {
  color: var(--color-accent);
  text-decoration: none;
}

.link-accent:hover,
.about-text a:hover {
  text-decoration: underline;
}

.link-muted {
  font-family: var(--font-en);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-light);
}

.link-muted a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.link-muted a:hover {
  color: var(--color-accent);
}

.link-on-dark {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

.link-on-dark:hover,
.link-on-dark:focus-visible {
  color: #fff;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-ja);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ====== Hero ====== */

.hero {
  position: relative;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff;
  padding: 72px 0 56px;
}

.hero .container {
  position: relative;
}

/* ====== Hamburger ====== */

.hamburger {
  position: absolute;
  top: 4px;
  right: 24px;
  z-index: 10;
}

.hamburger__toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  line-height: 0;
}

.hamburger__bar {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.hamburger__close[hidden] {
  display: none;
}

.hamburger__close:not([hidden]) {
  position: fixed;
  z-index: 202;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
}

.hamburger.is-open .hamburger__toggle {
  visibility: hidden;
}

.hamburger__menu[hidden] {
  display: none;
}

.hamburger__menu:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 20px 24px;
  background: rgba(26, 54, 93, 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  overflow-y: auto;
}

.hamburger__panel {
  width: 100%;
  max-width: 420px;
}

.hamburger__section + .hamburger__section {
  margin-top: 24px;
}

.hamburger__heading {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff;
}

.hamburger__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}

.hamburger__list a {
  display: block;
  padding: 8px 10px;
  font-size: clamp(0.68rem, 2.6vw, 0.78rem);
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
}

.hamburger__list a:visited {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
}

.hamburger__list a:hover,
.hamburger__list a:focus-visible,
.hamburger__list a.is-selected,
.hamburger__list a:visited:hover,
.hamburger__list a:visited:focus-visible,
.hamburger__list a:visited.is-selected {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.hero-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 40px;
}

.hero-content {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  text-align: left;
}

.hero-photo-wrap {
  grid-column: 1;
  grid-row: 1;
  width: auto;
  height: 0;
  min-height: 100%;
  aspect-ratio: 3 / 4;
  position: relative;
}

.hero-photo {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  object-position: top center;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.35),
    0 4px 24px rgba(0, 0, 0, 0.2);
}

.hero-links {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.hero-id .hero-name-en {
  margin-bottom: 0;
}

.hero-affiliation .hero-job-ja:first-child {
  margin-top: 16px;
}

.hero-name {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.15;
  margin-bottom: 4px;
}

.hero-name-en {
  font-family: var(--font-en);
  font-size: 1.1rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 16px;
}

.hero-job-ja {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.7;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.hero-job-en {
  font-family: var(--font-en);
  font-size: 0.9rem;
  font-weight: 400;
  opacity: 0.85;
  line-height: 1.6;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.hero-link {
  display: inline-block;
}

.hero-link:hover,
.hero-link:focus-visible {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
}

/* ====== Progress ====== */

.progress {
  position: fixed;
  left: var(--progress-inset-left);
  top: 0;
  height: 100vh;
  width: var(--progress-size);
  z-index: 100;
  pointer-events: none;
}

.progress__list {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  height: 100%;
  padding: 12px 0;
}

.progress__link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  text-decoration: none;
  pointer-events: auto;
}

.progress__dot {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
  transition: opacity 0.2s, background 0.2s, transform 0.2s;
}

.progress__link:hover .progress__dot,
.progress__link:focus-visible .progress__dot {
  opacity: 0.6;
}

.progress__link.is-visible .progress__dot {
  background: var(--color-accent);
  opacity: 1;
  transform: scale(1.2);
}

@media (prefers-reduced-motion: reduce) {
  .progress__dot {
    transition: none;
  }
}

/* ====== Section ====== */

.section {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--color-border);
}

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

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 28px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--color-accent);
  display: inline-block;
}

/* ====== About ====== */

.about-text p {
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.about-text p:last-child {
  margin-bottom: 0;
}

/* ====== Two-col ====== */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

/* ====== Tags ====== */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ====== Cards ====== */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
}

a.card {
  transition: transform 0.25s;
}

a.card:hover {
  transform: translateY(-2px);
}

.card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--color-border);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s, border-color 0.25s;
}

.card:is(:hover, :focus-visible) .card__media {
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}

.card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius);
}

.card-grid--og .card__media {
  aspect-ratio: 1200 / 630;
}

.card-grid--product .card,
.card-grid--product .card__media,
.card-grid--product .card__media img,
.card-grid--product .card__overlay {
  border-radius: 4px;
}

.card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: linear-gradient(to top, rgba(15, 23, 42, 0.88) 0%, rgba(15, 23, 42, 0.45) 55%, transparent 100%);
  opacity: 0;
  transition: opacity 0.25s;
}

.card:is(:hover, :focus-visible) .card__overlay {
  opacity: 1;
}

.card__overlay h4 {
  font-family: var(--font-en);
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
  line-height: 1.4;
}

.card__overlay p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.88);
  margin: 0;
  line-height: 1.45;
}

/* ====== Rows ====== */

.presentation-list {
  padding: 0;
}

.presentation-list li {
  display: flex;
  gap: 24px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.presentation-list li:last-child {
  border-bottom: none;
}

.pres-year {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-accent);
  flex-shrink: 0;
  min-width: 36px;
}

.section--wide-year .pres-year {
  width: 9.5em;
  min-width: 9.5em;
}

.pres-title {
  font-size: 0.82rem;
  font-weight: 600;
}

.presentation-list > li > div > .pres-title {
  display: block;
  margin-bottom: 2px;
}

.presentation-list .presentation-link {
  display: block;
  margin-bottom: 2px;
  text-decoration: none;
  color: inherit;
}

.presentation-list .presentation-link:hover .pres-title {
  color: var(--color-accent);
}

.presentation-list .presentation-link .pres-title {
  display: inline;
  margin-bottom: 0;
}

.pres-authors,
.pres-venue {
  font-size: 0.82rem;
  color: var(--color-text-light);
  display: block;
}

.pres-authors {
  margin-bottom: 2px;
}

.presentation-list .pres-authors strong,
.presentation-list .pres-venue strong {
  display: inline;
  font-weight: 700;
}

.more-articles {
  margin-top: 0;
  margin-bottom: 28px;
}

/* ====== Footer ====== */

.footer {
  background: var(--color-primary);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 32px 0;
  margin-top: 40px;
}

.footer p {
  font-size: 0.82rem;
  margin-bottom: 12px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.footer-links .link-on-dark {
  font-family: var(--font-en);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
}

.footer-links .link-on-dark:hover,
.footer-links .link-on-dark:focus-visible {
  color: #fff;
}

/* ====== Responsive ====== */

/* プログレス表示時、コンテナ左余白がレール領域より狭い幅だけ main を寄せる */
@media (min-width: 769px) and (max-width: 932px) {
  main.container {
    padding-left: max(24px, calc(var(--progress-reserved) + var(--progress-gap)));
  }
}

@media (max-width: 768px) {
  .progress {
    display: none;
  }

  .hero {
    padding: 48px 0 40px;
  }

  .hero-inner {
    grid-template-columns: auto 1fr;
    column-gap: 20px;
    row-gap: 16px;
  }

  .hero-content {
    display: contents;
  }

  .hero-photo-wrap {
    grid-column: 1;
    grid-row: 1;
    width: 112px;
    height: auto;
    min-height: 0;
  }

  .hero-profile {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .hero-links {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    margin-top: 0;
    justify-content: center;
  }

  .hero-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    overflow: hidden;
    white-space: nowrap;
  }

  .hero-link__rest {
    display: none;
  }

  .hero-link.is-expanded {
    width: auto;
    padding: 5px 14px;
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
  }

  .hero-link.is-expanded .hero-link__rest {
    display: inline;
  }

  .hero-name {
    font-size: 2rem;
  }

  .hero-job-ja,
  .hero-job-en {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: keep-all;
    max-width: 100%;
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .two-col > .column + .column {
    margin-top: 28px;
    padding-top: 40px;
    border-top: 1px solid var(--color-border);
  }

  .card-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .section {
    padding: 40px 0 28px;
  }
}

@media (max-width: 480px) {
  .hero-inner {
    gap: 16px;
  }

  .hero-photo-wrap {
    width: 96px;
    height: auto;
    min-height: 0;
  }

  .hero-name {
    font-size: 1.7rem;
    letter-spacing: 0.04em;
  }

  .hero-name-en {
    font-size: 0.95rem;
  }

  .hero-job-ja {
    font-size: 0.9rem;
  }

  .hero-job-en {
    font-size: 0.82rem;
  }

  .presentation-list li {
    flex-direction: column;
    gap: 4px;
  }
}
