@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-400-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;

  --bg: #fff;
  --text: #111;
  --text-muted: #555;
  --text-subtle: #555;
  --accent: #2558a8;
  --accent-bg: #dce8f7;
  --border: #ddd;
  --border-subtle: #f0f0f0;
  --link-deco: #ccc;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141416;
    --text: #e2e2e6;
    --text-muted: #a0a0aa;
    --text-subtle: #a0a0aa;
    --accent: #6fa3f7;
    --accent-bg: #1a2d47;
    --border: #2c2c32;
    --border-subtle: #1e1e24;
    --link-deco: #404048;
  }
}

:root[data-theme="dark"] {
  --bg: #141416;
  --text: #e2e2e6;
  --text-muted: #a0a0aa;
  --text-subtle: #a0a0aa;
  --accent: #6fa3f7;
  --accent-bg: #1a2d47;
  --border: #2c2c32;
  --border-subtle: #1e1e24;
  --link-deco: #404048;
}

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

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

body {
  font-family:
    "IBM Plex Sans",
    system-ui,
    -apple-system,
    "Segoe UI",
    Helvetica,
    Arial,
    sans-serif;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 2rem;
}

main {
  flex: 1;
  padding: 4rem 0 5rem;
}

/* Site header & nav */
body > header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  position: relative;
}

body > header .container {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.site-name {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-name:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 2rem;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.1s;
}

nav a:hover,
nav a.active {
  color: var(--accent);
}

nav a.active {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 0.2rem;
}

.nav-toggle .icon-close {
  display: none;
}
header.nav-open .nav-toggle .icon-menu {
  display: none;
}
header.nav-open .nav-toggle .icon-close {
  display: block;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-subtle);
  padding: 0.2rem;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color 0.15s;
}

.theme-toggle:hover {
  color: var(--text);
}

/* Show moon in light mode, sun in dark mode */
.theme-toggle .icon-sun {
  display: none;
}
.theme-toggle .icon-moon {
  display: flex;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: flex;
  }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: none;
  }
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: flex;
}
:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
}

footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

footer p {
  font-size: 0.8rem;
  color: var(--text-subtle);
  margin: 0;
}

/* Typography */
h1 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1.75rem;
}

/* Section labels — only for direct h2s in page content, not blog prose */
.container > h2 {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-top: 3.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--accent-bg);
}

.container > h1 + h2 {
  margin-top: 0;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.2rem;
}

p {
  margin-bottom: 1rem;
}
p:last-child {
  margin-bottom: 0;
}
ul,
ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 2px;
  transition:
    color 0.15s,
    text-decoration-color 0.15s;
}

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

@keyframes target-highlight {
  0%,
  20% {
    background-color: var(--accent-bg);
  }
  100% {
    background-color: transparent;
  }
}

.entry:target {
  animation: target-highlight 2s ease-out;
  border-radius: 4px;
  margin-inline: -0.75rem;
  padding-inline: 0.75rem;
}

/* Home page */
.about-intro {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

.photo-placeholder {
  width: 110px;
  height: 110px;
  background: var(--border-subtle);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.photo {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}

.about-intro h1 {
  margin-bottom: 0.2rem;
}

.persona-tagline {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 0;
}
.about-bio {
  margin-bottom: 3rem;
}

.social-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem;
  margin-top: 0.75rem;
}

.social-links a {
  display: flex;
  align-items: center;
  color: var(--text-subtle);
  text-decoration: none;
  padding: 0.3rem 0.5rem;
  transition: color 0.15s;
}

.social-links a:hover {
  color: var(--accent);
}

/* Entries (shared across Experience, Research, Projects) */
.entry {
  margin-bottom: 2.25rem;
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.2rem 1.5rem;
  margin-bottom: 0.3rem;
}

.entry-date {
  font-size: 0.8rem;
  color: var(--text-subtle);
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.entry-meta {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

/* Blog post */
article {
  max-width: 640px;
}

article > header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--accent-bg);
}

article > header h1 {
  margin-bottom: 0.5rem;
}

article > header time {
  font-size: 0.82rem;
  color: var(--text-subtle);
}

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

/* Blog list */
.update-list {
  list-style: none;
  padding: 0;
}

.update-list li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.update-row {
  display: flex;
  gap: 1.25rem;
  align-items: baseline;
}

.update-list time {
  font-size: 0.8rem;
  color: var(--text-subtle);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 5rem;
}

.update-images {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  margin-left: calc(5rem + 1.25rem);
}

.update-image {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.update-image a {
  display: block;
}

.update-image img {
  display: block;
  width: 100%;
  height: 200px;
  border-radius: 4px;
  object-fit: cover;
}

.update-image figcaption {
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin-top: 0.25rem;
}

.see-more {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.post-list li:last-child {
  border-bottom: none;
}

.post-list time {
  font-size: 0.8rem;
  color: var(--text-subtle);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Responsive */
@media (max-width: 620px) {
  html {
    font-size: 16px;
  }
  h1 {
    font-size: 1.6rem;
  }
  .container {
    padding: 0 1.25rem;
  }
  main {
    padding: 2.5rem 0 3.5rem;
  }

  .nav-toggle {
    display: flex;
    align-items: center;
  }

  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.25rem 1.25rem 0.75rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 10;
  }

  nav a {
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border-subtle);
  }
  nav a:last-child {
    border-bottom: none;
  }
  header.nav-open nav {
    display: flex;
  }

  .about-intro {
    flex-direction: column;
    gap: 1.5rem;
  }
  .photo-placeholder {
    width: 80px;
    height: 80px;
  }
  .entry-header {
    flex-direction: column;
    gap: 0.1rem;
  }

  .update-images {
    flex-direction: column;
    margin-left: calc(5rem + 1.25rem);
  }

  .update-image img {
    height: 160px;
  }
}
