/* 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: #1d2125;
  --ink-soft: #3f464d;
  --muted: #646b72;
  --line: #e4e6e8;
  --panel: #f5f5f3;
  --bg: #ffffff;
  --accent: #2f6db5;
  --on-accent: #ffffff;
  --measure: 46rem;
  --radius: 14px;
  --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: #b8403a;
  --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);
}

/* ---------------------------------------------------------------- cover */

.cover {
  position: relative;
  height: clamp(150px, 27vw, 280px);
  overflow: hidden;
  background: #d9dbdd;
}

.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lang-switch {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 2px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  font-size: 0.8125rem;
  line-height: 1;
}

.lang-switch a,
.lang-switch span {
  display: block;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
}

.lang-switch a:hover {
  background: rgba(0, 0, 0, 0.06);
}

.lang-switch [aria-current] {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

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

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

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

.hero {
  display: grid;
  grid-template-columns: 96px 1fr;
  grid-template-areas:
    "kicker kicker"
    "photo head"
    "body body";
  column-gap: 1rem;
  row-gap: 1rem;
  align-items: center;
  padding: 1.6rem 0 2.25rem;
  border-bottom: 1px solid var(--line);
}

.hero-photo {
  grid-area: photo;
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.hero-head {
  grid-area: head;
  min-width: 0;
}

.hero-body {
  grid-area: body;
}

.kicker {
  grid-area: kicker;
  margin-bottom: -0.25rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.theme-ja .kicker {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

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

.name-alt {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

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

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

.intro {
  margin-top: 0.9rem;
}

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

.links a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 36px;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.875rem;
  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 .ext {
  color: var(--muted);
  font-size: 0.8em;
}

.links a:hover .ext {
  color: inherit;
}

@media (min-width: 720px) {
  .hero {
    grid-template-columns: 220px 1fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "photo kicker"
      "photo head"
      "photo body";
    column-gap: 2.25rem;
    row-gap: 0.9rem;
    align-items: start;
    padding: 2.75rem 0 3rem;
  }

  .hero-photo {
    width: 220px;
    height: 220px;
    border-radius: 16px;
  }

  .kicker {
    margin-bottom: -0.6rem;
  }

  h1 {
    font-size: 2.25rem;
  }
}

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

.section {
  padding-top: 2.75rem;
}

.section h2 {
  margin-bottom: 1.25rem;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.theme-ja .section h2 {
  letter-spacing: 0.02em;
}

.label,
.group-label {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

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

.theme-ja .label,
.theme-ja .group-label {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

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

/* Research questions */

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

.question {
  padding: 1.25rem 1.3rem 1.4rem;
  border-radius: var(--radius);
  background: var(--panel);
}

.question .label {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}

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

@media (min-width: 720px) {
  .questions {
    grid-template-columns: 1fr 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);
}

.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: var(--radius);
  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: 2.75rem 1.25rem 3rem;
  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;
  }
}
