@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap');

:root {
  --bg: #FFFFFF;
  --bg-dark: #111111;
  --surface: #1A1A1A;
  --accent: #C4553A;
  --accent-muted: #D4846F;
  --text-primary: #1A1A1A;
  --text-secondary: #333333;
  --text-tertiary: #555555;
  --border-color: #E0E0E0;
  --bg-subtle: #F9F9F9;
  --content-width: 720px;
  --hero-bg: #1A1A1A;
  --hero-text: #F0EDED;
  --hero-link: #A0A0A0;
  --footer-bg: #1A1A1A;
  --footer-text: #F0EDED;
  --footer-link: #A0A0A0;
  --code-bg: #1A1A1A;
  --code-text: #F0EDED;
  --mono-bg: #1A1A1A;
  --toggle-bg: #1A1A1A;
  --toggle-text: #FFFFFF;
}

[data-theme="dark"] {
  --bg: #111111;
  --surface: #1A1A1A;
  --text-primary: #F0EDED;
  --text-secondary: #A0A0A0;
  --text-tertiary: #666666;
  --border-color: #2A2A2A;
  --bg-subtle: #1A1A1A;
  --hero-bg: #1A1A1A;
  --hero-text: #F0EDED;
  --hero-link: #A0A0A0;
  --footer-bg: #1A1A1A;
  --footer-text: #F0EDED;
  --footer-link: #A0A0A0;
  --code-bg: #333333;
  --code-text: #F0EDED;
  --mono-bg: #F0EDED;
  --toggle-bg: #F0EDED;
  --toggle-text: #111111;
}

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

body {
  font-family: 'Space Mono', monospace;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 24px 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.monogram {
  width: 32px;
  height: 32px;
  background: var(--mono-bg);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

[data-theme="dark"] .monogram {
  color: #111111;
}

.header-name {
  font-size: 18px;
  font-weight: 700;
}

.header-name-short {
  display: none;
}

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

.nav a {
  color: var(--text-secondary);
  font-size: 14px;
  text-decoration: none;
}

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

.nav-active {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.nav-active a {
  color: var(--text-primary);
  font-weight: 700;
}

.nav-active::after {
  content: '';
  width: 16px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* Theme Toggle */
.theme-toggle {
  width: 32px;
  height: 32px;
  background: var(--toggle-bg);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-family: 'Space Mono', monospace;
  color: var(--toggle-text);
  transition: background 0.2s, color 0.2s;
}

.theme-toggle:hover {
  opacity: 0.8;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
}

.theme-toggle .icon-sun {
  display: inline;
}

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

[data-theme="dark"] .theme-toggle .icon-moon {
  display: inline;
}

/* Hero */
.hero {
  background: var(--hero-bg);
  padding: 48px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hero-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-description {
  font-size: 14px;
  color: var(--hero-text);
  max-width: var(--content-width);
  text-align: center;
  line-height: 1.7;
}

.hero-links {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.hero-links a {
  color: var(--hero-link);
  text-decoration: none;
}

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

.hero-links .dot,
.hero-links .location {
  color: var(--hero-link);
}

/* Posts Section */
.posts-section {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.year-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.year-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0;
}

.post-item {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-primary);
}

.post-item:hover .post-title {
  color: var(--accent);
}

.post-date {
  font-size: 13px;
  color: var(--text-tertiary);
  white-space: nowrap;
  min-width: 50px;
}

.post-title {
  font-size: 14px;
  font-weight: 400;
  transition: color 0.15s;
}

/* Footer */
.footer {
  background: var(--footer-bg);
  padding: 32px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--footer-text);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 13px;
  color: var(--footer-link);
  text-decoration: none;
}

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

.footer-location {
  font-size: 13px;
  color: var(--footer-link);
}

.footer-prompt {
  font-size: 13px;
  color: var(--footer-link);
  font-style: italic;
}

/* Article Page */
.article-header {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 48px 20px 0;
}

.article-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
}

.article-meta {
  font-size: 13px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 40px;
}

.article-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 20px 48px;
}

.article-content p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.article-content h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 40px;
  margin-bottom: 16px;
}

.article-content h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 32px;
  margin-bottom: 12px;
}

.article-content ul,
.article-content ol {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 24px;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 8px;
}

.article-content a {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.article-content a:hover {
  color: var(--accent);
}

.article-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  margin-bottom: 24px;
  color: var(--text-secondary);
  font-style: italic;
}

/* Code blocks */
.article-content pre {
  background: var(--code-bg);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  overflow-x: auto;
}

.article-content pre code {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--code-text);
}

.article-content code {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 3px;
}

.article-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

/* Code syntax highlighting */
.hljs-keyword { color: #C4553A; }
.hljs-string { color: #98C379; }
.hljs-comment { color: #6B6B6B; font-style: italic; }
.hljs-function { color: #61AFEF; }
.hljs-number { color: #D19A66; }
.hljs-property { color: #E5C07B; }
.hljs-title { color: #61AFEF; }
.hljs-params { color: #F0EDED; }
.hljs-built_in { color: #E5C07B; }
.hljs-literal { color: #D19A66; }
.hljs-attr { color: #E5C07B; }

.back-link {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 20px 48px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.back-link a {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
}

.back-link a:hover {
  color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    padding: 16px 20px;
  }

  .header-name {
    font-size: 16px;
  }

  .header-name-full {
    display: none;
  }

  .header-name-short {
    display: inline;
  }

  .nav {
    gap: 16px;
  }

  .theme-toggle {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .hero {
    padding: 32px 20px;
  }

  .hero-description {
    text-align: left;
  }

  .article-title {
    font-size: 22px;
  }

  .post-item {
    flex-direction: column;
    gap: 4px;
  }
}
