:root {
  --bg-color: #ffffff;
  --text-color: #333333;
  --text-secondary: #555555;
  --text-muted: #666666;
  --border-color: #eeeeee;
  --link-color: #0066cc;
  --link-hover: #0066cc;
  --button-bg: #f5f5f5;
  --button-hover-bg: #0066cc;
  --button-hover-text: #ffffff;
  --accent-color: #0066cc;
  --code-bg: #f6f8fa;
  --code-border: #d0d7de;
}

[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #e0e0e0;
  --text-secondary: #b0b0b0;
  --text-muted: #999999;
  --border-color: #333333;
  --link-color: #4da6ff;
  --link-hover: #66b3ff;
  --button-bg: #2a2a2a;
  --button-hover-bg: #4da6ff;
  --button-hover-text: #1a1a1a;
  --accent-color: #4da6ff;
  --code-bg: #2d2d2d;
  --code-border: #404040;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

header {
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 40px;
  padding-bottom: 20px;
}

header h1 {
  font-size: 2em;
  margin-bottom: 10px;
}

nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

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

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

#theme-toggle {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

#theme-toggle:hover {
  background-color: var(--button-bg);
}

#theme-toggle svg {
  width: 20px;
  height: 20px;
}

[data-theme="light"] .moon-icon {
  display: none;
}

[data-theme="dark"] .sun-icon {
  display: none;
}

main {
  min-height: calc(100vh - 200px);
}

.post-list h2 {
  margin-bottom: 30px;
}

.post-list ul {
  list-style: none;
}

.post-list li {
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
}

.post-list li:last-child {
  border-bottom: none;
}

.post-list h3 {
  margin-bottom: 5px;
}

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

.post-list h3 a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.post-list time {
  color: var(--text-muted);
  font-size: 0.9em;
  display: block;
  margin-bottom: 10px;
}

.post-list p {
  color: var(--text-secondary);
}

.post header h2 {
  margin-bottom: 10px;
}

.post header time {
  color: var(--text-muted);
  font-size: 0.9em;
  display: block;
  margin-bottom: 30px;
}

.post-content {
  margin-bottom: 40px;
}

.post-content h1 {
  margin-top: 30px;
  margin-bottom: 20px;
}

.post-content h2 {
  margin-top: 25px;
  margin-bottom: 15px;
}

.post-content h3 {
  margin-top: 20px;
  margin-bottom: 10px;
}

.post-content p {
  margin-bottom: 15px;
}

.post-content ul, .post-content ol {
  margin-bottom: 15px;
  margin-left: 30px;
}

.post-content li {
  margin-bottom: 5px;
}

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

.post footer a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

footer {
  border-top: 2px solid var(--border-color);
  margin-top: 40px;
  padding-top: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9em;
}

.about-page h2 {
  margin-bottom: 30px;
}

.about-content {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

.profile-picture {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.about-text p {
  margin-bottom: 15px;
}

.contact-links {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 40px;
}

.contact-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: var(--text-color);
  transition: color 0.2s, transform 0.2s;
}

.contact-links a:hover {
  color: var(--link-color);
  transform: translateY(-2px);
}

.contact-links svg {
  width: 28px;
  height: 28px;
}

.talks-page h2 {
  margin-bottom: 20px;
}

.talks-intro {
  color: var(--text-muted);
  margin-bottom: 40px;
  font-size: 1.1em;
}

.talks-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.talk {
  border-left: 4px solid var(--accent-color);
  padding-left: 20px;
}

.talk h3 {
  margin-bottom: 10px;
  color: var(--text-color);
}

.talk-description {
  color: var(--text-secondary);
  margin-bottom: 15px;
  line-height: 1.6;
}

.talk-links {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.talk-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: var(--button-bg);
  border-radius: 6px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.9em;
  transition: background-color 0.2s, color 0.2s;
}

.talk-links a:hover {
  background-color: var(--button-hover-bg);
  color: var(--button-hover-text);
}

.talk-links svg {
  width: 18px;
  height: 18px;
}

/* Code block styles */
code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
  font-size: 0.9em;
}

/* Inline code */
p code,
li code,
td code {
  background-color: var(--code-bg);
  color: var(--text-color);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--code-border);
}

/* Code blocks */
pre {
  background-color: var(--code-bg);
  border: 2px solid var(--code-border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin: 20px 0;
  line-height: 1.5;
}

pre code {
  background-color: transparent;
  border: none;
  padding: 0;
  font-size: 0.85em;
  color: inherit;
}

/* Syntax highlighting theme adjustments */
pre[class*="language-"] {
  background-color: var(--code-bg);
  border: 2px solid var(--code-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] pre[class*="language-"] {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Ensure code blocks in post content have proper spacing */
.post-content pre {
  margin: 25px 0;
}

@media (max-width: 600px) {
  .about-content {
    flex-direction: column;
    align-items: center;
  }

  .profile-picture {
    width: 150px;
    height: 150px;
  }

  .contact-links {
    gap: 15px;
  }

  .contact-links a {
    width: 40px;
    height: 40px;
  }

  .contact-links svg {
    width: 24px;
    height: 24px;
  }

  pre {
    padding: 12px;
    font-size: 0.85em;
  }
}