/* joelhmarquez.com — hand-written stylesheet.
   System fonts, serif reading text, dark/light via prefers-color-scheme. */

:root {
  --bg: #fdfdfc;
  --surface: #f4f4f2;
  --text: #1c1c1a;
  --muted: #6b6b66;
  --accent: #2050a0;
  --accent-hover: #173d7c;
  --border: #e3e3de;
  --code-bg: #f2f2ef;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131417;
    --surface: #1b1d20;
    --text: #e8e8e4;
    --muted: #9d9d97;
    --accent: #7aa5e8;
    --accent-hover: #a3c0f2;
    --border: #2c2e33;
    --code-bg: #1e2023;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.wrap {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover, a:focus {
  color: var(--accent-hover);
  text-decoration: underline;
}

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

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}
.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.site-title:hover { color: var(--text); text-decoration: none; }
.site-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-nav a { color: var(--muted); font-size: 0.98rem; }
.site-nav a:hover { color: var(--accent); text-decoration: none; }

/* ---------- Main ---------- */

.site-main {
  padding-top: 2.5rem;
  padding-bottom: 3.5rem;
  min-height: 60vh;
}

/* ---------- Hero / home ---------- */

.hero { text-align: center; padding: 1.5rem 0 2.5rem; }
.hero-photo {
  width: 9.5rem;
  height: 9.5rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 20%;
  border: 1px solid var(--border);
}
.hero-name {
  font-size: 2.4rem;
  line-height: 1.15;
  margin: 1rem 0 0.25rem;
  letter-spacing: -0.02em;
}
.hero-bio { color: var(--muted); font-size: 1.15rem; margin: 0.25rem 0 1rem; }
.hero-links { display: flex; gap: 1.25rem; justify-content: center; flex-wrap: wrap; }

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem 1.75rem;
  margin: 0 auto 3rem;
  max-width: 46rem;
}
.home-section { max-width: 46rem; margin: 0 auto; }
.section-title { font-size: 1.45rem; letter-spacing: -0.01em; margin: 0 0 0.75rem; }
.section-intro { color: var(--muted); margin-top: 0; }
.text-link { font-weight: 600; }

/* ---------- Post lists ---------- */

.post-list { list-style: none; margin: 1.25rem 0 0; padding: 0; }
.post-list-item { border-top: 1px solid var(--border); }
.post-list-item:last-child { border-bottom: 1px solid var(--border); }
.post-list-link {
  display: block;
  padding: 1rem 0.25rem;
  color: var(--text);
}
.post-list-link:hover { text-decoration: none; }
.post-list-link:hover .post-list-title { color: var(--accent); }
.post-list-meta {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}
.post-list-title { display: block; font-size: 1.15rem; font-weight: 650; line-height: 1.35; }
.post-list-desc { display: block; color: var(--muted); margin-top: 0.2rem; font-size: 0.98rem; }

/* ---------- Pages & posts (reading view) ---------- */

.page, .post { max-width: 44rem; margin: 0 auto; }
.page-header h1, .post-title {
  font-size: 2.1rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}
.post-meta { color: var(--muted); font-size: 0.95rem; margin: 0 0 2rem; }
.post-tag {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.05rem 0.6rem;
  font-size: 0.82rem;
  color: var(--muted);
  margin-right: 0.25rem;
}
.post-tag:hover { color: var(--accent); text-decoration: none; }

.page-content, .post-content {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Times New Roman", serif;
  font-size: 1.13rem;
  line-height: 1.75;
}
.page-content p, .post-content p { margin: 0 0 1.35em; }
.page-content h2, .post-content h2 { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 1.5rem; margin: 1.8em 0 0.6em; letter-spacing: -0.01em; }
.page-content h3, .post-content h3 { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 1.22rem; margin: 1.6em 0 0.5em; }
.page-content ul, .post-content ul,
.page-content ol, .post-content ol { margin: 0 0 1.35em; padding-left: 1.4em; }
.page-content li, .post-content li { margin-bottom: 0.35em; }
.page-content img, .post-content img { border-radius: 0.4rem; }
blockquote {
  margin: 1.5em 0;
  padding: 0.25em 1.1em;
  border-left: 3px solid var(--border);
  color: var(--muted);
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.12em 0.35em;
  border-radius: 0.3rem;
}
pre {
  background: var(--code-bg);
  padding: 1rem 1.1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  line-height: 1.5;
}
pre code { background: none; padding: 0; }
hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }
table { border-collapse: collapse; width: 100%; margin: 0 0 1.5em; font-size: 0.95em; }
th, td { border: 1px solid var(--border); padding: 0.45rem 0.7rem; text-align: left; }

/* ---------- Post footer ---------- */

.post-footer { margin-top: 3rem; }
.post-author {
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  font-size: 0.98rem;
}
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 2rem;
}
.post-nav a { display: block; max-width: 48%; }
.post-nav-next { margin-left: auto; text-align: right; }
.post-nav-label { display: block; color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
.post-nav-title { font-weight: 600; }

/* ---------- Tags ---------- */

.tag-index { margin-bottom: 2rem; line-height: 2.1; }
.tag-section { margin-bottom: 2.25rem; }
.tag-section h2 { font-size: 1.3rem; margin-bottom: 0.25rem; }

/* ---------- 404 ---------- */

.lost-container { text-align: center; padding: 3rem 0; }
.lost-image { max-width: 16rem; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-top: 1.4rem;
  padding-bottom: 1.6rem;
}
.footer-meta { margin: 0; }
.footer-links { margin: 0; display: flex; gap: 1.1rem; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent); }

/* ---------- Small screens ---------- */

@media (max-width: 40rem) {
  .hero-name { font-size: 1.9rem; }
  .page-header h1, .post-title { font-size: 1.7rem; }
  .post-nav { flex-direction: column; }
  .post-nav a { max-width: 100%; }
  .post-nav-next { margin-left: 0; text-align: left; }
}
