@font-face {
  font-family: 'GenSekiGothic2';
  src: url('fonts/GenSekiGothic2TW-L.woff2') format('woff2');
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: 'GenSekiGothic2';
  src: url('fonts/GenSekiGothic2TW-R.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'GenSekiGothic2';
  src: url('fonts/GenSekiGothic2TW-M.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #FFFFFF;
  --text: #171717;
  --text-secondary: #444444;
  --text-tertiary: #8C8C8C;
  --line: #EAEAEA;
  --accent: #FF2E9A;
  --sans: 'DM Sans', 'GenSekiGothic2', -apple-system, 'Helvetica Neue', 'PingFang TC', Arial, sans-serif;
  --zh: 'GenSekiGothic2', 'PingFang TC', 'Noto Sans TC', sans-serif;
  --hand: 'Roboto', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --track: 0.12em;
  --sidebar: 320px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 14.5px;
  font-weight: 400;
  letter-spacing: 0.03em;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #171717; color: #fff; }

a { color: inherit; text-decoration: none; }

.container {
  max-width: 820px;
  margin: 0;
  padding: 0 48px 0 56px;
}

/* ── Layout: left sidebar + main ── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
  max-width: 1320px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 96px 40px 56px 80px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: block;
  transition: color 0.25s ease;
  font-family: var(--hand);
  font-size: 1.5rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  line-height: 1.2;
}

.brand-zh {
  display: block;
  font-family: var(--zh);
  font-style: normal;
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-top: 8px;
}

.menu {
  list-style: none;
  margin-top: 110px;
}

.menu li { margin-bottom: 30px; }

.menu a {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: var(--track);
  text-transform: lowercase;
  color: var(--text);
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}


.menu a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.menu a.active { border-bottom-color: var(--text); }

.sidebar-foot {
  margin-top: auto;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: #B5B5B5;
  text-transform: lowercase;
}

.sidebar-foot a { color: var(--text-tertiary); }
.sidebar-foot a:hover { color: var(--accent); }

main { min-width: 0; }

.brand:hover { color: var(--accent); }

/* ── Header ── */
header {
  padding: 96px 0 80px;
}

.header-inner {
  display: flex;
  align-items: center;
}

.headshot {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  flex-shrink: 0;
}

.header-text { flex: 1; }

.name {
  font-family: var(--hand);
  font-size: 3rem;
  font-weight: 900;
  font-style: italic;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.name-zh {
  display: block;
  font-family: var(--zh);
  font-style: normal;
  font-weight: 300;
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-top: 10px;
  text-transform: none;
}

.tagline {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-top: 28px;
  font-weight: 300;
  letter-spacing: 0.08em;
  line-height: 1.7;
}

.contact-links {
  margin-top: 22px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.contact-links a {
  color: var(--text);
  border-bottom: 1px solid var(--line);
  transition: border-color 0.25s ease;
}

.contact-links a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.contact-links .sep { margin: 0 12px; color: var(--line); }

/* ── Sections ── */
section {
  padding: 90px 0;
  border-top: 1px solid var(--line);
}

h2 {
  font-family: var(--hand);
  font-size: 1.3rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: var(--text);
  margin-bottom: 36px;
}

/* ── About ── */
.about p {
  font-size: 1.15rem;
  line-height: 2;
  font-weight: 300;
  color: var(--text);
  max-width: 760px;
}

/* ── Publications ── */
.filter-controls {
  margin-bottom: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 30px;
}

.filter-btn {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 300;
  letter-spacing: var(--track);
  text-transform: lowercase;
  padding: 0 0 4px;
  border: none;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.filter-btn:hover { color: var(--accent); }

.filter-btn.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

.pub-category-group { margin-bottom: 34px; }
.pub-category-group:last-child { margin-bottom: 0; }

.pub-category-label {
  font-family: var(--hand);
  font-size: 1.05rem;
  font-weight: 900;
  font-style: italic;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-bottom: 8px;
}

.pub-item {
  padding: 4px 0;
  line-height: 1.5;
}

.pub-title-en {
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.pub-title-en a {
  color: var(--text);
  transition: color 0.2s ease;
}

.pub-title-en a:hover { color: var(--accent); }

.pub-date {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pub-links {
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.pub-links a {
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--line);
}

.pub-links a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.pub-sub {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-tertiary);
  margin-top: -1px;
  margin-bottom: 4px;
}

.pub-sub .dot { color: var(--line); }

.pub-title-zh {
  font-family: var(--zh);
  font-weight: 300;
  letter-spacing: 0.04em;
}

.pub-coauthors { }

/* ── Experience ── */
.exp-item {
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.exp-item:last-child { border-bottom: 1px solid var(--line); }

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 24px;
}

.exp-title {
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.exp-dates {
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.exp-org {
  font-size: 0.86rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.exp-desc {
  font-size: 0.86rem;
  color: var(--text-tertiary);
  margin-top: 10px;
  line-height: 1.8;
  max-width: 680px;
}

/* ── Education ── */
.edu-item {
  padding: 26px 0;
  border-top: 1px solid var(--line);
}

.edu-item:last-child { border-bottom: 1px solid var(--line); }

.edu-school {
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.edu-detail {
  font-size: 0.86rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.edu-note {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 6px;
  line-height: 1.7;
}

/* ── Footer ── */
footer {
  padding: 60px 0 50px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.76rem;
  letter-spacing: var(--track);
  text-transform: lowercase;
  color: var(--text-tertiary);
}

footer a {
  color: var(--text);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}

footer a:hover { color: var(--accent); border-bottom-color: var(--accent); }

footer .sep { margin: 0 14px; color: var(--line); }

.footer-tagline {
  margin-top: 22px;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: #B5B5B5;
}

/* ── Responsive ── */
@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    padding: 40px 24px 8px;
  }
  .menu { margin-top: 32px; }
  .menu li { display: inline-block; margin: 0 24px 14px 0; }
  .menu a { font-size: 0.9rem; }
  .sidebar-foot { display: none; }
  .container { padding: 0 24px; }

  header { padding: 24px 0 56px; }
  .header-inner { align-items: flex-start; text-align: left; gap: 0; }
  .name { font-size: 2.4rem; }
  .name-zh { font-size: 1.15rem; }

  section { padding: 56px 0; }
  .about p { font-size: 1.02rem; }
  .exp-header { flex-direction: column; }
}

/* ── Page header (inner pages) ── */
.page-header {
  padding: 96px 0 44px;
}

.page-title {
  font-family: var(--hand);
  font-size: 2.4rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  line-height: 1.2;
}

.page-intro {
  font-size: 0.88rem;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  margin-top: 14px;
  max-width: 720px;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-body {
  padding: 60px 0 100px;
}

/* ── Narrative (about) ── */
.narrative p {
  font-size: 0.98rem;
  line-height: 1.7;
  font-weight: 300;
  max-width: 720px;
  margin-bottom: 24px;
}

.narrative p:last-child { margin-bottom: 0; }

.narrative a {
  border-bottom: 1px solid var(--line);
  transition: border-color 0.25s ease;
}

.narrative a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Home intro + section tiles ── */
.intro p {
  font-size: 0.98rem;
  line-height: 1.7;
  font-weight: 300;
  max-width: 720px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  margin-top: 60px;
}

.tile {
  display: block;
  padding: 40px 32px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background 0.3s ease;
}

.tile:hover { background: #FAFAFA; }

.tile-name {
  font-family: var(--hand);
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  font-weight: 900;
  font-style: italic;
}

.tile-desc {
  font-size: 0.86rem;
  color: var(--text-tertiary);
  margin-top: 10px;
  line-height: 1.7;
}

.tile-arrow {
  display: inline-block;
  margin-top: 18px;
  font-size: 0.9rem;
  color: var(--text-tertiary);
  transition: transform 0.3s ease, color 0.3s ease;
}

.tile:hover .tile-arrow { transform: translateX(6px); color: var(--accent); }

.empty-note {
  font-size: 0.86rem;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  padding: 40px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

@media (max-width: 720px) {
  .page-header { padding: 24px 0 32px; }
  .page-title { font-size: 2rem; }
  .page-body { padding: 32px 0 60px; }
  .tiles { grid-template-columns: 1fr; }
  .tile { padding: 26px 22px; }
  .narrative p, .intro p { font-size: 1rem; }
}

