/* =========================================================
   Tadayoshi Aoyama — Modern Minimal Theme
   ========================================================= */

:root {
  --bg: #ffffff;
  --bg-soft: #f2f6fa;
  --bg-tint: #e9f1f7;
  --text: #0f1720;
  --ink: #0c141f;
  --muted: #54606e;
  --faint: #8a929e;
  --line: #e2e7ee;
  --accent: #0f5aa8;
  --accent-dark: #0a3f78;
  --accent-soft: #e6eef8;
  --green: #10a37a;
  --green-dark: #0b7d5d;
  --green-soft: #e0f4ed;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
  --maxw: 940px;
  --font: "Inter", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 16px;
}

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Navbar ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-brand {
  display: flex;
  flex-direction: column;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  letter-spacing: .01em;
  padding-left: 14px;
  border-left: 3px solid var(--green);
}
.nav-brand:hover { color: var(--accent); text-decoration: none; }
.nav-brand small { color: var(--muted); font-weight: 500; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 500;
}
.nav-links a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--accent); background: var(--accent-soft); }

.lang-toggle { position: relative; }
.lang-toggle > summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lang-toggle > summary::-webkit-details-marker { display: none; }
.lang-toggle > summary:hover { background: var(--bg-soft); color: var(--text); }
.lang-toggle[open] > summary { background: var(--accent-soft); color: var(--accent); }
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  min-width: 168px;
  padding: 6px;
  z-index: 200;
}
.lang-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 7px;
  color: var(--text);
  font-size: 14px;
}
.lang-menu a:hover { background: var(--bg-soft); text-decoration: none; }

.nav-toggle { display: none; }
.hamburger {
  display: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  color: var(--text);
}

/* ---------- Layout ---------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
main { padding-bottom: 96px; }

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 40px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
}
.hero-text h1 {
  font-size: 42px;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  font-weight: 700;
}
.hero-kicker {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--green-dark);
  margin-bottom: 18px;
  padding: 4px 12px;
  background: var(--green-soft);
  border-radius: 999px;
}
.hero-role {
  font-size: 17px;
  color: var(--muted);
  margin: 0 0 22px;
  line-height: 1.6;
}
.hero-photo {
  width: 190px;
  height: 235px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  transition: all .15s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

/* ---------- Sections ---------- */
.section { padding: 40px 0 8px; scroll-margin-top: 80px; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--accent) 0%, var(--green) 60%, rgba(16,163,122,0) 100%) 1;
}
.section-head h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  padding-left: 14px;
  border-left: 4px solid var(--accent);
}
.section-head .count {
  font-size: 13px;
  color: var(--faint);
  font-weight: 500;
}

/* ---------- Timeline (bio) ---------- */
.timeline { position: relative; margin: 0; padding: 0 0 0 26px; list-style: none; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line);
}
.timeline li { position: relative; padding: 0 0 20px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}
.timeline .t-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
  letter-spacing: .02em;
}
.timeline .t-body { color: var(--text); }

/* ---------- Project cards ---------- */
.cards { display: grid; gap: 14px; }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: var(--bg);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.card:hover { border-color: #cdd6e0; box-shadow: var(--shadow-sm); }
.card .c-meta {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.card .c-role {
  display: inline-block;
  background: var(--green-soft);
  color: var(--green-dark);
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}
.card .c-title { font-size: 15.5px; font-weight: 600; line-height: 1.5; }
.card .c-title a { color: var(--text); }
.card .c-title a:hover { color: var(--accent); }

/* ---------- Chips (memberships / societies) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.chips li {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-soft);
}

/* ---------- Contact ---------- */
.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  background: var(--bg-soft);
  line-height: 1.9;
}
.contact-card .c-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--faint);
  font-weight: 600;
}

/* ---------- Publications ---------- */
.pub-note {
  background: var(--accent-soft);
  border: 1px solid #cfe0ee;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 14.5px;
  color: var(--accent-dark);
  margin: 8px 0 8px;
}
.pub-note a { font-weight: 600; }

.pub-list {
  list-style: none;
  counter-reset: pub;
  margin: 0;
  padding: 0;
}
.pub-list > li {
  counter-increment: pub;
  position: relative;
  padding: 16px 8px 16px 52px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.65;
  transition: background .15s ease;
}
.pub-list > li:hover { background: var(--bg-soft); }
.pub-list > li::before {
  content: counter(pub);
  position: absolute;
  left: 0;
  top: 16px;
  width: 34px;
  text-align: right;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
  font-weight: 600;
}
.pub-list font[color="red"] {
  display: inline-block;
  color: #a15c00 !important;
  background: #fef3e2;
  border: 1px solid #f3d9a8;
  border-radius: 6px;
  padding: 0 8px;
  font-size: 12.5px;
  font-weight: 600;
  margin-left: 4px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  border-top: 3px solid var(--green);
  padding: 30px 0;
  color: #9aa6b4;
  font-size: 13.5px;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
}
.footer-inner a { color: #cbd5e1; }
.footer-inner a:hover { color: #fff; }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--green) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { background: var(--accent-dark); color: #fff; text-decoration: none; transform: translateY(-2px); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .hamburger { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 10px 16px 16px;
    box-shadow: var(--shadow);
    display: none;
  }
  .nav-toggle:checked ~ .nav-inner .nav-links { display: flex; }
  .nav-links a { padding: 12px 14px; border-radius: 9px; }
  .lang-toggle { width: 100%; }
  .lang-toggle > summary { padding: 12px 14px; }
  .lang-menu { position: static; box-shadow: none; border: none; padding: 0 0 4px 8px; min-width: 0; }

  .hero {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 48px 0 30px;
    text-align: left;
  }
  .hero-photo { width: 150px; height: 185px; order: -1; }
  .hero-text h1 { font-size: 33px; }
}
