* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  background-color: var(--bg);
  font-family: "DM Sans", Avenir, Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.45em;
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.2s, color 0.2s;
}

:root {
  --bg: #ffffff;
  --bg2: #f7f7f7;
  --text: #222;
  --muted: #999;
  --border: #ddd;
  --link: #0055cc;
}
.dark {
  --bg: #111;
  --bg2: #1a1a1a;
  --text: #e4e4e4;
  --muted: #555;
  --border: #2a2a2a;
  --link: #6699ff;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  opacity: 0.75;
}

.container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.inner {
  max-width: 740px;
  margin: 0 auto;
  padding: 36px 32px 24px;
  width: 100%;
  flex: 1;
}

.header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
}
.header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.title {
  font-family: "DM Sans", Helvetica, Arial;
  font-weight: 300;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--text) !important;
  margin: 0;
  line-height: 1em;
}
.title:hover,
.title:visited {
  color: var(--text) !important;
}
.tagline {
  font-size: 11px;
  color: var(--muted);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav {
  display: flex;
  gap: 20px;
  align-items: center;
}
.nav a {
  color: var(--muted) !important;
  font-size: 13px;
}
.nav a:hover {
  color: var(--text) !important;
  opacity: 1;
}
.nav a:visited {
  color: var(--muted) !important;
}
.theme-toggle {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--muted);
  flex-shrink: 0;
}
.theme-toggle:hover {
  color: var(--text);
  border-color: var(--muted);
}
.theme-toggle svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

/* show/hide correct icon based on theme */
.icon-moon { display: block; }
.icon-sun  { display: none;  }
.dark .icon-moon { display: none;  }
.dark .icon-sun  { display: block; }

.pixel-strip {
  display: flex;
  gap: 3px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  opacity: 0.3;
  overflow: hidden;
  width: 100%;
}
.px {
  width: 5px;
  height: 5px;
  flex-shrink: 0;
  background: var(--muted);
}
.px.lit {
  background: var(--text);
  opacity: 0.9;
}

.content {
  width: 100%;
}
.content h1 {
  font-family: "DM Sans", Helvetica, Arial;
  font-weight: 300;
  font-size: 26px;
  line-height: 1em;
  letter-spacing: -0.02em;
  margin-top: 0;
  margin-bottom: 18px;
  color: var(--text);
}
.post {
  margin-bottom: 26px;
}
.post-link {
  font-size: 17px;
  font-weight: 300;
  color: var(--link);
}
.post-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.post-body {
  line-height: 1.7em;
}
.post-body p {
  margin: 14px 0;
}
.post-body h2 {
  font-weight: 300;
  font-size: 20px;
  letter-spacing: -0.02em;
  margin: 28px 0 10px;
}
.post-body h3 {
  font-weight: 400;
  font-size: 16px;
  margin: 22px 0 8px;
}
.empty-note {
  color: var(--muted);
  line-height: 1.7em;
  margin: 0 0 14px 0;
}
p {
  margin: 12px 0;
  color: var(--text);
}
ul {
  margin: 12px 0;
  padding-left: 20px;
  color: var(--text);
}
ul li {
  margin-bottom: 4px;
}

.footer {
  width: 100%;
  padding: 14px 32px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 0;
}
.footer-links {
  display: flex;
  gap: 14px;
}
.footer-links a {
  color: var(--muted);
}
.footer-links a:hover {
  color: var(--text);
  opacity: 1;
}

code {
  font-family: Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  background: var(--bg2);
  padding: 1px 5px;
}
pre {
  overflow-x: auto;
  padding: 12px;
  background: var(--bg2);
}
pre code {
  background: none;
  padding: 0;
}

@media only screen and (max-width: 760px) {
  body {
    -webkit-text-size-adjust: none;
  }
  .header,
  .footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .inner {
    padding: 24px 16px;
  }
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .content h1 {
    font-size: 22px;
  }
  .title {
    font-size: 20px;
  }
}
