@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&family=Oswald:wght@400;500;600&display=swap');

:root {
  --red: #d8443f;
  --red-dark: #c92f2b;
  --text: #252525;
  --muted: #666;
  --line: #ef5b58;
  --link: #377de8;
  --page-max: 1510px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: #fff;
}

body {
  color: var(--text);
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--link); }

/* ===== Base layout ===== */

.page-shell {
  width: min(100%, var(--page-max));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  padding: 42px 34px 40px 42px;
}

.brand-box {
  display: inline-block;
  border: 2px solid #333;
  padding: 0 5px;
  font-family: "Open Sans", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.15;
}

.site-title {
  margin-top: 52px;
  font-family: "Oswald", "Arial Narrow", Arial, sans-serif;
  font-size: 21px;
  line-height: 1.35;
  font-weight: 400;
}

.side-nav {
  margin-top: 72px;
  display: flex;
  flex-direction: column;
  gap: 19px;
  align-items: flex-start;
}

.side-nav a {
  color: #222;
  text-decoration: none;
  padding: 1px 5px;
  font-size: 16px;
}

.side-nav a.active {
  color: #fff;
  background: #171717;
  font-weight: 700;
}

.main {
  min-width: 0;
  padding: 10px 0 0;
}

/* ===== Home ===== */

.hero {
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  padding: 38px 0 35px 8px;
  margin-right: 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 195px;
  gap: 70px;
}

.hero h1,
.hero .degree,
.news h2 {
  font-family: "Oswald", "Arial Narrow", Arial, sans-serif;
}

.hero h1 {
  margin: 0;
  color: #cf0d0d;
  font-size: 54px;
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: .2px;
}

.hero .degree {
  margin-top: 10px;
  color: #cf0d0d;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 500;
}

.affiliation {
  margin-top: 25px;
  font-size: 17px;
}

.affiliation ul {
  margin: 9px 0 0 20px;
  padding: 0;
  list-style-type: square;
}

.affiliation li {
  padding-left: 4px;
  margin: 4px 0;
  color: #444;
}

.mail {
  margin: 17px 0 0;
  color: #555;
  font-size: 16px;
}

.external-links {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
  font-size: 16px;
}

.hero-side {
  width: 195px;
}

.jp-button {
  display: block;
  width: 100%;
  padding: 9px 12px;
  background: var(--red);
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-family: "Open Sans", Arial, sans-serif;
  font-weight: 700;
  border-radius: 2px;
}

.hero .jp-button {
  width: 195px;
  font-size: 16px;
}

.profile-image {
  display: block;
  width: 195px;
  margin-top: 26px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.news {
  padding: 42px 80px 32px 10px;
}

.news h2 {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: .2px;
}

.news h2 span { font-size: .95em; }

.news-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.news-row {
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr);
  column-gap: 18px;
  align-items: start;
  padding-left: 17px;
  position: relative;
}

.news-row::before {
  content: "▪";
  position: absolute;
  left: 0;
  top: 0;
  color: #222;
}

.news-row time {
  color: #e00000;
  font-weight: 700;
  white-space: nowrap;
}

.news-row p {
  margin: 0;
  font-weight: 600;
}

.news-row p a:first-of-type { color: #e00000; }

.read-more {
  display: inline-block;
  margin: 18px 0 0 17px;
  color: #222;
  font-weight: 700;
}

/* ===== Internal pages ===== */

.subpage {
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  margin-right: 78px;
  padding: 40px 0 58px 8px;
  min-height: 620px;
}

.subpage-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 48px;
  margin-bottom: 62px;
}

.subpage h1 {
  margin: 0;
  color: #222;
  font-family: "Oswald", "Arial Narrow", Arial, sans-serif;
  font-size: 54px;
  line-height: 1.05;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .2px;
}

.sub-jp {
  flex: 0 0 195px;
  width: 195px;
  margin-top: 4px;
}

.page-content {
  max-width: 1040px;
  font-size: 17px;
  line-height: 1.55;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.timeline-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.timeline-row .date {
  font-weight: 400;
  white-space: nowrap;
}

.timeline-row .detail {
  display: block;
  margin-top: 18px;
  color: var(--text);
}

.research-block { margin-bottom: 34px; }

.research-block h2,
.pub-section h2,
.archive-title {
  margin: 0 0 10px;
  color: #222;
  font-family: "Oswald", "Arial Narrow", Arial, sans-serif;
  font-size: 27px;
  font-weight: 500;
}

.research-block ul { margin-top: 8px; }

.pub-section { margin-bottom: 42px; }

.pub-section h3 {
  margin: 18px 0 7px;
  font-family: "Oswald", "Arial Narrow", Arial, sans-serif;
  font-size: 21px;
  font-weight: 500;
}

.pub-list {
  margin: 0;
  padding-left: 24px;
}

.pub-list li {
  margin-bottom: 14px;
  line-height: 1.6;
}

.publications-content,
.news-archive,
.wide-page .page-content {
  max-width: 1040px;
}

.link-list { padding-left: 22px; }

.link-list li { margin: 11px 0; }

.archive-title span { font-size: .9em; }

.archive-row { margin-bottom: 9px; }

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

.footer-panel,
.compact-footer {
  display: none !important;
}

footer.site-footer {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 82px;
  margin: 42px 0 0 -120px !important;
  padding: 18px 40px !important;
  background: var(--red) !important;
  color: #fff !important;
  border: 0 !important;
  text-align: center;
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 400;
}

footer.site-footer::before,
footer.site-footer::after {
  content: none !important;
}

/* ===== Japanese pages ===== */

.jp-page {
  font-family: "Open Sans", "Yu Gothic", "YuGothic",
               "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
}

.jp-page .hero h1,
.jp-page .hero .degree {
  font-family: "Open Sans", "Yu Gothic", "YuGothic",
               "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  font-weight: 700;
}

.jp-page .hero h1 { letter-spacing: .03em; }

.jp-page .jp-intro {
  max-width: 760px;
  margin: 22px 0 0;
  line-height: 1.8;
}

.jp-page .research-block h2 {
  font-family: "Open Sans", "Yu Gothic", "YuGothic",
               "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  font-size: 23px;
  font-weight: 700;
}

.jp-page .timeline-row { line-height: 1.7; }

.jp-page .pub-section > h2,
.jp-page .pub-section > h3 {
  font-family: "Open Sans", "Yu Gothic", "YuGothic",
               "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  font-weight: 700;
}

/* ===== Responsive: tablet / smartphone ===== */

@media (max-width: 768px) {
  body { font-size: 15px; }

  .page-shell {
    display: block;
    width: 100%;
  }

  .sidebar {
    padding: 24px 20px 14px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 22px;
    row-gap: 20px;
    align-items: center;
  }

  .brand-box { font-size: 16px; }

  .site-title {
    margin: 0;
    font-size: 19px;
    line-height: 1.35;
  }

  .side-nav {
    grid-column: 1 / -1;
    margin-top: 0;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px 18px;
    align-items: center;
  }

  .side-nav a {
    font-size: 16px;
    padding: 2px 4px;
  }

  .main { padding: 0 20px; }

  /* Home: single column, with language button/image after name and degree */
  .hero {
    margin-right: 0;
    padding: 32px 0 34px;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .hero-text { display: contents; }

  .hero h1 {
    order: 1;
    font-size: 42px;
    line-height: 1.02;
    overflow-wrap: normal;
    word-break: normal;
  }

  .hero .degree {
    order: 2;
    margin-top: 10px;
    font-size: 26px;
    line-height: 1.15;
  }

  .hero-side {
    order: 3;
    width: 100%;
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero .jp-button {
    width: 100%;
    max-width: 360px;
    padding: 11px 14px;
    font-size: 16px;
  }

  .profile-image {
    width: 220px;
    max-width: 70vw;
    margin-top: 22px;
  }

  .affiliation {
    order: 4;
    width: 100%;
    margin-top: 30px;
    font-size: 16px;
  }

  .affiliation ul {
    margin: 12px 0 0 22px;
    padding: 0;
  }

  .affiliation li {
    padding-left: 3px;
    margin: 8px 0;
    line-height: 1.6;
  }

  .jp-intro {
    order: 5;
    width: 100%;
  }

  .mail {
    order: 6;
    width: 100%;
    margin-top: 22px;
    font-size: 15px;
    overflow-wrap: anywhere;
  }

  .external-links {
    order: 7;
    width: 100%;
    margin-top: 18px;
    gap: 10px;
    font-size: 15px;
  }

  .external-links a { overflow-wrap: anywhere; }

  .news { padding: 32px 0 28px; }

  .news h2 {
    font-size: 22px;
    line-height: 1.3;
  }

  .news h2 span {
    display: block;
    margin-top: 2px;
    font-size: .78em;
  }

  .news-row {
    display: block;
    padding-left: 15px;
    margin-bottom: 12px;
  }

  .news-row time {
    display: block;
    margin-bottom: 3px;
  }

  .news-row p { line-height: 1.55; }

  .read-more { margin: 14px 0 0 15px; }

  /* Internal pages */
  .subpage {
    margin-right: 0;
    padding: 30px 0 42px;
    min-height: 0;
  }

  .subpage-head {
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin-bottom: 34px;
  }

  .subpage h1 {
    font-size: 40px;
    line-height: 1.08;
  }

  .sub-jp {
    flex: none;
    width: 100%;
    max-width: 360px;
    margin-top: 0;
  }

  .page-content { font-size: 15px; }

  .timeline-row {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 10px;
  }

  .timeline-row .detail { margin-top: 8px; }

  .pub-list { padding-left: 20px; }

  .pub-list li { overflow-wrap: anywhere; }

  .link-list { padding-left: 20px; }

  footer.site-footer {
    min-height: 72px;
    margin: 34px -20px 0 !important;
    padding: 16px 20px !important;
  }
}

@media (max-width: 420px) {
  .sidebar { column-gap: 18px; }

  .site-title { font-size: 18px; }

  .side-nav { gap: 9px 14px; }

  .hero h1 { font-size: 38px; }

  .hero .degree { font-size: 24px; }

  .profile-image { width: 210px; }

  .affiliation { font-size: 15px; }

  .subpage h1 { font-size: 36px; }

  .timeline-row { display: block; }

  .timeline-row .date { margin-bottom: 3px; }
}
