/* =========================
   CSS VARIABLES
========================= */

:root {
  --nav-height: 80px;

  --accent: #1a5cff;
  --accent-soft: #ffd88a;

  --text-main: #111;
  --text-muted: #444;

  --bg-main: #ffffff;
  --bg-pill: #e6e6e6;
  --bg-pill-hover: #d4d4d4;

  --border-soft: #e5e5e5;
}

/* =========================
   GLOBAL
========================= */

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;

  max-width: 760px;
  margin: 0 auto;
  padding: 36px 20px;

  line-height: 1.65;
  color: var(--text-main);
  background: var(--bg-main);
}

/* =========================
   BULLETPROOF ANCHOR OFFSET
========================= */

section::before {
  content: "";
  display: block;
  height: var(--nav-height);
  margin-top: calc(-1 * var(--nav-height));
  visibility: hidden;
  pointer-events: none;
}

/* =========================
   SECTION LAYOUT (UNIFORM)
========================= */

/* One source of truth for vertical rhythm */
section {
  margin-bottom: 28px;
}

/* Divider carries spacing, not sections */
.section-divider {
  border: none;
  border-top: 1px solid var(--border-soft);
  margin: 28px 0;
}

/* =========================
   HEADINGS
========================= */

h1 {
  font-size: 32px;
  margin-bottom: 6px;
}

h2 {
  margin: 0 0 12px;
  font-size: 20px;
  letter-spacing: 0.2px;
}

/* =========================
   LINKS
========================= */

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

a:hover {
  text-decoration: underline;
}

/* =========================
   PROFILE
========================= */

.profile {
  display: flex;
  gap: 22px;
  align-items: center;
}

.profile img {
  width: 120px;
  border-radius: 12px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.45;
}

/* =========================
   NAVIGATION (PILLS)
========================= */

.nav-pills {
  position: sticky;
  top: 0;
  z-index: 10;

  background: var(--bg-main);
  padding: 8px 0 14px;

  display: flex;
  flex-wrap: wrap;
  gap: 10px;

  border-bottom: 1px solid var(--border-soft);
}

.nav-pills .pill {
  padding: 8px 14px;
  border-radius: 12px;

  background: var(--bg-pill);
  color: var(--text-main);

  font-size: 14px;
  font-weight: 500;

  transition: background 0.2s ease, transform 0.1s ease;
}

.nav-pills .pill:hover {
  background: var(--bg-pill-hover);
  transform: translateY(-1px);
}

.nav-pills .pill.active {
  background: var(--accent-soft);
  font-weight: 600;
}

.nav-pills .pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =========================
   SECTION FADE-IN (JS ONLY)
========================= */

/* Progressive enhancement: content visible without JS */
.js section {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.js section.visible {
  opacity: 1;
}

/* =========================
   PUBLICATIONS
========================= */

.pub {
  margin-bottom: 20px;
}

.pub em {
  font-style: italic;
}

.first-author {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 6px;
}

.pub-details {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-muted);
  display: none;
}

.pub-details p {
  margin: 0.5em 0;
}

.pub-toggle {
  background: none;
  border: none;
  color: var(--accent);
  padding: 0;
  font-size: 14px;
  cursor: pointer;
}

.pub-toggle:hover {
  text-decoration: underline;
}

/* Publication controls */

.pub-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 22px;
  font-size: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.pub-controls button {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  margin-right: 10px;
  font-size: 14px;
}

.pub-controls button:hover {
  text-decoration: underline;
}

.pub-controls button.active {
  font-weight: 600;
  text-decoration: underline;
}

/* =========================
   EXPERIENCE
========================= */

.experience-block {
  margin-bottom: 26px;
}

.experience-block p {
  margin-bottom: 8px;
  line-height: 1.5;
}

.experience-block strong {
  font-weight: 600;
}

.experience-block em {
  color: var(--text-muted);
  font-style: italic;
}

.experience-block ul {
  margin-top: 8px;
  padding-left: 20px;
}

.experience-block li {
  margin-bottom: 10px;
  line-height: 1.6;
}

/* Citation line */

.exp-citation {
  display: inline-block;
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-muted);
}

.exp-citation strong {
  font-weight: 600;
}

.exp-citation a {
  color: var(--accent);
}

.exp-citation a:hover {
  text-decoration: underline;
}

/* =========================
   LINKS / ICONS
========================= */

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

/* =========================
   BACK TO TOP
========================= */

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 20;

  padding: 8px 14px;
  border-radius: 12px;

  background: var(--bg-pill);
  color: var(--text-main);

  font-size: 14px;
  font-weight: 500;

  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);

  transition: opacity 0.25s ease, transform 0.25s ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--bg-pill-hover);
}

/* =========================
   MOBILE
========================= */

@media (max-width: 600px) {

  body {
    padding-top: 28px;
  }

  .profile {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile img {
    width: 100px;
  }

  section {
    margin-bottom: 32px;
  }

  .section-divider {
    margin: 32px 0;
  }
}
