/* =========================================================
   Tanaka Laboratory — shared stylesheet
   ========================================================= */
:root{
  --font-body: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --text: #111;
  --muted: #666;
  --link: #0366d6;
  --rule: #eee;
  --accent: #0aa77f;
  --accent-deep: #077a5d;
  --accent-soft: #f0fdf9;
  --card: #fafafa;
  --maxw: 880px;
}
html{ font-size: 16px; scroll-behavior: smooth; }
body{
  font-family: var(--font-body);
  color: var(--text);
  line-height: 1.8;
  margin: 0;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: #fff;
}
a{ color: var(--link); }
header, nav, main, footer{ max-width: var(--maxw); margin: 0 auto; padding-left: 16px; padding-right: 16px; }
header{ padding-top: 28px; padding-bottom: 6px; }

/* ---- Brand ---- */
.brand{ font-weight: 800; margin: 0; letter-spacing: 0.02em; line-height: 1.3;
  font-size: clamp(1.6rem, 1.5vw + 1.2rem, 2.2rem); }
.brand a{ color: inherit; text-decoration: none; }
.tagline{ margin: .2rem 0 0; color: var(--muted); font-size: 1rem; }

/* ---- Navigation ---- */
nav{
  display: flex; flex-wrap: wrap; gap: 4px 18px;
  padding-top: 10px; padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; background: rgba(255,255,255,.96); z-index: 10;
}
nav a{ color: var(--link); text-decoration: none; font-weight: 600; font-size: .96rem; padding: 2px 0; border-bottom: 2px solid transparent; }
nav a:hover{ border-bottom-color: #cfe0f5; }
nav a.active{ color: var(--text); border-bottom-color: var(--accent); }
nav .lang{ margin-left: auto; color: var(--muted); }

/* ---- Headings & sections ---- */
h1.page-title{ font-size: clamp(1.4rem, 1vw + 1.1rem, 1.8rem); margin: 2rem 0 .4rem; }
h2{
  font-weight: 700; line-height: 1.4;
  font-size: clamp(1.3rem, .8vw + 1rem, 1.6rem);
  border-left: 6px solid var(--accent);
  padding-left: 10px;
  margin: 0 0 1rem;
}
h3{ font-weight: 700; font-size: 1.05rem; color: var(--muted); margin: 1.6rem 0 .6rem; }
section{ margin: 2.8rem 0; scroll-margin-top: 64px; }
p{ margin: .6rem 0; }
.muted{ color: var(--muted); }
.lead{ font-size: 1.02rem; }

/* ---- Notice ---- */
.notice{
  background: var(--accent-soft); border: 1px solid #bfeadd; border-left: 5px solid var(--accent);
  border-radius: 8px; padding: 12px 16px; margin-top: 1.6rem; font-size: .95rem; line-height: 1.65;
}
.notice strong{ color: var(--accent-deep); }

/* ---- Profile card ---- */
.profile{
  display: flex; gap: 24px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--rule); border-radius: 10px;
  padding: 20px;
}
.profile img{ width: 150px; height: 188px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.profile .name{ font-size: 1.35rem; font-weight: 800; margin: 0 0 .3rem; }
.profile .name small{ font-size: .9rem; font-weight: 600; color: var(--muted); margin-left: .4rem; }
.profile ul{ list-style: none; padding: 0; margin: 0 0 .8rem; color: #333; }
.profile li{ margin: 0; line-height: 1.6; }
.profile .fields{ font-size: .95rem; color: var(--muted); margin: 0 0 .9rem; }
@media (max-width: 600px){
  .profile{ flex-direction: column; align-items: center; text-align: center; }
  .profile .btns{ justify-content: center; }
}

/* ---- Buttons ---- */
.btns{ display: flex; flex-wrap: wrap; gap: 8px; }
.btn{
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--accent); color: var(--accent-deep); background: #fff;
  font-size: .9rem; font-weight: 600; text-decoration: none; line-height: 1.5;
}
.btn:hover{ background: var(--accent-soft); }

/* ---- Cards ---- */
.cards{ display: grid; grid-template-columns: 1fr; gap: 14px; margin: 1rem 0; }
@media (min-width: 640px){ .cards{ grid-template-columns: 1fr 1fr; } }
.card{
  border: 1px solid var(--rule); border-top: 4px solid var(--accent);
  border-radius: 8px; padding: 14px 16px; background: #fff;
}
.card h4{ margin: 0 0 .35rem; font-size: 1.02rem; line-height: 1.5; }
.card p{ margin: 0; font-size: .95rem; color: #333; line-height: 1.65; }
.card .meta{ margin-top: .5rem; font-size: .88rem; color: var(--muted); }

/* ---- Stat tiles ---- */
.stats{ display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 1rem 0; }
@media (min-width: 640px){ .stats{ grid-template-columns: repeat(4, 1fr); } }
.stat{ background: var(--card); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; text-align: center; }
.stat .num{ display: block; font-size: 1.6rem; font-weight: 800; color: var(--accent-deep); line-height: 1.2; }
.stat .lbl{ font-size: .85rem; color: var(--muted); }

/* ---- Page TOC (pills) ---- */
.toc{ display: flex; flex-wrap: wrap; gap: 8px; margin: .8rem 0 0; }
.toc a{
  font-size: .9rem; font-weight: 600; text-decoration: none; color: #333;
  background: var(--card); border: 1px solid var(--rule); border-radius: 999px; padding: 4px 12px;
}
.toc a:hover{ border-color: var(--accent); }
.toc .count{ color: var(--muted); font-weight: 500; margin-left: 2px; }

/* ---- Publication lists ---- */
.pubs{ list-style: none; padding: 0; margin: 0; }
.pubs li{
  padding: .5rem 0 .5rem 14px; border-left: 2px solid var(--rule);
  margin-bottom: .35rem; line-height: 1.7;
}
.pubs .me{ font-weight: 700; }
.pubs a.doi{
  font-size: .8rem; font-weight: 600; text-decoration: none;
  border: 1px solid #cfe0f5; border-radius: 4px; padding: 0 6px; margin-left: 4px; white-space: nowrap;
}
.pubs a.doi:hover{ background: #f2f7fd; }
.year{ font-weight: 800; color: var(--accent-deep); font-size: 1rem; margin: 1.4rem 0 .4rem; }

/* ---- Tags / badges ---- */
.tag{
  display: inline-block; font-size: .76rem; font-weight: 700; line-height: 1.6;
  border-radius: 4px; padding: 0 7px; margin-right: 4px; white-space: nowrap;
  background: #f1f1f1; color: #444;
}
.tag.pi{ background: var(--accent-soft); color: var(--accent-deep); border: 1px solid #bfeadd; }
.tag.co{ background: #f5f5f5; color: #555; border: 1px solid #e5e5e5; }

/* ---- Member cards ---- */
.members{ display: grid; grid-template-columns: 1fr; gap: 10px; margin: .6rem 0 1rem; }
@media (min-width: 640px){ .members{ grid-template-columns: 1fr 1fr; } }
.member{ border: 1px solid var(--rule); border-radius: 8px; padding: 10px 14px; background: #fff; }
.member .who{ font-weight: 700; }
.member .who .yr{ font-weight: 600; font-size: .82rem; color: var(--accent-deep); background: var(--accent-soft); border-radius: 4px; padding: 0 6px; margin-left: 6px; }
.member .aff{ font-size: .85rem; color: var(--muted); }
.member .theme{ font-size: .93rem; color: #333; margin-top: 2px; line-height: 1.6; }

/* ---- Blog feed ---- */
#rss-feed ul{ list-style: none; padding: 0; margin: 0; }
#rss-feed li{ padding: .6rem 0; border-bottom: 1px solid var(--rule); line-height: 1.6; }
#rss-feed .date{ font-size: .82rem; color: var(--muted); display: block; }
#rss-feed .desc{ font-size: .88rem; color: var(--muted); }

/* ---- Code ---- */
pre{ background: #fafafa; border: 1px solid var(--rule); padding: 12px; border-radius: 8px; overflow: auto; max-height: 420px; font-size: .85rem; line-height: 1.55; }
code{ font-family: var(--font-mono); font-size: .92em; }
p code, li code{ background: #f3f3f3; border-radius: 4px; padding: 0 4px; }

/* ---- Contact ---- */
.contact{ background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 16px 20px; }
.contact p{ margin: 0; }

/* ---- Footer ---- */
footer{
  margin-top: 3rem; padding-top: 1rem; padding-bottom: 2rem;
  border-top: 1px solid var(--rule); font-size: .9rem; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between;
}
footer a{ color: var(--muted); }
