/* Design tokens: coral theme from "Personal Identity Presentation Template.pptx"
   (coral, near-black, white; Montserrat + Playfair Display).
   Change them here and the whole site follows. */
:root {
  --bg: #ffffff;
  --text: #161922;      /* near-black */
  --muted: #6b6f78;
  --border: #f0dcdb;    /* soft coral tint */
  --accent: #e06666;    /* template coral: fills, rules, rings */
  --link: #c94d4d;      /* slightly deeper coral so small link text stays readable */
  --link-hover: #ff6b65;
  --strong: #161922;
  --on-accent: #161922; /* text on coral fills (white on coral is too low-contrast) */
  --font: "Montserrat", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Playfair Display", Georgia, "Times New Roman", serif;
}
:root[data-theme="dark"] {
  --bg: #161922;
  --text: #f3f1f1;
  --muted: #a3a7b0;
  --border: #3a2a30;
  --accent: #ff6b65;
  --link: #ff6b65;
  --link-hover: #ff9a95;
  --strong: #ffffff;
}

* { box-sizing: border-box; }
html { font-size: 17px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
}
a { color: var(--link); }
a:hover { color: var(--link-hover); }

/* Top bar: name on the left, pill menu on the right */
.nav {
  /* Sticky: stays at the top of the window while the page scrolls.
     Full-width bar with a solid background so text never shows through it;
     the side padding keeps the menu lined up with the 900px content column. */
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem max(1.5rem, calc((100% - 900px) / 2 + 1.5rem));
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.nav .brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--strong);
  text-decoration: none;
  margin-right: auto;
}
.nav a.pill {
  padding: 0.25rem 0.9rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border: 1.5px solid var(--accent);
}
.nav a.pill:hover { background: var(--border); color: var(--text); }
.nav a.pill[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
#theme-toggle {
  background: none; border: 0; cursor: pointer;
  color: var(--text); font-size: 1.05rem; padding: 0 0.25rem;
}

/* Home page header: big name beside the photo */
.hero {
  max-width: 900px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  border-bottom: 3px solid var(--accent);
}
.avatar {
  width: 170px; height: 170px; flex: none;
  border-radius: 50%;
  border: 4px solid var(--accent);
  background: var(--border);
  display: grid; place-items: center;
  color: var(--muted); font-size: 0.7rem; text-align: center;
}
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; }
.affil a { color: inherit; }
.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2.2rem, 7vw, 3.4rem);
  line-height: 1.05;
  margin: 0 0 0.4rem;
  color: var(--strong);
}
.hero .tagline { margin: 0 0 0.75rem; color: var(--muted); font-style: italic; }
.links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; font-size: 0.8rem; font-weight: 600; }
.links a { color: var(--text); text-decoration: none; border-bottom: 2px solid var(--accent); }
.links a:hover { color: var(--link-hover); }
.affil { font-size: 0.8rem; color: var(--muted); margin: 0.5rem 0 0; }

/* Main reading column */
.content {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 2rem;
}
.content > * { max-width: 40rem; }
.content p { margin: 0 0 1.1rem; }
.content h1, .content h2 {
  font-family: var(--font-head);
  color: var(--strong);
}
.content h1 { font-size: 2rem; margin: 0 0 1.25rem; }
.content h2 {
  font-size: 1.35rem;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.content h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin: 1.4rem 0 0.1rem;
}
.entries li > span:first-child { display: block; }
.placeholder { color: var(--muted); font-style: italic; }

/* Publications / CV lists */
.entries { list-style: none; padding: 0; margin: 0; }
.entries li { padding: 0.9rem 0; border-bottom: 1px solid var(--border); }
.entries .meta { display: block; color: var(--muted); font-size: 0.8rem; }

.footer {
  max-width: 900px; margin: 0 auto; padding: 0 1.5rem 2rem;
  color: var(--muted); font-size: 0.75rem;
}

@media (max-width: 600px) {
  .hero { flex-direction: column; align-items: flex-start; }

  /* Phones: name on the first line, all menu buttons together on the second */
  .nav { padding: 0.6rem 1rem; gap: 0.35rem; }
  .nav .brand { flex: 1 0 100%; margin-right: 0; }
  .nav a.pill { padding: 0.2rem 0.65rem; font-size: 0.75rem; }
  #theme-toggle { margin-left: auto; }
}
