:root {
  --bg: #141414;
  --bg-alt: #1e1e1e;
  --text: #e0ddd6;
  --text-muted: #8a8880;
  --accent: #c8b89a;
  --border: #2e2e2e;
  --font-serif: 'EB Garamond', 'Cormorant Garamond', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --sidebar-width: 280px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ========== SIDEBAR ========== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 3rem 2rem;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 100;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
}

.site-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 2rem;
  letter-spacing: -0.3px;
}

.site-title a:hover {
  color: inherit;
}

.nav-list {
  list-style: none;
  margin-bottom: 1.5rem;
}

.nav-list li {
  margin-bottom: 0.4rem;
}

.nav-list a {
  font-size: 17px;
}

.nav-list a.active {
  color: var(--accent);
}

.nav-sublist {
  list-style: none;
  padding-left: 1rem;
}

.nav-sublist li {
  margin-bottom: 0.3rem;
}

.nav-sublist a {
  font-size: 15px;
  color: var(--text-muted);
}

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

/* ========== PROFILE PHOTO ========== */

.profile-photo {
  float: right;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 0 1.5rem 1.5rem;
  shape-outside: circle();
}

/* ========== CONTENT ========== */

.content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 3rem 4rem;
  max-width: 800px;
  min-height: 100vh;
}

.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 50%;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 1.5rem;
}

.back-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

h1 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
}

h2 {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2.5rem;
  margin-bottom: 0.8rem;
}

h3 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
}

p {
  margin-bottom: 1.2rem;
}

/* ========== BLOG INDEX ========== */

.blog-index h1 {
  margin-bottom: 2rem;
}

.year-heading {
  font-size: 24px;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

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

.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
}

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

.post-list a {
  font-size: 17px;
}

.post-list .post-date {
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: 1rem;
  flex-shrink: 0;
}

/* ========== POST ========== */

.post-header {
  margin-bottom: 2rem;
}

.post-title {
  font-size: 34px;
  margin-bottom: 0.5rem;
}

.post-meta {
  font-size: 15px;
  color: var(--text-muted);
}

.post-body h2 {
  margin-top: 2.5rem;
}

.post-body h3 {
  margin-top: 2rem;
}

.post-body p {
  margin-bottom: 1.2rem;
}

.post-body blockquote {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border);
  font-style: italic;
  color: var(--text-muted);
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-alt);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.post-body pre {
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  font-size: 0.85em;
  line-height: 1.6;
  border-radius: 2px;
}

.post-body pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

.post-body ul,
.post-body ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.post-body li {
  margin-bottom: 0.3rem;
}

.post-body img {
  max-width: 100%;
  height: auto;
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.post-body a {
  color: var(--accent);
}

.post-body a:hover {
  text-decoration: underline;
}

/* ========== PAGE ========== */

.page-title {
  margin-bottom: 1.5rem;
}

.page-body p {
  margin-bottom: 1.2rem;
}

.page-body ul {
  list-style: none;
  padding: 0;
}

.page-body ul li {
  margin-bottom: 0.5rem;
}

.page-body ul li a {
  color: var(--accent);
}

.page-body ul li a:hover {
  text-decoration: underline;
}

/* ========== FOOTER ========== */

.footer-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0 1.5rem 0;
}

.site-footer {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  padding-bottom: 2rem;
}

.footer-sep {
  margin: 0 0.5rem;
}

.site-footer a {
  color: var(--text-muted);
}

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

.footer-hand {
  font-size: 14px;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
  body {
    font-size: 17px;
    line-height: 1.7;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    padding: 1rem 1.5rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    z-index: 1000;
  }

  .nav-toggle {
    display: block;
    z-index: 1001;
  }

  .sidebar-inner {
    display: none;
    margin-top: 1rem;
  }

  .nav-open .sidebar-inner {
    display: block;
  }

  .content {
    margin-left: 0;
    padding: 5rem 1.5rem 2rem;
    max-width: 100%;
  }

  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 23px;
  }

  h3 {
    font-size: 20px;
  }

  .post-title {
    font-size: 28px;
  }

  .post-list li {
    flex-direction: column;
    align-items: flex-start;
  }

  .post-list .post-date {
    margin-left: 0;
    margin-top: 0.1rem;
  }
}
