/* ══════════════════════════════════════════════════════════════════════════
   Taichi Maki — Research Achievements
   Modern academic portfolio design
   ══════════════════════════════════════════════════════════════════════════ */

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

:root {
  --primary: #1e3a5f;
  --primary-light: #2c5282;
  --primary-dark: #0f2440;
  --accent: #c8a951;
  --accent-light: #e6c96e;
  --bg: #f8f9fa;
  --bg-white: #ffffff;
  --bg-section: #f1f3f5;
  --text: #2d3748;
  --text-light: #718096;
  --text-muted: #a0aec0;
  --border: #e2e8f0;
  --border-light: #edf2f7;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 14px rgba(0,0,0,0.1);
  --radius: 8px;
  --radius-sm: 4px;
  --transition: 0.2s ease;
  --font-sans: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-jp: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --max-width: 1200px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

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

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

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

.navbar.scrolled {
  box-shadow: var(--shadow);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 64px;
  gap: 32px;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 24px;
  flex: 1;
}

.nav-links a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
  white-space: nowrap;
}

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

/* Language toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border: 2px solid var(--primary);
  border-radius: 20px;
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: var(--font-sans);
}

.lang-toggle:hover {
  background: var(--primary);
  color: white;
}

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

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

@media (max-width: 768px) {
  .nav-hamburger {
    display: flex;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 16px 24px;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .nav-links.open {
    display: flex;
  }
  .nav-inner {
    gap: 12px;
  }
  .lang-toggle {
    margin-left: auto;
  }
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  padding: 140px 24px 80px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  color: white;
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-name {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 300;
  opacity: 0.85;
  margin-bottom: 48px;
  letter-spacing: 0.06em;
}

.stats-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.stat-card {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  padding: 24px 32px;
  min-width: 160px;
  text-align: center;
  transition: transform var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-card-link {
  cursor: pointer;
}

.stat-card-link:hover {
  background: rgba(255,255,255,0.18);
}

.stat-number {
  display: block;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent-light);
  line-height: 1.1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.85rem;
  opacity: 0.8;
  font-weight: 400;
}

/* ── About ────────────────────────────────────────────────────────────────── */
.about-section {
  padding: 64px 0;
  background: var(--bg-white);
}

.bio-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
  max-width: 800px;
  margin: 0 auto 40px;
  text-align: center;
}

.bio-text p {
  margin: 0 0 0.75em;
}

.bio-text p:last-child {
  margin-bottom: 0;
}

/* Career highlights */
.career-highlights {
  max-width: 700px;
  margin: 0 auto 48px;
}

.career-highlights h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-weight: 600;
  text-align: center;
}

.highlights-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}

.highlights-list li {
  position: relative;
  padding-left: 20px;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.5;
}

.highlights-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

@media (max-width: 600px) {
  .highlights-list {
    grid-template-columns: 1fr;
  }
}

.research-areas {
  text-align: center;
  margin-bottom: 48px;
}

.research-areas h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-weight: 600;
}

.area-tags {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.area-tag {
  padding: 8px 20px;
  border-radius: 24px;
  background: var(--bg-section);
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--border);
}

/* Timeline chart */
.timeline-chart {
  max-width: 700px;
  margin: 0 auto;
}

.timeline-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-weight: 600;
  text-align: center;
}

.timeline-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 140px;
  padding: 0 8px;
}

.timeline-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.timeline-bar {
  width: 100%;
  background: linear-gradient(to top, var(--primary), var(--primary-light));
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: opacity var(--transition);
  position: relative;
}

.timeline-bar-count {
  font-size: 0.7rem;
  color: var(--text-light);
  font-weight: 600;
}

.timeline-bar-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Search ────────────────────────────────────────────────────────────────── */
.search-bar {
  position: sticky;
  top: 64px;
  z-index: 900;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.search-input-wrap {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 12px 44px 12px 48px;
  border: 2px solid var(--border);
  border-radius: 28px;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  transition: all var(--transition);
  outline: none;
}

.search-input:focus {
  border-color: var(--primary-light);
  background: white;
  box-shadow: 0 0 0 3px rgba(44,82,130,0.1);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  background: var(--border);
  border-radius: 50%;
  font-size: 1.1rem;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all var(--transition);
}

.search-clear:hover {
  background: var(--text-muted);
  color: white;
}

.search-results-info {
  text-align: center;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ── Publications ──────────────────────────────────────────────────────────── */
.publications {
  padding: 40px 0 80px;
}

/* Section pills */
.section-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  justify-content: center;
}

.section-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text-light);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  font-family: var(--font-sans);
}

.section-pill:hover,
.section-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.section-pill .pill-count {
  background: rgba(0,0,0,0.08);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.section-pill.active .pill-count,
.section-pill:hover .pill-count {
  background: rgba(255,255,255,0.2);
}

/* Publication section blocks */
.pub-section {
  margin-bottom: 24px;
  background: var(--bg-white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.pub-section:hover {
  box-shadow: var(--shadow);
}

.pub-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  cursor: pointer;
  user-select: none;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: all var(--transition);
  gap: 16px;
}

.pub-section-header:hover {
  background: var(--border-light);
}

.pub-section.open .pub-section-header {
  border-bottom-color: var(--border);
  background: var(--bg-white);
}

.pub-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.pub-section-title .section-count {
  background: var(--primary);
  color: white;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.pub-section-chevron {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.pub-section.open .pub-section-chevron {
  transform: rotate(180deg);
}

.pub-section-body {
  display: none;
  padding: 0;
}

.pub-section.open .pub-section-body {
  display: block;
}

/* Section toolbar */
.section-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: var(--bg-section);
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.section-toolbar select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-family: var(--font-sans);
  color: var(--text);
  background: white;
  cursor: pointer;
  outline: none;
}

.section-toolbar select:focus {
  border-color: var(--primary-light);
}

.section-toolbar label {
  font-size: 0.82rem;
  color: var(--text-light);
  font-weight: 500;
}

/* Table */
.pub-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.pub-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.pub-table th {
  background: var(--bg-section);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.pub-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  line-height: 1.5;
}

.pub-table tbody tr:hover {
  background: rgba(44,82,130,0.03);
}

.pub-table tbody tr.highlight {
  background: rgba(200,169,81,0.08);
}

/* Column widths */
.pub-table .col-num { width: 48px; text-align: center; color: var(--text-muted); font-weight: 500; }
.pub-table .col-authors { min-width: 120px; max-width: 200px; }
.pub-table .col-year { width: 60px; text-align: center; font-weight: 500; }
.pub-table .col-title { min-width: 300px; }
.pub-table .col-pages { width: 80px; white-space: nowrap; }
.pub-table .col-date { width: 100px; white-space: nowrap; }

/* Conference event group header */
.conference-event-row td {
  background: var(--bg-section);
  font-weight: 500;
  color: var(--primary);
  font-size: 0.84rem;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

/* Book parent marker */
.wiki-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
  transition: color 0.2s, border-color 0.2s;
}

.wiki-link:hover {
  color: var(--accent-dark, #1a5276);
  border-bottom-style: solid;
}

.book-parent-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}

/* Search highlight */
mark {
  background: rgba(200,169,81,0.3);
  color: inherit;
  padding: 1px 2px;
  border-radius: 2px;
}

/* No results */
.no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 1rem;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.6);
  padding: 32px 0;
  text-align: center;
  font-size: 0.85rem;
}

/* ── Utility ──────────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Smooth section open/close */
.pub-section-body {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero {
    padding: 120px 16px 60px;
  }
  .hero-name {
    font-size: 2rem;
  }
  .stats-row {
    gap: 12px;
  }
  .stat-card {
    padding: 16px 20px;
    min-width: 130px;
  }
  .stat-number {
    font-size: 1.6rem;
  }
  .about-section {
    padding: 40px 0;
  }
  .container {
    padding: 0 16px;
  }
  .pub-section-header {
    padding: 14px 16px;
  }
  .pub-section-title {
    font-size: 0.9rem;
  }
  .section-toolbar {
    padding: 10px 16px;
  }
  .pub-table {
    font-size: 0.82rem;
  }
  .pub-table th,
  .pub-table td {
    padding: 8px 8px;
  }
  .pub-table .col-pages,
  .pub-table .col-date {
    display: none;
  }
  .section-pills {
    gap: 6px;
  }
  .section-pill {
    font-size: 0.76rem;
    padding: 5px 12px;
  }
  .timeline-bars {
    height: 100px;
  }
}

@media (max-width: 480px) {
  .stats-row {
    flex-direction: column;
    align-items: center;
  }
  .stat-card {
    width: 100%;
    max-width: 200px;
  }
  .pub-table .col-authors {
    max-width: 100px;
  }
  .pub-table .col-num {
    width: 32px;
  }
}
