/* Self-hosted fonts (no third-party CDN) */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('/fonts/fraunces.woff2') format('woff2');
}
@font-face {
  font-family: 'Spectral';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/spectral-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Spectral';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/spectral-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Spectral';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/spectral-400i.woff2') format('woff2');
}

:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #5a615c;
  --rule: #1a1a1a;
  --rule-soft: #e3e3e0;
  --accent: #1d6f54;
  --link: #1d6f54;
  --visited: #6b4f86;
  --ring: #e3e3e0;
}

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

body {
  font-family: 'Spectral', Georgia, serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  max-width: 720px;
  margin: 0 auto;
  padding: 44px 40px;
  -webkit-font-smoothing: antialiased;
}

.header-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.header-row nav { font-size: 16px; }
.header-row nav a { margin-left: 18px; }

.site-title {
  font-family: 'Fraunces', 'Spectral', serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}
.site-title a { color: inherit; padding: 0; }
.site-title a:hover { text-decoration: none; color: var(--accent); }

h1, h2 { font-family: 'Fraunces', 'Spectral', serif; letter-spacing: -0.01em; }
h1 { font-size: 28px; font-weight: 700; margin-bottom: 0; }
h2 { font-size: 23px; font-weight: 600; margin: 0 0 14px; }
h2::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 11px;
  transform: translateY(-3px);
}
p { margin-bottom: 12px; }

a { color: var(--link); text-decoration: none; }
a:visited { color: var(--visited); }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

hr { border: none; border-top: 1px solid var(--rule-soft); margin: 26px 0; clear: both; }
hr.major { border-top: 2px solid var(--accent); }

.subtitle { font-style: italic; color: var(--muted); font-size: 17px; margin-bottom: 12px; }

.links-row { margin-bottom: 12px; font-size: 14.5px; line-height: 1.8; }
.links-row a { margin-right: 6px; }

.bio { color: var(--fg); margin-bottom: 0; }

/* Avatar */
.avatar {
  float: right;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  margin: 4px 0 14px 26px;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--ring), 0 6px 18px rgba(0, 0, 0, 0.10);
}
@media (max-width: 600px) { .avatar { width: 120px; height: 120px; margin-left: 18px; } }

/* Experience / Education entries */
.exp-entry { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
.exp-entry .exp-text { flex: 1; }
.exp-entry strong { display: block; font-weight: 600; }
.exp-entry .exp-desc { color: var(--muted); font-size: 14.5px; }

/* Skills list */
.skills-list { list-style: none; padding-left: 0; line-height: 1.9; margin-bottom: 12px; }
.skills-list li { position: relative; padding-left: 18px; }
.skills-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.72em;
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
}

/* Publications */
.pub-list { list-style: none; padding-left: 0; margin-bottom: 10px; }
.pub-list li { position: relative; padding-left: 18px; margin-bottom: 12px; font-size: 15.5px; line-height: 1.5; }
.pub-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.62em;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
.pub-list em { font-style: italic; }
.pub-more { font-size: 14.5px; margin-bottom: 0; }

/* Generic content lists (markdown bullets) */
main ul:not(.skills-list):not(.links-row):not(.pub-list) { list-style: disc; padding-left: 20px; margin-bottom: 12px; }
main ul li { margin-bottom: 4px; }

/* Footer */
.footer-text { color: var(--muted); font-size: 14px; margin-top: 0; }

/* Theme toggle */
.theme-toggle {
  position: fixed;
  top: 18px; right: 18px;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 50%;
  width: 42px; height: 42px;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  transition: background-color 0.2s, color 0.2s;
  color: var(--accent);
}
.theme-toggle:hover { background-color: var(--accent); color: var(--bg); }

/* Responsive */
@media (max-width: 768px) {
  body { padding: 34px 30px; }
  .site-title { font-size: 27px; }
}
@media (max-width: 600px) {
  body { padding: 24px 20px; }
  .site-title { font-size: 24px; }
  .header-row nav a { margin-left: 12px; }
}

/* ======== DARK MODE ======== */
html[data-theme="dark"] {
  --bg: #14151a;
  --fg: #ecede7;
  --muted: #969a96;
  --rule-soft: #2a2c33;
  --accent: #5fbf97;
  --link: #5fbf97;
  --visited: #b6a6cf;
  --ring: #2a2c33;
}
html[data-theme="dark"] .avatar { box-shadow: 0 0 0 1px var(--ring), 0 6px 18px rgba(0, 0, 0, 0.45); }

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --bg: #14151a;
    --fg: #ecede7;
    --muted: #969a96;
    --rule-soft: #2a2c33;
    --accent: #5fbf97;
    --link: #5fbf97;
    --visited: #b6a6cf;
    --ring: #2a2c33;
  }
  html:not([data-theme]) .avatar { box-shadow: 0 0 0 1px var(--ring), 0 6px 18px rgba(0, 0, 0, 0.45); }
}
