/* ========================================
   THEME: Editorial Warm

   Design principles applied:
   - Font pairing: Source Serif 4 (headings) + Inter (body)
   - CJK: Noto Serif SC (headings) + Noto Sans SC (body)
   - Type scale: Minor Third (1.2x) ratio
   - Color: Near-monochrome + single warm accent (#A8613D)
   - Line-height: 1.6 body, 1.3 headings
   - Letter-spacing: -0.02em on headings
   ======================================== */

:root {
  /* --- Colors ---
     Near-monochrome palette with warm undertone.
     Single accent color for restraint. */
  --color-bg: #FAF9F7;
  --color-surface: #FFFFFF;
  --color-text: #1D1D1F;
  --color-text-secondary: #636366;
  --color-accent: #A8613D;
  --color-accent-hover: #8B4E30;
  --color-accent-glow: rgba(168, 97, 61, 0.1);
  --color-highlight: #A8613D;
  --color-divider: #D5D0C8;
  --color-nav-bg: rgba(250, 249, 247, 0.92);

  /* --- Typography ---
     Source Serif 4 + Noto Serif SC: headings
     Inter + Noto Sans SC: body text
     JetBrains Mono: dates, code */
  --font-heading: 'Source Serif 4', 'Noto Serif SC', Georgia, serif;
  --font-body: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Menlo', monospace;
  --font-size-base: 16px;

  /* Type scale — Minor Third (1.2x) */
  --size-xs: 0.694rem;
  --size-sm: 0.833rem;
  --size-base: 1rem;
  --size-lg: 1.2rem;
  --size-xl: 1.44rem;
  --size-2xl: 1.728rem;
  --size-3xl: 2.488rem;

  /* --- Spacing --- */
  --space-section: 3.5rem;
  --space-page-x: 1.5rem;
  --content-width: 780px;

  /* --- Shapes --- */
  --profile-radius: 12px;
  --card-radius: 6px;

  /* --- Shadows --- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07);

  /* --- Timeline --- */
  --timeline-gradient: linear-gradient(to bottom, #1D1D1F, #A8613D);

}

/* ---- Dark Mode ---- */
[data-theme="dark"] {
  --color-bg: #1A1917;
  --color-surface: #23221F;
  --color-text: #E8E8E3;
  --color-text-secondary: #94938E;
  --color-accent: #E0A070;
  --color-accent-hover: #EBB88A;
  --color-accent-glow: rgba(224, 160, 112, 0.1);
  --color-highlight: #E0A070;
  --color-divider: #36342F;
  --color-nav-bg: rgba(26, 25, 23, 0.92);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ---- Tags ----
   Warm-toned pastels, equal weight — no hierarchy */
.tag-journal {
  background: #DABB96;
  color: #5C4225;
}

.tag-oral {
  background: #B8CFA0;
  color: #3A5020;
}

.tag-invited {
  background: #C0C4D0;
  color: #3C4050;
}

.tag-poster {
  background: #BDD0C4;
  color: #304840;
}

.tag-preprint {
  background: #D0B8B0;
  color: #5A3E38;
}

[data-theme="dark"] .tag-journal {
  background: #4D3E28;
  color: #DABB96;
}

[data-theme="dark"] .tag-oral {
  background: #304528;
  color: #B8CFA0;
}

[data-theme="dark"] .tag-invited {
  background: #30343E;
  color: #C0C4D0;
}

[data-theme="dark"] .tag-poster {
  background: #283830;
  color: #BDD0C4;
}

[data-theme="dark"] .tag-preprint {
  background: #443430;
  color: #D0B8B0;
}

/* ---- Hero spiral k-space trajectory (drawn via JS canvas) ---- */

/* ---- Selection ---- */
::selection {
  background: rgba(168, 97, 61, 0.2);
  color: inherit;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-divider); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-secondary); }

/* ---- Section title ----
   Serif heading with accent underline */
.section-title {
  position: relative;
  display: inline-block;
  font-size: var(--size-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-title::after {
  content: '';
  display: block;
  width: 32px;
  height: 2px;
  background: var(--color-accent);
  margin-top: 0.4rem;
  border-radius: 1px;
}

/* ---- Subsection title ---- */
.subsection-title {
  font-family: var(--font-heading);
  font-size: var(--size-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  border-bottom-color: var(--color-divider);
  border-bottom-width: 1px;
}

/* ---- Card hover ---- */
.pub-card {
  transition: box-shadow 0.3s cubic-bezier(.22, 1, .36, 1),
              border-color 0.2s ease,
              background-color 0.3s ease;
}

.pub-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}

/* ---- Publication title — serif ---- */
.pub-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--size-base);
  letter-spacing: -0.01em;
}

/* ---- Publication links ---- */
.pub-links a {
  color: var(--color-accent);
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: border-color 0.2s ease;
}

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

/* ---- News hover ---- */
.news-item {
  transition: background-color 0.2s ease;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: 4px;
}

.news-item:hover {
  background: var(--color-accent-glow);
}

/* ---- Presentation hover ---- */
.pres-item {
  transition: background-color 0.2s ease;
}

.pres-item:hover {
  background: var(--color-accent-glow);
}

/* ---- Hero name — serif ---- */
.hero-name {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: var(--size-3xl);
}

/* ---- Hero Chinese name ---- */
.hero-name-cn {
  font-family: 'Noto Serif SC', serif;
  font-weight: 400;
  font-size: var(--size-xl);
}

/* ---- Pronunciation ---- */
.hero-pronunciation {
  font-size: var(--size-sm);
}

.hero-pronunciation em {
  font-style: italic;
}

/* ---- Profile image ---- */
.profile-img {
  border: none;
  box-shadow: var(--shadow-md);
}

.profile-img:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .profile-img:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

/* ---- Links ---- */
a {
  color: var(--color-accent);
}

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

/* ---- Nav ---- */
.nav-links a {
  color: var(--color-text-secondary);
  font-family: var(--font-body);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-text);
}

.nav-links a::after {
  background: var(--color-accent);
  height: 1.5px;
}

.nav .nav-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--size-lg);
  color: var(--color-text);
  letter-spacing: -0.02em;
}

/* ---- Wave divider — Fourier harmonics ---- */
.wave-divider {
  color: var(--color-accent);
}

.wave-divider svg path {
  stroke-dasharray: 2400;
  stroke-dashoffset: 2400;
  animation: drawWave 3s ease forwards;
}

.wave-divider svg path:nth-child(1) {
  stroke-width: 1.2;
  opacity: 0.4;
  animation-delay: 0s;
}

.wave-divider svg path:nth-child(2) {
  stroke-width: 0.8;
  opacity: 0.25;
  animation-delay: 0.4s;
}

.wave-divider svg path:nth-child(3) {
  stroke-width: 0.5;
  opacity: 0.15;
  animation-delay: 0.8s;
}

@keyframes drawWave {
  to { stroke-dashoffset: 0; }
}

/* ---- Footer ---- */

.footer-links a {
  font-family: var(--font-body);
  font-size: var(--size-sm);
}

/* ---- Timeline ---- */
.timeline-dot {
  width: 10px;
  height: 10px;
  border-width: 2px;
}

.timeline-current .timeline-dot {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

/* ---- Dates — mono for tabular alignment ---- */
.news-date,
.pres-date {
  font-family: var(--font-mono);
  font-size: var(--size-sm);
  color: var(--color-text-secondary);
}

/* ---- Tags ---- */
.pres-tag {
  font-family: var(--font-body);
  font-size: var(--size-xs);
  letter-spacing: 0.06em;
}

/* ---- Publication venue — serif ---- */
.pub-venue {
  font-family: var(--font-heading);
}

/* ---- Map legend dots — colors work in both light & dark ---- */
.dot-lived { background: #C47A50; }
.dot-conference { background: #5A9BD5; }
.dot-collaborator { background: #7BC47B; }

/* ---- Pub tag ---- */
.pub-tag {
  font-family: var(--font-body);
}
