/* Academic personal site — light/dark themes */

:root {
  --font-sans: "Source Sans 3", system-ui, -apple-system, sans-serif;
  --font-serif: "Source Serif 4", Georgia, serif;

  --bg: #fafafa;
  --bg-sidebar: #e6f1e8;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-muted: #4a5568;
  --accent: #177A2B;
  --accent-hover: #0f5a1f;
  --border: #e2e8f0;
  --shadow: rgba(15, 23, 42, 0.08);
  --blockquote-bg: #f1f5f9;
  --toggle-bg: #e2e8f0;
}

[data-theme="dark"] {
  --bg: #0f1419;
  --bg-sidebar: #14211a;
  --surface: #1a2332;
  --text: #e8edf4;
  --text-muted: #94a3b8;
  --accent: #4caf63;
  --accent-hover: #6fd083;
  --border: #2d3a4d;
  --shadow: rgba(0, 0, 0, 0.35);
  --blockquote-bg: #1e293b;
  --toggle-bg: #334155;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  transition: background 0.2s ease, color 0.2s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Theme toggle */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform 0.15s ease;
}

.theme-toggle:hover {
  transform: scale(1.05);
}

.theme-toggle__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.theme-toggle__icon {
  font-size: 1.15rem;
  line-height: 1;
}

[data-theme="dark"] .theme-toggle__icon--sun {
  display: none;
}

html:not([data-theme="dark"]) .theme-toggle__icon--moon {
  display: none;
}

/* Centered outer wrapper */
.page-wrapper {
  max-width: 1100px;
  margin: 0 auto;
}

/* Layout: sidebar + main */
.page {
  display: grid;
  min-height: 100vh;
}

@media (min-width: 900px) {
  .page {
    grid-template-columns: minmax(260px, 300px) 1fr;
  }
}

/* Sidebar */
.sidebar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 900px) {
  .sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    overflow-y: auto;
    border-bottom: none;
    border-right: none;
  }
}

.sidebar__inner {
  padding: 3rem 2rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (min-width: 900px) {
  .sidebar__inner {
    padding: 6rem 2rem 2.5rem;
  }
}

.profile {
  margin: 0 0 1.5rem;
}

.profile__photo {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--surface);
  box-shadow: 0 4px 20px var(--shadow);
}

@media (min-width: 900px) {
  .profile__photo {
    width: 180px;
    height: 180px;
  }
}

.profile__name {
  margin: 0.75rem 0 0.25rem;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
}

@media (min-width: 900px) {
  .profile__name {
    font-size: 1.9rem;
  }
}

.contact-list {
  display: inline-block;
  list-style: none;
  margin: 0 auto;
  padding: 0;
  text-align: left;
}

.contact-list li {
  margin-bottom: 0.5rem;
}

.contact-list a,
.contact-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-size: 0.95rem;
}

.contact-list a:hover {
  color: var(--accent);
  text-decoration: none;
}

.contact-list__icon {
  flex-shrink: 0;
  width: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Main */
.main {
  max-width: none;
  width: 100%;
  padding: 1.5rem 1.25rem 3rem;
  margin: 0;
}

@media (min-width: 900px) {
  .main {
    padding: 6rem 3.5rem 4rem;
  }
}

.hero__title {
  margin: 0 0 1rem;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.hero__lead {
  font-size: 1.1rem;
}

.section {
  margin-top: 2.5rem;
  padding-top: 0.5rem;
}

.section__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0 1rem;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--border);
}

@media (min-width: 900px) {
  .section__title {
    font-size: 1.5rem;
  }
}

.section__title-link {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text);
}

.section__title-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.subsection__title {
  margin: 1.1rem 0 0.4rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--accent);
}

.subsection__title:first-of-type {
  margin-top: 0.5rem;
}

.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pub-item {
  margin-bottom: 1.35rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--border);
}

.pub-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.pub-list--compact .pub-item {
  margin-bottom: 0.45rem;
  padding-bottom: 0;
  border-bottom: none;
}

.pub-item__title {
  display: block;
  margin: 0;
  line-height: 1.35;
  font-size: 0.95rem;
  font-weight: 600;
}

.pub-venue {
  color: #565E58;
  font-weight: 700;
}

.pub-item__authors {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.85rem;
  line-height: 1.3;
  color: var(--text-muted);
}

.pub-cofirst {
  font-style: italic;
}

.pub-footnote {
  margin: 1.25rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pub-fulllist {
  margin: 0.25rem 0 1rem;
  font-size: 0.9rem;
}

.pub-item__title a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

.pub-item__title a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  margin-bottom: 0.6rem;
}

.timeline__date {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.timeline__detail {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* Service */
.service-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.service-list li {
  margin-bottom: 0.45rem;
  font-size: 0.95rem;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.site-footer p {
  margin: 0.25rem 0;
}

.site-footer__credit {
  font-size: 0.8rem;
}
