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

html {
  background-color: #222222;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 1.125rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 4rem;
  line-height: 1.7;
  background-color: #222222;
  color: #d3d3d3;
  min-height: 100vh;
}

@media (min-width: 1440px) {
  body { font-size: 1.25rem; }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
  line-height: 1.1;
  color: #ffffff;
}

h1 { font-size: 2.25rem; margin-top: 0; }
h2 { font-size: 1.625rem; }
h3 { font-size: 1.25rem; }

p, blockquote { margin-bottom: 1.5rem; }
li { margin-bottom: 0.6rem; }
ul, ol { margin-bottom: 1.5rem; padding-left: 1.5rem; }

/* Links */
a {
  color: #add8e6;
  text-decoration: none;
  transition: all 0.2s ease;
}
a:hover {
  color: #87ceeb;
  text-decoration: underline;
}

/* Header and Navigation */
.site-header {
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #444;
}

.main-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-wordmark {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: #fff;
  text-decoration: none;
  transition: color 0.2s ease;
}
.nav-wordmark:hover { color: #add8e6; text-decoration: none; }

.nav-link {
  color: #d3d3d3;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 400;
  transition: all 0.2s ease;
}
.nav-link:hover {
  color: #add8e6;
  text-decoration: none;
  box-shadow: 0 2px 0 #add8e6;
}

.back-link {
  font-size: 0.9rem;
  display: inline-block;
}

/* Blog post list */
.post-list { list-style: none; padding: 0; }

.post-item {
  margin-bottom: 3rem;
  border-bottom: 1px solid #333;
  padding-bottom: 1.75rem;
}
.post-item:last-child { border-bottom: none; }

.post-date {
  color: #888;
  font-size: 0.9rem;
  font-weight: 400;
}

.post-title { margin: 0.5rem 0 0 0; }
.post-title a { text-decoration: none; color: #add8e6; }
.post-title a:hover { color: #87ceeb; }

/* Blog post content */
.post-meta {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.post-content code {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9rem;
  font-family: 'Courier New', monospace;
}

.post-content pre {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 1.5rem;
  border-radius: 5px;
  overflow-x: auto;
  margin: 1.75rem 0;
  line-height: 1.4;
}
.post-content pre code { background: none; padding: 0; }

.post-content blockquote {
  border-left: 4px solid #66b3ff;
  margin: 1.75rem 0;
  padding-left: 1.5rem;
  font-style: italic;
  color: #ccc;
}

/* Sidenotes - Tufte-style margin notes */
.sidenote-article {
  counter-reset: sidenote-counter -1;
}

input.sidenote-toggle {
  display: none;
}

.sidenote-number {
  counter-increment: sidenote-counter;
}

.sidenote-number::after {
  content: counter(sidenote-counter);
  font-size: 0.75em;
  vertical-align: super;
  color: #add8e6;
  margin-left: 0.1em;
}

.sidenote {
  display: none;
  font-weight: normal;
}

@media (max-width: 1024px) {
  .sidenote-number { cursor: pointer; }

  input.sidenote-toggle:checked + .sidenote {
    display: block;
    background: #2d2d2d;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    border-left: 3px solid #add8e6;
    font-size: 0.85rem;
    line-height: 1.45;
    color: #bbb;
  }

  input.sidenote-toggle:checked + .sidenote::before {
    content: counter(sidenote-counter) ". ";
    color: #add8e6;
    font-weight: 500;
  }
}

@media (min-width: 1025px) {
  .sidenote-article {
    max-width: 700px;
    margin-left: 18%;
    margin-right: auto;
  }

  .sidenote {
    display: block;
    float: right;
    clear: right;
    margin-right: -320px;
    width: 240px;
    margin-top: 0.3rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #999;
  }

  .sidenote::before {
    content: counter(sidenote-counter) ". ";
    color: #add8e6;
  }
}
