/* Between Pixels — clean editorial style */

:root {
  color-scheme: light;
  --bg: #faf8f2;
  --ink: #111111;
  --muted: #595959;
  --accent: #8c1d18;
  --rule: #d6d2c4;
  --code-bg: #efeadf;
  --serif: "Times New Roman", "Tinos", Times, serif;
  --sans: "Times New Roman", "Tinos", Times, serif;
  --mono: "D2Coding", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #181713;
  --ink: #e8e5da;
  --muted: #a09b8c;
  --accent: #d3755f;
  --rule: #36332a;
  --code-bg: #24221b;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0 auto;
  max-width: 42rem;
  padding: 0 1.25rem 2rem;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  transition: background-color 0.2s ease, color 0.2s ease;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Header & footer */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.5rem;
}

.theme-toggle {
  appearance: none;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.site-name {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

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

.site-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
}

.site-footer p {
  margin: 0;
  line-height: 1;
}

.footer-square {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid currentColor;
  border-radius: 1px;
  box-sizing: border-box;
}

/* Post list */

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

.post-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}

.post-list li:first-child {
  padding-top: 0;
}

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

.post-list time {
  display: block;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.post-list h2 {
  font-family: var(--serif);
  font-size: 1.625rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0;
}

.post-list h2 a {
  color: var(--ink);
  text-decoration: none;
}

.post-list h2 a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* Post page */

.back-link {
  margin: 0 0 2rem;
  font-size: 0.9375rem;
}

.back-link a {
  color: var(--accent);
  text-decoration: none;
}

.back-link a:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.post-title {
  font-family: var(--serif);
  font-size: 2.5rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.post-meta {
  margin: 0 0 2.25rem;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.status {
  color: var(--muted);
}

.status--error {
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 0.75rem;
}

/* Rendered Markdown */

.post-content h1,
.post-content h2,
.post-content h3 {
  font-family: var(--serif);
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 2.25rem 0 0.75rem;
}

.post-content h1 { font-size: 2rem; }
.post-content h2 { font-size: 1.625rem; }
.post-content h3 { font-size: 1.3125rem; }

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

.post-content a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

.post-content a:hover {
  text-decoration-thickness: 2px;
}

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

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

.post-content li::marker {
  color: var(--muted);
}

.post-content blockquote {
  margin: 0 0 1.25rem;
  padding-left: 1rem;
  border-left: 3px solid var(--rule);
  color: var(--muted);
  font-style: italic;
}

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

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

.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem 0;
}

.post-content code {
  font-family: var(--mono);
  font-size: 0.875em;
  font-variant-ligatures: common-ligatures;
  background: var(--code-bg);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

.post-content pre {
  font-family: var(--mono);
  font-variant-ligatures: common-ligatures;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 0 0 1.25rem;
  line-height: 1.55;
}

.post-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.875rem;
}

/* Responsive */

@media (max-width: 34rem) {
  body {
    font-size: 1rem;
    padding: 0 1rem 3rem;
  }

  .site-header {
    padding-top: 1.75rem;
    margin-bottom: 1.75rem;
  }

  .post-title {
    font-size: 2rem;
  }

  .post-list h2 {
    font-size: 1.4375rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
