:root {
  --bg: #fafaf8;
  --text: #1a1a1a;
  --text-secondary: #555;
  --text-muted: #888;
  --border: #e0e0de;
  --link: #1a1a1a;
  --link-hover: #000;
  --code-bg: #f0f0ee;
}

[data-theme="dark"] {
  --bg: #111;
  --text: #e0e0e0;
  --text-secondary: #aaa;
  --text-muted: #777;
  --border: #2a2a2a;
  --link: #e0e0e0;
  --link-hover: #fff;
  --code-bg: #1a1a1a;
}

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

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

nav {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

#theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
}

#theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

main {
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* Hero */
.hero {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}

.hero img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.hero h1 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
}

.intro {
  margin-bottom: 1.5rem;
}

.intro p {
  margin-bottom: 0.8rem;
  color: var(--text-secondary);
}

.links {
  margin-bottom: 2.5rem;
}

.links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

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

.links .sep {
  color: var(--text-muted);
  margin: 0 0.3rem;
}

/* Sections */
h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* Project / work items */
.item {
  margin-bottom: 1.2rem;
}

.item h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.item p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.item .meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.item-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

.item-links .sep {
  color: var(--text-muted);
  margin: 0 0.2rem;
}

/* Blog list */
.post-list {
  list-style: none;
}

.post-list li {
  margin-bottom: 0.6rem;
  display: flex;
  gap: 0.8rem;
  align-items: baseline;
}

.post-list time {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
  min-width: 5.5rem;
}

.post-list a {
  color: var(--text);
  text-decoration: none;
}

.post-list a:hover {
  text-decoration: underline;
}

/* Blog post */
.post h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.post time {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

.post p {
  margin-bottom: 1.2rem;
}

.post img {
  max-width: 100%;
  border-radius: 6px;
  margin: 1rem 0;
}

/* Beyond work */
.aside-text {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Footer */
footer {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
}

footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Code */
code {
  background: var(--code-bg);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  font-size: 0.9em;
}

pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1.2rem;
}

pre code {
  background: none;
  padding: 0;
}

/* Mobile */
@media (max-width: 600px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .hero img {
    width: 72px;
    height: 72px;
  }

  .post-list li {
    flex-direction: column;
    gap: 0.1rem;
  }
}
