/* Quiet Progress — a calm reading site for self-development.
   Layout: a narrow reading column for articles, a wider grid for the home and library. */
:root {
  --bg: #f5f7f3;
  --surface: #ffffff;
  --ink: #1b2320;
  --muted: #5c6a64;
  --line: #dde4df;
  --accent: #2c6a58;
  --accent-soft: #e1eee8;
  --sun: #d9952f;
  --sun-soft: #fbefd9;

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Literata", Georgia, "Times New Roman", serif;
  --ui: "Inter", "Segoe UI", system-ui, sans-serif;

  --wide: 1120px;
  --read: 680px;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121815; --surface: #19211d; --ink: #e6ece8; --muted: #9aaaa2;
    --line: #2a3530; --accent: #7cc4ab; --accent-soft: #1f3129;
    --sun: #f0b65a; --sun-soft: #3a2e1a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121815; --surface: #19211d; --ink: #e6ece8; --muted: #9aaaa2;
  --line: #2a3530; --accent: #7cc4ab; --accent-soft: #1f3129;
  --sun: #f0b65a; --sun-soft: #3a2e1a; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--ui);
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }

.wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Header */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 700 1.15rem/1 var(--display); }
.logo-mark { width: 28px; height: 28px; flex: none; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: var(--muted); text-decoration: none; font-size: .92rem; font-weight: 500; padding: 6px 10px; border-radius: 999px; }
.nav a:hover { color: var(--ink); background: var(--accent-soft); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
@media (max-width: 560px) {
  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 8px; }
  .nav { justify-content: flex-start; margin-left: -10px; }
}

/* Hero */
.hero { padding-block: 64px 48px; }
.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.eyebrow { font: 600 .78rem/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.hero h1 { font-size: clamp(2.3rem, 5.5vw, 3.9rem); margin-top: 14px; font-weight: 700; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { font: 1.2rem/1.6 var(--body); color: var(--muted); max-width: 34ch; margin: 20px 0 28px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font: 600 .95rem/1 var(--ui); text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* The "progress ladder": small steps, the site's signature graphic */
.ladder { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.ladder-title { font: 600 .8rem/1 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.ladder-row { display: grid; grid-template-columns: 70px 1fr 44px; align-items: center; gap: 12px; padding-block: 8px; font-size: .9rem; }
.ladder-row span:first-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.ladder-bar { height: 10px; background: var(--accent-soft); border-radius: 999px; overflow: hidden; }
.ladder-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transform-origin: left; animation: grow 1.2s ease-out both; }
.ladder-row span:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.ladder-note { margin-top: 16px; font: italic .95rem/1.5 var(--body); color: var(--muted); }
@keyframes grow { from { transform: scaleX(.15); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .ladder-bar i { animation: none; } }
@media (max-width: 820px) { .hero-grid { grid-template-columns: 1fr; gap: 32px; } .hero { padding-block: 40px 32px; } }

/* Sections */
.section { padding-block: 48px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.section-head a { font-weight: 600; font-size: .95rem; text-decoration: none; }

/* Topics */
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.topic { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); transition: border-color .2s, transform .2s; }
.topic:hover { border-color: var(--accent); transform: translateY(-2px); }
.topic strong { font: 600 1.05rem/1.2 var(--display); }
.topic span { color: var(--muted); font-size: .88rem; line-height: 1.45; }
.topic .count { color: var(--accent); font-weight: 600; font-size: .8rem; }

/* Article cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card { display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); min-width: 0; transition: border-color .2s, transform .2s; }
a.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { font-size: 1.3rem; }
.card p { margin: 0; color: var(--muted); font: .98rem/1.55 var(--body); }
.meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: .8rem; color: var(--muted); }
.tag { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: .75rem; letter-spacing: .02em; }
.card.soon { opacity: .78; border-style: dashed; }
.card.soon .tag { background: var(--sun-soft); color: var(--sun); }
.card-foot { margin-top: auto; padding-top: 6px; font-weight: 600; font-size: .9rem; color: var(--accent); }
.card.soon .card-foot { color: var(--muted); font-weight: 500; }

.featured { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); }
.featured-art { background: var(--accent); color: var(--bg); padding: 40px; display: flex; flex-direction: column; justify-content: space-between; min-height: 280px; gap: 24px; }
.featured-art blockquote { margin: 0; font: italic 1.35rem/1.45 var(--body); }
.featured-body { padding: 36px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.featured-body h3 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
.featured-body p { margin: 0; color: var(--muted); font: 1.05rem/1.6 var(--body); }
.featured:hover .featured-body h3 { color: var(--accent); }
@media (max-width: 760px) { .featured { grid-template-columns: 1fr; } .featured-art, .featured-body { padding: 26px; } .featured-art { min-height: 0; } }

/* Filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.filters button { font: 500 .9rem/1 var(--ui); padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* Page header (inner pages) */
.page-head { padding-block: 56px 24px; }
.page-head h1 { font-size: clamp(2rem, 5vw, 3rem); margin-top: 12px; }
.page-head p { font: 1.15rem/1.6 var(--body); color: var(--muted); max-width: 60ch; margin: 16px 0 0; }

/* Article */
.progress-bar { position: fixed; left: 0; top: 0; height: 3px; width: 0; background: var(--sun); z-index: 20; }
.article { max-width: var(--read); margin: 0 auto; padding-block: 48px 24px; }
.article-head h1 { font-size: clamp(2rem, 5vw, 2.9rem); margin: 16px 0; }
.article-head .standfirst { font: italic 1.25rem/1.55 var(--body); color: var(--muted); margin: 0 0 20px; }
.article-head .meta { padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.prose { font: 1.13rem/1.8 var(--body); }
.prose p { margin: 0 0 1.3em; }
.prose h2 { font-size: 1.6rem; margin: 2.2em 0 .7em; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--sun); font-style: italic; font-size: 1.2rem; color: var(--ink); }
.prose .step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 0 0 14px; }
.prose .step strong { font-family: var(--display); display: block; font-size: 1.1rem; margin-bottom: 4px; }
.prose .step p { margin: 0; }
.prose .steps { margin: 0 0 1.6em; }
.refs { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: .88rem; color: var(--muted); }
.refs h2 { font-size: 1.1rem; margin-bottom: 12px; color: var(--ink); }
.refs ol { padding-left: 20px; margin: 0; display: grid; gap: 10px; }
.refs a { word-break: break-all; }
.share { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 32px; font-size: .9rem; color: var(--muted); }

/* Ad slots: stay hidden until you paste your ad code and add class "on" */
.ad-slot { display: none; }
.ad-slot.on { display: block; margin: 32px auto; text-align: center; min-height: 100px; }
.ad-slot.on::before { content: "Advertisement"; display: block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

/* Plain text pages */
.text-page { max-width: var(--wide); margin: 0 auto; padding-block: 8px 48px; font: 1.08rem/1.75 var(--body); }
.text-page > * { max-width: 680px; }
.text-page h2 { font-size: 1.35rem; margin: 1.8em 0 .5em; }
.text-page ul { padding-left: 22px; }
.note { background: var(--sun-soft); border-radius: var(--radius); padding: 16px 20px; font: .95rem/1.55 var(--ui); color: var(--ink); }

/* Quote band */
.band { background: var(--accent-soft); border-radius: var(--radius); padding: 40px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.band p { margin: 0; font: italic clamp(1.15rem, 2.4vw, 1.5rem)/1.5 var(--body); max-width: 46ch; }
@media (max-width: 680px) { .band { grid-template-columns: 1fr; padding: 26px; } }

/* Footer */
.site-footer { margin-top: 48px; border-top: 1px solid var(--line); padding-block: 36px; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.theme-toggle { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 6px 12px; font: 500 .85rem var(--ui); cursor: pointer; }

/* Tables and lists inside articles */
.prose ul { padding-left: 1.2em; margin: 0 0 1.4em; display: grid; gap: .5em; }
.table-wrap { overflow-x: auto; margin: 0 0 1.6em; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.prose table { width: 100%; min-width: 560px; border-collapse: collapse; font: .92rem/1.5 var(--ui); }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; color: var(--muted); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; background: var(--accent-soft); }
.prose tr:last-child td { border-bottom: 0; }
.prose td:first-child { font-weight: 600; color: var(--accent); white-space: nowrap; }
.prose td:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Pinterest image inside articles */
.pin-save { margin: 2.4em auto; max-width: 340px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.pin-save img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: 0 18px 40px -22px rgba(0,0,0,.45); }
.pin-save p { margin: 0; font: .9rem/1.4 var(--ui); color: var(--muted); }
.pin-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; background: #e60023; color: #fff; font: 600 .92rem/1 var(--ui); text-decoration: none; }
.pin-btn:hover { filter: brightness(1.08); }
.pin-btn svg { width: 18px; height: 18px; }
