/* ---------------------------------------------------------------------------
   Theme tokens
--------------------------------------------------------------------------- */
:root {
  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --text: #1f2328;
  --text-muted: #6b7280;
  --heading: #111827;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --border: #e5e7eb;
  --pill-bg: #f3f4f6;
  --pill-text: #4b5563;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --github-icon: #24292f;
  --x-icon: #0f1419;
}

[data-theme="dark"] {
  --bg: #0d1117;
  --bg-elevated: #161b22;
  --text: #d1d7de;
  --text-muted: #8b939d;
  --heading: #eceef0;
  --accent: #6ea8fe;
  --accent-hover: #96c0ff;
  --accent-soft: #14233c;
  --border: #262d35;
  --pill-bg: #1c232b;
  --pill-text: #9aa4ae;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --github-icon: #e6edf3;
  --x-icon: #e7e9ea;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

h1, h2, h3, h4 {
  color: var(--heading);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.3rem;
  margin: 2.5em 0 0.8em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

h3::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Date markers in the Highlights list (written as `code` spans in Markdown) */
code {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  white-space: nowrap;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

img {
  max-width: 100%;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ---------------------------------------------------------------------------
   Layout
--------------------------------------------------------------------------- */
.wrapper {
  max-width: 62rem;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 2rem;
  display: flex;
  gap: 4rem;
  align-items: flex-start;
}

.sidebar {
  flex: 0 0 15rem;
  position: sticky;
  top: 3.5rem;
  text-align: center;
}

main {
  flex: 1;
  min-width: 0;
  max-width: 42rem;
}

main > section > p:first-of-type {
  margin-top: 0;
}

/* ---------------------------------------------------------------------------
   Sidebar
--------------------------------------------------------------------------- */
.avatar {
  width: 10.5rem;
  height: 10.5rem;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.site-title {
  font-size: 1.35rem;
  margin: 1.1rem 0 0.2rem;
}

.site-title a {
  color: var(--heading);
}

.site-title a:hover {
  text-decoration: none;
  color: var(--accent);
}

.tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1.2rem;
  line-height: 1.5;
}

.social {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 1.4rem;
}

.social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  font-size: 1.05rem;
  transition: background 0.15s ease, transform 0.15s ease, filter 0.15s ease;
}

.social a:hover {
  background: var(--accent-soft);
  text-decoration: none;
  transform: translateY(-2px);
  filter: brightness(1.15);
}

.social .fa-github { color: var(--github-icon); }
.social .fa-linkedin-in { color: #0a66c2; }
.social .fa-x-twitter { color: var(--x-icon); }
.social .fa-google-scholar { color: #4285f4; }
.social .fa-envelope { color: #ea4335; }

.site-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 1.5rem;
}

.site-nav a {
  color: var(--text);
  font-size: 0.92rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.site-nav a i {
  color: var(--text-muted);
  margin-left: 0.2em;
}

#theme-toggle {
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-size: 0.95rem;
  box-shadow: var(--shadow);
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

#theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: rotate(15deg);
}

[data-theme="light"] .fa-sun { display: none; }
[data-theme="dark"] .fa-moon { display: none; }

/* ---------------------------------------------------------------------------
   Content
--------------------------------------------------------------------------- */
section p {
  margin: 0 0 1.1em;
}

/* Highlights list: date pill + entry per line */
section p code {
  margin-right: 0.35em;
}

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
}

footer a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

footer a:hover {
  color: var(--accent);
}

/* ---------------------------------------------------------------------------
   Responsive
--------------------------------------------------------------------------- */
@media (max-width: 800px) {
  .wrapper {
    flex-direction: column;
    gap: 2rem;
    padding-top: 2.5rem;
  }

  .sidebar {
    position: static;
    flex: none;
    width: 100%;
  }

  .avatar {
    width: 8.5rem;
    height: 8.5rem;
  }

  .site-nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3rem;
  }

  h3 {
    margin-top: 1.8em;
  }
}
