/* =============================================================
   homemadesoftware.net — site.css
   Edit freely. One file, top to bottom, no magic.
   ============================================================= */

/* --- tokens -------------------------------------------------- */
:root {
  --bg:     #ffffff;
  --bg2:    #f5f5f5;
  --text:   #111111;
  --muted:  #666666;
  --line:   #dddddd;
  --font:   -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --bg:    #111111;
  --bg2:   #181818;
  --text:  #eeeeee;
  --muted: #aaaaaa;
  --line:  #333333;
}

/* --- reset ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { background: var(--bg); }
body  { min-height: 100vh; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a     { color: inherit; text-decoration: none; }
img   { display: block; max-width: 100%; }

/* --- shell (max-width wrapper) ------------------------------- */
.shell { width: min(960px, calc(100% - 32px)); margin: auto; }

/* --- nav ----------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 52px; gap: 16px; }

.brand { font-size: 1rem; font-weight: 700; }

.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a { font-size: 0.875rem; color: var(--muted); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }

.theme-toggle {
  width: 28px; height: 28px; padding: 0;
  font-size: 0.85rem; cursor: pointer;
  color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 4px;
}
.theme-toggle:hover { color: var(--text); }

/* --- home page ----------------------------------------------- */
.home { padding: 56px 0 64px; }

.home-title {
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.home-desc {
  font-size: 1rem;
  color: var(--muted);
  max-width: 52ch;
  margin-bottom: 36px;
}

/* --- latest posts on home ------------------------------------ */
.home-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.post-list { list-style: none; border-top: 1px solid var(--line); }

.post-list li { border-bottom: 1px solid var(--line); }

.post-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 14px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.post-list a:hover { color: var(--muted); }

.post-list .post-meta {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* --- social follow block (home) ------------------------------ */
.follow-block { margin-top: 48px; }

.follow-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.follow-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 16px;
  max-width: 54ch;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
}
.social-links a:hover { border-color: var(--text); }

.follow-social-label { margin-top: 20px; margin-bottom: 10px; }

/* --- blog listing page --------------------------------------- */
.page-hero { padding: 48px 0 32px; border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.page-hero p  { color: var(--muted); }

.eyebrow { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }

.section { padding: 32px 0; }

.listing { list-style: none; border-top: 1px solid var(--line); }
.listing li { border-bottom: 1px solid var(--line); }

.listing-card {
  display: block;
  padding: 20px 0;
  color: var(--text);
}
.listing-card:hover .listing-card-title { color: var(--muted); }

.listing-card .tag { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 6px; }
.listing-card-title { font-size: 1.15rem; font-weight: 700; line-height: 1.3; margin-bottom: 4px; }
.listing-card p { font-size: 0.9rem; color: var(--muted); }

/* --- footer -------------------------------------------------- */
.site-footer { padding: 24px 0; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 0.82rem; color: var(--muted); }
.footer-inner a { text-decoration: underline; text-underline-offset: 3px; }
.footer-inner a:hover { color: var(--text); }

/* --- 404 ---------------------------------------------------- */
.not-found { padding: 80px 0; }
.not-found h1 { font-size: clamp(2.5rem, 8vw, 5rem); font-weight: 700; margin-bottom: 12px; }
.not-found p  { color: var(--muted); margin-bottom: 24px; }

.btn {
  display: inline-flex; align-items: center; height: 38px; padding: 0 16px;
  font-size: 0.875rem; font-weight: 600; border-radius: 6px;
  background: var(--text); color: var(--bg); border: none; cursor: pointer;
}
.btn:hover { opacity: 0.8; }

/* --- mobile -------------------------------------------------- */
@media (max-width: 600px) {
  .home { padding: 40px 0 52px; }
  .page-hero { padding: 36px 0 24px; }
  .post-list a { flex-direction: column; gap: 2px; }
  .post-list .post-meta { align-self: flex-start; }
}

/* --- reduced motion ----------------------------------------- */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
