:root {
  --bg: #f6f6f8;
  --surface: #ffffff;
  --text: #1c1c1e;
  --muted: #5b5b61;
  --border: #e4e4e7;
  --accent: #d12f45;
  --line: #d9d9de;
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
  --hero-bg: #1e1e1e;
  --hero-text: #ffffff;
  --hero-muted: #c7c7cc;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --surface: #1b1b1f;
    --text: #ececef;
    --muted: #a1a1a8;
    --border: #2c2c31;
    --accent: #ff5a6e;
    --line: #34343a;
    --shadow: none;
    --hero-bg: #1b1b1f;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

/* Hero */

.hero {
  padding: 72px 16px 64px;
  background: var(--hero-bg);
  color: var(--hero-text);
  text-align: center;
  border-bottom: 4px solid #e73b50;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.role {
  margin: 10px 0 0;
  font-size: 1.15rem;
  color: var(--hero-muted);
}

.social {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.social a {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--hero-text);
  transition: background 0.15s;
}

.social a:hover {
  background: #e73b50;
}

.social svg {
  width: 22px;
  height: 22px;
}

/* Sections */

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 64px 0 8px;
}

section > h2 {
  margin: 0 0 28px;
  font-size: 1.75rem;
  text-align: center;
}

section > h2::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin: 12px auto 0;
  border-radius: 2px;
  background: var(--accent);
}

#summary p {
  margin: 0 0 16px;
}

/* Career timeline */

.timeline {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: var(--line);
}

.timeline li {
  position: relative;
  width: 50%;
  padding: 0 44px 32px 0;
}

.timeline li:nth-child(even) {
  margin-left: 50%;
  padding: 0 0 32px 44px;
}

.year {
  position: absolute;
  top: 12px;
  right: -30px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #e73b50;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 0 0 6px var(--bg);
}

.timeline li:nth-child(even) .year {
  right: auto;
  left: -30px;
}

.card {
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.97rem;
}

/* Open source */

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.project {
  display: flex;
  flex-direction: column;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

.project:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.project h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  color: var(--accent);
}

.project p {
  flex: 1;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.stars {
  font-size: 0.9rem;
  font-weight: 600;
}

/* Writing */

.posts {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.posts li {
  display: flex;
  gap: 16px;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.posts a {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

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

.posts time {
  flex: none;
  color: var(--muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.more {
  margin: 18px 0 0;
  text-align: center;
}

/* Contact */

#contact {
  padding-bottom: 72px;
  text-align: center;
}

#contact p {
  margin: 0 0 22px;
  color: var(--muted);
}

.button {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  background: #e73b50;
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.button:hover {
  background: #cf2c41;
}

footer {
  padding: 24px 16px 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  main {
    padding: 0 16px;
  }

  section {
    padding-top: 52px;
  }

  .timeline::before {
    left: 24px;
  }

  .timeline li,
  .timeline li:nth-child(even) {
    width: auto;
    margin-left: 0;
    padding: 0 0 24px 64px;
  }

  .year,
  .timeline li:nth-child(even) .year {
    top: 0;
    left: 0;
    right: auto;
    width: 48px;
    height: 48px;
    font-size: 0.82rem;
  }

  .posts li {
    flex-direction: column;
    gap: 2px;
  }
}
