/* ------------------------------------------------------------
   Vitor Jung — personal site
   ------------------------------------------------------------ */
:root {
  --text: #1a1a1a;
  --muted: #666;
  --faint: #999;
  --link: #1a4f8b;
  --rule: #e6e6e6;
  --bg: #ffffff;
  --max: 860px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.65;
}

a { color: var(--link); }
strong, b { font-weight: 500; }

/* ---------- Top navigation ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--rule);
}
.topbar nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  justify-content: flex-end;
  gap: 1.6rem;
}
.topbar a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 400;
}
.topbar a:hover,
.topbar a[aria-current="page"] { color: var(--text); }
.topbar a[aria-current="page"] { font-weight: 500; }

/* ---------- Page container ---------- */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.25rem 5rem;
}
main.narrow { max-width: 760px; }

h1 {
  font-weight: 300;
  font-size: 2.6rem;
  line-height: 1.15;
  margin: 0;
}
.subtitle {
  color: var(--muted);
  margin: 0.35rem 0 0;
  font-size: 1rem;
}
.page-title {
  font-weight: 500;
  font-size: 1.9rem;
  margin: 0 0 2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--rule);
}

/* ---------- Home: photo + text ---------- */
.home {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.5rem;
  margin-top: 2.2rem;
  align-items: start;
}
.home .photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
}
.home p:first-child { margin-top: 0; }

/* ---------- Research ---------- */
h2 {
  font-weight: 500;
  font-size: 1.3rem;
  margin: 2.4rem 0 1.1rem;
}
.page-title + h2 { margin-top: 0; }

.paper { margin-bottom: 1.8rem; }
.paper h3 {
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
  line-height: 1.5;
}
.paper h3 a { text-decoration: none; }
.paper h3 a:hover { text-decoration: underline; }
.paper .authors { font-style: italic; color: var(--muted); margin: 0.15rem 0 0; font-size: 0.95rem; }
.paper .note { color: var(--muted); margin: 0.15rem 0 0; font-size: 0.92rem; }

details { margin-top: 0.35rem; }
details summary {
  list-style: none;
  cursor: pointer;
  width: fit-content;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: " +"; }
details[open] summary::after { content: " −"; }
details p {
  margin: 0.6rem 0 0;
  font-size: 0.93rem;
  color: #333;
  text-align: justify;
}

/* ---------- Teaching ---------- */
.course { margin-bottom: 1.5rem; }
.course h3 { font-size: 1rem; font-weight: 500; margin: 0; }
.course .when { color: var(--muted); font-style: italic; font-size: 0.93rem; margin: 0.1rem 0 0; }

/* ---------- Footer ---------- */
footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  color: var(--faint);
  font-size: 0.8rem;
}

/* ---------- Phones ---------- */
@media (max-width: 680px) {
  h1 { font-size: 2.1rem; }
  .home { grid-template-columns: 1fr; gap: 1.5rem; }
  .home aside { max-width: 240px; }
  .topbar nav { justify-content: center; gap: 1.3rem; }
}
