:root {
  --bg: #ffffff;
  --bg-alt: #f5f6f8;
  --text: #1a1d23;
  --text-muted: #5b6270;
  --accent: #3457d5;
  --accent-hover: #263f9e;
  --border: #e3e5e9;
  --radius: 10px;
  --max-width: 860px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --bg-alt: #1c1f25;
    --text: #eceef1;
    --text-muted: #9aa1ad;
    --accent: #7c93ff;
    --accent-hover: #9db0ff;
    --border: #2a2e36;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

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

img {
  max-width: 100%;
}

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

/* Header / nav */
header.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
}

header.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.brand:hover {
  color: var(--text);
  text-decoration: none;
}

nav.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

nav.site-nav a {
  color: var(--text-muted);
  font-weight: 500;
}

nav.site-nav a:hover,
nav.site-nav a.active {
  color: var(--accent);
  text-decoration: none;
}

/* Main sections */
main {
  padding: 3rem 0 4rem;
}

section {
  margin-bottom: 3.5rem;
}

section h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.hero {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.hero img.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: fill;
  border: 1px solid var(--border);
}

.hero h1 {
  margin: 0 0 0.4rem;
  font-size: 2rem;
}

.hero p.tagline {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero .socials a {
  margin-right: 1rem;
  font-weight: 500;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--bg-alt);
}

.project-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.project-card p {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.project-tags span {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
}

.project-links a {
  font-size: 0.9rem;
  font-weight: 600;
  margin-right: 1rem;
}

/* Contact */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-list li {
  margin-bottom: 0.5rem;
}

.contact-list .label {
  color: var(--text-muted);
  display: inline-block;
  min-width: 70px;
}

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

.post-list li {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
}

.post-list li:first-child {
  padding-top: 0;
}

.post-list h3 {
  margin: 0 0 0.3rem;
  font-size: 1.15rem;
}

.post-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 0 0.4rem;
}

.post-summary {
  margin: 0;
  color: var(--text-muted);
}

.post-status {
  color: var(--text-muted);
}

/* Single post */
.post-header h1 {
  margin: 0 0 0.4rem;
  font-size: 1.8rem;
}

.post-content {
  margin-top: 2rem;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  margin-top: 2rem;
}

.post-content pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
}

.post-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.post-content :not(pre) > code {
  background: var(--bg-alt);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 1rem 0;
  padding: 0.25rem 1rem;
  color: var(--text-muted);
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

/* Footer */
footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 500px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
}
