/* ==========================================================================
   "Personal" design layer for the AcademicPages theme.
   Loaded after main.css only when `design: personal` is set in _config.yml.
   Accent colour is taken from the red of the profile photo.
   ========================================================================== */

:root {
  --pf-bg: #faf7f2;
  --pf-surface: #f2ede4;
  --pf-ink: #1d1f23;
  --pf-muted: #5f636b;
  --pf-faint: #d9d2c5;
  --pf-accent: #9e1b32;
  --pf-accent-soft: rgba(158, 27, 50, 0.10);
  --pf-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --pf-display: "Fraunces", "Source Serif 4", Georgia, serif;
  --pf-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --pf-width: 46rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --pf-bg: #16181b;
    --pf-surface: #1f2226;
    --pf-ink: #e9e6e0;
    --pf-muted: #a3a7ae;
    --pf-faint: #34383e;
    --pf-accent: #e7677c;
    --pf-accent-soft: rgba(231, 103, 124, 0.14);
  }
}

/* ---------- base ---------- */
html { background: var(--pf-bg); }
body {
  background: var(--pf-bg);
  color: var(--pf-ink);
  font-family: var(--pf-serif);
  font-size: 1.02rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--pf-accent); color: #fff; }

a, a:visited { color: var(--pf-ink); text-decoration: none;
  background-image: linear-gradient(var(--pf-accent), var(--pf-accent));
  background-size: 100% 1px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size .2s ease, color .2s ease; }
a:hover { color: var(--pf-accent); background-size: 100% 2px; }
a u { text-decoration: none; }

h1, h2, h3, h4, .page__title {
  font-family: var(--pf-display);
  font-weight: 600;
  color: var(--pf-ink);
  letter-spacing: -0.01em;
}

/* ---------- top navigation ---------- */
.masthead {
  background: var(--pf-bg) !important;
  border-bottom: 1px solid var(--pf-faint) !important;
  position: relative;
}
.masthead__inner-wrap { max-width: var(--pf-width); margin: 0 auto; padding: 0.9em 1rem; }
.masthead__menu-item a, .masthead__menu-item a:visited,
.greedy-nav a, .greedy-nav a:visited {
  font-family: var(--pf-mono) !important;
  font-size: 0.8rem !important;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  color: var(--pf-muted) !important;
  background-image: none;
}
.greedy-nav a:hover { color: var(--pf-accent) !important; }
.masthead__menu-item--lg a, .masthead__menu-item--lg a:visited {
  font-family: var(--pf-display) !important;
  font-size: 1.05rem !important;
  text-transform: none;
  color: var(--pf-ink) !important;
  font-weight: 600;
}
.greedy-nav, .greedy-nav .visible-links, .greedy-nav .hidden-links { background: var(--pf-bg) !important; }
.greedy-nav .visible-links a::before { background: var(--pf-accent) !important; }
.greedy-nav button { background-color: var(--pf-accent) !important; }
.greedy-nav .hidden-links { border-color: var(--pf-faint) !important; }

/* ---------- single centred column, no sidebar ---------- */
.sidebar { display: none !important; }
#main {
  max-width: var(--pf-width) !important;
  margin: 0 auto !important;
  padding: 2.5rem 1rem 1rem !important;
}
#main .archive, #main .page, #main > article {
  width: 100% !important;
  float: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.page__inner-wrap, .page__content { width: 100% !important; float: none !important; }
.page__title, .archive h1.page__title { font-size: 2.1rem; margin: 0 0 1.25rem; }
.archive h1, .page__content h1 { /* markdown "=====" section titles */
  font-size: 1.45rem;
  margin: 2.6rem 0 0.9rem;
  padding: 0;
  border: none;
}
.archive h2, .page__content h2 {
  font-size: 1.3rem; margin: 2.4rem 0 0.8rem; border: none; padding: 0;
}
.archive h2::before, .page__content h2::before, .archive h1:not(.page__title):not(.pf-hero__name)::before, .page__content h1::before {
  content: "§ ";
  color: var(--pf-accent);
  font-weight: 400;
}
.archive h3, .page__content h3 { font-size: 1.1rem; margin: 1.8rem 0 0.5rem; }
p, li { color: var(--pf-ink); }
strong { font-weight: 600; }
hr { border-color: var(--pf-faint); }

/* ---------- home hero ---------- */
.pf-hero {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 2rem;
  align-items: center;
  margin: 0.5rem 0 2.6rem;
}
.pf-hero__avatar {
  width: 9.5rem; height: 9.5rem;
  border-radius: 50%;
  object-fit: cover; object-position: 50% 22%;
  box-shadow: 0 0 0 4px var(--pf-bg), 0 0 0 5px var(--pf-accent);
}
.pf-hero__name {
  font-family: var(--pf-display);
  font-size: clamp(2.2rem, 6vw, 3.1rem);
  line-height: 1.05;
  margin: 0 0 0.35rem;
  font-weight: 600;
}
.pf-hero__role {
  font-family: var(--pf-mono);
  font-size: 0.82rem;
  color: var(--pf-muted);
  margin: 0 0 0.8rem;
}
.pf-hero__tagline {
  font-size: 1.15rem;
  font-style: italic;
  margin: 0 0 1rem;
}
.pf-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; }
.pf-links li { font-family: var(--pf-mono); font-size: 0.8rem; margin: 0; color: var(--pf-muted); }
.pf-links i { color: var(--pf-accent); margin-right: 0.2em; }
@media (max-width: 600px) {
  .pf-hero { grid-template-columns: 1fr; text-align: left; gap: 1.2rem; }
  .pf-hero__avatar { width: 7rem; height: 7rem; }
}

/* ---------- lists: news, recent pubs, talks ---------- */
.archive ul, .page__content ul { padding-left: 1.1rem; }
.archive ul li::marker, .page__content ul li::marker { color: var(--pf-accent); }
small { color: var(--pf-muted); font-size: 0.85em; }

/* archive items (publications / talks pages) */
.list__item { border-top: 1px solid var(--pf-faint); padding-top: 1.1rem; margin-bottom: 1.1rem; }
.list__item:first-of-type { border-top: none; }
.archive__item-title { font-family: var(--pf-display); font-size: 1.15rem; font-weight: 600; margin: 0 0 0.3rem; }
.archive__item-title a { background-image: none; }
.archive__item-title a:hover { color: var(--pf-accent); }
.archive__item-excerpt, .archive__item p { font-size: 0.97rem; }
.archive__item-excerpt { color: var(--pf-muted); }
.page__meta, .archive__item p:first-of-type em { color: var(--pf-muted); }
.archive h2.archive__subtitle { font-family: var(--pf-mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--pf-muted); }
.archive h2.archive__subtitle::before { content: ""; }

/* dates and meta in mono */
time, .page__date, .page__meta { font-family: var(--pf-mono); font-size: 0.8rem; }

/* buttons */
.btn, .btn:visited {
  font-family: var(--pf-mono) !important;
  font-size: 0.78rem !important;
  font-weight: 500;
  border-radius: 999px !important;
  background: transparent !important;
  color: var(--pf-accent) !important;
  border: 1px solid var(--pf-accent) !important;
  padding: 0.45em 1.1em !important;
  background-image: none !important;
}
.btn:hover { background: var(--pf-accent) !important; color: #fff !important; }

/* BibTeX block */
details summary { font-family: var(--pf-mono); font-size: 0.8rem; color: var(--pf-accent); cursor: pointer; }
pre, code { background: var(--pf-surface) !important; color: var(--pf-ink) !important; border: none !important; font-family: var(--pf-mono); font-size: 0.78rem; }

/* iframes (slides) */
iframe { border: 1px solid var(--pf-faint) !important; border-radius: 6px; }

/* ---------- bag of words ---------- */
.pf-bow {
  max-width: var(--pf-width);
  margin: 3rem auto 0;
  padding: 0 1rem;
}
.pf-bow > * { margin-left: 0; }
.pf-bow__head { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px dashed var(--pf-faint); padding-top: 1rem; }
.pf-bow__title { font-family: var(--pf-mono); font-size: 0.75rem; color: var(--pf-muted); text-transform: lowercase; }
.pf-bow__shake {
  font-family: var(--pf-mono); font-size: 0.75rem; color: var(--pf-accent);
  background: none; border: none; cursor: pointer; padding: 0;
}
.pf-bow__shake:hover { text-decoration: underline; }
.pf-bow__words { line-height: 2.1; margin: 0.6rem 0 0.2rem; font-family: var(--pf-display); }
.pf-bow__words.is-shaken .pf-bow__w { animation: pf-drop .35s ease both; }
.pf-bow__w {
  display: inline-block;
  padding: 0 0.35em;
  margin: 0 0.15em;
  border-radius: 4px;
  background: var(--pf-accent-soft);
  color: var(--pf-ink);
}
@keyframes pf-drop { from { opacity: 0; transform: translateY(-4px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .pf-bow__w { animation: none; } }

/* ---------- footer ---------- */
.pf-footer { max-width: var(--pf-width); margin: 1.5rem auto 0; padding: 1.2rem 1rem 2.5rem; }
.pf-footer__inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem;
  font-family: var(--pf-mono); font-size: 0.75rem; color: var(--pf-muted);
  border-top: 1px solid var(--pf-faint); padding-top: 1rem;
}
.pf-footer__links { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.pf-footer a { color: var(--pf-muted); }

/* hide template chrome we no longer need */
.page__footer, .page__share, .page__related, .page__comments { display: none !important; }

/* no fade-in on load: content should be there immediately */
#main, .masthead, .page__footer, .archive, .page, .sidebar { animation: none !important; }

/* ---------- fixes after first screenshots ---------- */
a, a:visited, a:hover, a u { text-decoration: none !important; }
.archive .pf-hero__name, .archive h1.pf-hero__name {
  font-size: clamp(2.3rem, 6vw, 3.2rem); margin: 0 0 0.35rem;
}
.archive ul.pf-links { padding-left: 0; }
.pf-links a, .pf-links a:visited { background-image: none; color: var(--pf-muted); }
.pf-links a:hover { color: var(--pf-accent); }

/* publication / talk list items: lighter titles, tighter spacing, no § mark */
.archive .archive__item-title { font-size: 1.15rem; margin: 0 0 0.25rem; line-height: 1.3; }
.archive .archive__item-title::before { content: none !important; }
.archive__item-title a, .archive__item-title a:visited { background-image: none; }
.list__item .archive__item p { margin: 0.25rem 0; }
.list__item { padding: 1.1rem 0 0.6rem; margin: 0; }
.archive > h1.page__title + * { margin-top: 0; }

/* ---------- round 2: Helvetica-like type, fewer underlines ---------- */
:root {
  --pf-serif: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;   /* body (name kept for compatibility) */
  --pf-display: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
body { font-size: 1rem; line-height: 1.7; font-feature-settings: "ss01", "cv11"; }
h1, h2, h3, h4, .page__title, .pf-hero__name, .archive__item-title { letter-spacing: -0.02em; }
.archive .pf-hero__name { font-weight: 700; letter-spacing: -0.035em; }
.pf-hero__tagline { font-style: normal; color: var(--pf-muted); font-size: 1.1rem; }
.pf-bow__words { font-family: var(--pf-display); font-weight: 500; }

/* Links: no underline by default; only links inside running prose get the red underline */
a, a:visited { background-image: none; }
a:hover { color: var(--pf-accent); }
.archive p a, .page__content p a,
.archive li a:not(:first-child), .page__content li a:not(:first-child) {
  background-image: linear-gradient(var(--pf-accent), var(--pf-accent));
  background-size: 100% 1px; background-position: 0 100%; background-repeat: no-repeat;
}
/* list titles (recent publications, talks, news) are plain but bold-ish */
.archive li > a:first-child, .page__content li > a:first-child { font-weight: 500; }
/* "View all …" links and paper action links: mono, accent colour, no underline */
a.pf-more, .archive p a.pf-more,
.archive__item p a, .page__content .archive__item p a {
  background-image: none !important;
  font-family: var(--pf-mono); font-size: 0.8rem; color: var(--pf-accent) !important;
}
a.pf-more:hover, .archive__item p a:hover { text-decoration: underline !important; }
.pf-footer a, .pf-links a { background-image: none !important; }
.pf-meta { font-family: var(--pf-mono); font-size: 0.8rem; color: var(--pf-muted); margin-top: -0.2rem; }
.archive h3 a, .page__content h3 a { background-image: none !important; }

/* ---------- round 2b ---------- */
u, ins { border-bottom: none !important; text-decoration: none !important; }
/* titles in the generated "Recent publications / talks" lists: no underline */
.archive li > p > a:first-child, .page__content li > p > a:first-child {
  background-image: none !important; font-weight: 500;
}
/* tight headings, but keep word spaces readable */
h1, h2, h3, h4, .page__title, .pf-hero__name, .archive__item-title { word-spacing: 0.06em; }
