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

:root {
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Fira Code", Menlo, monospace;
  --color-bg: #fdfdfd;
  --color-text: #1a1a1a;
  --color-muted: #666;
  --color-accent: #2563eb;
  --color-border: #e5e5e5;
  --color-code-bg: #f5f5f5;
  --max-width: 42rem;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  padding: 2rem 1.5rem;
  max-width: 64rem;
  margin: 0 auto;
}

/* Navigation */
.site-nav {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

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

.site-nav a:hover {
  color: var(--color-accent);
}

/* Headings */
h1, h2, h3, h4 {
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

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

a:hover {
  text-decoration: underline;
}

/* Article page constraint */
.post {
  max-width: var(--max-width);
}

/* Post content */
.post-header {
  margin-bottom: 2rem;
}

.post-header h1 {
  margin-top: 0;
}

.post-meta {
  color: var(--color-muted);
  font-size: 0.9rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.post-tags {
  display: flex;
  gap: 0.5rem;
}

.tag {
  background: var(--color-code-bg);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.8rem;
}

.post-content p {
  margin-bottom: 1.25rem;
}

.post-content ul,
.post-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.25rem;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.post-content blockquote {
  border-left: 3px solid var(--color-border);
  padding-left: 1rem;
  color: var(--color-muted);
  margin-bottom: 1.25rem;
}

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

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

pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

th {
  font-weight: 600;
}

/* Callouts */
.callout {
  border-left: 4px solid var(--color-accent);
  background: var(--color-code-bg);
  padding: 1rem 1.25rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 1.25rem;
}

.callout-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.callout-warning {
  border-left-color: #f59e0b;
}

.callout-tip {
  border-left-color: #10b981;
}

.callout-important {
  border-left-color: #ef4444;
}

/* Home layout */
.home {
  display: grid;
  grid-template-columns: 1fr 20rem;
  gap: 4rem;
  max-width: 64rem;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .home {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

.home-blog h1 {
  margin-top: 0;
}

/* Blog listing */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.post-preview h2 {
  margin-top: 0;
  margin-bottom: 0.25rem;
}

.post-preview time {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.post-preview p {
  margin-top: 0.5rem;
  color: var(--color-muted);
}

/* Bio */
.bio {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.bio-photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.bio h1 {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.bio p {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.bio-links {
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}

.bio-links a {
  color: #0a66c2;
  display: inline-block;
  transition: transform 0.15s ease;
}

.bio-links a:hover {
  color: #0a66c2;
  transform: scale(1.2);
  text-decoration: none;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* Projects */
.home-projects h1 {
  margin-top: 0;
}

.project-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.project-list a {
  font-weight: 500;
}

.project-list p {
  margin-top: 0.25rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

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

/* Horizontal rule */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}
