:root {
  --bg: #0b0b0c;
  --fg: #e8e8ea;
  --muted: #8b8b92;
  --line: #1e1e21;
  --dim: #4a4a50;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid #38383d;
  transition: color .15s ease, border-color .15s ease;
}
a:hover { color: #fff; border-bottom-color: #fff; }

.container { max-width: 640px; margin: 0 auto; padding: 0 24px; }

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 11, 12, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.brand { font-weight: 600; letter-spacing: -0.02em; }
.brand a { border: none; }
.nav nav { display: flex; flex-wrap: wrap; gap: 16px; justify-content: flex-end; }
.nav nav a { font-size: 13px; color: var(--muted); border: none; }
.nav nav a:hover { color: #fff; }

/* Sections */
section { padding: 72px 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: none; }

.label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 24px;
}

h1 {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.hero { padding-top: 96px; }
.hero .lead {
  margin-top: 20px;
  color: var(--muted);
  font-size: 17px;
  max-width: 44ch;
}
.hero .meta { margin-top: 32px; font-size: 14px; color: var(--dim); }

/* Project cards */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 8px;
}
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } }
.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  transition: border-color .15s ease;
}
.item:hover { border-color: #333338; }
.item h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 6px; }
.item p { font-size: 14px; color: var(--muted); }
.item .tag { display: block; font-size: 12px; color: var(--dim); margin-top: 10px; }

/* Plain lists (interests, education) */
ul.plain { list-style: none; }
ul.plain li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
ul.plain li:last-child { border-bottom: none; }
ul.plain .title { font-weight: 500; }
ul.plain .sub { color: var(--muted); font-size: 14px; text-align: right; white-space: nowrap; }

/* Experience timeline */
.timeline {
  position: relative;
  margin-left: 4px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}
.timeline .entry { position: relative; padding-bottom: 36px; }
.timeline .entry:last-child { padding-bottom: 0; }
.timeline .entry::before {
  content: "";
  position: absolute;
  left: -29px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dim);
}
.timeline .date {
  font-size: 12px;
  color: var(--dim);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.timeline h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.timeline .role { font-size: 14px; color: var(--muted); margin-top: 2px; }
.timeline p { font-size: 14px; color: var(--muted); margin-top: 8px; max-width: 56ch; }

/* Writing / blog list */
.writing-link {
  display: block;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.writing-link:last-child { border-bottom: none; }
.writing-link .date { font-size: 12px; color: var(--dim); }
.writing-link h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; margin-top: 2px; }
.writing-link p { font-size: 14px; color: var(--muted); margin-top: 4px; }
.writing-link:hover h3 { color: #fff; }

/* Blog article */
article { padding-top: 72px; padding-bottom: 72px; }
.back {
  display: inline-block;
  font-size: 13px;
  color: var(--muted);
  border: none;
  margin-bottom: 40px;
}
.back:hover { color: #fff; }
article .post-meta { font-size: 13px; color: var(--dim); margin: 16px 0 40px; }
article h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 40px 0 12px; }
article p { margin-bottom: 20px; }
article ul, article ol { padding-left: 20px; margin-bottom: 20px; }
article li { margin-bottom: 8px; }

/* Scroll reveal */
.no-js .reveal { opacity: 1; transform: none; }
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

footer { padding: 40px 0 64px; color: var(--dim); font-size: 13px; }
footer .row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
