/* ============================================================
   Chinh Hoang-Duc — personal site
   Minimal academic theme: cream background, burgundy accent,
   Crimson Pro (serif body) + Inter (UI/headings).
   ============================================================ */

:root {
  --bg: #fdfbf6;
  --bg-soft: #f4efe6;
  --text: #1f1d1b;
  --muted: #6b655e;
  --rule: #e2dccf;
  --accent: #7a1f2b;          /* burgundy */
  --accent-soft: #a44352;
  --serif: "Crimson Pro", Charter, Cambria, Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  max-width: 920px;
  margin: 0 auto;
  padding: 4rem 1.25rem 3.5rem;
}

/* ---------- HEADER ---------- */

.header {
  display: grid;
  grid-template-columns: 192px 1fr;
  gap: 2.2rem;
  align-items: center;
  margin-bottom: 3rem;
}

.photo {
  width: 192px;
  height: 192px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--rule);
  box-shadow: 0 6px 24px rgba(31, 29, 27, 0.06);
}

.header-text h1 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 2.1rem;
  margin: 0 0 0.35rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.role {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--muted);
  margin: 0;
}

.affil {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.emails {
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 0.5rem;
}

.emails a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent-soft);
  transition: color 120ms ease, border-color 120ms ease;
}

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

.links {
  font-family: var(--sans);
  font-size: 0.95rem;
  margin: 0;
}

.links a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms ease, color 120ms ease;
}

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

.dot {
  color: var(--muted);
  margin: 0 0.4rem;
}

/* ---------- SECTIONS ---------- */

section {
  margin-top: 3rem;
}

section h2 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

section h3.subhead {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--muted);
  margin: 1.6rem 0 0.6rem;
}

#about p {
  margin: 0 0 1rem;
}

#about a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-underline-offset: 3px;
}

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

/* ---------- PAPERS / WORKING PAPERS ---------- */

.paper {
  margin-bottom: 1.6rem;
  padding-left: 0;
}

.paper-title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0 0 0.25rem;
  color: var(--text);
}

.paper-meta {
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 0.4rem;
}

.paper-links {
  font-family: var(--sans);
  font-size: 0.88rem;
  margin: 0.4rem 0 0;
}

.paper-links a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent-soft);
}

.paper-links a:hover { border-bottom-style: solid; }

/* ---------- PUBLICATIONS LIST ---------- */

ol.pubs {
  padding-left: 1.5rem;
  margin: 0;
}

ol.pubs li {
  margin-bottom: 1.1rem;
  padding-left: 0.2rem;
}

ol.pubs li::marker {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.9em;
}

ol.pubs a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

ol.pubs a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.me {
  font-weight: 600;
  color: var(--text);
}

/* ---------- DETAILS / ABSTRACTS ---------- */

details {
  margin: 0.4rem 0 0;
  font-size: 0.95em;
}

details summary {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  user-select: none;
}

details summary::-webkit-details-marker { display: none; }

details summary::before {
  content: "▸";
  font-size: 0.7rem;
  transition: transform 150ms ease;
  display: inline-block;
}

details[open] summary::before {
  transform: rotate(90deg);
}

details summary:hover { color: var(--accent-soft); }

details > p {
  margin: 0.5rem 0 0;
  padding: 0.6rem 0.9rem;
  background: var(--bg-soft);
  border-left: 2px solid var(--accent);
  border-radius: 0 4px 4px 0;
  color: var(--text);
  font-style: italic;
}

.abstract-placeholder {
  color: var(--muted);
  font-style: italic;
}

/* ---------- PLAIN LISTS (conferences, teaching) ---------- */

ul.plain {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.plain li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.65rem;
}

ul.plain li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ---------- AWARDS ---------- */

ul.awards {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: var(--sans);
  font-size: 0.95rem;
}

ul.awards li {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--rule);
}

ul.awards li:last-child { border-bottom: none; }

.award-year {
  color: var(--accent);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ---------- FOOTER ---------- */

footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

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

footer a:hover { text-decoration: underline; }

footer .updated {
  margin-top: 0.4rem;
  font-style: italic;
  font-size: 0.8rem;
}

/* ---------- MOBILE ---------- */

@media (max-width: 600px) {
  body { font-size: 19px; }

  main { padding: 2.5rem 1.1rem 3rem; }

  .header {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    text-align: center;
  }

  .photo {
    width: 160px;
    height: 160px;
    margin: 0 auto;
  }

  .header-text h1 { font-size: 1.85rem; }

  .emails {
    /* email strings can be long on phones — let them shrink gracefully */
    word-break: break-all;
    font-size: 0.9rem;
  }

  ul.awards li {
    grid-template-columns: 3.5rem 1fr;
    gap: 0.6rem;
  }
}

/* ---------- SELECTION ---------- */

::selection {
  background: var(--accent);
  color: var(--bg);
}
