:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1d2430;
  --muted: #5a6473;
  --accent: #17324d;
  --accent-soft: #e6ecf3;
  --link: #1f5f99;
  --rule: #e3e1db;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --surface: #1a2029;
    --text: #e4e7ec;
    --muted: #9aa4b2;
    --accent: #b9cde3;
    --accent-soft: #223041;
    --link: #8cbcf0;
    --rule: #2a323d;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); color: var(--accent); line-height: 1.25; }
h2 { font-size: 1.6rem; margin: 0 0 1rem; font-weight: 600; }
h3 { font-size: 1.1rem; margin: 1.6rem 0 .5rem; font-weight: 600; }

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: 1040px; margin: 0 auto; padding: .75rem 16px;
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; color: var(--accent); }
.nav-links { display: flex; gap: 1.1rem; flex-wrap: wrap; margin-left: auto; font-size: .92rem; }
.nav-links a { color: var(--muted); }
.nav-links a:hover, .nav-links a.active { color: var(--accent); text-decoration: none; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
section { padding: 3rem 0; border-bottom: 1px solid var(--rule); }
section:last-of-type { border-bottom: 0; }

/* Hero */
.hero { display: grid; grid-template-columns: 200px 1fr; gap: 2.5rem; align-items: start; padding: 3.5rem 0 3rem; }
.portrait {
  width: 200px; height: 250px; border-radius: 10px; object-fit: cover; object-position: center top;
  background: var(--accent-soft); display: grid; place-items: center;
  font-family: var(--serif); font-size: 3.4rem; color: var(--accent);
}
.hero h1 { font-size: 2.6rem; margin: 0 0 .25rem; }
.hero .role { font-size: 1.05rem; color: var(--muted); margin: 0 0 1.1rem; }
.hero p { margin: 0 0 .9rem; max-width: 62ch; }
.links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.2rem; }
.btn {
  display: inline-block; padding: .38rem .85rem; border: 1px solid var(--rule);
  border-radius: 999px; font-size: .88rem; color: var(--text); background: var(--surface);
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* Content blocks */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 2.5rem; }
.tags { display: flex; flex-wrap: wrap; gap: .45rem; padding: 0; margin: 0; list-style: none; }
.tags li { background: var(--accent-soft); color: var(--accent); padding: .3rem .75rem; border-radius: 6px; font-size: .9rem; }
.theme { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 1.1rem 1.25rem; }
.theme h3 { margin-top: 0; }
.theme p { margin: 0; color: var(--muted); font-size: .95rem; }

ul.plain { padding-left: 1.1rem; margin: .3rem 0; }
ul.plain li { margin: .3rem 0; }

.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.book { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--accent); border-radius: 8px; padding: .9rem 1rem; }
.book .t { font-family: var(--serif); font-weight: 600; color: var(--text); display: block; margin-bottom: .3rem; line-height: 1.35; }
.book .m { font-size: .85rem; color: var(--muted); }

.pub { padding: .6rem 0; border-bottom: 1px dashed var(--rule); }
.pub:last-child { border-bottom: 0; }
.pub .t { font-weight: 600; }
.pub .m { color: var(--muted); font-size: .92rem; }
.badge { display: inline-block; font-size: .72rem; padding: .05rem .45rem; border-radius: 4px; background: #f3e3c3; color: #6b4a0f; margin-left: .35rem; vertical-align: 2px; }
@media (prefers-color-scheme: dark) { .badge { background: #4a3a1c; color: #f1d9a6; } }

.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .6rem 2rem; }
.people div { font-size: .95rem; }
.people .n { font-weight: 600; }
.people .d { color: var(--muted); font-size: .88rem; }

footer { padding: 2rem 0 3rem; color: var(--muted); font-size: .85rem; }

/* Publications page */
.pub-tools { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin: 1rem 0 2rem; }
.pub-tools input {
  flex: 1 1 280px; padding: .55rem .8rem; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px;
}
.pub-tools .count { color: var(--muted); font-size: .9rem; }
.pub-toc { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
ol.publist { list-style: none; padding: 0; margin: 0; }
ol.publist li { display: grid; grid-template-columns: 58px 1fr; gap: .75rem; padding: .55rem 0; border-bottom: 1px dashed var(--rule); font-size: .95rem; }
ol.publist li .k { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; padding-top: .15rem; }
ol.publist li[hidden] { display: none; }

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 2rem; }
  .portrait { width: 140px; height: 175px; font-size: 2.4rem; }
  .hero h1 { font-size: 2rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .nav-links { margin-left: 0; gap: .8rem; }
  ol.publist li { grid-template-columns: 1fr; gap: 0; }
}

/* Sample-chapter manuscripts */
.samples { display: grid; gap: 1.25rem; }
.sample {
  display: grid; grid-template-columns: 150px 1fr; gap: 1.5rem; align-items: start;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 1.25rem;
}
.sample img { width: 150px; height: auto; display: block; border-radius: 4px; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.sample .t { display: block; font-family: var(--serif); font-weight: 600; font-size: 1.15rem; color: var(--text); line-height: 1.35; }
.sample .m { display: block; color: var(--muted); font-size: .88rem; margin: .2rem 0 0; }
.sample p { margin: .6rem 0 0; font-size: .95rem; }
.sample .btn { margin-top: .9rem; }
@media (max-width: 720px) {
  .sample { grid-template-columns: 96px 1fr; gap: 1rem; padding: 1rem; }
  .sample img { width: 96px; }
}

/* Contact language tabs */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--rule); margin-bottom: 1.1rem; }
.tabs button {
  font: inherit; font-size: .92rem; color: var(--muted); background: none; cursor: pointer;
  border: 0; border-bottom: 2px solid transparent; padding: .45rem .9rem; margin-bottom: -1px;
}
.tabs button:hover { color: var(--accent); }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tabs button:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
.tab-panel p { max-width: 68ch; }
:lang(ja) { font-family: var(--sans), "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif; line-height: 1.8; }
