/* ==============================================
   main.css — Masashi Sekine Personal Website
   ============================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Noto+Serif+JP:wght@300;400;500;600&display=swap');

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

:root {
  --bg:          #f7f7fb;
  --surface:     #ffffff;
  --dark:        #080811;
  --navy:        #0d1036;
  --accent:      #3451c7;
  --accent-glow: rgba(52, 81, 199, 0.18);
  --text:        #14142a;
  --muted:       #6b6b8a;
  --border:      rgba(14, 14, 60, 0.09);
  --hero-overlay: rgba(8, 8, 20, 0.52);
  --transition:  0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Noto Serif JP', 'Hiragino Kaku Gothic Pro', sans-serif;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ---- Top Navigation ---- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: rgba(8, 8, 17, 0.7);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  transition: background var(--transition);
}

.site-nav.light {
  background: rgba(247, 247, 251, 0.88);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  transition: color var(--transition);
}
.site-nav.light .nav-logo { color: var(--text); }

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

.nav-links a {
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  position: relative;
  transition: color var(--transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width var(--transition);
}

.nav-links a:hover { color: #fff; }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: #fff; }
.nav-links a.active::after { width: 100%; }

.site-nav.light .nav-links a { color: var(--muted); }
.site-nav.light .nav-links a:hover { color: var(--text); }
.site-nav.light .nav-links a.active { color: var(--accent); }

.nav-lang {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 5px 14px;
  border-radius: 20px;
  transition: all var(--transition);
}

.nav-lang:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}

.site-nav.light .nav-lang {
  color: var(--muted);
  border-color: var(--border);
}
.site-nav.light .nav-lang:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---- Hero (Home) ---- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  transition: opacity 1s ease;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(8,8,20,0.38) 0%,
    rgba(8,8,20,0.55) 50%,
    rgba(8,8,20,0.88) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 60px 80px;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  margin-bottom: 18px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.7);
}

.hero-name {
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 300;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 24px rgba(0,0,0,0.9), 0 1px 4px rgba(0,0,0,0.6);
}

.hero-name-en {
  font-family: 'Inter', sans-serif;
  font-size: clamp(1rem, 2vw, 1.4rem);
  font-weight: 300;
  color: rgba(255,255,255,0.8);
  letter-spacing: 0.12em;
  margin-bottom: 32px;
  text-shadow: 0 1px 12px rgba(0,0,0,0.8);
}

.hero-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.hero-tag {
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.35);
  padding: 6px 16px;
  border-radius: 30px;
  backdrop-filter: blur(8px);
  background: rgba(0,0,0,0.25);
  transition: all var(--transition);
}

.hero-tag:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.4);
}

.hero-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.hero-link {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition);
  text-shadow: 0 1px 8px rgba(0,0,0,0.7);
}

.hero-link:hover { color: #fff; }

.hero-link::after {
  content: '↗';
  font-size: 11px;
  transition: transform var(--transition);
}

.hero-link:hover::after { transform: translate(2px, -2px); }

/* ---- Page Header (inner pages) ---- */
.page-header {
  padding: 140px 60px 80px;
  background: var(--dark);
  background-image: url('../images/cover.jpg');
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(8, 8, 20, 0.78) 0%,
    rgba(8, 8, 20, 0.52) 50%,
    rgba(8, 8, 20, 0.28) 100%
  );
  pointer-events: none;
}

.page-header-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.page-header h1 {
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 300;
  color: #fff;
  position: relative;
  z-index: 1;
  letter-spacing: 0.03em;
}

/* ---- Main Content Area ---- */
.content-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 80px 40px 120px;
}

/* ---- Section ---- */
.section {
  margin-bottom: 80px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.section-title {
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 32px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.section-title::before {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 36px; height: 2px;
  background: var(--accent);
}

/* ---- Timeline (Profile) ---- */
.timeline { list-style: none; }

.timeline-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0 28px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

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

.timeline-year {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding-top: 2px;
  white-space: nowrap;
}

.timeline-desc {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text);
}

/* ---- Paper Cards ---- */
.paper-list { list-style: none; display: flex; flex-direction: column; gap: 20px; }

.paper-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 26px 30px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.paper-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--transition);
}

.paper-card:hover {
  border-color: var(--accent-glow);
  box-shadow: 0 4px 24px var(--accent-glow);
  transform: translateY(-2px);
}

.paper-card:hover::before { opacity: 1; }

.paper-authors {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.paper-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 10px;
}

.paper-venue {
  font-size: 12.5px;
  font-style: italic;
  color: var(--muted);
  margin-bottom: 14px;
}

.paper-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.paper-link {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent-glow);
  padding: 4px 12px;
  border-radius: 20px;
  transition: all var(--transition);
}

.paper-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ---- Talk/Award List ---- */
.item-list { list-style: none; display: flex; flex-direction: column; gap: 0; }

.item-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 16px;
  align-items: baseline;
}

.item-list li::before {
  content: '—';
  color: var(--muted);
  font-size: 12px;
}

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

/* ---- Membership / Affiliation ---- */
.affil-list { list-style: none; display: flex; flex-direction: column; gap: 0; }

.affil-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
  color: var(--text);
}

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

.affil-link {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
  transition: all var(--transition);
}

.affil-link:hover { color: var(--accent); border-color: var(--accent); }

/* ---- Funding ---- */
.funding-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 28px;
}

.funding-period {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.funding-title {
  font-size: 14.5px;
  color: var(--text);
  margin-bottom: 6px;
}

.funding-meta {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---- Home Info Section ---- */
.home-info {
  background: var(--surface);
  padding: 80px 60px;
}

.home-info-grid {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px 80px;
}

.info-block {}

.info-block .section-title { margin-bottom: 24px; }

.info-block p, .info-block li {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text);
}

.info-block a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-glow);
  transition: border-color var(--transition);
}

.info-block a:hover { border-color: var(--accent); }

/* ---- Profile Photo on Hero ---- */
.hero-photo {
  position: absolute;
  bottom: 0; right: 80px;
  width: 260px;
  height: 350px;
  overflow: hidden;
  opacity: 0.88;
  mask-image: none;
  -webkit-mask-image: none;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
}

/* SP photo shown only on mobile */
.hero-photo-sp {
  display: none;
}

/* ---- Footer ---- */
.site-footer {
  background: var(--dark);
  padding: 40px 60px;
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.06em;
}

/* ---- Underline for speaker name ---- */
.speaker { text-decoration: underline; text-underline-offset: 3px; }

/* ---- Scroll animation trigger ---- */
[data-animate] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .site-nav { padding: 0 20px; }
  .nav-links { display: none; }

  /* Hero: vertical layout — photo at top, text below */
  .hero {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    height: auto;
    min-height: 100svh;
  }

  /* Disable fixed attachment on mobile (causes zoom/blur issues) */
  .hero-bg {
    background-attachment: scroll;
    background-size: cover;
    background-position: center top;
  }

  /* Desktop photo hidden on mobile */
  .hero-photo { display: none; }

  /* SP photo: top of hero, in normal flow */
  .hero-photo-sp {
    display: block;
    position: relative;
    width: 100%;
    height: 52vw;
    max-height: 320px;
    min-height: 200px;
    overflow: hidden;
    margin-top: 60px; /* nav height */
    opacity: 0.92;
    mask-image: none;
    -webkit-mask-image: none;
  }

  .hero-photo-sp img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: top center;
  }

  /* Text below photo, full width */
  .hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    padding: 20px 24px 60px;
    margin: 0;
  }

  .page-header { padding: 120px 24px 60px; }
  .content-wrap { padding: 50px 24px 80px; }

  .home-info { padding: 60px 24px; }
  .home-info-grid { grid-template-columns: 1fr; gap: 48px; }

  .timeline-item { grid-template-columns: 1fr; gap: 4px; }
  .timeline-year { font-size: 11px; }

  /* Mobile hamburger menu */
  .nav-hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
  }

  .nav-hamburger span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: rgba(255,255,255,0.7);
    transition: all var(--transition);
    transform-origin: center;
  }

  /* X shape when active */
  .nav-hamburger.active span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }
  .nav-hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }
  .nav-hamburger.active span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }

  .mobile-nav {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8,8,20,0.97);
    backdrop-filter: blur(20px);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
  }

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

  .mobile-nav a {
    font-size: 24px;
    font-family: 'Noto Serif JP', serif;
    font-weight: 300;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    letter-spacing: 0.1em;
    transition: color var(--transition);
  }

  .mobile-nav a:hover { color: #fff; }

  .mobile-nav-close {
    position: absolute;
    top: 20px; right: 24px;
    font-size: 28px;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
  }
}

@media (min-width: 769px) {
  .nav-hamburger { display: none; }
  .mobile-nav { display: none !important; }
}
