/*
  main.css — compossible.blog
  Fonts: Boska (Fontshare) + Source Serif 4 (Google Fonts)
  Max width: 1400px throughout — consistent centred layout
*/

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --nb-bg: #1a1918; --nb-border: #2d2c2a; --nb-text: #a8a7a4;
  --nb-hover: #e0dfdc; --nb-teal: #4f98a3; --nb-height: 40px;
  --nb-font: 'Satoshi','Inter',sans-serif;

  --color-bg:           #faf9f6;
  --color-surface:      #f4f2ee;
  --color-text:         #1e1c18;
  --color-text-muted:   #7a7874;
  --color-text-faint:   #b8b6b1;
  --color-title:         #1a6b7a;  /* vibrant teal for feed card titles */
  --color-date:          #4a6580;  /* slate blue for dates */
  --color-primary:      #6b4c2a;
  --color-primary-hover:#4e3319;
  --color-border:       rgba(30,28,24,0.10);
  --color-border-strong:rgba(30,28,24,0.20);

  --font-display: 'Boska','Georgia',serif;
  --font-body:    'Source Serif 4','Georgia',serif;

  --space-2:  0.5rem; --space-3:  0.75rem; --space-4:  1rem;
  --space-6:  1.5rem; --space-8:  2rem;    --space-10: 2.5rem;
  --space-12: 3rem;   --space-16: 4rem;

  --radius-sm: 0.25rem; --radius-md: 0.5rem; --radius-lg: 0.75rem;
  --t-fast: 150ms; --ease: cubic-bezier(0.16,1,0.3,1);

  /* Single layout width used everywhere */
  --site-width: 1400px;
  --inner-width: 1200px;  /* for reading content (posts, categories) */
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  scroll-padding-top: 56px;
}
body {
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
a { color: var(--color-primary); text-underline-offset: 3px; transition: color var(--t-fast); }
a:hover { color: var(--color-primary-hover); }
p { max-width: none; text-wrap: pretty; }
p + p { margin-top: var(--space-4); }
h1, h2, h3, h4 { line-height: 1.2; text-wrap: balance; text-transform: none; }

/* ── Layout — one container to rule them all ─────────────────────────────── */
.container {
  max-width: var(--site-width);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}
.container--narrow {
  max-width: var(--inner-width);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

/* ── Network bar (injected by nav.js — keep overrides minimal) ──────────── */
/* nav.js injects its own network-bar + monitor-strip from asym-intel.info.
   These overrides ensure Compossible body shifts down correctly. */

/* ── Site header ─────────────────────────────────────────────────────────── */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding-block: var(--space-6);
}
.site-header__inner {
  max-width: var(--site-width);
  margin: 0 auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
  display: flex; align-items: center; justify-content: space-between;
}
.site-header__wordmark {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1.1rem + 0.5vw, 1.6rem);
  font-weight: 700; color: var(--color-text); text-decoration: none;
}
.site-header__strapline {
  font-size: 0.7rem; color: var(--color-text-muted);
  letter-spacing: 0.04em; text-transform: uppercase;
  display: block; margin-top: 2px;
}
.site-header__nav { display: flex; gap: var(--space-6); }
.site-header__nav-link {
  font-size: 0.875rem; font-weight: 500;
  color: var(--color-text-muted); text-decoration: none;
  transition: color var(--t-fast);
}
.site-header__nav-link:hover { color: var(--color-text); }

/* ── Typography ──────────────────────────────────────────────────────────── */
h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.2rem + 2.5vw, 3.25rem);
  font-weight: 400;
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem);
  font-weight: 400;
}
h3 {
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
  font-weight: 600;
}

/* ── Homepage ────────────────────────────────────────────────────────────── */
.home__hero {
  padding-block: var(--space-8);
  border-bottom: 1px solid var(--color-border);
}
.home__subtitle {
  font-size: clamp(1rem, 0.9rem + 0.4vw, 1.15rem);
  color: var(--color-text-muted);
  max-width: 60ch;
}
.home__feed { padding-block: var(--space-10); }
.home__feed-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-8);
}

/* ── View toggle ─────────────────────────────────────────────────────────── */
.view-toggle { display: flex; gap: 0.25rem; }
.view-toggle__btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 0.35rem 0.7rem; border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: transparent; color: var(--color-text-faint);
  cursor: pointer; transition: all var(--t-fast);
}
.view-toggle__btn:hover { color: var(--color-text-muted); border-color: var(--color-border-strong); }
.view-toggle__btn[aria-pressed="true"] {
  background: var(--color-surface); color: var(--color-text);
  border-color: var(--color-border-strong);
}

/* ── Tile view ───────────────────────────────────────────────────────────── */
.feed-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}
.tile-card {
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow var(--t-fast), border-color var(--t-fast);
}
.tile-card:hover { border-color: var(--color-border-strong); box-shadow: 0 4px 16px rgba(30,28,24,0.08); }
.tile-card__image-wrap { aspect-ratio: 16/9; overflow: hidden; background: var(--color-surface); }
.tile-card__image-wrap--placeholder { aspect-ratio: 16/9; background: var(--color-surface); }
.tile-card__image { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s var(--ease); }
.tile-card:hover .tile-card__image { transform: scale(1.03); }
.tile-card__body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.tile-card__meta { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.tile-card__date { font-size: 0.72rem; color: var(--color-date); font-weight: 500; }
.tile-card__cat {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--color-primary);
}
.tile-card__title {
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 0.85rem + 0.3vw, 1.1rem);
  font-weight: 400; line-height: 1.25; color: var(--color-title);
}
@media (max-width: 900px) { .feed-tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px)  { .feed-tiles { grid-template-columns: 1fr; } }

/* ── Category grid ───────────────────────────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  padding-top: var(--space-8);
}
.cat-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.cat-card__image-wrap { aspect-ratio: 16/9; overflow: hidden; background: var(--color-surface); }
.cat-card__image { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-card__body { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); flex: 1; }
.cat-card__title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 0.9rem + 0.4vw, 1.25rem);
  font-weight: 400; color: var(--color-title);
}
.cat-card__desc { font-size: 0.875rem; color: var(--color-text-muted); line-height: 1.55; }
.cat-card__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: auto; padding-top: var(--space-3); }
.cat-card__tag {
  font-size: 0.75rem; font-weight: 500; color: var(--color-primary);
  text-decoration: none; border: 1px solid var(--color-border);
  border-radius: 2rem; padding: 3px 10px;
  display: inline-flex; align-items: center; gap: 5px;
  transition: all var(--t-fast);
}
.cat-card__tag:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.cat-card__count { font-size: 0.65rem; opacity: 0.65; }
@media (max-width: 900px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .cat-grid { grid-template-columns: 1fr; } }

.home__feed-heading {
  font-family: var(--font-body); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--color-text-faint);
}

/* ── Feed cards ──────────────────────────────────────────────────────────── */
.feed-card {
  padding-block: var(--space-8);
  border-bottom: 1px solid var(--color-border);
  display: flex; flex-direction: column; gap: var(--space-2);
}
.feed-card:first-of-type { border-top: 1px solid var(--color-border); }

.feed-card--rich {
  flex-direction: column;
  gap: 0;
  align-items: stretch;
}
.feed-card__header { margin-bottom: var(--space-8); }
.feed-card__image-link { display: block; margin-bottom: var(--space-4); }
.feed-card__image {
  width: 100%;
  height: clamp(220px, 35vw, 480px);
  object-fit: cover; border-radius: var(--radius-md);
  display: block;
}
.feed-card__body { display: flex; flex-direction: column; gap: var(--space-2); }
.feed-card__meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.feed-card__date { font-size: 0.8rem; color: var(--color-date); font-weight: 500; }
.feed-card__cat {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--color-primary); text-decoration: none;
  transition: color var(--t-fast);
}
.feed-card__cat:hover { color: var(--color-text); }
.feed-card__title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.45rem);
  font-weight: 400; line-height: 1.25;
}
.feed-card__title a { color: var(--color-title); text-decoration: none; transition: color var(--t-fast); }
.feed-card__title a:hover { color: var(--color-primary); }
.feed-card__summary { color: var(--color-text-muted); font-size: 0.9rem; line-height: 1.55; }
.feed-card__read-more {
  font-size: 0.85rem; font-weight: 600; color: var(--color-primary);
  text-decoration: none; align-self: flex-start; transition: color var(--t-fast);
}
.feed-card__read-more:hover { color: var(--color-primary-hover); }
@media (max-width: 600px) {
  .feed-card__image { height: 200px; }
}

/* ── Single post ─────────────────────────────────────────────────────────── */
.single { padding-block: var(--space-12); }
.post {
  max-width: var(--inner-width);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}
.post__header {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-border);
}
.post__meta { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-4); }
.post__date { font-size: 0.8rem; color: var(--color-text-faint); }
.post__categories { font-size: 0.75rem; color: var(--color-text-muted); }
.post__title { font-family: var(--font-display); margin-bottom: var(--space-4); }
.post__summary { font-style: italic; color: var(--color-text-muted); font-size: 1.05rem; }
.post__body { line-height: 1.8; }
.post__body h1, .post__body h2, .post__body h3,
.post__body h4 { text-transform: none !important; }
.post__body h2 { margin-top: var(--space-10); margin-bottom: var(--space-4); }
.post__body h3 { margin-top: var(--space-8); margin-bottom: var(--space-2); }
.post__body p { margin-bottom: var(--space-4); }
.post__body ul, .post__body ol { padding-left: var(--space-6); margin-bottom: var(--space-4); }
.post__body li { margin-bottom: var(--space-2); }
.post__body img { width: 100%; height: auto; border-radius: var(--radius-md); margin-block: var(--space-6); }
.post__body blockquote {
  border-left: 3px solid var(--color-border-strong);
  padding-left: var(--space-6); margin-block: var(--space-6);
  color: var(--color-text-muted); font-style: italic;
}
.post__footer { margin-top: var(--space-12); padding-top: var(--space-6); border-top: 1px solid var(--color-border); }
.post__back { font-size: 0.9rem; color: var(--color-text-muted); text-decoration: none; }
.post__back:hover { color: var(--color-primary); }
.post__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: var(--space-4); }
.post__tag {
  font-size: 0.72rem; color: var(--color-text-muted); text-decoration: none;
  border: 1px solid var(--color-border); border-radius: 2rem; padding: 2px 8px;
  transition: all var(--t-fast);
}
.post__tag:hover { color: var(--color-primary); border-color: var(--color-primary); }

/* ── List pages (tag/category archives) ─────────────────────────────────── */
.list { padding-block: var(--space-12); }
.list__header {
  max-width: var(--inner-width); margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
  margin-bottom: var(--space-8); padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-border);
}
.list__posts {
  max-width: var(--inner-width); margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}
.list__description { margin-top: var(--space-4); color: var(--color-text-muted); }

/* ── Reading guide (categories page) ────────────────────────────────────── */
.categories-page { padding-block: var(--space-12); }
.categories-page .inner {
  max-width: var(--inner-width);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}
.categories-page .list__header {
  max-width: none; margin-inline: 0; padding-inline: 0;
}
.reading-group {
  padding-block: var(--space-10);
  border-bottom: 1px solid var(--color-border);
}
.reading-group:first-of-type { border-top: 1px solid var(--color-border); }
.reading-group__title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1rem + 0.5vw, 1.5rem);
  font-weight: 400; margin-bottom: var(--space-3);
}
.reading-group__desc {
  color: var(--color-text-muted); font-size: 0.95rem;
  max-width: 60ch; margin-bottom: var(--space-6);
}
.reading-group__cats { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.reading-group__cat {
  font-size: 0.875rem; font-weight: 500; color: var(--color-primary);
  text-decoration: none; border: 1px solid var(--color-border);
  border-radius: 2rem; padding: 5px 14px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all var(--t-fast);
}
.reading-group__cat:hover {
  background: var(--color-primary); color: #fff; border-color: var(--color-primary);
}
.reading-group__count { font-size: 0.7rem; font-weight: 400; opacity: 0.65; }

/* ── Tag cloud ───────────────────────────────────────────────────────────── */
.tag-cloud-section {
  padding-block: var(--space-10);
  border-top: 1px solid var(--color-border);
}
.tag-cloud__heading {
  font-family: var(--font-body); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--color-text-faint); margin-bottom: var(--space-6);
}
.tag-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; }
.tag-cloud__tag {
  text-decoration: none; color: var(--color-text-muted);
  font-family: var(--font-body); letter-spacing: 0.01em;
  border: 1px solid var(--color-border); border-radius: 2rem;
  padding: 3px 10px; transition: all var(--t-fast);
  display: inline-flex; align-items: center; gap: 5px;
}
.tag-cloud__tag:hover {
  color: var(--color-primary); border-color: var(--color-primary);
  background: rgba(107,76,42,0.05);
}
.tag-cloud__tag--sm { font-size: 0.75rem; }
.tag-cloud__tag--md { font-size: 0.875rem; }
.tag-cloud__tag--lg { font-size: 1rem; font-weight: 600; color: var(--color-text); }
.tag-cloud__count { font-size: 0.65rem; color: var(--color-text-faint); font-weight: 400; }

/* ── About page ──────────────────────────────────────────────────────────── */
.about-page { padding-block: var(--space-12); }
.about-page .inner {
  max-width: var(--inner-width);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

/* ── Site footer ─────────────────────────────────────────────────────────── */
.site-footer {
  padding-block: var(--space-8);
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem; color: var(--color-text-muted);
}
.site-footer__inner {
  max-width: var(--site-width); margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: var(--space-4);
}
.site-footer__nav { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.site-footer__nav a, .site-footer__copy a {
  color: var(--color-text-muted); text-decoration: none; transition: color var(--t-fast);
}
.site-footer__nav a:hover, .site-footer__copy a:hover { color: var(--color-primary); }

/* ── Archive navigation ─────────────────────────────────────────────────── */
.archive-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  padding-block: var(--space-10);
}
.archive-nav__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  background: transparent;
  color: var(--color-primary);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.archive-nav__btn:hover:not(:disabled) {
  background: var(--color-primary);
  color: #fff;
  transform: scale(1.08);
}
.archive-nav__btn:disabled {
  opacity: 0.25;
  cursor: default;
}
.archive-nav__info {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  min-width: 4ch;
  text-align: center;
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Dark theme (reader toggle; light is the default) ───────────────────── */
[data-theme="dark"] {
  --color-bg:           #171614;
  --color-surface:      #201f1c;
  --color-text:         #e8e6e1;
  --color-text-muted:   #a3a19b;
  --color-text-faint:   #6f6d68;
  --color-title:        #6cc3d1;
  --color-date:         #9db4cc;
  --color-primary:      #d6a970;
  --color-primary-hover:#e8c393;
  --color-border:       rgba(232,230,225,0.12);
  --color-border-strong:rgba(232,230,225,0.24);
  color-scheme: dark;
}
[data-theme="dark"] img { opacity: 0.94; }

/* ── Header nav + theme toggle ───────────────────────────────────────────── */
.site-header__nav { align-items: center; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-md);
  border: 1px solid var(--color-border-strong); background: transparent;
  color: var(--color-text-muted); cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.theme-toggle:hover { color: var(--color-text); border-color: var(--color-text-muted); }
.theme-toggle:focus-visible, .search-form__input:focus-visible { outline: 2px solid var(--color-title); outline-offset: 2px; }
.theme-toggle__moon { display: none; }
[data-theme="dark"] .theme-toggle__sun { display: none; }
[data-theme="dark"] .theme-toggle__moon { display: block; }

/* ── Search ──────────────────────────────────────────────────────────────── */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.search-page { max-width: 760px; margin: 0 auto; padding: var(--space-12) clamp(1rem, 4vw, 2rem) var(--space-16); }
.search-page__title { margin-bottom: var(--space-6); }
.search-form__input {
  width: 100%; font: inherit; font-size: 1.125rem; padding: var(--space-3) var(--space-4);
  color: var(--color-text); background: var(--color-surface);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-md);
}
.search-status { margin-top: var(--space-4); color: var(--color-text-muted); font-size: 0.9rem; }
.search-results { list-style: none; margin-top: var(--space-6); }
.search-result { padding-block: var(--space-6); border-top: 1px solid var(--color-border); }
.search-result__title { font-family: var(--font-display); font-size: 1.35rem; color: var(--color-title); text-decoration: none; }
.search-result__title:hover { text-decoration: underline; }
.search-result__date { display: block; font-size: 0.8rem; color: var(--color-date); margin-top: 2px; }
.search-result__snippet { margin-top: var(--space-2); color: var(--color-text-muted); font-size: 0.95rem; }

/* ── Readability pass (2026-09-28) ───────────────────────────────────────
   Boska at weight 400 and small sizes in teal was too thin to read.
   Titles now use ink at 700, with teal kept for hover; meta text is larger
   and muted/faint tokens are darkened to meet WCAG AA contrast on cream. */
:root {
  --color-text-muted: #55534e;   /* ~7:1 on #faf9f6 */
  --color-text-faint: #75736e;   /* ~4.6:1 */
  --color-date:       #3d5670;
  --color-title:      #1e1c18;
  --color-title-hover:#1a6b7a;
}
[data-theme="dark"] {
  --color-text-muted: #bdbab3;
  --color-text-faint: #8f8c86;
  --color-date:       #a9bfd6;
  --color-title:      #f1efea;
  --color-title-hover:#6cc3d1;
}
.tile-card__body { padding: var(--space-4) var(--space-4) var(--space-6); gap: var(--space-3); }
.tile-card__date, .feed-card__date { font-size: 0.85rem; font-weight: 600; }
.tile-card__cat, .feed-card__cat { font-size: 0.72rem; letter-spacing: 0.07em; }
.tile-card__title {
  font-size: clamp(1.15rem, 1rem + 0.45vw, 1.4rem);
  font-weight: 700; line-height: 1.22; letter-spacing: 0.005em;
  color: var(--color-title);
}
.tile-card:hover .tile-card__title { color: var(--color-title-hover); }
.feed-card__title { font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.85rem); font-weight: 700; }
.feed-card__title a { color: var(--color-title); }
.feed-card__title a:hover { color: var(--color-title-hover); }
.feed-card__summary { font-size: 1rem; color: var(--color-text-muted); }
.home__feed-heading { font-size: 0.8rem; color: var(--color-text-muted); }
.home__subtitle { color: var(--color-text-muted); }
.view-toggle__btn { font-size: 0.8rem; color: var(--color-text-muted); }
.site-header__nav-link { font-size: 0.95rem; color: var(--color-text-muted); }
.site-header__strapline { font-size: 0.75rem; }
.post__date { color: var(--color-text-muted); font-size: 0.9rem; }
.post__categories { font-size: 0.85rem; }
h1, h2, h3, .post__title { font-weight: 700; }
.search-result__title { font-weight: 700; }
.search-result__title, .search-result__title:visited { color: var(--color-title); }
.search-result__title:hover { color: var(--color-title-hover); }

/* ── After Intelligence (book section) ───────────────────────────────────── */
:root { --book-paper: #f6f3ec; --book-ink: #1c1c1c; --book-rule: rgba(28,28,28,0.14); }
[data-theme="dark"] { --book-paper: #1f1d1a; --book-ink: #ece9e2; --book-rule: rgba(236,233,226,0.16); }

.site-header__nav-link.is-active { color: var(--color-text); }

.book-kicker, .book-band__kicker, .book-hero__kicker {
  font-family: ui-monospace, 'DejaVu Sans Mono', Menlo, monospace;
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--color-text-muted); margin: 0 0 var(--space-2);
}

/* Homepage band */
.book-band { background: var(--book-paper); border-bottom: 1px solid var(--book-rule); padding-block: var(--space-10); }
.book-band__head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-6); margin-bottom: var(--space-6); flex-wrap: wrap; }
.book-band__title { margin: 0; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem); }
.book-band__title a { color: var(--book-ink); text-decoration: none; }
.book-band__title a:hover { color: var(--color-primary); }
.book-band__blurb { margin: var(--space-2) 0 0; max-width: 60ch; color: var(--color-text-muted); font-style: italic; }
.book-band__more { font-size: 0.9rem; color: var(--color-primary); text-decoration: none; white-space: nowrap; }
.book-band__more:hover { color: var(--color-primary-hover); text-decoration: underline; }

/* Chapter tiles: header images are 16:10 on paper, covers are portrait, so contain on paper */
.book-tile { background: var(--color-bg); }
.book-tile__image-wrap { aspect-ratio: 16/10; background: #f6f3ec; }
.book-tile__image { object-fit: contain; }
.book-tile__label {
  font-family: ui-monospace, 'DejaVu Sans Mono', Menlo, monospace;
  font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-primary);
}

/* Book page hero */
.book-hero { background: var(--book-paper); border-bottom: 1px solid var(--book-rule); padding-block: clamp(2.5rem, 6vw, 5rem); }
.book-hero__inner {
  max-width: var(--inner-width); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem);
  display: grid; grid-template-columns: minmax(200px, 340px) 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
}
.book-hero__cover { width: 100%; height: auto; display: block; border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12), 0 12px 32px rgba(30,28,24,0.18), 0 32px 64px rgba(30,28,24,0.10); }
.book-hero__title { margin: 0 0 var(--space-4); font-size: clamp(2.4rem, 1.4rem + 3.6vw, 4.4rem); line-height: 1.04; color: var(--book-ink); }
.book-hero__blurb { font-size: clamp(1.1rem, 1rem + 0.4vw, 1.35rem); line-height: 1.5; max-width: 34ch; margin: 0 0 var(--space-8); }
.book-hero__actions { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-8); }
.book-btn {
  display: inline-flex; align-items: center; padding: 0.7rem 1.3rem; border-radius: 2rem;
  font-size: 0.95rem; font-weight: 600; text-decoration: none;
  border: 1px solid var(--color-border-strong); color: var(--color-text); background: transparent;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.book-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.book-btn--primary { background: var(--book-ink); color: var(--book-paper); border-color: var(--book-ink); }
.book-btn--primary:hover { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.book-hero__facts { display: flex; gap: var(--space-8); flex-wrap: wrap; margin: 0; padding-top: var(--space-6); border-top: 1px solid var(--book-rule); }
.book-hero__facts dt { font-family: ui-monospace, 'DejaVu Sans Mono', Menlo, monospace; font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-text-muted); }
.book-hero__facts dd { margin: 0.2rem 0 0; font-size: 1rem; }

/* About + reader notes */
.book-about { padding-block: var(--space-12); border-bottom: 1px solid var(--color-border); }
.book-about__inner { max-width: var(--inner-width); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.book-about__intro { max-width: 68ch; font-size: 1.1rem; line-height: 1.75; margin-bottom: var(--space-10); }
.book-about__intro p { margin-bottom: var(--space-4); }
.book-about__notes { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.book-note { border-top: 2px solid var(--book-ink); padding-top: var(--space-4); }
.book-note__title { font-family: var(--font-body); font-size: 1rem; font-weight: 600; margin: 0 0 var(--space-2); }
.book-note__text { font-size: 0.95rem; line-height: 1.6; color: var(--color-text-muted); margin: 0; }
.book-note__text a { color: var(--color-primary); }

.book-chapters { padding-block: var(--space-12); }
.book-chapters__heading { margin: 0 0 var(--space-8); }
.book-chapters__empty { color: var(--color-text-muted); }

/* In-chapter navigation */
.book-nav--top {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; margin-bottom: var(--space-6);
  font-family: ui-monospace, 'DejaVu Sans Mono', Menlo, monospace; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
}
.book-nav--top a { color: var(--color-primary); text-decoration: none; }
.book-nav--top a:hover { text-decoration: underline; }
.book-nav__sep, .book-nav__here { color: var(--color-text-muted); }
.book-nav--bottom {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--space-6); align-items: center;
  margin-top: var(--space-12); padding: var(--space-6) 0; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border);
}
.book-nav--bottom a { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 0.2rem; }
.book-nav__next { text-align: right; }
.book-nav__next a { align-items: flex-end; }
.book-nav__dir { font-family: ui-monospace, 'DejaVu Sans Mono', Menlo, monospace; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-muted); }
.book-nav__target { font-family: var(--font-display); font-size: 1.15rem; color: var(--color-title); }
.book-nav--bottom a:hover .book-nav__target { color: var(--color-primary); }
.book-nav__contents a { font-size: 0.85rem; color: var(--color-text-muted); border: 1px solid var(--color-border); border-radius: 2rem; padding: 0.35rem 0.9rem; }
.book-nav__contents a:hover { color: var(--color-primary); border-color: var(--color-primary); }
.book-nav--bottom + .post__footer { border-top: 0; }

@media (max-width: 900px) {
  .book-hero__inner { grid-template-columns: 1fr; }
  .book-hero__cover-wrap { max-width: 260px; }
  .book-about__notes { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .book-about__notes { grid-template-columns: 1fr; }
  .book-nav--bottom { grid-template-columns: 1fr; text-align: left; }
  .book-nav__next { text-align: left; }
  .book-nav__next a { align-items: flex-start; }
}
.book-nav__soon { display: flex; flex-direction: column; gap: 0.2rem; align-items: flex-end; }
.book-nav__target--soon { color: var(--color-text-muted); font-style: italic; }
@media (max-width: 560px) { .book-nav__soon { align-items: flex-start; } }
.site-header__nav-link { white-space: nowrap; }
.nav-label--short { display: none; }
@media (max-width: 600px) {
  .nav-label--long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav-label--short { display: inline; }
  .site-header__nav { gap: var(--space-4); align-items: center; }
}

/* Section breaks: breathing room everywhere; book chapters use a centred asterism (scene break). */
.post__body hr { border: 0; border-top: 1px solid var(--color-border, #d9d4c7); margin: 2.5rem 0; }
.post--book .post__body hr { border: 0; height: auto; margin: 2.75rem 0; text-align: center; overflow: visible; }
.post--book .post__body hr::before { content: "*\2003*\2003*"; color: var(--color-text-muted); font-size: 0.95rem; letter-spacing: 0.1em; }
@media (max-width: 600px) {
  .book-nav--top .book-nav__series + .book-nav__sep, .book-nav--top .book-nav__book { display: none; }
}

/* ── Reader improvements (2026-10-08) ─────────────────────────────────────── */
/* 1. Comfortable reading measure: ~70 characters a line for post text (was the 1200px page width). */
.post { max-width: 47rem; }
.post__body { font-size: 1.075rem; }
.post__body img, .post__body figure { max-width: 100%; }

/* Footnotes: smaller, set apart, labelled. */
.post__body .footnotes { margin-top: var(--space-12); font-size: 0.9rem; color: var(--color-text-muted); }
.post__body .footnotes::before { content: "Notes"; display: block; font-family: var(--font-display); font-size: 1.25rem; color: var(--color-text); margin-bottom: var(--space-4); }
.post__body .footnotes hr { display: none; }
.post__body .footnotes li { margin-bottom: var(--space-1, 0.25rem); }
.post__body sup a, .post__body a.footnote-ref { text-decoration: none; padding-inline: 0.1em; }

/* 2. Reading time */
.reading-time { font-size: 0.8rem; color: var(--color-text-muted); }
.reading-time::before { content: "·"; margin-right: var(--space-2, 0.5rem); }
.tile-card__time { font-size: 0.75rem; color: var(--color-text-muted); }

/* 3. Series navigation for multi-part essays */
.series-box { border: 1px solid var(--color-border); border-left: 3px solid var(--color-text-muted); border-radius: var(--radius-md, 6px);
  padding: var(--space-4) var(--space-6); margin-bottom: var(--space-8); background: color-mix(in srgb, var(--color-text) 3%, transparent); }
.series-box__kicker { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: var(--space-2); }
.series-box__list { margin: 0; padding-left: 1.25rem; font-size: 0.95rem; }
.series-box__list li { margin-bottom: 0.25rem; }
.series-box__list .is-current span { font-weight: 600; }
.series-next { display: block; margin-top: var(--space-10); padding: var(--space-6); border: 1px solid var(--color-border); border-radius: var(--radius-md, 6px); text-decoration: none; color: inherit; }
.series-next:hover { border-color: var(--color-text-muted); }
.series-next__dir { display: block; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: var(--space-2); }
.series-next__title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; }

/* 4. Keep reading */
.related-wrap { max-width: var(--site-width); }
.related { border-top: 1px solid var(--color-border); margin-top: var(--space-12); padding-top: var(--space-10); }
.related__heading { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: var(--space-6); }
.related .feed-tiles { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .related .feed-tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .related .feed-tiles { grid-template-columns: 1fr; } }

/* 5. Reading progress bar on long posts */
.read-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 50; pointer-events: none; }
.read-progress__bar { display: block; height: 100%; background: var(--color-text-muted); transform-origin: 0 50%; transform: scaleX(0); }
@media (prefers-reduced-motion: no-preference) { .read-progress__bar { transition: transform 80ms linear; } }

/* Most read row (homepage) */
.popular-row { padding-block: var(--space-10); }
.popular-row__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); }
.popular-row__heading { font-family: var(--font-display); font-size: 1.5rem; }
.popular-row__note { font-size: 0.8rem; color: var(--color-text-muted); }

/* Homepage book kicker links to the book page */
.book-band__kicker a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.book-band__kicker a:hover, .book-band__kicker a:focus-visible { color: var(--color-text); border-bottom-color: currentColor; }

/* Figures with captions (from the image render hook) */
.post__body .post-figure { margin-block: var(--space-6); }
.post__body .post-figure img { margin-block: 0 var(--space-2); }
.post__body .post-figure figcaption { font-size: 0.85rem; font-style: italic; color: var(--color-text-muted); text-align: center; line-height: 1.45; }

/* Converted footnotes: superscript markers, compact notes list, back links */
.post__body sup.fnref { font-size: 0.7em; line-height: 0; vertical-align: super; margin-left: 0.05em; }
.post__body sup.fnref a { text-decoration: none; color: var(--color-primary); padding: 0 0.08em; border-radius: 3px; font-variant-numeric: tabular-nums; }
.post__body sup.fnref a:hover, .post__body sup.fnref a:focus-visible { background: color-mix(in srgb, var(--color-primary) 12%, transparent); }
.post__body .notes-start + ol { font-size: 0.9rem; line-height: 1.55; color: var(--color-text-muted); padding-left: 1.6em; overflow-wrap: anywhere; }
.post__body .notes-start + ol li { margin-bottom: 0.45rem; scroll-margin-top: 6rem; }
.post__body .notes-start + ol li:has(.fn-anchor:target) { background: color-mix(in srgb, var(--color-primary) 9%, transparent); border-radius: 4px; }
.post__body .notes-start + ol a[href^="#fnref-"] { text-decoration: none; margin-left: 0.25em; }
.post__body [id^="fnref-"] { scroll-margin-top: 6rem; }
.post__body .fn-anchor { scroll-margin-top: 6rem; }
.fn-pop { position: absolute; z-index: 60; max-width: min(26rem, calc(100vw - 2rem)); padding: 0.75rem 0.9rem; background: var(--color-surface, var(--color-bg)); color: var(--color-text); border: 1px solid var(--color-border-strong); border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.14); font-size: 0.85rem; line-height: 1.5; overflow-wrap: anywhere; }
.fn-pop a { color: var(--color-primary); }
.fn-pop__num { font-weight: 600; margin-right: 0.35em; }
.fn-pop__jump { display: block; margin-top: 0.45rem; font-size: 0.78rem; }

/* ── Long-read layout ──────────────────────────────────────────────────────
   Generated contents (inline disclosure + wide-screen rail), clearer section breaks,
   quotation styling with attribution, heading share links, back-to-top. */
.post-contents ul { list-style: none; padding: 0; margin: 0; }
.post-contents li { margin: 0; }
.post-contents ul ul { padding-left: 0.9rem; }
.post-contents a { display: block; text-decoration: none; color: var(--color-text-muted); line-height: 1.35; padding: 0.3rem 0; }
.post-contents a:hover, .post-contents a:focus-visible { color: var(--color-text); }
.post-contents__label { font-family: ui-monospace, 'DejaVu Sans Mono', Menlo, monospace; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-text-muted); }
.post-contents__count { font-size: 0.8rem; color: var(--color-text-faint); margin-left: 0.4rem; }

.post-contents--inline { border: 1px solid var(--color-border); border-radius: var(--radius-md, 8px); padding: 0.75rem 1rem; margin: 0 0 var(--space-8); background: var(--color-surface, transparent); }
.post-contents--inline summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; }
.post-contents--inline summary::-webkit-details-marker { display: none; }
.post-contents--inline summary::after { content: "+"; margin-left: auto; color: var(--color-text-muted); font-size: 1.1rem; line-height: 1; }
.post-contents--inline[open] summary::after { content: "–"; }
.post-contents--inline[open] summary { margin-bottom: 0.5rem; }
.post-contents--inline a { font-size: 0.92rem; border-top: 1px solid var(--color-border); }
.post-contents--inline ul ul a { border-top: 0; padding-top: 0.15rem; font-size: 0.86rem; }

.post-contents--rail { display: none; }
@media (min-width: 1240px) {
  .post-layout--with-rail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 47rem) minmax(0, 1fr); column-gap: var(--space-8); }
  .post-layout--with-rail > .post { grid-column: 2; margin-inline: 0; width: 100%; }
  .post-contents--rail { display: block; grid-column: 1; grid-row: 1; justify-self: end; width: 15rem; position: sticky; top: var(--space-8); align-self: start; max-height: calc(100vh - 4rem); overflow-y: auto; padding-right: var(--space-2); margin-top: 12rem; scrollbar-width: thin; }
  .post-contents--rail a { font-size: 0.84rem; padding: 0.32rem 0 0.32rem 0.75rem; border-left: 2px solid var(--color-border); }
  .post-contents--rail ul ul a { padding-left: 1.4rem; font-size: 0.8rem; }
  .post-contents--rail a.is-active { color: var(--color-text); border-left-color: var(--color-primary); }
  .post-contents--rail .post-contents__label { margin-bottom: 0.6rem; }
  .post-layout--with-rail .post-contents--inline { display: none; }
}

/* Section breaks in long essays */
.post--long .post__body h2 { margin-top: var(--space-16); padding-top: var(--space-8); border-top: 1px solid var(--color-border); font-size: clamp(1.45rem, 1.2rem + 0.9vw, 1.85rem); line-height: 1.2; }
.post--long .post__body h3 { margin-top: var(--space-10); font-size: 1.2rem; }
.post__body h2, .post__body h3 { scroll-margin-top: var(--space-8); }
.post__body .heading-anchor { opacity: 0; margin-left: 0.35em; font-size: 0.75em; text-decoration: none; color: var(--color-text-faint); transition: opacity .15s; }
.post__body h2:hover .heading-anchor, .post__body h3:hover .heading-anchor, .post__body .heading-anchor:focus-visible { opacity: 1; }
@media (hover: none) { .post__body .heading-anchor { display: none; } }

/* Quotations: a quieter panel with the attribution set apart */
.post__body blockquote { border-left: 3px solid var(--color-primary); background: color-mix(in srgb, var(--color-primary) 4%, transparent); padding: var(--space-4) var(--space-6); border-radius: 0 var(--radius-md, 8px) var(--radius-md, 8px) 0; color: var(--color-text); }
.post__body blockquote p:last-child { margin-bottom: 0; }
.post__body blockquote .quote-cite { font-style: normal; font-size: 0.85rem; color: var(--color-text-muted); margin-top: var(--space-2); }
.post__body blockquote .quote-cite::before { content: "— "; }
.post--book .post__body blockquote { background: none; border-radius: 0; }

/* Back to top */
.to-top { position: fixed; right: clamp(0.75rem, 3vw, 2rem); bottom: clamp(0.75rem, 3vw, 2rem); width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border-radius: 50%; background: var(--color-bg); border: 1px solid var(--color-border-strong); color: var(--color-text); text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,.08); opacity: 0; pointer-events: none; transform: translateY(6px); transition: opacity .2s, transform .2s; z-index: 40; }
.to-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }
@media print { .to-top, .post-contents, .read-progress { display: none !important; } }
.post-contents strong, .post-contents b, .post-contents em { font-weight: inherit; font-style: normal; }

/* ---- After Intelligence serialisation (2026-10-08) ---- */
.post__hero { margin: var(--space-6, 1.5rem) 0 var(--space-8, 2rem); }
.post__hero img { display: block; width: 100%; height: auto; border-radius: 4px; }
.post__hero:not(.post__hero--chapter) img { width: auto; max-width: 100%; max-height: min(28rem, 60vh); margin-inline: auto; }
.post__hero--chapter { margin-top: var(--space-4, 1rem); }
.post__hero--chapter img { border-radius: 2px; box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 8%, transparent); }
.part-end { margin-top: 2.5rem; padding: 1rem 1.25rem; border-left: 3px solid var(--color-primary, #8a5a2b); background: color-mix(in srgb, var(--color-primary, #8a5a2b) 6%, transparent); font-size: .95em; }
.book-rights { margin: 2.5rem 0 0; padding-top: 1rem; border-top: 1px solid color-mix(in srgb, currentColor 15%, transparent); font-size: .85rem; line-height: 1.55; opacity: .85; }
.book-rights--full { max-width: 47rem; margin: 3rem auto 0; }
.book-rights--full p { margin: 0 0 .75rem; }
.book-rights-wrap { padding-bottom: 3rem; }
.book-btn--quiet { border-style: dashed; }
.cast { margin: 0 0 2rem; }
.cast__item { padding: .75rem 0; border-bottom: 1px solid color-mix(in srgb, currentColor 10%, transparent); }
.cast__name { font-weight: 600; }
.cast__entry { margin: .2rem 0 0; }
.cast__from { display: block; font-size: .8rem; opacity: .7; margin-top: .2rem; }
.feedback-cta { margin: 1.5rem 0 2rem; padding: 1rem 1.25rem; border: 1px solid color-mix(in srgb, currentColor 15%, transparent); border-radius: 6px; }
.feedback-cta p { margin: 0 0 .75rem; }
@media print { .post__hero--chapter { break-after: avoid; } }

/* Share bar */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: 2rem 0 1rem; padding-top: 1rem; border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent); font-size: .85rem; }
.share__label { font-family: var(--font-mono, ui-monospace, monospace); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted, #6b665e); margin-right: .25rem; }
.share__btn { display: inline-flex; align-items: center; min-height: 2.1rem; padding: .3rem .8rem; border: 1px solid color-mix(in srgb, currentColor 22%, transparent); border-radius: 999px; background: transparent; color: inherit; font: inherit; text-decoration: none; cursor: pointer; }
.share__btn:hover, .share__btn:focus-visible { border-color: var(--color-primary, #8a5a2b); color: var(--color-primary, #8a5a2b); }
.share__native { background: var(--color-text, #1c1b19); color: var(--color-bg, #faf9f6); border-color: transparent; }
.share__native:hover, .share__native:focus-visible { color: var(--color-bg, #faf9f6); opacity: .9; }
.share__btn[hidden] { display: none; }
.book-hero .share { border-top: 0; padding-top: 0; margin: 1.25rem 0 0; }
