/* =============================================================================
 * Progress.org — warm magazine, on white
 * Ghost theme stylesheet, v2 (matches the React canvas in `Progress.org - warm
 * magazine on white.html`).
 *
 * The palette is fully tokenized at :root so a color variant is a one-file
 * change. All structural CSS is color-agnostic — values use var(--accent) etc.
 * ============================================================================= */

/* ── Tokens ─────────────────────────────────────────────────────────── */
:root {
  /* surface */
  --bg:       #ffffff;
  --surface:  #fbf6ec;   /* warm cream — cards, sidebars, blocks */
  --tint:     #f4ecdb;   /* softer tile */
  --hair:     #ece4d3;   /* warm divider */

  /* ink */
  --ink:      #1f1814;
  --ink-2:    #6b5b4a;
  --ink-3:    #a89a86;
  --rule:     #1f1814;

  /* accents */
  --accent:   #c0492a;   /* terracotta — primary */
  --accent-2: #2f5d50;   /* forest      — secondary */
  --accent-3: #b67a2a;   /* ochre       — tertiary */

  /* type */
  --serif:    "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans:     "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  /* spacing */
  --pad-x:    40px;
  --rule-w:   1.5px;
}

/* ── Reset-ish base ─────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { overflow-x: hidden; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button, input { font: inherit; }
button { cursor: pointer; border: none; background: transparent; padding: 0; color: inherit; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; }
ul { margin: 0; padding-left: 18px; }

/* ── Typography primitives ──────────────────────────────────────────── */
.kicker {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.kicker--alt   { color: var(--accent-2); }
.kicker--ink   { color: var(--ink); }
.kicker--mute  { color: var(--ink-2); }
.kicker--small { font-size: 10px; }

.rule       { border-top: var(--rule-w) solid var(--rule); }
.rule--thin { border-top: 1px solid var(--rule); }
.rule--hair { border-top: 1px solid var(--hair); }

.serif    { font-family: var(--serif); }
.sans     { font-family: var(--sans); }
.italic   { font-style: italic; }

/* Accent inline (used in headlines for emphasis) */
em.accent, .accent-em {
  color: var(--accent);
  font-style: italic;
  font-weight: 500;
}

/* ── Buttons & pills ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  font-family: var(--sans);
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: opacity .15s ease;
}
.btn:hover { opacity: .85; color: var(--ink); }
.btn--filled    { background: var(--ink);     color: var(--bg); border-color: var(--ink); }
.btn--accent    { background: var(--accent);  color: var(--bg); border-color: var(--accent); }
.btn--accent:hover { color: var(--bg); }
.btn--lg        { padding: 12px 22px; font-size: 13px; }
.btn--sm        { padding: 7px 14px; font-size: 12px; border-radius: 6px; }
.btn--square    { border-radius: 6px; }

.pill {
  display: inline-flex; align-items: center;
  padding: 3px 11px;
  font-family: var(--sans);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid var(--ink);
  color: var(--ink);
}
.pill--filled  { background: var(--ink);    color: var(--bg);  border: none; }
.pill--accent  { background: var(--accent); color: var(--bg);  border: none; }

/* ── Cover placeholder (when post has no feature_image) ────────────── */
.cover {
  position: relative;
  overflow: hidden;
  background: var(--accent);
  background-image:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.07) 0 2px, transparent 2px 14px);
}
.cover--accent-2 { background-color: var(--accent-2); }
.cover--accent-3 { background-color: var(--accent-3); }
.cover--ink      { background-color: var(--ink); }
.cover--tint     {
  background-color: var(--tint);
  background-image:
    repeating-linear-gradient(135deg, rgba(31,24,20,0.05) 0 2px, transparent 2px 14px);
}
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover__label {
  position: absolute; left: 14px; bottom: 10px;
  font-family: var(--sans);
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}
.cover--tint .cover__label { color: var(--ink-2); }

/* ── Photo system: mat + duotones ──────────────────────────────────── */
/*
 * Heroes go in a `.mat` — thin cream frame + hairline, ties any photo back
 * to the system. Thumbnails get a `.dt-*` duotone keyed to the post's
 * primary tag. SVG filter defs live once in default.hbs.
 */
.mat {
  background: var(--surface);
  padding: 10px;
  border: 1px solid var(--hair);
  border-radius: 5px;
}
.mat--sm { padding: 6px; border-radius: 4px; }
.mat > img,
.mat > .cover { border-radius: 3px; display: block; }

.dt-terracotta { filter: url(#dt-terracotta); }
.dt-forest     { filter: url(#dt-forest); }
.dt-ochre      { filter: url(#dt-ochre); }
.dt-sepia      { filter: sepia(.6) hue-rotate(-12deg) saturate(1.05) brightness(.96); }

/* Captions for matted / inline photos */
.photo-caption {
  font-family: var(--serif);
  font-size: 13px; font-style: italic;
  color: var(--ink-2);
  line-height: 1.4;
  margin-top: 8px;
}

/* ── Site header ───────────────────────────────────────────────────── */
.bar-utility {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px var(--pad-x);
  border-bottom: 1px solid var(--hair);
  font-family: var(--sans);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-2);
}
.bar-utility__right { display: flex; gap: 22px; }

/* Hamburger hidden on desktop; the masthead grid is unchanged */
.masthead__hamburger { display: none; }
.masthead__menu { display: contents; }

.masthead {
  padding: 24px var(--pad-x) 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.masthead__brand { display: flex; align-items: center; gap: 12px; }
.masthead__mark {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 600; font-size: 22px;
  font-style: italic; padding-bottom: 2px;
}
.masthead__name {
  font-family: var(--serif); font-size: 24px; font-weight: 600;
  letter-spacing: -0.015em; line-height: 1;
}
.masthead__name .dot { color: var(--accent); }
.masthead__tag {
  font-family: var(--sans); font-size: 10px; color: var(--ink-2);
  letter-spacing: 0.18em; text-transform: uppercase; margin-top: 3px;
}

.nav {
  display: flex; justify-content: center; gap: 34px;
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  list-style: none; margin: 0; padding: 0;
}
.nav li { list-style: none; }
.nav li::marker { content: ""; }
.nav a {
  padding-bottom: 6px;
  border-bottom: 2px solid transparent;
}
.nav a.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.masthead__right {
  display: flex; gap: 10px; justify-content: flex-end; align-items: center;
}
.search-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  background: var(--surface); border-radius: 999px;
  font-family: var(--sans); font-size: 12px; color: var(--ink-2);
}
.search-pill__key {
  padding: 1px 6px;
  background: var(--bg);
  border: 1px solid var(--hair);
  border-radius: 4px;
  font-size: 10px;
  color: var(--ink-3);
  margin-left: 8px;
}

.site-header__rule { border-bottom: var(--rule-w) solid var(--rule); }

/* Breadcrumb */
.crumb {
  padding: 10px var(--pad-x);
  border-bottom: 1px solid var(--hair);
  font-family: var(--sans); font-size: 11px;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-2);
}
.crumb__sep { margin: 0 8px; }
.crumb__current { color: var(--ink); }

/* ── Wiki-mode header (de-emphasized site nav) ─────────────────────── */
.wiki-bar-utility {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px var(--pad-x);
  border-bottom: 1px solid var(--hair);
  font-family: var(--sans);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-2);
}
.wiki-bar-utility__back { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.wiki-bar-utility__right { display: flex; gap: 22px; }

.wiki-masthead {
  padding: 16px var(--pad-x) 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--hair);
}
.wiki-masthead__brand { display: flex; align-items: center; gap: 10px; }
.wiki-masthead__mark {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 600; font-size: 16px;
  font-style: italic; padding-bottom: 1px;
}
.wiki-masthead__wordmark {
  display: flex; align-items: baseline; gap: 8px;
  font-family: var(--serif);
  letter-spacing: -0.01em;
}
.wiki-masthead__wordmark .site-name {
  font-size: 14px; color: var(--ink-2); font-weight: 500;
}
.wiki-masthead__wordmark .sep { color: var(--ink-3); font-size: 12px; }
.wiki-masthead__wordmark .wiki-name {
  font-size: 22px; font-weight: 600; font-style: italic; color: var(--ink);
}

.wiki-search {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border: 1.5px solid var(--ink); border-radius: 6px;
  font-family: var(--sans); font-size: 14px; color: var(--ink-2);
  max-width: 560px; margin-left: auto; width: 100%;
}
.wiki-search__key {
  padding: 2px 8px; background: var(--surface);
  border-radius: 4px; font-size: 11px; color: var(--ink-2);
  margin-left: auto;
}

.wiki-actions { display: flex; gap: 8px; }

.wiki-nav {
  padding: 10px var(--pad-x);
  display: flex; gap: 0;
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  border-bottom: var(--rule-w) solid var(--rule);
  overflow-x: auto; white-space: nowrap;
}
.wiki-nav a {
  padding: 4px 18px 14px;
  margin-bottom: -12px;
  border-bottom: 2px solid transparent;
}
.wiki-nav a.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.wiki-nav__spacer { flex: 1; }
.wiki-nav__util { color: var(--ink-2); padding: 4px 12px; }

/* -- Newsletter CTA (above footer) ------------------------------------------- */
.newsletter-cta {
  background: var(--surface, #fbf6ec);
  padding: 36px var(--pad-x);
  scroll-margin-top: 80px;
}
.newsletter-cta__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  max-width: var(--max-width, 1100px);
  margin: 0 auto;
}
.newsletter-cta__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 6px 0 8px;
  color: var(--ink, #1f1814);
}
.newsletter-cta__deck {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2, #444);
  margin: 0;
}
.newsletter-cta__form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}
.newsletter-cta__field {
  flex: 1 1 240px;
  position: relative;
}
.newsletter-cta__field-label {
  position: absolute;
  left: -9999px;
}
.newsletter-cta__field input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--hair, #e8e0d0);
  border-radius: 6px;
  background: var(--bg);
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink, #1f1814);
  height: 100%;
  box-sizing: border-box;
}
.newsletter-cta__field input:focus {
  outline: none;
  border-color: var(--accent, #c0492a);
  box-shadow: 0 0 0 2px rgba(192, 73, 42, 0.15);
}
.newsletter-cta__form .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.newsletter-cta__feedback {
  width: 100%;
  margin: 8px 0 0;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-2, #444);
  min-height: 1.4em;
}
.newsletter-cta__feedback.is-error { color: var(--accent, #c0492a); }
@media (max-width: 720px) {
  .newsletter-cta { padding: 28px var(--pad-x); }
  .newsletter-cta__inner { grid-template-columns: 1fr; gap: 18px; }
  .newsletter-cta__title { font-size: 24px; }
  .newsletter-cta__form .btn { width: 100%; }
}

/* ── Site footer ───────────────────────────────────────────────────── */
.site-footer__top {
  padding: 28px var(--pad-x) 22px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-2);
}
@media (max-width: 720px) {
  .site-footer__top {
    grid-template-columns: 1fr 1fr;
    gap: 20px 16px;
  }
  .site-footer__legal {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  .site-footer__legal-right { flex-wrap: wrap; gap: 10px 14px; }
}
.site-footer__brand {
  font-family: var(--serif);
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1;
}
.site-footer__brand .dot { color: var(--accent); }
.site-footer__about { margin-top: 10px; max-width: 280px; line-height: 1.5; }
.site-footer__col { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.site-footer__legal {
  padding: 12px var(--pad-x);
  border-top: 1px solid var(--hair);
  display: flex; justify-content: space-between;
  font-family: var(--sans); font-size: 11px;
  color: var(--ink-2);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.site-footer__legal-right { display: flex; gap: 18px; }

/* ── HOME: hero ────────────────────────────────────────────────────── */
.hero {
  padding: 48px var(--pad-x) 40px;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 48px;
  align-items: end;
}
.hero__kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.hero__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 78px;
  line-height: 0.94;
  letter-spacing: -0.03em;
  margin: 0;
}
.hero__deck {
  font-family: var(--serif);
  font-size: 20px; font-style: italic; font-weight: 400;
  line-height: 1.45;
  color: var(--ink-2);
  margin-top: 22px;
  max-width: 600px;
}
.hero__byline {
  display: flex; align-items: center; gap: 14px;
  margin-top: 28px;
}
.hero__avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent-2);
  flex-shrink: 0;
}
.hero__avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.hero__by-name { font-size: 13px; font-weight: 600; }
.hero__by-meta { font-size: 11px; color: var(--ink-2); }
.hero__actions { margin-left: auto; display: flex; gap: 10px; }

.hero__side {
  display: flex; flex-direction: column; gap: 14px;
}
.hero__side-image {
  background: var(--surface);
  padding: 10px;
  border: 1px solid var(--hair);
  border-radius: 6px;
}
.hero__side-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--bg);
}
.hero__side-image .cover {
  display: block;
  width: 100%;
  height: 300px;
  border-radius: 4px;
}
.hero__editor-note {
  background: var(--surface);
  border-radius: 6px;
  padding: 16px 18px;
}
/* Hide editor note on mobile/narrow viewports — saves vertical real estate */
@media (max-width: 720px) {
  .hero__editor-note { display: none; }
}
.hero__editor-note .body {
  font-family: var(--serif); font-size: 15px; line-height: 1.45;
  color: var(--ink); margin-top: 8px;
}
.hero__editor-note .cta {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px;
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
}

/* ── HOME: 4-column rail ───────────────────────────────────────────── */
.home-rail {
  display: grid;
  grid-template-columns: 1.05fr 1.5fr 1.2fr 1.05fr;
  border-top: var(--rule-w) solid var(--rule);
  border-bottom: var(--rule-w) solid var(--rule);
}
.home-rail > section { padding: 26px 24px; }
.home-rail > section + section { border-left: 1px solid var(--hair); }

/* Learning paths column gets a light tan background per design theme */
.home-col--paths {
  background: var(--tint, #f5efe6);
}
/* All `.paths` lists (anywhere on the site) inherit the same tan background
   container treatment for consistency — but only when used as a standalone
   block (e.g. on /paths/ page). On home, the parent column already has it. */
.paths-block {
  background: var(--tint, #f5efe6);
  padding: 22px;
  border-radius: 8px;
  margin: 16px 0;
}
.home-rail__mid { padding: 26px 28px; }

.col-h {
  display: flex; justify-content: space-between; align-items: baseline;
}
.col-h h3 {
  font-family: var(--serif); font-weight: 600;
  font-size: 22px; letter-spacing: -0.015em; margin: 0;
}
.col-intro {
  font-family: var(--serif); font-size: 13px;
  font-style: italic; color: var(--ink-2);
  margin-top: 6px; line-height: 1.4;
}

/* Learning paths (col 1) */
.paths { display: flex; flex-direction: column; margin-top: 16px; counter-reset: path-counter; }
.path-row {
  padding: 12px 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  counter-increment: path-counter;
}
.path-row + .path-row { border-top: 1px solid var(--hair); }
.path-row__badge {
  width: 36px; height: 36px; border-radius: 6px;
  background: var(--accent); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 600; font-size: 14px;
}
.path-row:nth-child(2) .path-row__badge { background: var(--accent-2); }
.path-row:nth-child(3) .path-row__badge { background: var(--accent-3); }
.path-row:nth-child(4) .path-row__badge { background: var(--ink); }
.path-row__num::before {
  content: counter(path-counter, decimal-leading-zero);
}
.path-row__badge.accent-2 { background: var(--accent-2); }
.path-row__badge.accent-3 { background: var(--accent-3); }
.path-row__badge.ink      { background: var(--ink); }
.path-row__title {
  font-family: var(--serif); font-size: 15px; font-weight: 600;
  letter-spacing: -0.005em; line-height: 1.15;
  color: var(--ink);
}
.path-row__meta {
  font-family: var(--sans); font-size: 11px; color: var(--ink-2);
  margin-top: 2px;
}
.path-row__meta .done { color: var(--accent); margin-left: 6px; }
.path-row__arrow { color: var(--ink-2); font-size: 13px; }

.col-more {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px;
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink);
}

/* Feed: lead + secondary articles (col 2 — "The canon") */
.feed-lead { margin-top: 16px; }
.feed-lead .cover,
.feed-lead img {
  width: 100%; height: 180px; object-fit: cover; border-radius: 6px; display: block;
}
.feed-lead__body { margin-top: 12px; }
.feed-lead__title {
  font-family: var(--serif); font-weight: 600;
  font-size: 24px; line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 6px 0 6px;
}
.feed-lead__deck {
  font-family: var(--serif); font-size: 14px; line-height: 1.5;
  color: var(--ink-2);
}
.feed-lead__by {
  font-family: var(--sans); font-size: 11px;
  color: var(--ink-2); margin-top: 8px;
  letter-spacing: 0.04em;
}
.feed-secondary {
  display: grid; grid-template-columns: 1fr 90px;
  gap: 14px; align-items: start;
}
.feed-secondary + .feed-secondary { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hair); }
.feed-secondary__title {
  font-family: var(--serif); font-weight: 600;
  font-size: 18px; line-height: 1.1; letter-spacing: -0.01em;
  margin: 4px 0 4px;
}
.feed-secondary__deck {
  font-family: var(--serif); font-size: 13px;
  color: var(--ink-2); line-height: 1.45;
}
.feed-secondary__by {
  font-family: var(--sans); font-size: 10px;
  color: var(--ink-2); margin-top: 6px; letter-spacing: 0.04em;
}
.feed-secondary .cover,
.feed-secondary img {
  width: 90px; height: 70px; object-fit: cover; border-radius: 4px;
}

/* "From the library" text list (col 3) */
.text-list { display: flex; flex-direction: column; margin-top: 14px; counter-reset: text-list-counter; }
.text-list__row {
  padding: 12px 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px; align-items: baseline;
  counter-increment: text-list-counter;
}
.text-list__row + .text-list__row { border-top: 1px solid var(--hair); }
.text-list__n {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: 20px; line-height: 1; color: var(--accent);
  width: 24px;
}
.text-list__n::before {
  content: counter(text-list-counter, decimal-leading-zero);
}
/* Variant: numbering starts at 04 (used in "From the library" home column,
   where the canonical featured row above counts as 01–03). */
.text-list--from-04 { counter-reset: text-list-counter 3; }
.text-list__title {
  font-family: var(--serif); font-weight: 600;
  font-size: 16px; line-height: 1.15; letter-spacing: -0.005em;
  margin: 3px 0 4px;
}
.text-list__by {
  font-family: var(--sans); font-size: 11px; color: var(--ink-2);
}

/* Home search card (col 4) — default Ghost search; replaces wiki callout while
   the Wiki isn't live. Uses the warm tint surface like other home cards. */
.home-search {
  display: block;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 18px;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.home-search:hover { background: var(--tint); border-color: rgba(0,0,0,0.12); }
.home-search__title {
  font-family: var(--serif); font-weight: 600;
  font-size: 22px; letter-spacing: -0.01em;
  line-height: 1.1; margin-top: 4px;
  color: var(--ink-1, #1a1a1a);
}
.home-search__pill {
  margin-top: 12px;
  background: var(--bg);
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 8px 14px;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 13px;
  color: var(--ink-2);
}
.home-search__pill > span:first-child { font-size: 15px; }
.home-search__pill > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-search__key {
  font-family: var(--sans); font-size: 11px;
  padding: 1px 6px;
  border: 1px solid var(--hair);
  border-radius: 4px;
  color: var(--ink-3);
  background: var(--bg);
}
.home-search__hint {
  font-family: var(--sans); font-size: 10px;
  margin-top: 10px;
  color: var(--ink-3);
  letter-spacing: 0.06em; text-transform: uppercase;
}

/* Wiki callout + collections (col 4) */
.wiki-callout {
  background: var(--accent); color: var(--bg);
  border-radius: 8px;
  padding: 18px;
  position: relative; overflow: hidden;
}
.wiki-callout::after {
  content: ''; position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
}
.wiki-callout__inner { position: relative; }
.wiki-callout__title {
  font-family: var(--serif); font-weight: 600;
  font-size: 22px; letter-spacing: -0.01em;
  line-height: 1.1; margin-top: 4px;
}
.wiki-callout__search {
  margin-top: 10px;
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
  padding: 7px 12px;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 12px;
  color: rgba(255,255,255,0.85);
}
.wiki-callout__chips {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-top: 10px;
}
.wiki-callout__chip {
  font-family: var(--sans); font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.4);
  color: var(--bg);
  letter-spacing: 0.04em;
}
.wiki-callout__count {
  font-family: var(--sans); font-size: 10px;
  margin-top: 10px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.06em; text-transform: uppercase;
}

.coll-list { display: flex; flex-direction: column; margin-top: 12px; }
.coll-row {
  padding: 10px 0;
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 10px; align-items: center;
}
.coll-row + .coll-row { border-top: 1px solid var(--hair); }
.coll-row__swatch {
  width: 30px; height: 30px; border-radius: 4px;
  background: var(--accent);
}
.coll-list .coll-row:nth-child(2) .coll-row__swatch { background: var(--accent-2); }
.coll-list .coll-row:nth-child(3) .coll-row__swatch { background: var(--accent-3); }
.coll-list .coll-row:nth-child(4) .coll-row__swatch { background: var(--ink); }
/* Legacy class hooks — kept for any callers still using them */
.coll-row__swatch.accent-2 { background: var(--accent-2); }
.coll-row__swatch.accent-3 { background: var(--accent-3); }
.coll-row__swatch.ink      { background: var(--ink); }
.coll-row__title {
  font-family: var(--serif); font-weight: 600;
  font-size: 14px; letter-spacing: -0.005em; line-height: 1.15;
}
.coll-row__meta {
  font-family: var(--sans); font-size: 10px;
  color: var(--ink-2); margin-top: 2px; letter-spacing: 0.04em;
}
.coll-row__arrow { color: var(--ink-2); font-size: 13px; }

/* ── Section header (shared by all index pages) ────────────────────── */
.page-head {
  padding: 48px var(--pad-x) 28px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: end;
}
.page-head__title {
  font-family: var(--serif); font-weight: 600;
  font-size: 72px;
  letter-spacing: -0.03em;
  line-height: 0.96;
  margin: 8px 0 0;
}
.page-head__deck {
  font-family: var(--serif); font-size: 18px;
  line-height: 1.5;
  color: var(--ink-2);
  margin-top: 16px;
  max-width: 680px;
}
.page-head__stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px;
}
.page-head__stats--two { grid-template-columns: 1fr 1fr; }
.stat {
  background: var(--surface);
  border-radius: 6px;
  padding: 14px 16px;
}
.stat__n {
  font-family: var(--serif); font-size: 30px; font-weight: 600;
  letter-spacing: -0.02em; color: var(--accent); line-height: 1;
}
.stat__l {
  font-family: var(--sans); font-size: 11px;
  color: var(--ink-2); margin-top: 4px;
  letter-spacing: 0.06em; text-transform: uppercase;
}

/* ── Articles index ────────────────────────────────────────────────── */
.topic-chips {
  padding: 8px var(--pad-x) 18px;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  display: flex; gap: 8px; flex-wrap: wrap;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: transparent;
  color: var(--ink);
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  letter-spacing: 0.02em;
}
.chip__n { font-weight: 400; opacity: 0.7; font-size: 11px; }
.chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.articles-body {
  display: grid; grid-template-columns: 240px 1fr;
}
.articles-sidebar {
  padding: 28px;
  border-right: 1px solid var(--hair);
}
.sidebar-group + .sidebar-group { margin-top: 22px; border-top: 1px solid var(--hair); padding-top: 22px; }
.sidebar-radio, .sidebar-check {
  display: flex; flex-direction: column; gap: 6px; margin-top: 10px;
  font-family: var(--sans); font-size: 13px; color: var(--ink);
}
.sidebar-radio label,
.sidebar-check label {
  display: flex; align-items: center; gap: 8px;
}
.sidebar-radio .dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 1.5px solid var(--ink-3); background: transparent;
  box-sizing: content-box;
}
.sidebar-radio .dot.is-active {
  background: var(--accent); border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--bg);
}
.sidebar-radio label.is-active { color: var(--accent); font-weight: 600; }
.sidebar-check .box {
  width: 12px; height: 12px; border-radius: 3px;
  border: 1.5px solid var(--ink-3); position: relative;
}
.sidebar-check .box.is-active { border-color: var(--accent); background: var(--accent); }
.sidebar-check .box.is-active::after {
  content: '✓'; position: absolute; inset: 0;
  color: var(--bg); font-size: 9px; font-weight: 700; text-align: center;
  line-height: 12px;
}

.articles-main { padding: 28px var(--pad-x) 40px; }
.articles-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 18px;
  font-family: var(--sans); font-size: 13px; color: var(--ink-2);
}
.articles-meta b { color: var(--ink); }
.view-toggle {
  display: flex; gap: 4px; padding: 3px;
  background: var(--surface); border-radius: 6px;
  font-family: var(--sans); font-size: 12px;
}
.view-toggle__opt {
  padding: 5px 12px; border-radius: 4px; color: var(--ink); font-weight: 500;
}
.view-toggle__opt.is-active {
  background: var(--bg); font-weight: 600;
  box-shadow: 0 1px 2px rgba(31,24,20,0.08);
}

.featured-row {
  display: grid; grid-template-columns: 1.4fr 1fr;
  gap: 32px; align-items: center;
  padding: 18px 0 26px;
  border-bottom: 1px solid var(--hair);
}
.featured-row__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.featured-row h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: 42px; letter-spacing: -0.02em; line-height: 1.02;
  margin: 0 0 12px;
}
.featured-row__deck {
  font-family: var(--serif); font-size: 17px; line-height: 1.5;
  color: var(--ink-2); margin: 0 0 14px; max-width: 600px;
}
.featured-row__by {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-size: 12px; color: var(--ink-2);
}
.featured-row__avatar {
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent-2);
}
.featured-row__cover img {
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--bg);
  display: block;
}
.featured-row__cover .cover {
  width: 100%; height: 210px; border-radius: 6px;
}

.article-list { display: flex; flex-direction: column; counter-reset: article-list-counter; }
.article-list .article-list-row { counter-increment: article-list-counter; }
.article-list .article-list__n::before {
  content: counter(article-list-counter, decimal-leading-zero) ".";
}
.article-list-row {
  display: grid;
  grid-template-columns: 64px 1fr 120px;
  gap: 22px;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--hair);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}
.article-list-row:hover { background: rgba(0,0,0,0.015); }
.article-list-row:last-child { border-bottom: none; }

.article-list__n {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 36px;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
  align-self: center;
  text-align: left;
}

.article-list__body { min-width: 0; }

.article-list__kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3, #666);
  margin-bottom: 6px;
}
.article-list__topic { color: var(--ink-2, #333); }
.article-list__dot { opacity: 0.5; }
.article-list__time { color: var(--ink-3, #666); }

.article-list__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 8px;
  color: var(--ink-1, #1a1a1a);
}
.article-list-row:hover .article-list__title { color: var(--accent); }

.article-list__by {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 400;
}
.article-list__by b {
  font-weight: 600;
  color: var(--ink-1, #1a1a1a);
}

.article-list__cover {
  width: 120px;
  height: 84px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.article-list__cover img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* Color-swatch placeholders for missing cover images.
   Rotates through 6 muted palette colors with diagonal stripes. */
.article-list__cover .cover-swatch {
  width: 100%; height: 100%;
  background-color: var(--swatch-color, #6b5a4e);
  background-image: repeating-linear-gradient(
    45deg,
    transparent 0,
    transparent 8px,
    rgba(0,0,0,0.12) 8px,
    rgba(0,0,0,0.12) 12px
  );
}
.article-list__cover--swatch-0 .cover-swatch,
.article-list__cover--swatch-6 .cover-swatch  { --swatch-color: #3d5a3a; }  /* deep green */
.article-list__cover--swatch-1 .cover-swatch,
.article-list__cover--swatch-7 .cover-swatch  { --swatch-color: #c8612b; }  /* burnt orange */
.article-list__cover--swatch-2 .cover-swatch,
.article-list__cover--swatch-8 .cover-swatch  { --swatch-color: #a04528; }  /* terracotta */
.article-list__cover--swatch-3 .cover-swatch,
.article-list__cover--swatch-9 .cover-swatch  { --swatch-color: #2a3c2a; }  /* dark green */
.article-list__cover--swatch-4 .cover-swatch,
.article-list__cover--swatch-10 .cover-swatch { --swatch-color: #c4a878; }  /* beige */
.article-list__cover--swatch-5 .cover-swatch,
.article-list__cover--swatch-11 .cover-swatch { --swatch-color: #1f1f1f; }  /* black */

.pagination {
  display: flex; justify-content: space-between; align-items: center;
  padding: 28px 0 0; margin-top: 8px;
  border-top: var(--rule-w) solid var(--ink);
  font-family: var(--sans); font-size: 13px;
}
.pagination__newer { color: var(--ink-3); letter-spacing: 0.04em; }
.pagination__older { color: var(--ink); font-weight: 600; letter-spacing: 0.04em; }
.pagination__pages { display: flex; gap: 6px; font-weight: 500; }
.pagination__pages a,
.pagination__pages span {
  padding: 6px 12px; border-radius: 4px; color: var(--ink);
}
.pagination__pages .is-active {
  background: var(--ink); color: var(--bg); font-weight: 600;
}

/* ── POST: article page ────────────────────────────────────────────── */
.read-progress { height: 3px; background: var(--hair); }
.read-progress__bar { height: 100%; background: var(--accent); }

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
}
.article-main {
  padding: 56px 80px 56px 96px;
  max-width: 920px;
}
.article-kicker { margin: 0; }
.article-title {
  font-family: var(--serif); font-weight: 600;
  font-size: 68px; letter-spacing: -0.03em; line-height: 0.96;
  margin: 14px 0 0;
}
.article-deck {
  font-family: var(--serif); font-size: 22px;
  font-style: italic; font-weight: 400;
  line-height: 1.4; color: var(--ink-2); margin-top: 20px;
}
.article-byline {
  display: flex; align-items: center; gap: 14px;
  margin-top: 24px; padding-bottom: 20px;
  border-bottom: 1px solid var(--hair);
  font-family: var(--sans); font-size: 13px;
}
.article-byline__avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent-2);
}
.article-byline__name { font-weight: 600; }
.article-byline__meta { color: var(--ink-2); }
.article-byline__actions {
  margin-left: auto; display: flex; gap: 8px;
  font-family: var(--sans); font-size: 12px; color: var(--ink-2);
}

.article-feature {
  margin-top: 28px;
  background: var(--surface);
  padding: 10px;
  border: 1px solid var(--hair);
  border-radius: 6px;
}
.article-feature img {
  width: 100%; height: auto;
  max-height: 520px;
  object-fit: contain;
  border-radius: 4px;
  display: block;
  background: var(--bg);
}
.article-feature .cover {
  width: 100%; height: 360px;
  border-radius: 4px;
  display: block;
}
.article-caption {
  font-family: var(--serif); font-size: 13px; font-style: italic;
  color: var(--ink-2); margin-top: 8px; line-height: 1.4;
}

/* Wide content in article body must not force grid to overflow viewport.
   Wrap tables in a horizontally scrollable container instead, and clamp pre/code/iframe widths. */
.gh-content table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.gh-content pre,
.gh-content code {
  max-width: 100%;
  overflow-x: auto;
  word-break: break-word;
}
.gh-content iframe,
.gh-content video {
  max-width: 100%;
}
.gh-content img {
  max-width: 100%;
  height: auto;
}

/* Fine-print republication notice — used at top of imported posts to attribute
   the original source (Substack, etc.) without overwhelming the article. */
.gh-content .republication-notice {
  font-size: 0.78em !important;
  color: var(--ink-3, #888) !important;
  line-height: 1.4 !important;
  margin: 0 0 1.2em !important;
  padding-bottom: 0.8em;
  border-bottom: 1px solid var(--hair, #e8e0d0);
}
.gh-content .republication-notice--top {
  margin-top: 0 !important;
}
.gh-content .republication-notice em { font-style: italic; }
.gh-content .republication-notice strong { font-weight: 600; color: var(--ink-2, #555); }
.gh-content .republication-notice a {
  color: var(--accent, #c0492a);
  text-decoration: underline;
}

/* Body content — applied to Ghost's `.gh-content` */
.gh-content {
  margin-top: 28px;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
}
.gh-content > p { margin: 0 0 16px; }
.gh-content > h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: 34px; letter-spacing: -0.015em;
  line-height: 1.1; margin: 36px 0 12px;
}
.gh-content > h3 {
  font-family: var(--serif); font-weight: 600;
  font-size: 26px; margin: 28px 0 8px;
}
/* Drop-cap on the first paragraph of body content.
   Skip the republication-notice attribution: when that's present, the drop
   cap should apply to the article's actual first paragraph after it. */
.gh-content > p:first-of-type::first-letter,
.gh-content > .republication-notice + p::first-letter {
  font-family: var(--serif); font-weight: 600;
  font-size: 76px; float: left; line-height: 0.78;
  margin: 8px 12px -6px 0;
  color: var(--accent);
}
/* Opt-out: pages that shouldn't get a drop-cap (e.g. the welcome letter). */
.gh-content--no-dropcap > p:first-of-type::first-letter,
.gh-content--no-dropcap > .republication-notice + p::first-letter {
  font-family: inherit;
  font-size: inherit;
  float: none;
  line-height: inherit;
  margin: 0;
  color: inherit;
}
/* Suppress the drop-cap when the very first paragraph IS the republication notice. */
.gh-content > .republication-notice:first-of-type::first-letter,
.gh-content > p.republication-notice:first-of-type::first-letter {
  font-family: inherit;
  font-size: inherit;
  float: none;
  line-height: inherit;
  margin: 0;
  color: inherit;
  font-weight: inherit;
}
.gh-content blockquote {
  border-top: var(--rule-w) solid var(--ink);
  border-bottom: var(--rule-w) solid var(--ink);
  padding: 24px 0;
  margin: 32px 0;
  font-family: var(--serif); font-style: italic;
  font-weight: 400; font-size: 32px;
  line-height: 1.2; letter-spacing: -0.01em;
}
.gh-content blockquote cite {
  display: block;
  font-family: var(--sans); font-style: normal;
  font-size: 11px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-2);
  margin-top: 16px;
}
.gh-content a { color: var(--ink); border-bottom: 1px dotted var(--accent); }
.gh-content a:hover { color: var(--accent); }
.gh-content img { margin: 24px auto; border-radius: 4px; }

/* Inline wiki callout — used as an HTML card in Markdown */
.wiki-card {
  display: grid; grid-template-columns: auto 1fr; gap: 18px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 18px 22px;
  margin: 28px 0;
}
.wiki-card__head { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 24px; margin-top: 4px; line-height: 1.05; }
.wiki-card__body { font-family: var(--serif); font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.wiki-card__cta  { color: var(--accent); font-weight: 600; font-family: var(--sans); font-size: 13px; margin-left: 6px; }

/* Article right rail */
.article-rail {
  padding: 40px 28px;
  border-left: 1px solid var(--hair);
  background: var(--surface);
}
.rail-section + .rail-section { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--hair); }
.toc { display: flex; flex-direction: column; gap: 7px; margin-top: 12px;
       font-family: var(--sans); font-size: 13px; color: var(--ink); }
.toc__item {
  border-left: 2px solid transparent;
  padding-left: 10px; line-height: 1.35;
}
.toc__item.is-active {
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.path-card {
  background: var(--bg);
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 12px 14px;
  margin-top: 10px;
}
.path-card__t {
  font-family: var(--serif); font-weight: 600;
  font-size: 15px; line-height: 1.15; letter-spacing: -0.005em;
}
.path-card__m {
  font-family: var(--sans); font-size: 11px; color: var(--ink-2); margin-top: 4px;
}
.progress-track {
  height: 5px; border-radius: 3px;
  background: var(--hair); margin-top: 8px; overflow: hidden;
}
.progress-track__bar { height: 100%; background: var(--accent); }

.up-next {
  background: var(--accent);
  color: var(--bg);
  border-radius: 6px;
  padding: 14px 16px;
  margin-top: 10px;
}
.up-next__k {
  font-family: var(--sans); font-size: 11px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.up-next__t {
  font-family: var(--serif); font-weight: 600;
  font-size: 18px; letter-spacing: -0.01em; line-height: 1.1; margin-top: 4px;
}
.up-next__cta {
  margin-top: 12px;
  background: var(--bg); color: var(--ink);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  display: inline-block;
}

.related { display: flex; flex-direction: column; margin-top: 8px; }
.related__row { padding: 10px 0; }
.related__row + .related__row { border-top: 1px solid var(--hair); }
.related__t {
  font-family: var(--serif); font-weight: 500;
  font-size: 15px; line-height: 1.15; letter-spacing: -0.005em;
}
.related__k {
  font-family: var(--sans); font-size: 10px; color: var(--ink-2);
  margin-top: 3px; letter-spacing: 0.06em; text-transform: uppercase;
}

.cited-entries {
  display: flex; flex-direction: column; gap: 6px; margin-top: 10px;
  font-family: var(--serif); font-size: 13px; color: var(--ink);
}
.cited-entries a {
  border-bottom: 1px dotted var(--ink-2);
  padding-bottom: 2px; width: fit-content;
}

.signup {
  display: flex; gap: 6px; margin-top: 10px;
}
.signup input {
  flex: 1; padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--hair);
  border-radius: 6px;
  font-family: var(--sans); font-size: 12px;
  color: var(--ink);
}
.signup button {
  padding: 8px 14px;
  background: var(--ink); color: var(--bg);
  border-radius: 6px;
  font-family: var(--sans); font-size: 12px; font-weight: 600;
}

/* ── PATHS index ───────────────────────────────────────────────────── */
.paths-filter-bar {
  padding: 12px var(--pad-x) 18px;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--sans); font-size: 12px;
}
.paths-filter-bar__chips { display: flex; gap: 8px; flex-wrap: wrap; }
.paths-filter-bar__sort { display: flex; align-items: center; gap: 14px; color: var(--ink-2); }
.paths-filter-bar__sort b { color: var(--ink); font-weight: 600; }

.path-featured {
  padding: 32px var(--pad-x) 8px;
}
.path-featured__card {
  background: var(--surface);
  border-radius: 8px;
  padding: 28px 30px 30px;
  display: grid; grid-template-columns: 1.6fr 1fr;
  gap: 36px; align-items: center;
}
.path-featured__num {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: 48px; color: var(--accent); line-height: 1;
  display: inline-block;
}
.path-featured__title {
  font-family: var(--serif); font-weight: 600;
  font-size: 44px; letter-spacing: -0.02em; line-height: 1.0;
  display: inline-block; margin-left: 14px; vertical-align: baseline;
}
.path-featured__deck {
  font-family: var(--serif); font-size: 17px; line-height: 1.5;
  color: var(--ink-2); margin-top: 14px; max-width: 540px;
}

.path-grid {
  margin: 0 var(--pad-x) 40px;
  padding: 24px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px;
  background: var(--tint, #f4ecdb);
  border-radius: 8px;
  counter-reset: path-card-counter;
}
.path-card-row {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 18px; align-items: center;
  padding: 18px;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 6px;
  transition: background-color 0.15s ease;
  counter-increment: path-card-counter;
}
.path-card-row:hover { background: rgba(255,255,255,0.5); }
.path-card-row__num::before {
  content: counter(path-card-counter, decimal-leading-zero);
}
.path-card-row:nth-child(6n+2) .path-card-row__badge { background: var(--accent-2); }
.path-card-row:nth-child(6n+3) .path-card-row__badge { background: var(--accent-3); }
.path-card-row:nth-child(6n+4) .path-card-row__badge { background: var(--ink); }
.path-card-row__badge {
  width: 54px; height: 54px; border-radius: 6px;
  background: var(--accent); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 600; font-size: 20px;
}
.path-card-row__title {
  font-family: var(--serif); font-weight: 600;
  font-size: 20px; letter-spacing: -0.01em; line-height: 1.15;
  margin: 3px 0 4px;
}
.path-card-row__deck {
  font-family: var(--serif); font-size: 13px; line-height: 1.45;
  color: var(--ink-2); margin: 0; max-width: 480px;
}
.path-card-row__by {
  font-family: var(--sans); font-size: 11px; color: var(--ink-2);
  margin-top: 6px;
}

/* ── COLLECTIONS index ─────────────────────────────────────────────── */
.coll-grid {
  padding: 24px var(--pad-x) 40px;
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}
.coll-card { display: flex; flex-direction: column; gap: 14px; }
.coll-card__cover img,
.coll-card__cover .cover { width: 100%; height: 210px; object-fit: cover; border-radius: 6px; }
.coll-card__title {
  font-family: var(--serif); font-weight: 600;
  font-size: 24px; letter-spacing: -0.015em; line-height: 1.1;
  margin: 6px 0 8px;
}
.coll-card__deck {
  font-family: var(--serif); font-size: 14px; line-height: 1.5;
  color: var(--ink-2); margin: 0 0 10px;
}
.coll-card__feat {
  padding: 10px 12px; background: var(--surface);
  border-radius: 4px;
  display: flex; gap: 8px; align-items: center;
}
.coll-card__feat-k {
  font-family: var(--sans); font-size: 10px; color: var(--ink-2);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.coll-card__feat-t {
  font-family: var(--serif); font-size: 13px; font-weight: 500;
  color: var(--ink); line-height: 1.2;
}

/* ── WIKI hub ──────────────────────────────────────────────────────── */
.wiki-summary {
  padding: 18px var(--pad-x);
  display: grid; grid-template-columns: 1.6fr auto;
  gap: 32px; align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--hair);
}
.wiki-summary__lead {
  font-family: var(--serif); font-size: 16px; line-height: 1.5;
  color: var(--ink);
}
.wiki-summary__stats {
  display: flex; gap: 18px;
  font-family: var(--sans); font-size: 11px;
  color: var(--ink-2); letter-spacing: 0.06em; text-transform: uppercase;
}
.wiki-summary__stats b {
  color: var(--ink); font-size: 14px;
  letter-spacing: 0; font-family: var(--serif); font-weight: 600;
}

.wiki-featured-row {
  padding: 24px var(--pad-x);
  display: grid; grid-template-columns: 1.6fr 1fr;
  gap: 24px;
}
.wiki-featured {
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 22px 24px 20px;
}
.wiki-featured__head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.wiki-featured__title {
  font-family: var(--serif); font-weight: 600;
  font-size: 46px; letter-spacing: -0.025em; line-height: 0.98;
  margin: 2px 0 0;
}
.wiki-featured__also {
  font-family: var(--serif); font-style: italic;
  font-size: 14px; color: var(--ink-2); margin-top: 6px;
}
.wiki-featured__body {
  font-family: var(--serif); font-size: 15px; line-height: 1.55;
  color: var(--ink); margin-top: 12px; max-width: 540px;
}
.wiki-featured__actions {
  display: flex; gap: 14px; margin-top: 14px;
  font-family: var(--sans); font-size: 12px;
}
.wiki-featured__actions a:first-child { color: var(--accent); font-weight: 600; }
.wiki-featured__actions a { color: var(--ink-2); }

.dyk {
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 22px 22px 18px;
  background: var(--bg);
}
.dyk__list { display: flex; flex-direction: column; margin-top: 10px; }
.dyk__item {
  padding: 10px 0;
  font-family: var(--serif); font-size: 14px;
  line-height: 1.5; color: var(--ink);
}
.dyk__item + .dyk__item { border-top: 1px solid var(--hair); }

.wiki-cats {
  padding: 24px var(--pad-x) 8px;
  border-top: 1px solid var(--hair);
}
.wiki-cats__grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  border-top: 1px solid var(--hair);
  border-left: 1px solid var(--hair);
}
.wiki-cat {
  padding: 18px 20px;
  border-right: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  display: flex; flex-direction: column; gap: 8px;
}
.wiki-cat__head {
  display: flex; justify-content: space-between; align-items: baseline;
}
.wiki-cat__title {
  font-family: var(--serif); font-weight: 600;
  font-size: 22px; letter-spacing: -0.01em;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}
.wiki-cat__title.accent-2 { border-left-color: var(--accent-2); }
.wiki-cat__title.accent-3 { border-left-color: var(--accent-3); }
.wiki-cat__title.ink      { border-left-color: var(--ink); }
.wiki-cat__count {
  font-family: var(--sans); font-size: 11px; color: var(--ink-2);
  letter-spacing: 0.04em;
}
.wiki-cat__list {
  list-style: none; padding: 0; margin: 4px 0 0;
  display: flex; flex-direction: column; gap: 3px;
}
.wiki-cat__list li {
  font-family: var(--serif); font-size: 14px;
  line-height: 1.35; color: var(--ink);
}
.wiki-cat__list a {
  border-bottom: 1px dotted var(--ink-2);
  padding-bottom: 1px;
}
.wiki-cat__more {
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); margin-top: auto;
}

.wiki-three-up {
  padding: 32px var(--pad-x) 16px;
  display: grid; grid-template-columns: 1.2fr 1fr 1fr;
  gap: 32px;
  border-top: 1px solid var(--hair);
  margin-top: 24px;
}
.wiki-three-up h3 {
  font-family: var(--serif); font-weight: 600;
  font-size: 20px; letter-spacing: -0.01em;
}
.wiki-three-up__head {
  display: flex; justify-content: space-between; align-items: baseline;
}
.wiki-three-up__row {
  display: grid; gap: 14px;
  align-items: baseline; padding: 8px 0;
  border-top: 1px solid var(--hair);
}
.wiki-three-up__row.recent   { grid-template-columns: 1fr auto auto; }
.wiki-three-up__row.cited    { grid-template-columns: auto 1fr auto; gap: 12px; }
.wiki-three-up__row.stubs    { grid-template-columns: 1fr auto; gap: 12px; }
.wiki-three-up__row .n {
  font-family: var(--serif); font-style: italic;
  font-size: 14px; color: var(--accent); width: 24px;
}
.wiki-three-up__row .t {
  font-family: var(--serif); font-size: 15px; font-weight: 500;
  color: var(--ink); letter-spacing: -0.005em;
}
.wiki-three-up__row .t.stub  { color: var(--accent); font-style: italic; }
.wiki-three-up__row .meta-k {
  font-family: var(--sans); font-size: 10px; color: var(--ink-2);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.wiki-three-up__row .meta-r  {
  font-family: var(--sans); font-size: 11px; color: var(--ink-2);
  width: 90px; text-align: right;
}
.wiki-three-up__row .meta-c {
  font-family: var(--sans); font-size: 11px; color: var(--ink-2); letter-spacing: 0.04em;
}

.az-strip { padding: 16px var(--pad-x) 28px; border-top: 1px solid var(--hair); margin-top: 16px; }
.az-strip__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px;
}
.az-strip__letters {
  display: flex; gap: 5px; flex-wrap: wrap;
}
.az-strip__letters a,
.az-strip__letters span {
  width: 34px; height: 34px; display: flex;
  align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 16px; font-weight: 500;
  border: 1px solid var(--hair);
  border-radius: 4px;
  color: var(--ink);
}

.contribute-strip {
  margin: 0 var(--pad-x) 40px;
  padding: 20px 26px;
  background: var(--surface);
  border-radius: 8px;
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
}
.contribute-strip__title {
  font-family: var(--serif); font-size: 20px; font-weight: 600;
  letter-spacing: -0.015em; margin-top: 4px;
}
.contribute-strip__body {
  font-family: var(--serif); font-size: 13px; line-height: 1.5;
  color: var(--ink-2); margin-top: 4px; max-width: 560px;
}
.contribute-strip__actions { display: flex; gap: 8px; }

/* ── WIKI entry ────────────────────────────────────────────────────── */
.wiki-entry-head {
  padding: 40px var(--pad-x) 28px;
  display: grid; grid-template-columns: 1fr 280px;
  gap: 48px; align-items: end;
  border-bottom: var(--rule-w) solid var(--ink);
}
.wiki-entry-head__title {
  font-family: var(--serif); font-weight: 600;
  font-size: 84px; letter-spacing: -0.03em; line-height: 0.94;
  margin: 10px 0 0;
}
.wiki-entry-head__also {
  font-family: var(--serif); font-style: italic;
  font-size: 18px; color: var(--ink-2);
  margin-top: 10px;
}
.wiki-entry-head__lede {
  font-family: var(--serif); font-size: 20px; line-height: 1.5;
  color: var(--ink); margin-top: 18px; max-width: 680px;
}
.wiki-meta-card {
  background: var(--surface);
  border-radius: 6px;
  padding: 14px 16px;
  font-family: var(--sans); font-size: 12px;
}
.wiki-meta-card table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.wiki-meta-card td {
  padding: 4px 0;
  vertical-align: top;
}
.wiki-meta-card td:first-child {
  color: var(--ink-2); padding-right: 12px;
  width: 90px; letter-spacing: 0.04em;
}
.wiki-meta-card td:last-child { color: var(--ink); font-weight: 500; }
.wiki-meta-card__actions {
  margin-top: 10px; display: flex; gap: 6px;
}
.wiki-meta-card__actions button {
  flex: 1; padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--ink);
  border-radius: 4px;
  font-family: var(--sans); font-size: 11px; font-weight: 600;
}

.wiki-entry-body {
  display: grid; grid-template-columns: 200px 1fr 240px;
}
.wiki-entry-outline {
  padding: 32px 22px;
  border-right: 1px solid var(--hair);
}
.wiki-entry-outline .toc { margin-top: 10px; gap: 6px; }
.wiki-entry-main {
  padding: 40px 56px;
  max-width: 800px; margin: 0 auto;
}
.wiki-entry-main h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: 30px; letter-spacing: -0.015em;
  margin: 32px 0 12px;
}
.wiki-entry-main h2:first-child { margin-top: 0; }
.wiki-entry-main p {
  font-family: var(--serif); font-size: 17px; line-height: 1.7;
  color: var(--ink); margin: 0 0 14px;
}
.wiki-entry-main a.wl {
  border-bottom: 1px dotted var(--accent);
  color: var(--ink);
}
.wiki-entry-main a.wl:hover { color: var(--accent); }

.wiki-entry-aside {
  padding: 40px 22px;
  border-left: 1px solid var(--hair);
  background: var(--surface);
}
.sidenote {
  font-family: var(--serif); font-style: italic;
  font-size: 13px; color: var(--ink);
  line-height: 1.5;
  padding-left: 10px;
  border-left: 2px solid var(--accent);
  margin-top: 8px;
}
.see-also {
  display: flex; flex-direction: column; gap: 5px;
  margin-top: 10px;
  font-family: var(--serif); font-size: 14px; color: var(--ink);
}
.see-also a {
  border-bottom: 1px dotted var(--ink-2);
  padding-bottom: 2px; width: fit-content;
}
.appears-in { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.appears-in a { padding-bottom: 6px; border-bottom: 1px solid var(--hair); display: block; }
.appears-in a:last-child { border-bottom: none; }
.appears-in__t {
  font-family: var(--serif); font-weight: 500; font-size: 13px;
  line-height: 1.2; letter-spacing: -0.005em;
}
.appears-in__k {
  font-family: var(--sans); font-size: 10px; color: var(--ink-2);
  margin-top: 3px; letter-spacing: 0.06em; text-transform: uppercase;
}

/* ── ABOUT ─────────────────────────────────────────────────────────── */
.about-hero {
  padding: 72px var(--pad-x) 48px;
  text-align: center;
  border-bottom: 1px solid var(--hair);
}
.about-hero__title {
  font-family: var(--serif); font-weight: 600;
  font-size: 88px; letter-spacing: -0.03em; line-height: 0.94;
  margin: 14px auto 0;
  max-width: 1000px;
}
.about-hero__deck {
  font-family: var(--serif); font-size: 20px; line-height: 1.5;
  color: var(--ink-2);
  margin: 22px auto 0; max-width: 720px;
}

.about-mission {
  padding: 48px var(--pad-x) 32px;
  display: grid; grid-template-columns: 1.4fr 1fr;
  gap: 48px; align-items: start;
}
.about-mission__body {
  font-family: var(--serif); font-size: 17px; line-height: 1.65;
  color: var(--ink);
}
.about-mission__body p { margin: 0 0 14px; }
.about-mission__body > p:first-child::first-letter {
  font-family: var(--serif); font-weight: 600;
  font-size: 54px; float: left; line-height: 0.8;
  margin: 4px 12px -2px 0;
  color: var(--accent);
}
.about-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.about-stat {
  background: var(--surface); border-radius: 6px;
  padding: 18px;
}
.about-stat__n {
  font-family: var(--serif); font-size: 34px; font-weight: 600;
  letter-spacing: -0.02em; color: var(--accent); line-height: 1;
}
.about-stat__l {
  font-family: var(--sans); font-size: 11px; color: var(--ink-2);
  margin-top: 6px; letter-spacing: 0.06em; text-transform: uppercase;
}

.principles-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.principle {
  display: grid; grid-template-columns: auto 1fr;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--hair);
  border-radius: 6px;
}
.principle__n {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: 32px; color: var(--accent); line-height: 1;
  width: 34px;
}
.principle__t {
  font-family: var(--serif); font-weight: 600;
  font-size: 20px; letter-spacing: -0.01em;
  margin: 0 0 6px; line-height: 1.15;
}
.principle__d {
  font-family: var(--serif); font-size: 14px; line-height: 1.5;
  color: var(--ink-2); margin: 0;
}

.editors-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
}
.editor {
  display: grid; grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border-radius: 6px;
}
.editor__avatar {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--accent); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 22px;
}
.editor__avatar.accent-2 { background: var(--accent-2); }
.editor__avatar.accent-3 { background: var(--accent-3); }
.editor__n {
  font-family: var(--serif); font-weight: 600;
  font-size: 18px; letter-spacing: -0.01em;
}
.editor__r {
  font-family: var(--sans); font-size: 11px; color: var(--ink-2);
  margin-top: 2px; letter-spacing: 0.04em;
}
.editor__b {
  font-family: var(--serif); font-style: italic; font-size: 13px;
  color: var(--ink-2); margin-top: 6px; line-height: 1.35;
}

.support-strip {
  margin: 24px var(--pad-x) 16px;
  padding: 32px 36px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 8px;
  display: grid; grid-template-columns: 1.4fr 1fr;
  gap: 32px; align-items: center;
}
.support-strip__title {
  font-family: var(--serif); font-weight: 600;
  font-size: 38px; letter-spacing: -0.02em;
  line-height: 1.05; margin: 6px 0 8px;
}
.support-strip__body {
  font-family: var(--serif); font-size: 15px; line-height: 1.5;
  color: rgba(255,255,255,0.92); max-width: 540px; margin: 0;
}

/* ── Newsletter strip (used on home + others) ──────────────────────── */
.newsletter-strip {
  margin: 8px var(--pad-x) 48px;
  padding: 28px 36px;
  background: var(--surface);
  border-radius: 8px;
  display: grid; grid-template-columns: 1fr auto;
  gap: 24px; align-items: center;
}
.newsletter-strip__title {
  font-family: var(--serif); font-size: 30px; font-weight: 600;
  letter-spacing: -0.02em; line-height: 1.1; margin: 6px 0 0;
}
.newsletter-strip__body {
  font-family: var(--serif); font-size: 14px; color: var(--ink-2);
  margin-top: 8px; max-width: 560px; line-height: 1.5;
}
.newsletter-strip form { display: flex; gap: 8px; align-items: center; }
.newsletter-strip input[type="email"] {
  padding: 12px 16px; background: var(--bg);
  border: 1px solid var(--hair); border-radius: 999px;
  font-family: var(--sans); font-size: 13px;
  width: 240px; outline: none; color: var(--ink);
}
.newsletter-strip button {
  padding: 12px 22px; background: var(--ink); color: var(--bg);
  border-radius: 999px;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  letter-spacing: 0.04em;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  :root { --pad-x: 28px; }
  .hero__title { font-size: 56px; }
  .article-title, .wiki-entry-head__title { font-size: 52px; }
  .home-rail { grid-template-columns: 1fr 1fr; }
  .home-rail > section + section:nth-child(3) { border-left: none; border-top: 1px solid var(--hair); }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-rail { border-left: none; border-top: 1px solid var(--hair); }
  .article-main { padding: 40px 28px; }
  .wiki-entry-body { grid-template-columns: 1fr; }
  .wiki-entry-outline, .wiki-entry-aside { border: none; }
  .wiki-cats__grid, .editors-grid, .coll-grid, .wiki-three-up { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  :root { --pad-x: 18px; }

  /* Home page: cap learning-path list at 5 on mobile (desktop shows all 9). */
  .paths .path-row:nth-child(n+6) { display: none; }

  /* Masthead: brand on the left, hamburger on the right; menu collapses below */
  .masthead {
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand hamburger" "menu menu";
    gap: 8px 12px;
    padding: 14px var(--pad-x) 10px;
    align-items: center;
  }
  .masthead__brand { grid-area: brand; justify-content: flex-start; }
  .masthead__hamburger {
    grid-area: hamburger;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px; height: 42px;
    background: transparent;
    border: 1px solid var(--hair);
    border-radius: 6px;
    cursor: pointer;
    padding: 0 10px;
  }
  .masthead__hamburger .hamburger__bar {
    display: block; width: 100%; height: 2px;
    background: var(--ink-1, #1a1a1a);
    transition: transform 0.18s ease, opacity 0.18s ease;
    transform-origin: center;
  }
  .masthead__hamburger[aria-expanded="true"] .hamburger__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .masthead__hamburger[aria-expanded="true"] .hamburger__bar:nth-child(2) { opacity: 0; }
  .masthead__hamburger[aria-expanded="true"] .hamburger__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .masthead__menu {
    grid-area: menu;
    display: none;
    flex-direction: column;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--hair);
    margin-top: 6px;
  }
  .masthead__menu.is-open { display: flex; }

  .masthead__name { font-size: 22px; }
  .masthead__tag { font-size: 11px; }

  /* Nav inside the menu: vertical list, no horizontal scroll */
  .masthead__menu .nav {
    display: block;
    overflow: visible;
    gap: 0;
    padding: 0;
  }
  .masthead__menu .nav ul.nav {
    flex-direction: column;
    display: flex;
    gap: 0;
    padding: 0; margin: 0; list-style: none;
  }
  .masthead__menu .nav ul.nav li {
    padding: 12px 0;
    border-bottom: 1px solid var(--hair);
    white-space: nowrap;
  }
  .masthead__menu .nav ul.nav li:last-child { border-bottom: none; }
  .masthead__menu .nav a { font-size: 16px; font-weight: 500; }

  .masthead__right {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 6px;
  }

  /* Utility bar: simpler on mobile */
  .bar-utility {
    padding: 6px var(--pad-x);
    font-size: 11px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .bar-utility__right { gap: 12px; }

  /* Page heads + heroes collapse to one column */
  .hero, .page-head, .article-feature .cover {
    grid-template-columns: 1fr;
    padding-left: var(--pad-x);
    padding-right: var(--pad-x);
    gap: 16px;
  }
  .page-head { padding-top: 28px; padding-bottom: 18px; }
  .page-head__title { font-size: 32px !important; line-height: 1.15; }
  .page-head__deck { font-size: 14px; }
  .hero__title { font-size: 44px; }
  .article-title, .wiki-entry-head__title { font-size: 36px; line-height: 1.1; }
  .article-deck { font-size: 16px; }
  .article-main { padding: 24px var(--pad-x) 32px; }
  .crumb { padding: 12px var(--pad-x); font-size: 12px; flex-wrap: wrap; }

  /* Multi-col grids collapse */
  .home-rail, .principles-grid, .editors-grid,
  .coll-grid, .wiki-cats__grid, .wiki-three-up,
  .path-grid, .featured-row, .about-mission,
  .support-strip, .newsletter-strip {
    grid-template-columns: 1fr;
  }
  .home-rail > section + section { border-left: none; border-top: 1px solid var(--hair); }

  /* /articles/ list: kill the empty left rail, stack each row */
  .articles-body, .articles-body--no-sidebar {
    grid-template-columns: 1fr;
  }
  .articles-main { padding: 18px var(--pad-x) 32px; }
  .articles-meta {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    margin-bottom: 14px;
  }
  .articles-meta > div { line-height: 1.5; }
  .view-toggle { font-size: 12px; }

  /* Topic chips: smaller, less padding */
  .topic-chips {
    padding: 8px var(--pad-x) 12px;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .topic-chips::-webkit-scrollbar { display: none; }
  .topic-chips .chip {
    font-size: 12px;
    padding: 4px 10px;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* Article list rows: number left, body middle, swatch right. Compact mobile layout. */
  .article-list-row {
    grid-template-columns: 38px 1fr 64px;
    gap: 12px;
    padding: 18px 0;
    align-items: center;
  }
  .article-list__n {
    display: block;
    font-size: 26px;
  }
  .article-list__title {
    font-size: 17px;
    line-height: 1.22;
    margin: 0 0 6px;
  }
  .article-list__kicker {
    font-size: 10px;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
    gap: 6px;
  }
  .article-list__by { font-size: 12px; }
  .article-list__cover { width: 64px; height: 64px; }

  /* Featured row: stack cover above text */
  .featured-row {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px 0 20px;
  }
  .featured-row h2 { font-size: 24px; line-height: 1.15; }
  .featured-row__deck { font-size: 14px; }
  /* Featured cover: real image flows at natural aspect (capped),
     placeholder stays at fixed visual height. */
  .featured-row__cover img {
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: contain;
    background: var(--bg);
  }
  .featured-row__cover .cover { width: 100%; height: 220px; }

  /* Tag-archive header right column (image + 'All articles') collapses */
  .col-more { font-size: 12px; }

  /* Right rail on post pages stacks below body */
  .article-rail { padding: 24px var(--pad-x) 32px; }
  .rail-section { margin-bottom: 22px; }

  /* Search pill in headers */
  .search-pill { width: 100% !important; max-width: 100% !important; }
}

@media (max-width: 480px) {
  .topic-chips .chip__n { display: none; }
  .masthead__tag { display: none; }
  .page-head__title { font-size: 26px !important; }
  .hero__title { font-size: 32px; }
  .article-title, .wiki-entry-head__title { font-size: 28px; }
  .featured-row h2 { font-size: 20px; }
  .article-list__title { font-size: 16px; }
  .article-list-row { grid-template-columns: 34px 1fr 56px; gap: 10px; }
  .article-list__n { font-size: 22px; }
  .article-list__cover { width: 56px; height: 56px; }
}
