/* wyatt log — mono-forward, light/dark themed.
 * Inspired by steipete.me + mzsanford.com. */

:root {
  --bg: #ebebeb;
  --card: #ffffff;
  --border: #1a1a1a;
  --text: #1a1a1a;
  --soft: #2d2d2d;
  --muted: #555555;
  --faint: #8a8a8a;
  --line: #e2e2e2;
  --code-bg: #f4f4f4;
  --accent: #27916e;
  --accent-soft: #1f7a5b;
  --accent-line: rgba(39, 145, 110, 0.55);
  --radius: 6px;
  --shadow: 0 1px 0 rgba(0,0,0,0.04);
}

:root[data-theme="dark"] {
  --bg: #1a1a1a;
  --card: #242424;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f0f0f0;
  --soft: #dddddd;
  --muted: #aaaaaa;
  --faint: #777777;
  --line: rgba(255, 255, 255, 0.08);
  --code-bg: rgba(255, 255, 255, 0.06);
  --accent: #2fa57e;
  --accent-soft: #38b88e;
  --accent-line: rgba(47, 165, 126, 0.7);
  --shadow: 0 1px 0 rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

html { color-scheme: light dark; }

body {
  font-family: ui-monospace, "JetBrains Mono", "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  line-height: 1.65;
  max-width: 54rem;
  margin: 0 auto;
  padding: 2.5rem 2rem 5rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--accent); }

p { margin: 1rem 0; }

/* ---- site header ---- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--accent-line);
}
.site-header .brand {
  font-size: 1.45rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.01em;
  color: var(--text);
}
.site-header .brand:hover { color: var(--accent); }
.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.95rem;
}
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
}
.site-header nav a:hover { color: var(--accent); }

.theme-toggle {
  background: transparent;
  border: none;
  padding: 4px;
  margin: 0;
  cursor: pointer;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.theme-toggle:hover { color: var(--accent); }
.theme-toggle svg { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root:not([data-theme="dark"]) .theme-toggle .icon-sun { display: none; }

/* ---- intro / bio block ---- */
.intro {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.75rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 1.75rem;
}
.intro .avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--card);
}
.intro .intro-text {
  flex: 1;
  min-width: 0;
}
.intro .intro-text > :first-child { margin-top: 0; }
.intro h1 {
  font-size: 1.85rem;
  margin: 0 0 1rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.intro p {
  margin: 0.75rem 0;
  color: var(--soft);
  font-size: 0.95rem;
  line-height: 1.65;
}
.intro p a { color: var(--text); }
.intro p a:hover { color: var(--accent); }
.intro .socials {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}
.intro .socials a {
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.intro .socials a:hover { color: var(--accent); }
.intro .socials svg { display: block; }

/* ---- post list (index) ---- */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.post-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}
.post-row .row-title {
  display: inline-block;
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.35;
  letter-spacing: -0.005em;
  color: var(--accent);
}
.post-row .row-title:hover { color: var(--accent-soft); text-decoration: underline; }
.post-row .row-meta {
  font-size: 0.8rem;
  color: var(--faint);
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-style: italic;
}
.post-row .row-meta .cal { color: var(--faint); flex-shrink: 0; }
.post-row .row-meta .dot { opacity: 0.6; font-style: normal; }
.post-row .row-meta time { color: var(--muted); }
.post-row .row-excerpt {
  margin: 0.65rem 0 0;
  color: var(--soft);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ---- single post view ---- */
.back {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  margin: 0 0 2rem;
}
.back:hover { color: var(--accent); text-decoration: underline; }

article.post {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
article.post h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 0.85rem;
  letter-spacing: -0.015em;
  font-weight: 700;
  color: var(--accent);
}
.post-meta {
  font-size: 0.82rem;
  color: var(--faint);
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-style: italic;
}
.post-meta .cal { color: var(--faint); flex-shrink: 0; }
.post-meta .dot { opacity: 0.6; font-style: normal; }
.post-meta time { color: var(--muted); }
.post-meta .post-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  color: var(--faint);
  font-style: normal;
}
.tag { color: var(--faint); }

.post-body {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.7;
}
.post-body p { margin: 1rem 0; }
.post-body a { color: var(--accent); text-decoration-thickness: 1px; }
.post-body a:hover { color: var(--accent-soft); }
.post-body h2 {
  font-family: ui-monospace, "JetBrains Mono", "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.3rem;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.01em;
}
.post-body h3 {
  font-family: ui-monospace, "JetBrains Mono", "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
}
.post-body ul, .post-body ol { padding-left: 1.5rem; }
.post-body li { margin: 0.35rem 0; }
.post-body code {
  font-family: ui-monospace, "JetBrains Mono", "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 3px;
}
.post-body pre {
  background: var(--code-bg);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.85em;
  border-radius: 4px;
  line-height: 1.55;
}
.post-body pre code { background: transparent; padding: 0; }
.post-body blockquote {
  margin: 1.25rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--accent-line);
  color: var(--muted);
  font-style: italic;
}
.post-body hr { border: none; border-top: 1px solid var(--line); margin: 2rem 0; }
.post-body img { max-width: 100%; height: auto; }

/* ---- about / prose ---- */
.prose {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow);
}
.prose h1 {
  font-size: 1.75rem;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
  color: var(--accent);
}
.prose p { margin: 1rem 0; color: var(--soft); }
.prose a { color: var(--accent); }
.prose a:hover { color: var(--accent-soft); }

/* ---- footer ---- */
.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--accent-line);
  font-size: 0.82rem;
  color: var(--faint);
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* ---- loading / errors ---- */
.loading { color: var(--faint); font-style: italic; }
.error {
  background: var(--code-bg);
  padding: 0.75rem 1rem;
  border-left: 2px solid var(--accent);
  font-size: 0.9rem;
  color: var(--soft);
}

/* ---- small screens ---- */
@media (max-width: 600px) {
  body { padding: 2rem 1.25rem 4rem; font-size: 15px; }
  .site-header .brand { font-size: 1.2rem; }
  .site-header nav { gap: 1rem; font-size: 0.85rem; }
  .intro {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
  }
  .intro .avatar { width: 120px; height: 120px; }
  .intro .socials { justify-content: center; }
  .intro h1 { font-size: 1.5rem; }
  article.post { padding: 1.5rem 1.25rem; }
  article.post h1 { font-size: 1.65rem; }
}
