:root {
  --navy: #333f7f;
  --navy-dark: #26325f;
  --light-blue: #e9edf8;
  --accent-red: #ff4a3d;
  --text: #222;
  --border: #d7dbea;
  --bg-soft: #f7f8fc;
}

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

html {
  scroll-padding-top: 140px;
  overflow-x: hidden;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  line-height: 1.8;
  color: #333;
  overflow-x: hidden;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */

.site-header {
  border-bottom: 4px solid var(--navy-dark);
  background: var(--navy);
  padding: 10px 0;
  margin-bottom: 60px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
}

.site-title h1 {
  margin: 0;
  font-size: 1.2rem;
  color: white;
}

.site-title h2 {
  margin: 4px 0 0;
  font-size: 1.0rem;
  font-weight: normal;
  color: white;
}

.main-nav {
  display: flex;
  gap: 16px;
}

.main-nav a {
  color: white;
  text-decoration: none;
  font-weight: 700;
}

.main-nav a:hover {
  text-decoration: underline;
  color: #dfe5ff;
}

.main-nav a.active {
  border-bottom: 3px solid white;
  padding-bottom: 3px;
}

.lang-switch {
  display: flex;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
}

.lang-switch a {
  color: white;
  text-decoration: none;
  opacity: 0.7;
}

.lang-switch a:hover {
  opacity: 1;
}

.lang-switch .active {
  color: white;
  border-bottom: 2px solid white;
}

/* Sections */

section {
  margin-bottom: 70px;
}

#about,
#news {
  scroll-margin-top: 30px;
}

section h2 {
  font-size: 1.8rem;
  margin-bottom: 24px;
  padding-bottom: 8px;
  border-bottom: 4px solid var(--navy);
}

.section-soft {
  background: #f4f6fb;
  padding: 60px 0;
}

/* Top image */

.topimage {
  position: relative;
  width: 100%;
  margin-bottom: 70px;
}

.topimage img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  display: block;
}

.hero-text {
  position: absolute;
  left: 8%;
  bottom: 50%;

  color: white;
  background: rgba(0, 0, 0, 0.45);

  padding: 20px 28px;
}

.hero-text h2 {
  margin: 0;
  font-size: 2.4rem;
}

.hero-text p {
  margin: 8px 0 0;
  font-size: 1.2rem;
}

/* Research */

.research-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.research-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.research-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.research-card-image {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.research-card-image img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.research-card-text {
  padding: 24px;
  flex: 1;
}

.research-card h3 {
  margin-top: 0;
  color: var(--navy);
}

.research-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.research-card-link:hover .research-card {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* For students */

.for-students-home {
  background: #f4f6fb;
  border-left: 6px solid var(--navy);
  padding: 32px;
  margin-bottom: 80px;
}

.for-students-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
}

.for-students-home h2 {
  margin-top: 0;
  color: var(--navy);
}

.student-button {
  flex-shrink: 0;
  display: inline-block;
  background: var(--navy);
  color: white;
  text-decoration: none;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 4px;
}

.student-button:hover {
  background: var(--navy-dark);
}

/* Page */

.page-title {
  margin-top: 50px;
  margin-bottom: 60px;
}

.page-title h2 {
  display: inline-block;
  font-size: 2.4rem;
  color: var(--navy);
  padding-bottom: 8px;
  border-bottom: 4px solid var(--navy);
}

.research-detail {
  margin-bottom: 100px;
}

.research-detail h2 {
  font-size: 1.8rem;
  margin-bottom: 24px;
}

.research-detail img {
  max-width: 700px;
  width: 100%;
  height: auto;
  display: block;
  margin: 30px auto;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

/* Page: publication */

.publication-section {
  margin-bottom: 80px;
}

.publication-list {
  padding-left: 28px;
}

.publication-list li {
  margin-bottom: 20px;
  line-height: 1.8;
}

.publication-list a {
  color: #333;
}

.publication-list a:hover {
  text-decoration: none;
}

.pub-links {
  margin-left: 8px;
  white-space: nowrap;
}

.pub-links a {
  margin-right: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: bold;
}

.pub-links a:hover {
  text-decoration: underline;
}

.peer-reviewed {
  font-size: 0.85em;
  font-weight: bold;
  margin-left: 6px;
}

/* Page: teaching */

.teaching-section {
  margin-bottom: 80px;
}

.course-card {
  border-left: 5px solid var(--navy);
  background: var(--bg-soft);
  padding: 20px 24px;
  margin-bottom: 30px;
}

.course-card h3 {
  margin-top: 0;
  margin-bottom: 5px;
}

.course-meta {
  margin-top: 0;
  font-size: 0.9rem;
  color: #666;
}

.highlight {
  color: var(--accent-red);
  font-weight: bold;
}

/* Page: contact */

.address {
  display: flex;
  align-items: flex-start;
}

.address-label {
  flex-shrink: 0;
  margin-right: 0px;
}

.address-text {
  display: block;
}

.e-mail {
  display: flex;
  align-items: flex-start;
}

.email-text {
  display: block;
}

/* Footer */

.site-footer {
  background: var(--navy);
  color: white;
  margin-top: 80px;
  padding: 25px 0;
}

.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;

  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
}

.footer-left {
  display: flex;
  flex-direction: column;
}

.footer-lab strong {
  font-size: 1rem;
}

.footer-lab p {
  margin: 5px 0;
}

.footer-links {
  display: flex;
  flex-direction: row;
  gap: 20px;
  margin-top: 10px;
  align-items: center;
}

.footer-links a {
  display: inline-block;
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;

  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.7);

  padding: 6px 14px;
  border-radius: 4px;

  transition: 0.2s;
}

.footer-links a:hover {
  background: white;
  color: var(--navy);
  text-decoration: none;
}

.footer-info {
  text-align: right;
  font-size: 0.85rem;
}

.footer-info p {
  margin: 5px 0;
}

/* ハンバーガーメニュー：PCでは非表示 */
.menu-toggle,
.hamburger {
  display: none;
}

/* Smartphone */
@media (max-width: 768px) {
  .header-inner,
  .footer-inner,
  .container,
  .for-students-inner,
  .research-grid {
    max-width: 100%;
  }


  .site-header {
    padding: 8px 0;
    margin-bottom: 30px;
  }

  .header-inner {
    position: relative;
    padding: 0 15px;
    gap: 12px;
  }

  .site-title {
    flex: 1;
    min-width: 0;
  }

  .site-title h1 {
    font-size: 1rem;
    line-height: 1.15;
  }

  .site-title h2 {
    font-size: 0.72rem;
    line-height: 1.2;
  }

  /* ハンバーガーボタン */
  .hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;

    width: 32px;
    height: 32px;

    cursor: pointer;
    flex-shrink: 0;
  }

  .hamburger span {
    display: block;
    width: 26px;
    height: 2px;
    background: white;
  }

  /* ナビゲーションは通常非表示 */
  .main-nav {
    display: none;

    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;

    flex-direction: column;
    gap: 0;

    background: var(--navy);
    padding: 10px 20px 15px;

    border-bottom: 4px solid var(--navy-dark);
  }

  .main-nav a {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }

  .main-nav a:last-child {
    border-bottom: none;
  }

  /* チェックされたら表示 */
  .menu-toggle:checked ~ .main-nav {
    display: flex;
  }

  .lang-switch {
    flex-shrink: 0;
    font-size: 0.75rem;
  }

  /* footer */
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 20px 15px;
  }

  .footer-left {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .footer-info {
    width: 100%;
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: left;
  }

  .footer-links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 16px;
  }

  .footer-lab {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .footer-lab p,
  .footer-info p {
    margin: 4px 0;
  }

  /* For students */
  .for-students-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .student-button {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }

  /* Research highlight*/
  .research-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .research-card,
  .research-card-link {
    width: 100%;
  }

  .research-card-image img {
    width: 100%;
    height: auto;
  }  
}