/* ============================================================
   Theme variables
   ============================================================ */
:root {
  --max: 760px;

  /* Light theme — warm / cream toned (default) */
  --bg:          #faf5ee;
  --bg-soft:     #f3ebe0;
  --ink:         #322d28;
  --muted:       #80746a;
  --rule:        #e7dccd;
  --accent:      #b35a31;
  --accent-soft: rgba(179, 90, 49, 0.22);
  --pastel:      #3d9c8f;
}

:root[data-theme="dark"] {
  /* Dark theme — Zen Browser palette (zen-browser.app) */
  --bg:          #1f1f1f;   /* --zen-paper */
  --bg-soft:     #2a2a2a;
  --ink:         #d1cfc0;   /* --zen-dark  */
  --muted:       #908c7e;
  --rule:        #ffffff1a; /* --zen-subtle (white 10%) */
  --accent:      #f76f53;   /* Zen coral   */
  --accent-soft: rgba(247, 111, 83, 0.35);
  --pastel:      #7fd8c6;
}

/* ============================================================
   Base
   ============================================================ */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Lora", Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.35s ease, color 0.35s ease;
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 84px 28px 120px;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  transition: border-color 0.2s ease, color 0.2s ease;
}
a:hover { border-bottom-color: var(--accent); }

.supervisor-link {
  color: var(--ink);
  border-bottom-color: var(--rule);
}
.supervisor-link:hover { border-bottom-color: currentColor; }

strong { font-weight: 600; }

/* ============================================================
   Header / intro
   ============================================================ */
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.intro h1 {
  margin: 0 0 6px;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.intro .role {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.avatar {
  flex-shrink: 0;
  display: block;
  width: 170px;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--rule);
  transition: border-color 0.35s ease;
}

/* ============================================================
   Bio
   ============================================================ */
.bio { margin-top: 38px; }
.bio p { margin: 0 0 12px; }

.contact {
  color: var(--muted);
  font-size: 16px;
}

/* ============================================================
   Sections
   ============================================================ */
section { margin-top: 56px; }

h2 {
  margin: 0 0 22px;
  padding-bottom: 10px;
  font-size: 24px;
  font-weight: 600;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.35s ease;
}

/* Experience timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline li {
  display: flex;
  gap: 18px;
  padding: 9px 0;
  font-size: 18px;
}
.timeline .when {
  flex-shrink: 0;
  width: 150px;
  white-space: nowrap;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.timeline .what { flex: 1; }
.accent { color: var(--accent); }
.timeline .note {
  color: var(--pastel);
}

/* Publications */
.pub {
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
}
.pub .title { font-weight: 600; }
.pub .authors { font-size: 16px; }
.pub .venue {
  color: var(--muted);
  font-style: italic;
  font-size: 15px;
}
.pub .links { font-size: 15px; margin-top: 2px; }

/* ============================================================
   Footer
   ============================================================ */
.page-footer {
  margin-top: 84px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  transition: border-color 0.35s ease;
}
.page-footer .icon-credit { flex-basis: 100%; }

/* ============================================================
   Theme toggle
   ============================================================ */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================
   Small screens
   ============================================================ */
@media (max-width: 560px) {
  main { padding: 64px 22px 90px; }

  .intro {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 20px;
  }
  .intro h1 { font-size: 30px; }
  .avatar { width: 130px; }

  .timeline li { flex-direction: column; gap: 2px; }
  .timeline .when { width: auto; }
}
