/* =========================================================
   Academic minimal — dark theme
   Inspired by tomdonoghue.github.io: plain, sans-serif,
   centered single column, text-first, no cards/shadows.
   Tweak the CSS variables in :root to rebrand.
   ========================================================= */

:root {
  --bg: #0f1115;
  --panel: #161a20;
  --text: #e6e8eb;
  --muted: #9aa3ad;
  --accent: #6aa6ff;
  --accent-hover: #9cc3ff;
  --border: #232832;
  --max-width: 860px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px; /* so anchors land below sticky header */
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* -------- Header / nav -------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15, 17, 21, 0.85);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.brand {
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  font-size: 1rem;
}

.nav {
  display: flex;
  gap: 1.3rem;
  font-size: 0.95rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav a:hover { color: var(--accent); }

.nav a.current {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}

/* -------- Main -------- */
main {
  padding: 2.5rem 1.25rem 3rem;
}

section { padding: 1.6rem 0; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

/* -------- Typography -------- */
h1 {
  font-size: 2rem;
  margin: 0 0 0.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.4rem;
  margin: 0 0 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 1.6rem 0 0.6rem;
}

h3.year {
  color: var(--accent);
  letter-spacing: 0.05em;
  font-size: 0.9rem;
}

p { margin: 0.5rem 0; }

.muted { color: var(--muted); }

.note {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: -0.4rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

em { font-style: italic; color: var(--text); }
strong { font-weight: 600; }

/* -------- Hero -------- */
.hero {
  display: flex;
  gap: 2.25rem;
  align-items: center;   /* vertically center photo next to text */
  padding-top: 2rem;
}

.hero-photo {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-left: -2rem;   /* nudge photo toward the left edge */
}

.hero-photo img,
.photo-placeholder {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1px solid var(--border);
}

.photo-placeholder {
  background: var(--panel);
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* -------- Page titles (subpages) -------- */
.page-title {
  font-size: 2rem;
  margin: 0.5rem 0 0.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero-text { flex: 1; min-width: 0; }

.hero-text p {
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* keep the short role line left-aligned — it looks odd justified on one line */
.hero-text p.title { text-align: left; hyphens: manual; }

.title {
  color: var(--muted);
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: 0.9rem;
}

/* -------- Social icons -------- */
.social {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.social a {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-bottom: none;
  transition: color 0.15s ease, transform 0.15s ease;
}

.social svg { display: block; }

.social a:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

/* -------- Publications -------- */
.pubs {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pubs > li {
  margin: 0 0 1.1rem;
}

.pub-title {
  font-weight: 500;
  color: var(--text);
}

.pub-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.pub-links {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.pub-links a { margin-right: 0.15rem; }

/* -------- CV list -------- */
.cv {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
}

.cv li {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px dotted var(--border);
}

.cv li:last-child { border-bottom: none; }

.cv-date {
  color: var(--muted);
  font-size: 0.9rem;
}

/* -------- Footer -------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 1.25rem 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

/* =========================================================
   CV page — interactive elements
   ========================================================= */

.cv-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel);
  font-size: 0.9rem;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(106, 166, 255, 0.08);
}

/* Stats strip */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.stat {
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.stat-num {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.stat-label {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.1rem;
}

.summary {
  color: var(--text);
  margin: 1rem 0 2rem;
}

.hint {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

/* Skills */
.skills {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.skill-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1rem;
  align-items: center;
}

.skill-label {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.3;
}

.chip small {
  color: var(--muted);
  font-size: 0.7rem;
}

/* Experience accordions */
.timeline {
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
}

details.role {
  border-bottom: 1px solid var(--border);
}

details.role > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.9rem 0.2rem;
  transition: background 0.15s ease;
}

details.role > summary::-webkit-details-marker { display: none; }
details.role > summary::marker { display: none; }

details.role > summary:hover {
  background: rgba(106, 166, 255, 0.04);
}

.role-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.role-meta { flex: 1; min-width: 0; }

.role-title {
  font-weight: 600;
  color: var(--text);
}

.role-org {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.15rem;
}

.role-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.role-date {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.chev {
  color: var(--muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

details.role[open] .chev { transform: rotate(180deg); }

.role-bullets {
  margin: 0.2rem 0 1rem 1.2rem;
  padding: 0;
  color: var(--text);
}

.role-bullets li {
  margin: 0.35rem 0;
  line-height: 1.55;
}

/* Education timeline */
.edu {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.edu-item {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px dotted var(--border);
}

.edu-item:last-child { border-bottom: none; }

.edu-year {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
}

.edu-title {
  font-weight: 600;
}

.edu-org {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.1rem;
}

/* Awards */
.awards {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.award {
  display: grid;
  grid-template-columns: 80px 1fr 60px;
  gap: 1rem;
  align-items: baseline;
  padding: 0.6rem 0;
  border-bottom: 1px dotted var(--border);
}

.award:last-child { border-bottom: none; }

.award-amt {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.award-name { color: var(--text); }
.award-year { color: var(--muted); font-size: 0.9rem; text-align: right; }

/* Outreach list */
.outreach-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.outreach-list li {
  padding: 0.5rem 0;
  border-bottom: 1px dotted var(--border);
}

.outreach-list li:last-child { border-bottom: none; }

/* References */
.refs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
  margin-top: 0.5rem;
}

.ref {
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.ref-name { font-weight: 600; }
.ref-role { color: var(--muted); font-size: 0.85rem; margin-top: 0.2rem; }
.ref-org { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.4rem; }

/* Responsive CV */
@media (max-width: 620px) {
  .skill-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
  .award {
    grid-template-columns: 70px 1fr;
    grid-template-areas:
      "amt name"
      ".   year";
  }
  .award-amt { grid-area: amt; }
  .award-name { grid-area: name; }
  .award-year { grid-area: year; text-align: left; }

  .role-head {
    flex-wrap: wrap;
  }
  .role-right { margin-top: 0.25rem; }
}

/* -------- Selection -------- */
::selection {
  background: rgba(106, 166, 255, 0.25);
  color: var(--text);
}

/* -------- Responsive -------- */
@media (max-width: 620px) {
  body { font-size: 16px; }

  .hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    text-align: left;
  }
  .hero-photo {
    margin-left: 0;
  }
  .hero-photo img,
  .photo-placeholder {
    width: 180px;
    height: 180px;
  }
  .cv li {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
  .nav { gap: 0.9rem; font-size: 0.9rem; }
  h1 { font-size: 1.7rem; }
}