/* Seita Yamamoto - personal site
   Shared by the English page (.theme-en) and the Japanese page (.theme-ja).
   No web fonts or other external files: everything loads from this site,
   so the pages also open quickly from mainland China. */

:root {
  --ink: #1b2430;
  --ink-soft: #394653;
  --muted: #52606d;
  --line: #d9e0e4;
  --panel: #edf3f6;
  --bg: #ffffff;
  --accent: #235688;
  --on-accent: #ffffff;
  --measure: 73rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --display-font: Georgia, "Times New Roman", serif;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
}

.theme-ja {
  --accent: #962f32;
  --panel: #f7efee;
  --display-font: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif CJK JP", "MS PMincho", serif;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic",
    Meiryo, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.theme-ja {
  line-height: 1.85;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

p,
h1,
h2,
h3 {
  margin: 0;
}

h1,
h2,
h3 {
  line-height: 1.35;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.skip-link {
  position: absolute;
  top: 0;
  left: -9999px;
}

.skip-link:focus {
  top: 1rem;
  left: 1rem;
  z-index: 10;
  padding: 0.5rem 0.9rem;
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

/* ---------------------------------------------------------------- header */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: var(--measure);
  margin-inline: auto;
  padding: 0.85rem var(--gutter);
}

.disciplines {
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
}

.lang-switch {
  display: flex;
  flex-shrink: 0;
  gap: 0.25rem;
  font-size: 0.8125rem;
}

.lang-switch a,
.lang-switch span {
  display: grid;
  place-items: center;
  min-height: 36px;
  padding-inline: 0.55rem;
  border-radius: 4px;
  color: var(--accent);
}

.lang-switch a:hover {
  background: var(--panel);
}

.lang-switch [aria-current] {
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
}

/* ---------------------------------------------------------------- page */

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ---------------------------------------------------------------- hero */

.hero {
  display: grid;
  gap: 2rem;
  padding: 0.65rem 0 2.75rem;
}

.hero-media {
  position: relative;
  min-width: 0;
  margin-bottom: 0.5rem;
  isolation: isolate;
}

.cover-img {
  width: 100%;
  height: clamp(9rem, 43vw, 17rem);
  object-fit: cover;
  background: var(--panel);
  border-radius: 2px;
}

.hero-photo {
  position: absolute;
  right: clamp(0.65rem, 2vw, 1.15rem);
  bottom: -0.8rem;
  width: 6rem;
  height: 6rem;
  object-fit: cover;
  border: 4px solid var(--bg);
  border-radius: 50%;
  background: var(--panel);
}

.hero-body {
  min-width: 0;
}

h1 {
  font-family: var(--display-font);
  font-size: clamp(2.55rem, 5.2vw, 4.65rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.047em;
  text-wrap: balance;
}

.theme-ja h1 {
  letter-spacing: 0.045em;
}

.name-alt {
  display: block;
  margin-top: 0.55rem;
  color: var(--muted);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.tagline {
  margin-top: 1.15rem;
  font-size: 1.05rem;
  font-weight: 650;
}

.position {
  margin-top: 0.1rem;
  color: var(--ink-soft);
}

.intro {
  max-width: 48ch;
  margin-top: 1rem;
}

.theme-ja .intro {
  max-width: 32em;
}

.research-link {
  margin-top: 1.35rem;
}

.research-link a {
  display: inline-block;
  min-height: 44px;
  padding: 0.55rem 1.05rem;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 650;
  text-decoration: none;
}

.research-link a:hover {
  background: var(--panel);
  color: var(--accent);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 34px;
  padding: 0.3rem 0.75rem 0.3rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.2;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.links .icon {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

@media (min-width: 780px) {
  .hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
    padding: 1.25rem 0 3.5rem;
  }

  .hero-media {
    grid-column: 2;
    grid-row: 1;
  }

  .hero-body {
    grid-column: 1;
    grid-row: 1;
  }

  .cover-img {
    height: auto;
    aspect-ratio: 1.18;
  }

  .hero-photo {
    width: clamp(7rem, 11.7vw, 9.5rem);
    height: auto;
    aspect-ratio: 1;
    border-width: 5px;
  }
}

/* ---------------------------------------------------------------- sections */

.section {
  border-top: 1px solid var(--line);
  padding-block: clamp(1.75rem, 4vw, 3rem);
  scroll-margin-top: 1rem;
}

.section h2 {
  margin-bottom: 1.15rem;
  font-family: var(--display-font);
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.theme-ja .section h2 {
  font-size: clamp(1.45rem, 2.2vw, 1.75rem);
  letter-spacing: 0.02em;
}

.section-body {
  min-width: 0;
  max-width: 76ch;
}

@media (min-width: 780px) {
  .section {
    display: grid;
    grid-template-columns: minmax(10rem, 0.32fr) minmax(0, 1fr);
    gap: clamp(1.65rem, 4vw, 3.25rem);
    align-items: start;
  }

  .section h2 {
    margin-bottom: 0;
  }

  #questions .section-body {
    max-width: none;
  }
}

.label, .group-label {
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 700;
}

.group-label {
  margin: 0 0 0.75rem;
}

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

/* Research questions */

.questions {
  display: grid;
  gap: 1.25rem;
}

.question {
  padding: 1rem 1.15rem 1.2rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 7px 7px 0;
  background: var(--panel);
}

.question .label {
  margin-bottom: 0.4rem;
}

.question h3 {
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1.55;
}

.questions-link {
  margin-top: 1rem;
}

@media (min-width: 780px) {
  .questions {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }
}

/* Research in progress */

.projects {
  display: grid;
  gap: 1.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
}

.project .num {
  padding-top: 0.1rem;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.project h3 {
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.5;
}

.project .subtitle {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.project .summary {
  margin-top: 0.4rem;
  color: var(--ink-soft);
}

/* Publications and presentations */

.entries {
  display: grid;
  gap: 1.1rem;
  margin: 0 0 1.75rem;
  padding: 0;
  list-style: none;
}

.entries:last-child {
  margin-bottom: 0;
}

.entries li {
  padding-left: 1rem;
  border-left: 2px solid var(--line);
}

.presentation-title {
  font-size: 1.075rem;
  font-weight: 680;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.presentation-details {
  margin-top: 0.3rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.original-label {
  margin-inline-end: 0.35rem;
  font-weight: 650;
}

.cite a {
  overflow-wrap: anywhere;
}

.cite .self {
  font-weight: 700;
}

.cite-trans {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.875rem;
}

/* Education, grants and awards */

.timeline {
  display: grid;
  gap: 1rem;
  margin: 0 0 1.75rem;
  padding: 0;
  list-style: none;
}

.timeline:last-child {
  margin-bottom: 0;
}

.timeline li {
  display: grid;
  gap: 0.1rem;
}

.timeline strong {
  font-weight: 650;
}

/* Keep short Japanese phrases such as "訪問学生" on one line. */
.theme-ja .timeline .rest {
  display: inline-block;
}

.timeline .when {
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 720px) {
  .timeline li {
    grid-template-columns: 9rem 1fr;
    column-gap: 1.25rem;
    align-items: baseline;
  }

  .timeline .when {
    order: -1;
  }
}

/* Languages */

.langs {
  display: grid;
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.langs strong {
  font-weight: 650;
}

/* Contact */

.contact {
  padding: 1.3rem 1.4rem;
  border-radius: 7px;
  background: var(--panel);
}

.contact .mail {
  margin-top: 0.7rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- footer */

.footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0.5rem var(--gutter) 2.5rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

/* ---------------------------------------------------------------- 404 */

.not-found {
  display: grid;
  gap: 2.5rem;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.not-found h1 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
