:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --text: #17202a;
  --muted: #5d6875;
  --line: #e3e5e0;
  --accent: #0b6e6e;
  --accent-soft: #e2f0ee;
  --todo-bg: #fff1c2;
  --todo-text: #5c4400;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
:root[data-theme="dark"] {
  --bg: #10151a;
  --surface: #171e25;
  --text: #e6eaee;
  --muted: #9aa6b2;
  --line: #29333d;
  --accent: #5cc8c0;
  --accent-soft: #17343a;
  --todo-bg: #4a3b08;
  --todo-text: #ffe28a;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }

header.top { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 12px; padding-bottom: 12px; }
.brand { font: 600 20px var(--serif); color: var(--text); }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
nav a { color: var(--muted); padding: 6px 10px; border-radius: 6px; font-size: 15px; }
nav a:hover { background: var(--accent-soft); text-decoration: none; }
nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
button.theme, .chip { font: inherit; font-size: 14px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 4px 12px; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.25; margin: 0; }
h1 { font-size: clamp(30px, 5vw, 44px); }
h2 { font-size: 24px; margin-bottom: 18px; }
h3 { font-size: 18px; }
section { padding: 36px 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: 0; }
.page-head { padding: 40px 0 8px; }
.muted { color: var(--muted); }

.hero { display: grid; grid-template-columns: 1fr 240px; gap: 40px; align-items: center; padding: 52px 0 40px; border-bottom: 1px solid var(--line); }
.hero img { width: 240px; height: 240px; object-fit: cover; border-radius: 20px; border: 1px solid var(--line); }
.role { font-size: 18px; color: var(--accent); font-weight: 600; margin: 8px 0 14px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 14px; font-size: 14px; font-weight: 500; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.now { border-left: 4px solid var(--accent); }
.tag { display: inline-block; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid .card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.grid img, .grid svg { width: 100%; height: 190px; object-fit: contain; background: #fff; padding: 10px; font-size: 13px; }
.grid .body { padding: 16px 18px 18px; }
.grid p { margin: 8px 0 0; font-size: 14.5px; color: var(--muted); }

ul.news { list-style: none; margin: 0; padding: 0; }
ul.news li { display: grid; grid-template-columns: 90px 1fr; gap: 16px; padding: 9px 0; }
ul.news time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; }
details summary { cursor: pointer; color: var(--accent); margin-top: 10px; font-weight: 500; }

.pub { padding: 16px 0; border-top: 1px solid var(--line); }
.pub:first-of-type { border-top: 0; }
.pub h3 { font-size: 17px; }
.pub p { margin: 4px 0; font-size: 14.5px; color: var(--muted); }
.pub p b { color: var(--text); }
.year { font: 600 15px var(--sans); color: var(--muted); margin: 26px 0 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }

.job { display: grid; grid-template-columns: 170px 1fr; gap: 24px; padding: 18px 0; border-top: 1px solid var(--line); }
.job:first-of-type { border-top: 0; padding-top: 0; }
.job .when { color: var(--muted); font-size: 14px; }
.job ul { margin: 8px 0 0; padding-left: 18px; }

.project { display: grid; grid-template-columns: 320px 1fr; gap: 28px; align-items: start; }
.project img { width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }

.todo { background: var(--todo-bg); color: var(--todo-text); border-radius: 4px; padding: 0 5px; font-weight: 500; }
footer { color: var(--muted); font-size: 14px; padding: 28px 0 40px; border-top: 1px solid var(--line); }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 20px; }
  .hero img { order: -1; width: 160px; height: 160px; }
  .grid, .project, .job { grid-template-columns: 1fr; }
  .job { gap: 4px; }
  ul.news li { grid-template-columns: 1fr; gap: 0; }
  header.top { position: static; }
}

.detail { padding: 32px 0 40px; max-width: 760px; margin: 0 auto; }
.detail h1 { font-size: clamp(26px, 4vw, 34px); margin-bottom: 8px; }
.detail h2 { margin-top: 32px; }
.detail img { max-width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }

.logo { display: inline-flex; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; height: 46px; margin-bottom: 6px; }
.logo img { height: 28px; width: auto; max-width: 100%; }
.job .logo { display: flex; width: fit-content; max-width: 100%; }
.logos { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; padding: 22px 0 16px; border-bottom: 1px solid var(--line); }
