/* 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; }
.byline { color: var(--muted); font-size: .9rem; margin: .4rem 0 0; }
.byline a { color: var(--muted); text-decoration: underline; }
.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; }
.related-guides { margin: 2.4rem 0 .5rem; padding: 1.2rem 1.4rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.related-guides h2 { margin: 0 0 .6rem; font-size: 1.15rem; letter-spacing: -0.01em; }
.related-guides ul { margin: 0; padding-left: 1.2rem; }
.related-guides li { margin: .35rem 0; }

/* 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; }

/* Topics & search (browse IA) */
.hero-actions { margin-top: 1.4rem; display: flex; gap: .6rem; flex-wrap: wrap; }
.btn { display: inline-block; padding: .6rem 1.1rem; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 600; }
.btn:hover { background: var(--accent-dark); text-decoration: none; color: #fff; }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--card); color: var(--accent); }
.section-title { font-size: 1.3rem; letter-spacing: -0.01em; margin: 2.5rem 0 1rem; }
.eyebrow { margin: 0 0 .3rem; font-size: .9rem; }
.eyebrow a { color: var(--muted); }

.topic-grid { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.topic-card a { display: flex; flex-direction: column; gap: .25rem; padding: 1.1rem 1.2rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); height: 100%; transition: transform .12s ease, border-color .12s ease; }
.topic-card a:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.topic-emoji { font-size: 1.5rem; }
.topic-name { font-weight: 700; color: var(--fg); }
.topic-count { display: inline-block; margin-left: .3rem; font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 0 .5rem; }
.topic-desc { color: var(--muted); font-size: .9rem; }

.link-list { list-style: none; padding: 0; margin: 1.2rem 0; }
.link-list li { padding: .4rem 0; border-bottom: 1px solid var(--border); break-inside: avoid; }
.link-list a { color: var(--fg); }
.link-list a:hover { color: var(--accent); }
@media (min-width: 720px) { .link-list { columns: 2; column-gap: 2.5rem; } }

.search-box { margin: 1.5rem 0 .5rem; }
#search-input { width: 100%; padding: .9rem 1.1rem; font-size: 1.1rem; border: 2px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--fg); }
#search-input:focus { outline: none; border-color: var(--accent); }
.search-cat { font-size: .78rem; color: var(--muted); background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 0 .5rem; margin-left: .4rem; white-space: nowrap; }
.search-empty { color: var(--muted); }

/* Quotes */
.quote-hero { color: #fff; background: var(--grad, linear-gradient(135deg,#1457e6,#5b8dff)); border-radius: var(--radius); padding: 2.5rem 1.6rem; }
.quote-hero h1, .quote-hero p { color: #fff; }
.quote-hero .eyebrow a { color: rgba(255,255,255,.85); }
.quote-feature { color: #fff; background: var(--grad, linear-gradient(135deg,#1457e6,#5b8dff)); border-radius: var(--radius); padding: 3rem 2rem; text-align: center; margin: 1.5rem 0; }
.quote-big { font-size: 1.9rem; line-height: 1.35; font-weight: 700; letter-spacing: -0.02em; margin: 0 auto; max-width: 720px; }
.quote-theme-tag { margin: 1.3rem 0 0; }
.quote-theme-tag a { color: rgba(255,255,255,.92); font-weight: 600; }
.quote-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1.2rem 0; }
.quote-list { list-style: none; padding: 0; margin: 1.2rem 0; }
.quote-item { padding: .7rem 0; border-bottom: 1px solid var(--border); font-size: 1.05rem; }
.quote-item a { color: var(--fg); }
.quote-item a:hover { color: var(--accent); }
.quote-page { max-width: var(--maxw-wide); margin: 0 auto; }
button.btn { cursor: pointer; border: 0; font: inherit; }
.card-maker { max-width: 600px; margin: 1.5rem auto; }
#qc-text { width: 100%; padding: .9rem 1.1rem; font-size: 1.05rem; border: 2px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--fg); }
.qc-controls { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin: .8rem 0; }
.qc-label { font-size: .9rem; color: var(--muted); }
#qc-bg { padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--fg); margin-left: .4rem; }
#qc-canvas { width: 100%; max-width: 480px; height: auto; aspect-ratio: 1 / 1; border-radius: 12px; display: block; margin: 1rem auto; box-shadow: 0 8px 24px rgba(0,0,0,.12); }

/* Tools */
.tool-page { max-width: var(--maxw-wide); margin: 0 auto; }
.tool-lede { font-size: 1.15rem; color: var(--muted); }
.tool-widget { margin: 1.5rem 0; }
.tool-fields { display: grid; gap: .9rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; }
.tool-field { display: grid; grid-template-columns: 1fr auto; gap: .4rem 1rem; align-items: center; }
.tool-flabel { font-size: .98rem; }
.tool-hint { color: var(--muted); font-style: normal; font-size: .85rem; }
.tool-input { display: inline-flex; align-items: center; gap: .3rem; }
.tool-affix { color: var(--muted); font-size: .95rem; }
.tool-input input, .tool-input select { width: 130px; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--fg); font: inherit; text-align: right; }
.tool-input select { width: auto; text-align: left; }
.tool-result { margin-top: 1.2rem; display: grid; gap: .1rem; }
.result-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .7rem .2rem; border-bottom: 1px solid var(--border); }
.result-label { color: var(--muted); }
.result-value { font-weight: 700; font-size: 1.1rem; text-align: right; }
.result-value small { display: block; font-weight: 400; font-size: .8rem; color: var(--muted); }
.result-big { background: var(--accent); color: #fff; border-radius: 10px; padding: 1rem 1.1rem; margin-bottom: .4rem; border: 0; }
.result-big .result-label { color: rgba(255,255,255,.85); }
.result-big .result-value { color: #fff; font-size: 1.5rem; }
.result-big .result-value small { color: rgba(255,255,255,.82); }
.tool-note { font-size: .92rem; color: var(--muted); background: var(--card); border-left: 3px solid var(--accent); padding: .7rem 1rem; border-radius: 0 8px 8px 0; margin-top: 1.2rem; }
.tool-related { margin-top: 2rem; }
.tool-disclaimer { font-size: .82rem; color: var(--muted); margin-top: 1.5rem; }
.tool-embed { margin-top: 2rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.4rem; }
.tool-embed h2 { margin-top: 0; font-size: 1.1rem; }
.embed-code { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--fg); resize: vertical; margin-bottom: .7rem; box-sizing: border-box; }

/* Generators */
.gen-controls { display: grid; gap: .8rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; }
.gen-control { display: grid; gap: .3rem; }
.gen-control span { font-size: .95rem; }
.gen-control input, .gen-control select { padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--fg); font: inherit; }
.gen-actions { margin: 1rem 0; }
.gen-list { display: grid; gap: .5rem; }
.gen-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .65rem .9rem; background: var(--card); border: 1px solid var(--border); border-radius: 8px; }
.gen-text { font-weight: 600; }
.gen-item-actions { display: inline-flex; align-items: center; gap: .7rem; white-space: nowrap; }
.gen-copy { cursor: pointer; border: 1px solid var(--border); background: var(--bg); color: var(--muted); border-radius: 6px; padding: .25rem .6rem; font: inherit; font-size: .82rem; }
.gen-copy:hover { color: var(--accent); border-color: var(--accent); }
.gen-link { font-size: .82rem; white-space: nowrap; }

/* Quizzes */
.quiz-intro { color: var(--muted); }
.quiz-q { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 0 0 1rem; }
.quiz-q legend { font-weight: 700; padding: 0 .4rem; }
.quiz-opt { display: flex; align-items: flex-start; gap: .6rem; padding: .5rem 0; cursor: pointer; }
.quiz-opt input { margin-top: .3rem; }
.quiz-card { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 1.4rem 1.5rem; margin-top: 1rem; }
.quiz-badge { display: inline-block; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); font-weight: 700; }
.quiz-card h2 { margin: .3rem 0 .6rem; }
.quiz-body a { font-weight: 600; }

/* Builders (plan, invoice, cold email) */
.builder { display: grid; gap: 1.5rem; }
.builder-field { display: grid; gap: .3rem; margin-bottom: .8rem; }
.builder-field span { font-size: .92rem; color: var(--muted); }
.builder-field input, .builder-field textarea { padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--fg); font: inherit; width: 100%; }
.builder-actions { margin-top: 1rem; }
.print-doc { background: #ffffff; color: #1a1d21; border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; box-shadow: 0 4px 18px rgba(0,0,0,.06); }
.print-doc h2, .print-doc h3, .print-doc strong { color: #1a1d21; }
.plan-head { border-bottom: 2px solid #1a1d21; padding-bottom: .8rem; margin-bottom: 1rem; }
.plan-oneliner { font-size: 1.05rem; font-style: italic; }
.plan-row { margin: 1rem 0; }
.plan-row h3 { margin: 0 0 .2rem; font-size: 1rem; }
.plan-row p { margin: 0; color: #1a1d21; }

/* Invoice */
.inv-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem 1rem; }
.inv-input-table { width: 100%; border-collapse: collapse; margin: .6rem 0; }
.inv-input-table th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; padding: .2rem; }
.inv-input-table td input { width: 100%; padding: .45rem .5rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--fg); font: inherit; }
.inv-input-table td:nth-child(2), .inv-input-table td:nth-child(3) { width: 90px; }
.inv-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #1a1d21; padding-bottom: .6rem; }
.inv-head h2 { margin: 0; letter-spacing: .1em; }
.inv-num { color: #555; }
.inv-parties { display: flex; gap: 2rem; margin: 1rem 0; font-size: .95rem; }
.inv-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.inv-table th { text-align: left; border-bottom: 1px solid #ccc; padding: .4rem; font-size: .85rem; color: #1a1d21; }
.inv-table td { padding: .4rem; border-bottom: 1px solid #eee; color: #1a1d21; }
.inv-table th:last-child, .inv-table td:last-child { text-align: right; }
.inv-totals { margin-left: auto; width: 240px; }
.inv-totals > div { display: flex; justify-content: space-between; padding: .3rem 0; }
.inv-total { border-top: 2px solid #1a1d21; font-weight: 700; font-size: 1.1rem; }
.inv-notes { margin-top: 1.2rem; color: #555; font-size: .9rem; }
.ce-pre { white-space: pre-wrap; font-family: inherit; font-size: 1rem; line-height: 1.6; margin: 0; color: #1a1d21; }

/* Templates */
.template-page { max-width: var(--maxw-wide); margin: 0 auto; }
.legal-doc h3, .checklist-doc h3, .calendar-doc h3 { margin-top: 1.4rem; font-size: 1.05rem; color: #1a1d21; }
.legal-doc p, .checklist-doc p, .calendar-doc p { color: #1a1d21; }
.checklist-for { font-size: .95rem; color: #555 !important; margin-bottom: 1.2rem; }
.checklist { list-style: none; padding: 0; }
.checklist li { padding: .35rem 0 .35rem 2rem; position: relative; color: #1a1d21; }
.checklist li::before { content: "\2610"; position: absolute; left: 0; font-size: 1.25rem; line-height: 1; top: .15rem; }
.sign-grid { display: flex; gap: 2rem; margin-top: 2.5rem; }
.sign-grid div { flex: 1; }
.sign-grid p { color: #1a1d21; }
.legal-note { font-size: .82rem; color: #777 !important; margin-top: 1.5rem; border-top: 1px solid #ddd; padding-top: .8rem; }
.pillars, .prompts { color: #1a1d21; padding-left: 1.3rem; }
.pillars li, .prompts li { padding: .25rem 0; }
.prompts { columns: 2; column-gap: 2rem; }
.cal-table { width: 100%; border-collapse: collapse; margin: .8rem 0; }
.cal-table th, .cal-table td { border: 1px solid #ccc; padding: .45rem .5rem; text-align: left; color: #1a1d21; font-size: .9rem; }
.cal-table th { background: #f2f4f7; }
.cal-table td { height: 1.5rem; }
.cal-more { font-size: .85rem; color: #777 !important; font-style: italic; }

@media print {
  .site-header, .site-footer, .nav, .skip-link, .no-print, .tool-builder-form, .tool-related, .tool-disclaimer, .tool-lede, .eyebrow, .builder-actions, .tool-note, .tool-page > h1, .subscribe { display: none !important; }
  .builder { display: block; }
  .print-doc { box-shadow: none; border: 0; padding: 0; }
  body { font-size: 12pt; }
}

@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; }
  .quote-big { font-size: 1.5rem; }
  .tool-field { grid-template-columns: 1fr; }
  .tool-input input { width: 100%; }
}
