/* ===== CSS Custom Properties ===== */
:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f5f5f5;
  --color-dark: #1a1a1a;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-text-muted: #999999;
  --color-border: #e0e0e0;
  --color-white: #ffffff;
  --max-width: 1100px;
  --header-height: 72px;
  --radius: 3px;
  --transition: 0.25s ease;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-dark);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-text-light);
}

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

ul {
  list-style: none;
}

/* ===== Container ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Header ===== */
.site-header {
  background: #333333;
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-logo .logo-isct {
  height: 54px;
  width: auto;
}

.site-logo .logo-mark {
  height: 30px;
  width: auto;
  filter: brightness(0) invert(1);
}

.site-logo a {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-logo a:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* ===== Navigation ===== */
.main-nav ul {
  display: flex;
  gap: 4px;
  align-items: center;
}

.main-nav a {
  color: rgba(255, 255, 255, 0.7);
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color var(--transition), background var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* Language Toggle */
.lang-toggle {
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.04em;
  transition: all var(--transition);
}

.lang-toggle:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.6);
}

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  background: var(--color-dark);
  color: var(--color-white);
  padding: 0;
  overflow: hidden;
  min-height: 420px;
  display: flex;
  align-items: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 100%),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 400"><defs><linearGradient id="g" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" style="stop-color:%23222"/><stop offset="100%" style="stop-color:%23444"/></linearGradient></defs><rect fill="url(%23g)" width="800" height="400"/><circle cx="200" cy="200" r="120" fill="none" stroke="%23555" stroke-width="0.5" opacity="0.3"/><circle cx="600" cy="150" r="80" fill="none" stroke="%23555" stroke-width="0.5" opacity="0.3"/><circle cx="400" cy="300" r="160" fill="none" stroke="%23555" stroke-width="0.5" opacity="0.2"/><line x1="100" y1="50" x2="700" y2="350" stroke="%23444" stroke-width="0.3" opacity="0.2"/><line x1="50" y1="300" x2="750" y2="100" stroke="%23444" stroke-width="0.3" opacity="0.2"/></svg>');
  background-size: cover;
  background-position: center;
}

.hero .container {
  position: relative;
  z-index: 1;
  padding-top: 80px;
  padding-bottom: 80px;
}

.hero-slogan {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.hero-desc {
  font-size: 1rem;
  opacity: 0.8;
  max-width: 560px;
  line-height: 1.8;
}

.hero-lab-name {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 20px;
}

/* ===== Sections ===== */
.section {
  padding: 64px 0;
}

.section--alt {
  background: var(--color-bg-alt);
}

.section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text-muted);
  margin-bottom: 28px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ===== About ===== */
.about-text {
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--color-text);
  max-width: 900px;
}

/* ===== News ===== */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.news-item {
  display: flex;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
  align-items: baseline;
}

.news-item:first-child {
  padding-top: 0;
}

.news-date {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  min-width: 100px;
  font-variant-numeric: tabular-nums;
}

.news-title {
  font-size: 0.9rem;
  color: var(--color-text);
}

/* ===== Quick Links ===== */
.quick-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.quick-link-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  transition: border-color var(--transition), transform var(--transition);
  background: var(--color-white);
}

.quick-link-card:hover {
  border-color: var(--color-dark);
  transform: translateY(-2px);
}

.quick-link-card .card-icon {
  font-size: 1.6rem;
  margin-bottom: 10px;
  display: block;
  opacity: 0.6;
}

.quick-link-card h3 {
  font-size: 0.95rem;
  color: var(--color-dark);
  margin-bottom: 6px;
}

.quick-link-card p {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

/* ===== Members ===== */
/* Message Cards */
.message-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.message-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--color-white);
  transition: border-color var(--transition);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message-card:hover {
  border-color: var(--color-text-muted);
}

.message-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.message-header .member-photo {
  margin: 0;
  flex-shrink: 0;
}

.message-meta h4 {
  font-size: 0.95rem;
  color: var(--color-dark);
  margin-bottom: 2px;
}

.message-meta .research {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.message-meta .affiliation {
  font-size: 0.75rem;
  color: var(--color-text-light);
  font-style: italic;
  margin-top: 2px;
  line-height: 1.4;
}

.message-body {
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--color-text);
  padding: 12px 16px;
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  min-height: 60px;
}

.message-body--empty {
  color: var(--color-text-muted);
  font-style: italic;
}

.member-group-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text-muted);
  margin: 36px 0 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.member-group-title:first-of-type {
  margin-top: 0;
}

/* Student Grid */
.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.student-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  background: var(--color-white);
  transition: border-color var(--transition);
}

.student-card:hover {
  border-color: var(--color-text-muted);
}

.member-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-white);
  background: var(--color-dark);
  overflow: hidden;
}

.member-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.member-photo-link {
  display: inline-block;
  text-decoration: none;
  transition: opacity var(--transition);
}

.member-photo-link:hover {
  opacity: 0.85;
}

.student-card h4 {
  font-size: 0.92rem;
  color: var(--color-dark);
  margin-bottom: 4px;
}

.student-card h4 a {
  color: var(--color-dark);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}

.student-card h4 a:hover {
  border-bottom-color: var(--color-dark);
}

.student-card .research {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.student-card .affiliation {
  font-size: 0.75rem;
  color: var(--color-text-light);
  font-style: italic;
  margin-top: 4px;
  line-height: 1.4;
}

.affiliation + .affiliation {
  margin-top: 8px;
}

/* ===== Projects ===== */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.project-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--color-white);
}

.project-card h3 {
  font-size: 1.05rem;
  color: var(--color-dark);
  margin-bottom: 8px;
}

.project-status {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 2px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.project-status--active {
  background: #f0f0f0;
  color: #333;
  border: 1px solid #ccc;
}

.project-status--completed {
  background: #f7f7f7;
  color: #999;
  border: 1px solid #ddd;
}

.project-description {
  font-size: 0.88rem;
  line-height: 1.7;
  margin-bottom: 12px;
  color: var(--color-text-light);
}

.project-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keyword-tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  color: var(--color-text-muted);
}

/* ===== Publications ===== */
.pub-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.pub-filter-btn {
  padding: 5px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-white);
  color: var(--color-text-light);
  cursor: pointer;
  font-size: 0.82rem;
  font-family: inherit;
  transition: all var(--transition);
}

.pub-filter-btn:hover {
  border-color: var(--color-dark);
  color: var(--color-dark);
}

.pub-filter-btn.active {
  background: var(--color-dark);
  color: var(--color-white);
  border-color: var(--color-dark);
}

.pub-year-group {
  margin-bottom: 28px;
}

.pub-year {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-border);
}

.pub-item {
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.88rem;
  line-height: 1.7;
}

.pub-item:last-child {
  border-bottom: none;
}

.pub-authors {
  color: var(--color-text-light);
}

.pub-title {
  font-weight: 600;
  color: var(--color-dark);
}

.pub-venue {
  color: var(--color-text-muted);
  font-style: italic;
}

.pub-type-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 2px;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.pub-type-badge--journal {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
}

.pub-type-badge--conference {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
}

.pub-award-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 2px;
  margin-left: 4px;
  letter-spacing: 0.03em;
  vertical-align: middle;
  background: #fdecec;
  color: #c0392b;
  border: 1px solid #f8d7da;
}

/* ===== Contact ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.contact-info h3 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
  margin-top: 24px;
}

.contact-info h3:first-child {
  margin-top: 0;
}

.contact-info p,
.contact-info a {
  font-size: 0.9rem;
  line-height: 1.8;
}

.map-embed {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  height: 400px;
}

.map-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--color-dark);
  color: rgba(255, 255, 255, 0.5);
  padding: 20px 0;
  text-align: center;
  font-size: 0.78rem;
  margin-top: auto;
  letter-spacing: 0.02em;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.7);
}

.site-footer a:hover {
  color: rgba(255, 255, 255, 0.9);
}

.footer-link {
  margin-top: 6px;
  font-size: 0.85rem;
}

.footer-link a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-link a:hover {
  color: var(--color-white);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: #333333;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    padding: 8px 0;
  }

  .main-nav.open {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .main-nav a {
    display: block;
    padding: 10px 24px;
    border-radius: 0;
  }

  .main-nav li:last-child {
    padding: 10px 24px;
  }

  .hero {
    min-height: 300px;
  }

  .hero .container {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .hero-slogan {
    font-size: 1.5rem;
  }

  .hero-desc {
    font-size: 0.9rem;
  }

  .section {
    padding: 40px 0;
  }

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

  .student-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .map-embed {
    height: 300px;
  }

  .news-item {
    flex-direction: column;
    gap: 4px;
  }

  .news-date {
    min-width: auto;
  }

  .pub-filters {
    gap: 6px;
  }
}
