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

:root {
  --bg: #faf3e8;
  --fg: #2c2825;
  --muted: #9e978d;
  --accent: #6058b4;
  --border: #e4d0bb;
  --max-width: 680px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111111;
    --fg: #e4e4e0;
    --muted: #666;
    --accent: #9b8fd4;
    --border: #272727;
  }
}

[data-theme="dark"] {
  --bg: #111111;
  --fg: #e4e4e0;
  --muted: #666;
  --accent: #9b8fd4;
  --border: #272727;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--muted);
  padding: 0;
  transition: color 0.15s;
  line-height: 1;
}

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

html {
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
  padding: 3rem 1.5rem 4rem;
}

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

/* ── Header ────────────────────────────────────────────── */

header {
  margin-bottom: 2.5rem;
}

.header-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 0.35rem;
}

h1 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

nav {
  display: flex;
  gap: 1.25rem;
}

nav a {
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

nav a:hover {
  color: var(--fg);
}

.tagline {
  font-size: 0.875rem;
  color: var(--muted);
}

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

.tagline a:hover {
  color: var(--fg);
  text-decoration-color: var(--fg);
}

/* ── Intro ─────────────────────────────────────────────── */

.intro {
  margin-bottom: 3.5rem;
}

.intro p {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--fg);
}

.intro a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}

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

.links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 1.25rem;
}

.links-row a {
  font-size: 0.8125rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}

.links-row a:hover {
  color: var(--fg);
  border-color: var(--fg);
}

/* ── Sections ───────────────────────────────────────────── */

section {
  margin-bottom: 3.5rem;
}

h2 {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--border);
}

/* ── Updates ────────────────────────────────────────────── */

.updates-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.updates-list li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

.updates-list .date {
  color: var(--muted);
  font-size: 0.8125rem;
  padding-top: 0.075em;
  white-space: nowrap;
}

.updates-list .text a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}

.updates-list .text a:hover {
  text-decoration-color: var(--fg);
}

/* ── Works ──────────────────────────────────────────────── */

.works-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.work-main {
  margin-bottom: 0.2rem;
}

.work-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  line-height: 1.5;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: border-color 0.15s, color 0.15s;
}

.work-title:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.work-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
  flex-wrap: wrap;
}

.work-meta .year {
  white-space: nowrap;
}

.work-meta .venue::after {
  content: "·";
  margin-left: 0.75rem;
  color: var(--border);
}

.work-authors {
  font-size: 0.8125rem;
  color: var(--muted);
}

.works-more {
  margin-top: 1.25rem;
  font-size: 0.8125rem;
}

.works-more a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.works-more a:hover {
  color: var(--fg);
}

/* ── Experience ─────────────────────────────────────────── */

.experience-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.exp-main {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 0.625rem;
  margin-bottom: 0.2rem;
}

.exp-main .org {
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  color: var(--fg);
  transition: color 0.15s;
}

.exp-main .org:hover {
  color: var(--accent);
}

.exp-main .role {
  font-size: 0.875rem;
  color: var(--muted);
}

.exp-main .role::before {
  content: "·";
  margin-right: 0.625rem;
  color: var(--border);
}

.exp-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.desc {
  font-size: 0.875rem;
  color: var(--fg);
  opacity: 0.75;
  line-height: 1.6;
}

.desc a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}

.desc a:hover {
  text-decoration-color: var(--fg);
}

/* ── Footer ─────────────────────────────────────────────── */

footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--muted);
}

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

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

/* ── Mobile ─────────────────────────────────────────────── */

@media (max-width: 500px) {
  body {
    padding: 2rem 1.25rem 3rem;
  }

  .header-top {
    flex-direction: column;
    gap: 0.75rem;
  }

  nav {
    gap: 1rem;
  }

  .updates-list li {
    grid-template-columns: 4.75rem 1fr;
    gap: 0.5rem;
  }

  .exp-meta {
    flex-direction: column;
    gap: 0.1rem;
  }

  .links-row {
    gap: 0.5rem 1rem;
  }
}
