/* Howtostart.biz — lightweight, self-hosted, no third-party fonts or trackers. */
:root {
  --bg: #ffffff;
  --fg: #1a1d21;
  --muted: #5b6470;
  --accent: #1457e6;
  --accent-dark: #0f47c0;
  --border: #e6e8eb;
  --card: #fafbfc;
  --maxw: 760px;
  --maxw-wide: 1080px;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a; --fg: #e8eaed; --muted: #9aa3ad; --accent: #5b8dff; --accent-dark: #87a9ff;
    --border: #2a2e33; --card: #1c1f23;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font); font-size: 18px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.container { width: 100%; max-width: var(--maxw-wide); margin: 0 auto; padding: 0 20px; }
main.container { max-width: var(--maxw-wide); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
img { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 10; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.25rem; color: var(--fg); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; color: var(--accent); }
.nav { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: 0.95rem; }
.nav a { color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--accent); text-decoration: none; }

/* Home hero */
.home-hero { padding: 2.5rem 0 1.5rem; max-width: var(--maxw); }
.home-hero h1 { font-size: 2.2rem; margin: 0 0 .4rem; letter-spacing: -0.03em; }
.home-hero p { color: var(--muted); font-size: 1.15rem; margin: 0; }

/* Post list / cards */
.post-list { list-style: none; padding: 0; margin: 2rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.6rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .12s ease, box-shadow .12s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.card-img { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--border); }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 1rem 1.1rem 1.2rem; }
.card-body h2 { font-size: 1.15rem; line-height: 1.3; margin: 0 0 .4rem; letter-spacing: -0.01em; }
.card-body h2 a { color: var(--fg); }
.card-body h2 a:hover { color: var(--accent); text-decoration: none; }
.card-desc { color: var(--muted); font-size: .95rem; margin: .4rem 0 0; }
.post-meta { color: var(--muted); font-size: .85rem; margin: 0; }
.post-meta .tag { color: var(--muted); }

/* Pager */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 2.5rem 0 1rem; font-weight: 600; }
.pager-info { color: var(--muted); font-weight: 400; font-size: .9rem; }

/* Single post */
.post { max-width: var(--maxw); margin: 0 auto; padding: 2.5rem 0 1rem; }
.post-header h1 { font-size: 2.3rem; line-height: 1.15; letter-spacing: -0.03em; margin: .3rem 0 0; }
.post-header .post-meta { margin-bottom: .5rem; }
.post-header .tag { font-weight: 600; }
.post-feature { width: 100%; border-radius: var(--radius); margin: 1.8rem 0; aspect-ratio: 16 / 9; object-fit: cover; }
.post-content { font-size: 1.075rem; }
.post-content h2 { font-size: 1.6rem; margin: 2.2rem 0 .8rem; letter-spacing: -0.02em; }
.post-content h3 { font-size: 1.3rem; margin: 1.8rem 0 .6rem; }
.post-content p, .post-content ul, .post-content ol { margin: 0 0 1.2rem; }
.post-content img { border-radius: 8px; margin: 1.4rem 0; }
.post-content a { text-decoration: underline; text-underline-offset: 2px; }
.post-content blockquote { margin: 1.4rem 0; padding: .4rem 1.2rem; border-left: 3px solid var(--accent); color: var(--muted); }
.post-content pre { background: #0d1117; color: #e6edf3; padding: 1rem 1.2rem; border-radius: 8px; overflow-x: auto; font-size: .9rem; }
.post-content code { background: var(--card); border: 1px solid var(--border); padding: .1em .35em; border-radius: 4px; font-size: .9em; }
.post-content pre code { background: none; border: 0; padding: 0; }
.post-content table { width: 100%; border-collapse: collapse; margin: 1.4rem 0; font-size: .95rem; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: .5rem .7rem; text-align: left; }

/* Subscribe */
.subscribe-embed { max-width: var(--maxw); margin: 3rem auto 1.5rem; }
.subscribe-embed iframe { width: 100% !important; }
.subscribe { max-width: var(--maxw); margin: 3rem auto 1rem; padding: 1.8rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); text-align: center; }
.subscribe h2 { margin: 0 0 .4rem; font-size: 1.4rem; }
.subscribe p { color: var(--muted); margin: 0 0 1.1rem; }
.subscribe-form { display: flex; gap: .6rem; max-width: 440px; margin: 0 auto; flex-wrap: wrap; justify-content: center; }
.subscribe-form input { flex: 1 1 220px; padding: .7rem .9rem; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; background: var(--bg); color: var(--fg); }
.subscribe-form button { padding: .7rem 1.4rem; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 600; font-size: 1rem; cursor: pointer; }
.subscribe-form button:hover { background: var(--accent-dark); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; padding: 2rem 0 3rem; }
.copyright { text-align: center; color: var(--muted); font-size: .9rem; margin: 1.5rem 0 0; }

/* Error */
.error-page { max-width: var(--maxw); margin: 4rem auto; text-align: center; }

@media (max-width: 600px) {
  body { font-size: 17px; }
  .home-hero h1 { font-size: 1.8rem; }
  .post-header h1 { font-size: 1.8rem; }
  .post-list { grid-template-columns: 1fr; }
}
