:root {
  --bg-color: #FFFEF9;
  --text-color: #1a1a1a;
  --text-secondary: #2a2a2a;
  --text-muted: #8b8680;
  --text-subtle: #4a4a4a;
  --accent-color: #3d2f24;
  --accent-hover: #5a4535;
  --border-color: #e5e5e5;
  --border-accent: #3d2f24;
  --code-bg: #f5f5f0;
  --separator: rgba(0, 0, 0, 0.06);
}

html[data-theme='dark'] {
  --bg-color: #1e1e1e;
  --text-color: #e0e0e0;
  --text-secondary: #d0d0d0;
  --text-muted: #999999;
  --text-subtle: #b8b8b8;
  --accent-color: #c4a68a;
  --accent-hover: #d4b89a;
  --border-color: #444;
  --border-accent: #c4a68a;
  --code-bg: #0f0f0f;
  --separator: rgba(255, 255, 255, 0.06);
}

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

body {
  font-family: 'Iowan Old Style', 'Palatino Linotype', 'URW Palladio L', P052, serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  transition: background-color 0.3s ease, color 0.3s ease;
  font-variant-numeric: oldstyle-nums;
}


main {
  min-height: 60vh;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-color);
  font-weight: normal;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.8rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-weight: normal;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-weight: normal;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-color);
  transition: color 0.2s ease, border-bottom-color 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

a:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

a:focus:not(:focus-visible) {
  outline: none;
}

.post-list {
  list-style: none;
  margin-top: 0;
}

.post-item {
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

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

.post-title {
  font-size: 1.35rem;
  margin-bottom: 0.1rem;
}

.post-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.post-meta {
  margin-bottom: 2rem;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

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

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

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

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

.post-content code {
  background-color: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--text-color);
}

.post-content pre {
  background-color: var(--code-bg);
  padding: 1.5rem;
  overflow-x: auto;
  margin: 2rem 0;
  border-left: 3px solid var(--border-accent);
}

.post-content pre code {
  background-color: transparent;
  padding: 0;
}

.post-content blockquote {
  border-left: 3px solid var(--border-accent);
  padding-left: 2rem;
  margin-left: 0;
  margin: 2rem 0;
  color: var(--text-subtle);
  font-style: italic;
}

footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--border-accent);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.homepage-layout,
.single-layout {
  display: flex;
  flex-direction: row;
  gap: 5rem;
  padding: 3rem 0;
  align-items: flex-start;
}

.sidebar {
  flex: 0 0 auto;
  width: 200px;
}

.site-name {
  font-size: 1rem;
  font-weight: normal;
  margin-bottom: 1.5rem;
  color: var(--text-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-bottom-color 0.2s ease;
  display: inline-block;
  letter-spacing: -0.02em;
}

.site-name:hover {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

.site-name:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.site-name:focus:not(:focus-visible) {
  outline: none;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

.sidebar-links a {
  font-size: 0.95rem;
  color: var(--text-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-bottom-color 0.2s ease;
  display: inline-block;
}

.sidebar-links a:hover {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

.sidebar-links a:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.sidebar-links a:focus:not(:focus-visible) {
  outline: none;
}

.sidebar-links #theme-toggle {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-color);
  padding: 0;
  display: block;
  text-align: left;
  margin-top: 0.5rem;
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.sidebar-links #theme-toggle:hover {
  color: var(--accent-color);
  opacity: 0.8;
  transform: scale(1.1);
}

.sidebar-links #theme-toggle:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.sidebar-links #theme-toggle:focus:not(:focus-visible) {
  outline: none;
}

.posts-column,
.content-column {
  flex: 1 1 auto;
}

.post-line {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--separator);
}

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

.post-line-title {
  color: var(--text-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-bottom-color 0.2s ease;
  margin-right: 1rem;
  font-variant-numeric: tabular-nums;
}

.post-line-title:hover {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

.post-line-title:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.post-line-title:focus:not(:focus-visible) {
  outline: none;
}

.post-line-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
  body {
    padding: 1.5rem;
  }

  .homepage-layout,
  .single-layout {
    flex-direction: column;
    gap: 2rem;
    padding: 1.5rem 0;
  }

  .sidebar {
    width: 100%;
  }

  .site-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .site-name {
    margin-bottom: 0;
  }

  .sidebar-links {
    flex-direction: row;
    gap: 1rem;
    margin-top: 0;
    align-items: center;
  }

  .sidebar-links #theme-toggle {
    margin-top: 0;
    display: inline-flex;
    align-items: center;
  }

  .posts-column,
  .content-column {
    width: 100%;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.2rem;
  }
}
