/* ============================================================
   Personal academic homepage — sticky profile sidebar + scrolling content.
   Restrained, document-like academic style on a warm paper tone.
   Edit the variables below to re-theme the whole site at once.
   ============================================================ */

:root {
  /* Colors */
  --bg:           #faf9f7;   /* warm paper white (not stark) */
  --bg-soft:      #f1efe9;   /* faint fill for placeholders */
  --text:         #1a1a1a;   /* near-black ink */
  --text-soft:    #6b6b70;   /* muted secondary text */
  --line:         #e4e2dd;   /* hairline rules */
  --accent:       #8c1515;   /* Stanford cardinal — links only, sparing */
  --accent-soft:  #a83232;
  --nav-bg:       rgba(250, 249, 247, 0.86);

  /* Type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;

  /* Layout */
  --maxw: 1060px;            /* page width: top bar + two-column grid */
  --nav-h: 64px;
  --radius: 6px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------------------------- Navbar ---------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;        /* no brand — section links sit to the right */
}

.nav-links { display: flex; gap: 26px; }
.nav-links a {
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
  margin-right: auto;               /* keep it on the left when the bar collapses */
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

/* ---------------------------- Layout: sticky sidebar + content ---------------------------- */
.layout {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 52px;
  align-items: start;
}

/* Left identity rail — stays in view while the right column scrolls */
.sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 36px);
  align-self: start;
  padding-top: 42px;
}
.side-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.side-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 18%;      /* bias toward the face */
  transform: scale(1.05);           /* zoom in a touch — raise/lower to taste */
  transform-origin: center 20%;
  display: block;
}
.side-name {
  font-family: var(--font-serif);
  font-size: 1.45rem; font-weight: 600;
  letter-spacing: -0.01em;
  margin: 16px 0 4px;
}
.side-tagline {
  color: var(--text-soft);
  font-size: 0.9rem; line-height: 1.5;
  margin: 0 0 16px;
}

/* ---------------------------- Sections (right column) ---------------------------- */
.section {
  padding: 44px 0;
  scroll-margin-top: var(--nav-h);   /* offset sticky nav on anchor jump */
}
.section + .section { border-top: 1px solid var(--line); }
.section:first-child { padding-top: 40px; }

.section-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;                  /* tight so it lines up with the photo top */
  margin: 0 0 26px;
  letter-spacing: -0.01em;
}
.section-note { color: var(--text-soft); font-size: 0.9rem; margin: -14px 0 26px; }

/* ---------------------------- Social / contact ---------------------------- */
.social-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.social {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-soft);
  transition: color 0.18s ease, border-color 0.18s ease;
}
.social svg { width: 18px; height: 18px; fill: currentColor; }
.social:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}
.social-cv { width: auto; padding: 0 14px; gap: 7px; font-weight: 600; font-size: 0.88rem; }

/* ---------------------------- News ---------------------------- */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li {
  display: flex; gap: 18px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.news-list li:last-child { border-bottom: 0; }
.news-date {
  flex: 0 0 64px;
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.9rem;
  padding-top: 1px;
}
.news-text { color: var(--text); }

/* ---------------------------- Publications ---------------------------- */
/* Text-forward reference list — uppercase venue "eyebrow", accent bar on hover. */
.pub {
  position: relative;
  padding: 18px 0 18px 16px;
  border-bottom: 1px solid var(--line);
}
.pub:last-child { border-bottom: 0; }
.pub::before {                       /* cardinal bar that slides in on hover */
  content: "";
  position: absolute;
  left: 0; top: 16px; bottom: 16px;
  width: 2px; border-radius: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.pub:hover::before { opacity: 1; }
.pub-venue {
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 5px;
}
.pub-venue em { font-style: normal; font-weight: 600; color: inherit; }
.pub-title { font-size: 1.12rem; font-weight: 600; line-height: 1.38; margin: 0 0 5px; }
.pub-authors { margin: 0 0 4px; color: var(--text-soft); font-size: 0.94rem; }
.pub-authors strong { color: var(--text); }
.pub-links { display: flex; flex-wrap: wrap; gap: 16px; }
.pub-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--accent);
}
.pub-links a:hover { text-decoration: underline; }

/* ---------------------------- Talks ---------------------------- */
.talk-list { list-style: none; margin: 0; padding: 0; }
.talk-list li {
  display: flex; gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.talk-list li:last-child { border-bottom: 0; }
.talk-date {
  flex: 0 0 86px;
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  padding-top: 1px;
}
.talk-text { color: var(--text); }
.talk-title { font-weight: 600; }
.talk-meta { color: var(--text-soft); }

/* ---------------------------- Awards ---------------------------- */
.award-list { list-style: none; margin: 0; padding: 0; }
.award-list li {
  display: flex; gap: 18px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.award-list li:last-child { border-bottom: 0; }
.award-year { flex: 0 0 86px; color: var(--text-soft); font-weight: 600; font-size: 0.92rem; white-space: nowrap; padding-top: 2px; }

/* ---------------------------- Footer ---------------------------- */
.footer {
  text-align: center;
  padding: 48px 24px;
  border-top: 1px solid var(--line);
  color: var(--text-soft);
}
.footer p { margin: 0 0 8px; }
.footer-meta { font-size: 0.85rem; }

/* ---------------------------- Reveal-on-scroll (disabled — static, calm) ---------------------------- */
.reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------------------------- Responsive ---------------------------- */
/* Stack to a single, centered column on narrower screens */
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .sidebar {
    position: static;
    padding-top: 56px;
    text-align: center;
  }
  .side-photo { width: 168px; margin: 0 auto; }
  .social-row { justify-content: center; }
  .content .section:first-child { padding-top: 28px; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }

  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 16px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 12px 0; font-size: 1rem; border-bottom: 0; }
  .nav-links a.active { border-bottom: 0; }
}
