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

:root {
  --color-primary: #1e3a5f;
  --color-accent: #2980b9;
  --color-accent-light: #e8f4fd;
  --color-text: #2c3e50;
  --color-text-light: #6c7a89;
  --color-bg: #fafbfc;
  --color-white: #ffffff;
  --color-border: #e1e8ed;
  --color-card: #ffffff;
  --font-sans: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 8px;
  --max-width: 960px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-primary);
}

img {
  max-width: 100%;
  max-height: 200px;
  height: auto;
  border-radius: var(--radius);
  object-fit: cover;
}

/* ============================================
   Header & Navigation
   ============================================ */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.95);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-title {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  gap: 0;
  line-height: 1.2;
}

.site-title .name-ja {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.05em;
}

.site-title .affiliation {
  font-size: 0.7rem;
  color: var(--color-text-light);
  font-weight: 400;
}

.site-nav {
  display: flex;
  gap: 4px;
}

.site-nav a {
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-light);
  border-radius: 6px;
  transition: all 0.2s;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--color-primary);
  background: var(--color-accent-light);
}

.site-nav a.active {
  color: var(--color-accent);
  background: var(--color-accent-light);
  font-weight: 600;
}

.site-nav .nav-external {
  color: var(--color-accent);
}

.site-nav .nav-external::after {
  content: " ↗";
  font-size: 0.7em;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all 0.3s;
}

.nav-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

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

.nav-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   Main Content
   ============================================ */
.site-main {
  padding: 48px 0 80px;
  min-height: calc(100vh - 64px - 80px);
}

/* ============================================
   Page Hero
   ============================================ */
.hero {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 48px;
  padding: 32px;
  background: var(--color-white);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.hero-image img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.hero-content h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.hero-content .contact-info {
  font-size: 0.85rem;
  color: var(--color-text-light);
  line-height: 1.8;
}

.hero-content .contact-info a {
  color: var(--color-accent);
}

/* ============================================
   Section Styles
   ============================================ */
.section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-accent);
  display: inline-block;
}

.card {
  background: var(--color-white);
  border-radius: 12px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* ============================================
   News List
   ============================================ */
.news-list {
  list-style: none;
}

.news-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
  line-height: 1.7;
}

.news-list li:last-child {
  border-bottom: none;
}

.news-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
}

.news-tag.research { background: #e8f5e9; color: #2e7d32; }
.news-tag.award { background: #fff8e1; color: #f57f17; }
.news-tag.media { background: #fce4ec; color: #c62828; }
.news-tag.paper { background: #e3f2fd; color: #1565c0; }
.news-tag.education { background: #f3e5f5; color: #6a1b9a; }
.news-tag.talk { background: #e0f2f1; color: #00695c; }
.news-tag.tv { background: #fce4ec; color: #ad1457; }
.news-tag.collab { background: #fff3e0; color: #e65100; }
.news-tag.exhibition { background: #e8eaf6; color: #283593; }

/* ============================================
   Photo Caption
   ============================================ */
.photo-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 20px;
}

.photo-card img {
  width: 100%;
  display: block;
  border-radius: 12px;
}

.photo-caption {
  font-size: 0.8rem;
  color: var(--color-text-light);
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}

/* ============================================
   Publication List
   ============================================ */
.pub-list {
  list-style: none;
  counter-reset: pub-counter;
}

.pub-list li {
  padding: 14px 0 14px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.88rem;
  line-height: 1.7;
  position: relative;
}

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

.pub-list .pub-link {
  display: inline-block;
  font-size: 0.78rem;
  padding: 2px 8px;
  background: var(--color-accent-light);
  border-radius: 4px;
  margin-left: 4px;
  white-space: nowrap;
}

.pub-list .author-highlight {
  font-weight: 600;
  color: var(--color-primary);
}

/* ============================================
   CV Timeline
   ============================================ */
.timeline {
  list-style: none;
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--color-border);
}

.timeline li {
  padding: 10px 0;
  position: relative;
  font-size: 0.9rem;
}

.timeline li::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 2px solid var(--color-white);
  box-shadow: 0 0 0 2px var(--color-accent);
}

.timeline .year {
  font-weight: 600;
  color: var(--color-accent);
  font-size: 0.82rem;
  display: block;
}

/* ============================================
   Gallery Grid
   ============================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.gallery-item {
  background: var(--color-white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 0;
}

.gallery-item .gallery-body {
  padding: 20px;
}

.gallery-item h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.gallery-item p {
  font-size: 0.82rem;
  color: var(--color-text-light);
  line-height: 1.6;
}

.gallery-item .gallery-links {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gallery-item .gallery-links a {
  font-size: 0.78rem;
  padding: 3px 10px;
  background: var(--color-accent-light);
  border-radius: 4px;
  color: var(--color-accent);
  font-weight: 500;
}

/* ============================================
   Laboratory Page - Pastel Cards
   ============================================ */
.card-history    { border-left: 4px solid #81c784; background: linear-gradient(135deg, #f1f8e9 0%, var(--color-white) 40%); }
.card-collab     { border-left: 4px solid #ffb74d; background: linear-gradient(135deg, #fff8e1 0%, var(--color-white) 40%); }
.card-research   { border-left: 4px solid #64b5f6; background: linear-gradient(135deg, #e3f2fd 0%, var(--color-white) 40%); }
.card-data       { border-left: 4px solid #ba68c8; background: linear-gradient(135deg, #f3e5f5 0%, var(--color-white) 40%); }
.card-course     { border-left: 4px solid #4db6ac; background: linear-gradient(135deg, #e0f2f1 0%, var(--color-white) 40%); }
.card-seminar    { border-left: 4px solid #7986cb; background: linear-gradient(135deg, #e8eaf6 0%, var(--color-white) 40%); }
.card-contact    { border-left: 4px solid #f06292; background: linear-gradient(135deg, #fce4ec 0%, var(--color-white) 40%); }
.card-schedule   { border-left: 4px solid #a1887f; background: linear-gradient(135deg, #efebe9 0%, var(--color-white) 40%); }
.card-thesis     { border-left: 4px solid #4fc3f7; background: linear-gradient(135deg, #e1f5fe 0%, var(--color-white) 40%); }

.lab-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
}

.lab-tag.history    { background: #e8f5e9; color: #2e7d32; }
.lab-tag.collab     { background: #fff3e0; color: #e65100; }
.lab-tag.research   { background: #e3f2fd; color: #1565c0; }
.lab-tag.data       { background: #f3e5f5; color: #6a1b9a; }

/* ============================================
   English Page
   ============================================ */
.en-hero {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  align-items: start;
  margin-bottom: 40px;
}

.en-hero img {
  width: 100%;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.en-hero h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.en-hero h2 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-light);
  margin-bottom: 2px;
}

.en-hero h3 {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-text-light);
  margin-bottom: 16px;
}

/* ============================================
   Award List
   ============================================ */
.award-list {
  list-style: none;
}

.award-list li {
  padding: 10px 0;
  padding-left: 28px;
  position: relative;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--color-border);
}

.award-list li:last-child {
  border-bottom: none;
}

.award-list li::before {
  content: '🏆';
  position: absolute;
  left: 0;
  font-size: 0.9rem;
}

/* ============================================
   Misc
   ============================================ */
.text-muted {
  color: var(--color-text-light);
  font-size: 0.85rem;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--color-accent-light);
  color: var(--color-accent);
}

/* YouTube embed */
.video-wrapper {
  max-width: 356px;
  max-height: 200px;
  border-radius: var(--radius);
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.video-wrapper iframe {
  width: 356px;
  height: 200px;
  max-height: 200px;
  border: 0;
  display: block;
}

/* Two Column layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Description list */
.info-table {
  font-size: 0.9rem;
}

.info-table dt {
  font-weight: 600;
  color: var(--color-primary);
  margin-top: 12px;
}

.info-table dd {
  margin-left: 0;
  padding-left: 16px;
  color: var(--color-text);
}

/* Patent list */
.patent-list {
  list-style: none;
}

.patent-list li {
  padding: 8px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--color-border);
}

.patent-list li:last-child {
  border-bottom: none;
}

/* Grant list */
.grant-list {
  list-style: none;
}

.grant-list li {
  padding: 6px 0;
  font-size: 0.85rem;
  line-height: 1.6;
  border-bottom: 1px solid var(--color-border);
}

.grant-list li:last-child {
  border-bottom: none;
}

.grant-year {
  font-weight: 600;
  color: var(--color-accent);
  font-size: 0.8rem;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background: var(--color-primary);
  color: rgba(255,255,255,0.7);
  padding: 24px 0;
  text-align: center;
  font-size: 0.8rem;
}

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

  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: 12px 24px;
    box-shadow: var(--shadow-md);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 10px 14px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
  }

  .en-hero {
    grid-template-columns: 1fr;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

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

  .site-main {
    padding: 24px 0 48px;
  }
}
