/* Blog pages. Load after ../style.css: they reuse its tokens and header, add only blog layout.
   No hairlines: separation comes from space and from one step in surface tone. */

/* ---------- Blog index ---------- */

.blog-main { padding-bottom: 96px; }

/* Index blocks share one centred 720px column, like the post. */
.blog-intro, .blog-entries, .about { max-width: 720px; margin-inline: auto; }
.blog-intro { padding-top: 72px; display: grid; gap: 18px; }
.blog-intro h1 { font-size: clamp(3rem, 1.8rem + 6vw, 7rem); font-weight: 700; letter-spacing: -0.035em; line-height: 0.95; }
.blog-intro p { margin: 0; color: var(--ink); font-size: var(--step-lead); line-height: 1.5; }

/* The post as a printed measurement sheet: paper-tone panel, log rows with leaders. */
.blog-entries { padding-top: 48px; }
.sheet { max-width: 720px; background: var(--surface); border-radius: 12px; padding: clamp(24px, 4vw, 40px); display: grid; gap: 18px; }
.sheet-meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--step-small); color: var(--ink); }
.sheet-meta .sep { color: var(--muted); }
.sheet-title { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.25rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
.sheet-title a { text-decoration: none; }
.sheet-title a:hover { color: var(--accent); }
.sheet-lead { margin: 0; color: var(--ink); font-size: var(--step-body); line-height: 1.55; }

/* Entrance: each block of the index rises once on load. Transform and opacity only. */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.blog-intro > *, .sheet > *, .about > * { animation: rise .6s var(--ease) both; }
.sheet > :nth-child(2) { animation-delay: .08s; }
.sheet > :nth-child(3) { animation-delay: .16s; }
.sheet > :nth-child(4) { animation-delay: .24s; }
.sheet > :nth-child(5) { animation-delay: .32s; }
.sheet > :nth-child(6) { animation-delay: .4s; }
.sheet > :nth-child(7) { animation-delay: .48s; }
.about > :nth-child(2) { animation-delay: .12s; }
.about > :nth-child(3) { animation-delay: .2s; }
.about > :nth-child(4) { animation-delay: .28s; }
.blog-intro > :nth-child(2) { animation-delay: .08s; }
@media (prefers-reduced-motion: reduce) {
  .blog-intro > *, .sheet > *, .about > * { animation: none; }
}

/* Log rows: label, dotted leader, value. */
.log { margin: 6px 0 0; display: grid; gap: 12px; }
.log-row { display: flex; align-items: baseline; gap: 12px; margin: 0; }
.log-row { min-width: 0; }
.log-row dt { color: var(--ink); font-size: var(--step-small); min-width: 0; overflow-wrap: anywhere; }
.log-row::after { content: ""; order: 1; flex: 1; min-width: 16px; border-bottom: 3px dotted var(--muted); transform: translateY(-4px); }
.log-row dd { order: 2; margin: 0; white-space: nowrap; font-size: var(--step-small); color: var(--ink); font-variant-numeric: tabular-nums; }
.log-row dd b { color: var(--accent); font-size: 1.25em; font-weight: 700; }

.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--step-small); color: var(--ink); }

.sheet .button { justify-self: start; }

.about { padding-top: 96px; display: grid; gap: 16px; }
.about h2 { font-size: var(--step-h3); font-weight: 650; letter-spacing: -0.015em; }
.about p { margin: 0; color: var(--ink); line-height: 1.6; }
.about-links { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 28px; font-size: var(--step-small); }
.about-links a { color: var(--accent); }
.about-note { color: var(--ink); font-size: var(--step-small); }

/* ---------- Post page ---------- */

/* One reading column, centred: the post, its title and its blocks share its edges. */
.post { padding-top: 56px; }
.post article { max-width: 720px; margin-inline: auto; }
.post-head { display: grid; gap: 14px; margin-bottom: 48px; }
.post-head h1 { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; text-wrap: balance; }
.post-lead { font-size: var(--step-lead); color: var(--ink); line-height: 1.5; margin: 0; }
.post-meta { color: var(--ink); }
.post-foot a { color: var(--accent); }

.toc { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 16px; font-size: var(--step-small); }
.toc a { color: var(--accent); text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.post-body { color: var(--ink); }
.post-body h2 { font-size: var(--step-h3); font-weight: 650; letter-spacing: -0.015em; margin: 64px 0 18px; scroll-margin-top: 88px; }
.post-body p { margin: 0 0 18px; }
.post-body ul, .post-body ol { margin: 0 0 22px; padding-left: 22px; }
.post-body li { margin-bottom: 8px; }
.post-body a { color: var(--accent); }

/* Specs: four short tiles, one line each. */
.spec { list-style: none; padding: 0; margin: 24px 0 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.spec li { margin: 0; padding: 18px 18px; background: var(--surface); border-radius: 8px; }

/* Key numbers: big figure, one short line under it. */
.stats { list-style: none; padding: 0; margin: 28px 0 36px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats li { margin: 0; padding: 24px 22px 26px; background: var(--surface); border-radius: 8px; display: grid; gap: 10px; align-content: start; }
.stats b { font-size: clamp(2.25rem, 1.4rem + 1.6vw, 2.5rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stats b small { font-size: 0.4em; font-weight: 600; letter-spacing: 0; white-space: nowrap; }
.stats span { color: var(--ink); font-size: var(--step-small); line-height: 1.45; }

/* Layers: four steps, each one set in from the last, so the order reads as a climb. */
.ladder { list-style: none; padding: 0; margin: 28px 0 32px; display: grid; gap: 8px; }
.ladder li { margin: 0; padding: 22px 24px 24px; background: var(--surface); border-radius: 8px; }
.ladder li:nth-child(1) { margin-left: 0; }
.ladder li:nth-child(2) { margin-left: 24px; background: #212724; }
.ladder li:nth-child(3) { margin-left: 48px; background: #262d2a; }
.ladder li:nth-child(4) { margin-left: 72px; background: #2c3430; }
.ladder h3 { font-size: 1.2rem; font-weight: 650; letter-spacing: -0.01em; color: var(--ink); }
.ladder p { margin: 8px 0 0; }

/* Loop diagram. Colours come from the page tokens, so it follows the theme. */
.cycle { margin: 40px auto 48px; max-width: 460px; }
.cycle svg { display: block; width: 100%; height: auto; }
.cycle .node { fill: var(--surface); }
.cycle .node-good { fill: var(--accent); }
.cycle .node-bad { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
.cycle .step { fill: none; stroke: var(--accent); stroke-width: 2; }
.cycle .step-n { fill: var(--accent); font-family: var(--font); font-size: 15px; font-weight: 700; text-anchor: middle; dominant-baseline: central; }
.cycle .label-l { fill: var(--ink); font-family: var(--font); font-size: 18px; font-weight: 650; dominant-baseline: central; }
.cycle .sub-l { fill: var(--muted); font-family: var(--font); font-size: 14px; dominant-baseline: central; }
.cycle .sub { fill: var(--muted); font-family: var(--font); font-size: 14px; text-anchor: middle; dominant-baseline: central; }
.cycle .label-good { fill: var(--accent-ink); font-family: var(--font); font-size: 18px; font-weight: 700; text-anchor: middle; dominant-baseline: central; }
.cycle .sub-good { fill: var(--accent-ink); font-family: var(--font); font-size: 14px; text-anchor: middle; dominant-baseline: central; opacity: .85; }
.cycle .label { fill: var(--ink); font-family: var(--font); font-size: 18px; font-weight: 600; text-anchor: middle; dominant-baseline: central; }
.cycle .label-end { fill: var(--accent-ink); }
.cycle .flow, .cycle .loop { fill: none; stroke: var(--muted); stroke-width: 2; }
.cycle .loop { stroke-dasharray: 6 5; }
.cycle .arrowhead { fill: var(--muted); }
.cycle figcaption { margin-top: 14px; font-size: var(--step-small); color: var(--ink); line-height: 1.5; }

/* What I don't know: its own panel, the one place the post asks to be read slowly. */
.unknown { margin: 44px 0 52px; padding: 28px 28px 10px; background: var(--surface); border-radius: 10px; }
.unknown h3 { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 14px; }

/* Principles as a checklist. The boxes are decoration; the list is read as text. */
.checklist { list-style: none; padding: 0; margin: 24px 0 36px; display: grid; gap: 14px; }
.checklist li { position: relative; margin: 0; padding-left: 40px; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 0.3em; width: 18px; height: 18px; border: 2px solid var(--muted); border-radius: 4px; box-sizing: border-box; }
.checklist li::after { content: ""; position: absolute; left: 6px; top: 0.3em; width: 5px; height: 10px; border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }

.links { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 40px; font-size: var(--step-small); }
.links a { color: var(--accent); }

.post-foot { margin-top: 64px; background: var(--surface); padding: 20px 24px; border-radius: 8px; font-size: var(--step-small); color: var(--ink); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Numbers tables: wrap in .table-wrap so narrow screens scroll the table, not the page. */
.table-wrap { overflow-x: auto; margin: 24px 0 28px; }
.facts-table { width: 100%; border-collapse: collapse; font-size: var(--step-small); }
.facts-table th, .facts-table td { text-align: left; padding: 10px 12px; vertical-align: top; }
.facts-table th { color: var(--muted); font-weight: 600; }
.facts-table td:last-child { white-space: nowrap; }

@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr; }
  .stats b { white-space: normal; }
}

@media (max-width: 600px) {
  .blog-intro { padding-top: 40px; }
  .blog-entries { padding-top: 32px; }
  .about { padding-top: 64px; }
  .post { padding-top: 36px; }
  .post-head { margin-bottom: 36px; }
  .post-head h1 { font-size: 1.75rem; }
  .post-body h2 { margin-top: 48px; }
  .spec { grid-template-columns: 1fr; }
  .ladder li:nth-child(2) { margin-left: 12px; }
  .ladder li:nth-child(3) { margin-left: 24px; }
  .ladder li:nth-child(4) { margin-left: 36px; }
  .facts-table th, .facts-table td { padding: 8px 8px; }
  .facts-table td:last-child { white-space: normal; }
}
.cycle .loop { stroke-dasharray: 6 5; }

/* Subscribe page */
.sub-box { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 32px 0 16px; padding: 18px 20px; background: var(--surface); border-radius: 10px; }
.sub-box code { font-size: 0.95rem; color: var(--accent); word-break: break-all; flex: 1 1 260px; }
.sub-box .btn { cursor: pointer; border: 0; border-radius: 8px; padding: 10px 18px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 650; }
.sub-note { color: var(--muted); max-width: 62ch; margin-bottom: 32px; }
.sub-page { max-width: 760px; margin-inline: auto; padding-top: 72px; padding-bottom: 48px; } .sub-page h1 { margin-bottom: 16px; }
.intro-sub { margin-top: 20px; }
.sub-btn { display: inline-block; padding: 10px 18px; border: 1.5px solid var(--accent); border-radius: 8px; color: var(--accent); text-decoration: none; font-weight: 650; }
.sub-btn:hover { background: var(--accent); color: var(--accent-ink); }
