/* =========================================================
   Sicheng Zhou — Academic Website
   Editorial minimalist theme
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:            #fbf9f4;
  --bg-elevated:   #ffffff;
  --bg-subtle:     #f3efe5;
  --ink:           #1a1a1a;
  --ink-soft:      #4a4a4a;
  --ink-muted:     #7a7370;
  --rule:          #d9d3c4;
  --rule-strong:   #b8b0a0;
  --accent:        #8b2c1d;
  --accent-soft:   #c75a3f;
  --highlight:     #f0e5c8;

  --font-display:  'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --font-body:     'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:     'JetBrains Mono', ui-monospace, Menlo, monospace;

  --measure:       72ch;
  --sidebar-w:     280px;
  --gutter:        clamp(1.2rem, 3vw, 2.5rem);
  --section-gap:   clamp(2rem, 5vw, 3.5rem);

  --ease:          cubic-bezier(.2, .6, .2, 1);
}

[data-theme="dark"] {
  --bg:            #14110d;
  --bg-elevated:   #1c1916;
  --bg-subtle:     #221d18;
  --ink:           #f0ebe0;
  --ink-soft:      #c4bdaf;
  --ink-muted:     #8a8275;
  --rule:          #3a342c;
  --rule-strong:   #5a5145;
  --accent:        #e07a5f;
  --accent-soft:   #f0a78a;
  --highlight:     #2a2218;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 15% 10%, rgba(139, 44, 29, .035), transparent 50%),
    radial-gradient(ellipse at 90% 90%, rgba(139, 44, 29, .025), transparent 50%);
  background-attachment: fixed;
  font-feature-settings: 'kern', 'liga', 'calt';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
[data-theme="dark"] body {
  background-image:
    radial-gradient(ellipse at 15% 10%, rgba(224, 122, 95, .04), transparent 50%),
    radial-gradient(ellipse at 90% 90%, rgba(224, 122, 95, .03), transparent 50%);
}

img { max-width: 100%; display: block; }
a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
a:hover { color: var(--accent-soft); border-bottom-color: currentColor; }

.page {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
}

.sidebar {
  border-right: 1px solid var(--rule);
  padding: 3rem var(--gutter) 2rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }

.identity { text-align: center; margin-bottom: 2rem; }
.portrait {
  width: 168px; height: 168px;
  border-radius: 50%;
  margin: 0 auto 1.25rem;
  object-fit: cover;
  border: 1px solid var(--rule);
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: transparent; /* hide alt text when image fails to load */
  font-size: 0;
  box-shadow:
    0 1px 2px rgba(0,0,0,.04),
    0 8px 24px rgba(0,0,0,.06);
  transition: transform .4s var(--ease);
}
.portrait:hover { transform: scale(1.02); }

.name {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 .25rem;
  letter-spacing: -.01em;
  color: var(--ink);
}
.name-cn {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-muted);
  margin: 0 0 1rem;
}
.affiliation {
  font-size: .85rem;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}
.affiliation strong { color: var(--ink); font-weight: 600; }

.socials { display: flex; justify-content: center; gap: .75rem; margin-bottom: 2rem; }
.socials a {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--ink-soft);
  transition: all .2s var(--ease);
}
.socials a:hover {
  color: var(--bg);
  background: var(--ink);
  border-color: var(--ink);
  transform: translateY(-2px);
}
.socials svg { width: 16px; height: 16px; }

.nav { display: flex; flex-direction: column; gap: .125rem; }
.nav a {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  padding: .6rem .8rem;
  color: var(--ink-soft);
  border: none;
  border-radius: 4px;
  font-size: .95rem;
  letter-spacing: .01em;
  transition: all .2s var(--ease);
}
.nav a .num {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--ink-muted);
  letter-spacing: .05em;
}
.nav a:hover { background: var(--bg-subtle); color: var(--ink); }
.nav a.active { color: var(--accent); font-weight: 500; }
.nav a.active .num { color: var(--accent); }

.theme-toggle {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  font-size: .78rem;
  color: var(--ink-muted);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.theme-toggle button {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  width: 40px; height: 22px;
  border-radius: 11px;
  cursor: pointer;
  position: relative;
  padding: 0;
  transition: all .2s var(--ease);
}
.theme-toggle button::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--ink-soft);
  transition: transform .25s var(--ease);
}
[data-theme="dark"] .theme-toggle button::after {
  transform: translateX(18px);
  background: var(--accent);
}

.main { padding: 4rem var(--gutter) 5rem; max-width: 920px; }

.page-header { margin-bottom: var(--section-gap); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--accent);
  letter-spacing: .25em;
  text-transform: uppercase;
  margin: 0 0 .8rem;
}
.page-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 3.6rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.015em;
  margin: 0;
  color: var(--ink);
}
.page-title em { font-style: italic; color: var(--accent); font-weight: 400; }
.lede {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink-soft);
  margin-top: 1rem;
  max-width: 60ch;
  line-height: 1.5;
}

.prose { max-width: var(--measure); }
.prose p {
  margin: 0 0 1.1rem;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--ink-soft);
}
.prose p strong { color: var(--ink); font-weight: 600; }

.section { margin-bottom: var(--section-gap); }
.section-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -.005em;
  color: var(--ink);
  margin: 0 0 1.25rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: baseline;
  gap: .8rem;
}
.section-title .sub {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--ink-muted);
  letter-spacing: .15em;
  text-transform: uppercase;
  font-weight: 400;
}

.pubs { list-style: none; padding: 0; margin: 0; }
.pub {
  padding: 1.1rem 0;
  border-bottom: 1px dashed var(--rule);
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
}
.pub:last-child { border-bottom: none; }
.pub .year {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--ink-muted);
  letter-spacing: .05em;
  padding-top: .15rem;
}
.pub-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 .25rem;
  line-height: 1.35;
}
.pub-authors {
  font-size: .92rem;
  color: var(--ink-soft);
  margin: 0 0 .35rem;
  line-height: 1.55;
}
.pub-authors .me { color: var(--ink); font-weight: 600; }
.pub-venue {
  font-size: .88rem;
  color: var(--ink-muted);
  font-style: italic;
  margin: 0 0 .4rem;
}
.pub-venue .badge {
  display: inline-block;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: .1rem .5rem;
  border-radius: 3px;
  background: var(--highlight);
  color: var(--accent);
  margin-left: .4rem;
  border: 1px solid var(--rule);
}
.pub-links {
  display: flex;
  gap: .8rem;
  font-size: .82rem;
  font-family: var(--font-mono);
}
.pub-links a {
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
}

.news { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.news li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: .95rem;
}
.news .date {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--accent);
  letter-spacing: .05em;
  padding-top: .15rem;
}
.news .what { color: var(--ink-soft); line-height: 1.55; }
.news .what strong { color: var(--ink); font-weight: 600; }

.awards-list { list-style: none; padding: 0; margin: 0; }
.awards-list li {
  padding: .8rem 0;
  border-bottom: 1px dashed var(--rule);
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
  font-size: .98rem;
  color: var(--ink-soft);
  line-height: 1.55;
}
.awards-list li:last-child { border-bottom: none; }
.awards-list .year {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--ink-muted);
  padding-top: .15rem;
}
.awards-list strong { color: var(--ink); font-weight: 600; }

.scholar-card {
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--bg-elevated);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
}
.scholar-card .metrics { display: flex; gap: 1.8rem; }
.scholar-card .metric { text-align: center; }
.scholar-card .metric-val {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}
.scholar-card .metric-lbl {
  font-family: var(--font-mono);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-muted);
  margin-top: .35rem;
}
.scholar-card .scholar-icon {
  width: 48px; height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--highlight);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.scholar-card .scholar-note {
  font-size: .82rem;
  color: var(--ink-muted);
  margin-top: .8rem;
  grid-column: 1 / -1;
  border-top: 1px dashed var(--rule);
  padding-top: .8rem;
}
.scholar-card .scholar-note a {
  font-family: var(--font-mono);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.cv-frame-wrap {
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-elevated);
  margin-top: 1.5rem;
  aspect-ratio: 8.5 / 11;
  max-height: 90vh;
}
.cv-frame-wrap iframe { width: 100%; height: 100%; border: none; }
.cv-actions { display: flex; gap: .8rem; margin-top: 1rem; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1rem;
  font-family: var(--font-mono);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  border: 1px solid var(--ink);
  color: var(--ink);
  border-radius: 3px;
  transition: all .2s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--bg); border-bottom-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-soft); border-color: var(--accent-soft); }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.gallery figure {
  margin: 0;
  border: 1px solid var(--rule);
  background: var(--bg-elevated);
  border-radius: 4px;
  overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.gallery figure:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,.08); }
.gallery img {
  width: 100%; aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--bg-subtle);
  color: transparent;
  font-size: 0;
}
.gallery figcaption {
  padding: .85rem 1rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink);
  border-top: 1px solid var(--rule);
}

.foot {
  margin-top: var(--section-gap);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--ink-muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
}

.flourish {
  text-align: center;
  margin: 2rem 0;
  color: var(--rule-strong);
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: .8em;
}

@media (max-width: 880px) {
  .page { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 2rem var(--gutter) 1.5rem;
  }
  .identity { margin-bottom: 1.25rem; }
  .portrait { width: 132px; height: 132px; }
  .nav { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: .25rem; }
  .nav a { padding: .45rem .7rem; font-size: .88rem; }
  .nav a .num { display: none; }
  .theme-toggle { margin-top: 1rem; justify-content: center; }
  .main { padding: 2.5rem var(--gutter) 3.5rem; }
  .pub, .awards-list li, .news li { grid-template-columns: 1fr; gap: .2rem; }
  .pub .year, .awards-list .year, .news .date { margin-bottom: .2rem; }
  .scholar-card { grid-template-columns: 1fr; text-align: center; }
  .scholar-card .metrics { justify-content: center; flex-wrap: wrap; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.main > * { animation: fadeUp .6s var(--ease) both; }
.main > *:nth-child(1) { animation-delay: .05s; }
.main > *:nth-child(2) { animation-delay: .15s; }
.main > *:nth-child(3) { animation-delay: .25s; }
.main > *:nth-child(4) { animation-delay: .35s; }
.main > *:nth-child(5) { animation-delay: .45s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
