/* ==========================================================================
   THEME CONFIGURATION
   --------------------------------------------------------------------------
   Global visual settings live in this block. The dark theme overrides are
   defined below under [data-theme="dark"].
   ========================================================================== */

:root {
  /* ---- Brand / accent colors ------------------------------------------- */
  --color-accent:        #2563eb;  /* primary accent (links, highlights)   */
  --color-accent-hover:  #1d4ed8;  /* accent on hover                      */
  --color-accent-soft:   #eff4ff;  /* faint accent background (tags, pills)*/

  /* ---- Surfaces -------------------------------------------------------- */
  --color-bg:            #ffffff;  /* page background                      */
  --color-surface:       #f7f8fa;  /* cards / raised sections              */
  --color-border:        #e6e8ec;  /* hairlines, dividers                  */

  /* ---- Text ------------------------------------------------------------ */
  --color-text:          #1a1a1a;  /* primary text                        */
  --color-text-muted:    #5b6470;  /* secondary text                      */
  --color-text-faint:    #8a919c;  /* captions, metadata                  */

  /* ---- Typography ------------------------------------------------------ */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo,
               Consolas, monospace;

  --fs-name:     2.1rem;   /* the big name in the header                   */
  --fs-title:    1.6rem;   /* section titles                              */
  --fs-body:     1.02rem;  /* body copy                                   */
  --fs-small:    0.9rem;   /* metadata, tags                              */
  --lh-body:     1.7;      /* body line-height                            */

  /* ---- Layout ---------------------------------------------------------- */
  --max-width:   860px;    /* content column width                        */
  --radius:      14px;     /* corner rounding for cards / images          */
  --radius-sm:   8px;
  --gap:         1.6rem;   /* default vertical rhythm between blocks       */
  --section-gap: 3.4rem;   /* space between top-level sections            */

  /* ---- Effects --------------------------------------------------------- */
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 8px 24px rgba(0, 0, 0, 0.04);
  --transition: 0.18s ease;
}

/* ---- Dark theme: active when data-theme="dark" is set on <html> -------- */
[data-theme="dark"] {
  --color-accent:        #60a5fa;
  --color-accent-hover:  #93c5fd;
  --color-accent-soft:   #1c2942;

  --color-bg:            #0f1115;
  --color-surface:       #171a21;
  --color-border:        #262b34;

  --color-text:          #e8eaed;
  --color-text-muted:    #a9b1bd;
  --color-text-faint:    #737b87;

  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   BASE
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-bg);
  transition: background var(--transition), color var(--transition);
}

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

img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.4rem;
}

section { margin-top: var(--section-gap); }

.section-title {
  font-size: var(--fs-title);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1.4rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

/* ==========================================================================
   TOP BAR
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(10px);
  background: color-mix(in srgb, var(--color-bg) 82%, transparent);
  border-bottom: 1px solid var(--color-border);
}
.topbar__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.7rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar__brand {
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}
.topbar__nav { display: flex; gap: 1.2rem; align-items: center; }
.topbar__nav a {
  color: var(--color-text-muted);
  font-size: var(--fs-small);
  font-weight: 500;
}
.topbar__nav a:hover { color: var(--color-accent); }

.theme-toggle {
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all var(--transition);
}
.theme-toggle:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* ==========================================================================
   HERO / INTRO
   ========================================================================== */

.hero {
  margin-top: 3rem;
  display: flex;
  gap: 2.4rem;
  align-items: flex-start;
}
.hero__photo {
  flex: 0 0 auto;
  width: 190px;
  height: 190px;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
}
.hero__body { flex: 1 1 auto; min-width: 0; }
.hero__name {
  font-size: var(--fs-name);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.25rem;
}
.hero__role {
  color: var(--color-text-muted);
  font-weight: 500;
  margin: 0 0 1rem;
}
.hero__role a { font-weight: 600; }
.hero__bio { margin: 0 0 1.2rem; color: var(--color-text); }
.hero__bio p { margin: 0 0 0.8rem; }

/* social row */
.social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.social a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  transition: all var(--transition);
}
.social a:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  transform: translateY(-1px);
}
.social i { font-size: 1rem; }

/* ==========================================================================
   RESEARCH INTERESTS
   ========================================================================== */

.interest-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.interest-list li {
  position: relative;
  padding-left: 1.3rem;
  color: var(--color-text-muted);
}
.interest-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
}
.interest-list strong { color: var(--color-text); font-weight: 600; }

/* ==========================================================================
   PUBLICATIONS
   ========================================================================== */

.pub-list { display: flex; flex-direction: column; gap: 1.6rem; }
.pub {
  display: flex;
  gap: 1.3rem;
  padding: 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  transition: border-color var(--transition), transform var(--transition);
}
.pub:hover { border-color: color-mix(in srgb, var(--color-accent) 45%, var(--color-border)); }
.pub__thumb {
  flex: 0 0 auto;
  width: 160px;
  height: 108px;
  /* Scientific figures vary in aspect ratio — contain so nothing is cropped. */
  object-fit: contain;
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: #ffffff;
}
.pub__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-faint);
  font-family: var(--font-mono);
  font-size: 1.4rem;
}
.pub__body { flex: 1 1 auto; min-width: 0; }
.pub__title {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 0.3rem;
  line-height: 1.35;
  color: var(--color-text);
}
.pub__authors {
  font-size: var(--fs-small);
  color: var(--color-text-muted);
  margin: 0 0 0.2rem;
}
.pub__authors .me { color: var(--color-text); font-weight: 700; }
.pub__venue {
  font-size: var(--fs-small);
  color: var(--color-text-faint);
  font-style: italic;
  margin: 0 0 0.6rem;
}
.pub__links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pub__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-muted);
}
.pub__links a:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
  margin: var(--section-gap) 0 2.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-faint);
  font-size: var(--fs-small);
  text-align: center;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 640px) {
  :root { --fs-name: 1.7rem; --fs-title: 1.35rem; --section-gap: 2.6rem; }

  .hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.4rem;
  }
  .hero__photo { width: 150px; height: 150px; }
  .social { justify-content: center; }
  .interest-list { text-align: left; }

  .pub { flex-direction: column; }
  .pub__thumb { width: 100%; height: 150px; }

  .topbar__nav .nav-link { display: none; }
}
