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

:root {
  --bg:      #0C0C0C;
  --surface: #141414;
  --border:  #1E1E1E;
  --text:    #DDDDD8;
  --muted:   #666662;
  --accent:  #C9A84C;
  --link:    #A89060;
  --max-w:   680px;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 300;
  line-height: 1.7;
}

main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5rem 2rem 7rem;
}

/* ─── HERO ─── */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 3.5rem;
}

.avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  margin-bottom: 1.75rem;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07);
}

h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: #EEEEE9;
  margin-bottom: 0.5rem;
}

.role {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.role .highlight {
  color: var(--accent);
}

.location {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

.social {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}

.social a {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  transition: color 0.15s;
}

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

/* ─── SECTIONS ─── */

.section {
  padding: 2.75rem 0;
}

.section-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 400;
  color: #EEEEE9;
  margin-bottom: 1.5rem;
  letter-spacing: 0.01em;
}

.section-intro {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  line-height: 1.65;
}

.section-intro a {
  color: var(--link);
  text-decoration: none;
}

.section-intro a:hover {
  text-decoration: underline;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
}

/* ─── ABOUT ─── */

.about p {
  font-size: 0.975rem;
  color: var(--text);
  margin-bottom: 1.1rem;
  line-height: 1.8;
}

.about p:last-child {
  margin-bottom: 0;
}

/* ─── TIMELINE ─── */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.entry {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1.5rem;
}

.entry-year {
  font-size: 0.75rem;
  color: var(--muted);
  padding-top: 0.15rem;
  font-variant-numeric: tabular-nums;
}

.entry-company {
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 0.9rem;
}

.role-block {
  margin-bottom: 1.1rem;
}

.role-block:last-child {
  margin-bottom: 0;
}

.role-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.role-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: #DDDDD8;
}

.role-date {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.role-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.7;
}

/* ─── OPEN SOURCE ─── */

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.project-card {
  display: block;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.2rem;
  transition: border-color 0.15s, background 0.15s;
  background: var(--surface);
}

.project-card:hover {
  border-color: #2E2E2E;
  background: #181818;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.project-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
  line-height: 1.4;
}

.project-stars {
  font-size: 0.72rem;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

.project-desc {
  font-size: 0.775rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 0.75rem;
}

.project-tag {
  display: inline-block;
  font-size: 0.68rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  letter-spacing: 0.02em;
}

/* ─── UPSTREAM CONTRIBS ─── */

.upstream-contribs {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.upstream-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.upstream-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.upstream-link {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.2rem 0.6rem;
  transition: color 0.15s, border-color 0.15s;
}

.upstream-link:hover {
  color: var(--text);
  border-color: #333;
}

/* ─── TALKS ─── */

.talks-list {
  display: flex;
  flex-direction: column;
}

.talk-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.15s;
}

.talk-item:first-child {
  border-top: 1px solid var(--border);
}

.talk-item:hover {
  opacity: 0.65;
}

.talk-meta {
  font-size: 0.7rem;
  color: var(--accent);
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 500;
}

.talk-title {
  font-size: 0.875rem;
  color: var(--text);
}

.talk-arrow {
  color: var(--muted);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.talk-code {
  font-size: 0.68rem;
  color: var(--muted);
  margin-left: 0.4rem;
  letter-spacing: 0.04em;
}

/* ─── BOOK ─── */

.book-card {
  display: block;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.6rem 1.75rem;
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}

.book-card:hover {
  border-color: #2E2E2E;
  background: #181818;
}

.book-eyebrow {
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.book-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.2rem;
  color: #EEEEE9;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.book-desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 1.1rem;
}

.book-link {
  font-size: 0.8rem;
  color: var(--link);
}

/* ─── EDUCATION ─── */

.edu-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.edu-degree {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.edu-school {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ─── FOOTER ─── */

footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

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

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

/* ─── RESPONSIVE ─── */

@media (max-width: 580px) {
  main {
    padding: 3rem 1.25rem 5rem;
  }

  h1 {
    font-size: 2rem;
  }

  .entry {
    grid-template-columns: 2.75rem 1fr;
    gap: 1rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .role-header {
    flex-direction: column;
    gap: 0.15rem;
  }
}
