/* ============================================================
   VARIABLES & RESET
   ============================================================ */
:root {
  --bg-primary:    #050e1f;
  --bg-card:       #0d1f3c;
  --bg-alt:        #081427;
  --bg-nav:        rgba(5, 14, 31, 0.92);

  --accent:        #38bdf8;   /* sky-400 */
  --accent-dim:    #0ea5e9;
  --accent-glow:   rgba(56, 189, 248, 0.18);
  --accent-2:      #34d399;   /* emerald */

  --text-primary:  #e2eaf5;
  --text-secondary:#8da5c0;
  --text-muted:    #4e6a85;

  --border:        rgba(56, 189, 248, 0.12);
  --border-hover:  rgba(56, 189, 248, 0.38);

  --radius-sm:     8px;
  --radius:        14px;
  --radius-lg:     22px;

  --shadow-card:   0 4px 28px rgba(0, 0, 0, 0.45);
  --shadow-glow:   0 0 40px rgba(56, 189, 248, 0.12);

  --font-en:       'Inter', sans-serif;
  --font-ja:       'Noto Sans JP', sans-serif;

  --transition:    0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-h:         68px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scroll-padding-top: var(--nav-h);
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-en);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

body.lang-ja { font-family: var(--font-ja); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
  width: 90%;
  max-width: 1060px;
  margin: 0 auto;
}

.section {
  padding: 88px 0;
}

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

.section-alt::before,
.section-alt::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
}
.section-alt::before { top: 0; }
.section-alt::after  { bottom: 0; }

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  text-align: center;
  margin-bottom: 8px;
}

.section-sub {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 54px;
}

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1000;
  background: var(--bg-nav);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-logo {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  padding: 6px 14px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 8px;
  transition: color var(--transition), background var(--transition);
}

.nav-links a:hover {
  color: var(--accent);
  background: var(--accent-glow);
}

.lang-btn {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent-dim);
  border-radius: 20px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.lang-btn:hover {
  background: var(--accent-dim);
  color: #fff;
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 6px;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  overflow: hidden;
}

.hero-bg-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 700px;
  background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 60px;
  padding: 60px 0;
  position: relative;
  z-index: 1;
}

/* Photo */
.hero-photo-wrap {
  position: relative;
  flex-shrink: 0;
}

.photo-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), var(--accent));
  animation: spin 8s linear infinite;
  z-index: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

.hero-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 1;
  border: 4px solid var(--bg-primary);
  background: var(--bg-card);
}

/* Text */
.hero-text { flex: 1; }

.hero-greeting {
  font-size: 1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-name {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #fff 40%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--accent-2);
  margin-bottom: 6px;
}

.hero-affil {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.hero-bio {
  font-size: 0.97rem;
  color: var(--text-secondary);
  max-width: 500px;
  line-height: 1.8;
  margin-bottom: 28px;
}

/* Social Buttons */
.social-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all var(--transition);
}

.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.social-btn.github:hover  { border-color: #aaa; background: #161b22; }
.social-btn.email:hover   { border-color: var(--accent-2); color: var(--accent-2); }
.social-btn.scholar:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   SKILLS STRIP
   ============================================================ */
.skills-strip {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  overflow: hidden;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.tag {
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 20px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: var(--accent);
  transition: background var(--transition), border-color var(--transition);
}

.tag:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent);
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 36px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-dim), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: 28px;
}

.timeline-dot {
  position: absolute;
  left: -31px;
  top: 22px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 10px var(--accent-dim);
}

.timeline-content {
  padding: 24px 28px;
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.timeline-period {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge.edu {
  background: rgba(52, 211, 153, 0.12);
  color: var(--accent-2);
  border-color: rgba(52, 211, 153, 0.3);
}

.timeline-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.timeline-org {
  font-size: 0.88rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.timeline-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ============================================================
   PUBLICATION TABS
   ============================================================ */
.pub-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.pub-tab {
  padding: 8px 22px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.pub-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pub-tab.active {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
  color: #fff;
}

.pub-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
  font-size: 0.95rem;
}

/* 自分の著者名ハイライト */
.author-me {
  color: var(--accent);
}

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

.pub-card {
  display: flex;
  gap: 0;
}

.pub-year {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  padding: 20px 16px;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  min-width: 52px;
  flex-shrink: 0;
}

.pub-body {
  padding: 22px 26px;
  flex: 1;
}

.pub-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 8px;
}

.pub-title a {
  color: #fff;
  transition: color var(--transition);
}

.pub-title a:hover { color: var(--accent); }

.pub-authors {
  font-size: 0.87rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.pub-venue {
  font-size: 0.84rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.pub-venue i { opacity: 0.7; margin-right: 4px; }

.pub-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.pub-link:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: var(--accent-glow);
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-wrap { text-align: center; }

.contact-cards {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 40px;
  min-width: 220px;
  transition: all var(--transition);
}

.contact-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-4px);
}

.contact-icon {
  font-size: 1.8rem;
  color: var(--accent);
  margin-bottom: 4px;
}

.contact-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.contact-val {
  font-size: 0.9rem;
  color: var(--text-secondary);
  word-break: break-all;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.back-top {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.back-top:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate {
  animation: fadeInUp 0.6s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* Initial hidden state for observer */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    gap: 4px;
  }
  .menu-btn { display: block; }

  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 32px;
    padding: 40px 0;
  }

  .social-links { justify-content: center; }
  .hero-bio { max-width: 100%; }

  .pub-card { flex-direction: column; }
  .pub-year {
    writing-mode: horizontal-tb;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    min-width: auto;
  }

  .footer .container { flex-direction: column; gap: 12px; }
}

@media (max-width: 480px) {
  .section { padding: 60px 0; }
  .contact-card { min-width: 100%; }
}
