/* Methodox Blog - light, editorial, built for reading.
 *
 * Chrome is Inter and the brand blue, per the Methodox design system. Article
 * prose is Source Serif 4: a documented, deliberately scoped departure from the
 * system's "Inter, and only Inter" rule, because this surface exists to be read
 * at length rather than operated. Nothing outside .prose uses the serif.
 */

:root {
  /* Brand */
  --blue-500: #295bff;
  --blue-600: #1f49d6;
  --blue-800: #00259e;

  /* Cool neutrals, from the source colour board */
  --ink: #181d27;
  --ink-soft: #414651;
  --ink-muted: #717680;
  --rule: #e4e5e8;
  --rule-soft: #f0f1f2;
  --paper: #ffffff;
  --paper-tint: #fafafb;

  --radius: 7px;
  --radius-sm: 4px;

  /* Generous by intent: whitespace is the main design move on this site. */
  --measure: 44rem;
  --wide: 60rem;
  --gutter: 1.5rem;

  --ease: cubic-bezier(0.2, 0, 0, 1);

  --font-ui: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-prose: "Source Serif 4", ui-serif, Georgia, "Times New Roman", serif;
  --font-mono: "Cascadia Code", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: "fina" on, "init" on;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-800); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--blue-500); }

img { max-width: 100%; height: auto; }

/* ---------------------------------------------------------------- header - */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1rem var(--gutter);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--blue-500); }

.site-nav {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  font-size: 0.875rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 90ms var(--ease);
  white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a.current { color: var(--ink); font-weight: 500; }

.site-nav .feed-link {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------ shell - */

.shell {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 4.5rem var(--gutter) 6rem;
}

.page-home .shell,
.page-tag .shell,
.page-tags .shell,
.page-archive .shell { max-width: var(--wide); }

/* --------------------------------------------------------------- masthead - */

.masthead { margin-bottom: 4rem; }
.masthead-compact { margin-bottom: 3rem; }

.masthead-title {
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.masthead-tagline {
  font-family: var(--font-prose);
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 1rem 0 0;
  max-width: 34rem;
}

.eyebrow {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.eyebrow .sep { color: var(--rule); }

/* ------------------------------------------------------------------- feed - */

.feed { display: flex; flex-direction: column; }

.feed-entry {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  padding: 2.75rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.feed-entry:first-child { padding-top: 0; }
.feed-entry:last-child { border-bottom: none; }

.feed-text { flex: 1 1 auto; min-width: 0; }

.feed-title {
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.018em;
  margin: 0.625rem 0 0;
  /* Shares the excerpt's measure. Left unbounded the title ran the full column
   * width while the excerpt wrapped well short of it, and the two ragged edges
   * disagreed down the whole page. */
  max-width: 38rem;
  text-wrap: pretty;
}

.feed-title a { color: var(--ink); text-decoration: none; }
.feed-title a:hover { color: var(--blue-500); }

.feed-excerpt {
  font-family: var(--font-prose);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0.75rem 0 0;
  max-width: 38rem;
}

.feed-thumb {
  flex: 0 0 11rem;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--paper-tint);
  aspect-ratio: 4 / 3;
}

.feed-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.more { margin-top: 3rem; font-size: 0.9375rem; }

/* ------------------------------------------------------------------- tags - */

.tag-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }

.tag {
  font-size: 0.75rem;
  line-height: 1;
  padding: 0.4375rem 0.625rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  text-decoration: none;
  transition: border-color 90ms var(--ease), color 90ms var(--ease);
}
.tag:hover { border-color: var(--blue-500); color: var(--blue-800); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 0.625rem; }

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 90ms var(--ease);
}
.tag-chip:hover { border-color: var(--blue-500); }

.tag-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
}

/* ------------------------------------------------------------------- post - */

.post-header { margin-bottom: 2.5rem; }

.post-title {
  font-size: clamp(2.25rem, 5.5vw, 3.25rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.022em;
  margin: 0.875rem 0 0;
  text-wrap: balance;
}

.post-standfirst {
  font-family: var(--font-prose);
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 1.25rem 0 0;
}

.byline {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--ink-muted);
}
.byline .sep { margin: 0 0.5rem; color: var(--rule); }

.post-hero {
  margin: 0 0 3rem;
}
.post-hero img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  display: block;
}

/* ------------------------------------------------------------------ prose - */

.prose {
  font-family: var(--font-prose);
  font-size: 1.25rem;
  line-height: 1.75;
  color: #1f2430;
}

/* All vertical rhythm comes from one rule, so nothing has to guess whether its
 * neighbour already contributed a margin. Anything wanting more space sets
 * margin-top afterwards and wins on specificity. */
.prose > * { margin-top: 0; margin-bottom: 0; }
.prose > * + * { margin-top: 1.5em; }

.prose h2, .prose h3, .prose h4 {
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--ink);
  scroll-margin-top: 5rem;
}

.prose h2 { font-size: 1.75rem; margin-top: 3rem; }
.prose h3 { font-size: 1.3125rem; margin-top: 2.5rem; }
.prose h4 { font-size: 1.0625rem; margin-top: 2rem; text-transform: none; }

.prose ul, .prose ol { padding-left: 1.5em; }
.prose li + li { margin-top: 0.5em; }
.prose li::marker { color: var(--ink-muted); }

.prose blockquote {
  margin: 2rem 0;
  padding: 0 0 0 1.5rem;
  border-left: 2px solid var(--blue-500);
  color: var(--ink-soft);
  font-style: italic;
}
.prose blockquote p + p { margin-top: 1em; }

.prose img {
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
}

/* Images are wrapped into figures by the generator, so the picture and its
 * caption are one unit with space around the pair rather than between them. */
.prose figure { margin: 2.5rem 0; }
.prose figure img { margin: 0; }

.prose figcaption {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-muted);
  margin-top: 0.75rem;
  font-style: normal;
}

.prose hr { border: none; border-top: 1px solid var(--rule); margin: 3rem 0; }

/* Added by app.js; hidden until the heading is hovered so it never competes
 * with the text it belongs to. Always visible on touch, where there is no
 * hover to reveal it. */
.heading-anchor {
  font-family: var(--font-mono);
  font-weight: 400;
  color: var(--rule);
  text-decoration: none;
  margin-left: 0.5rem;
  opacity: 0;
  transition: opacity 90ms var(--ease);
}
h2:hover > .heading-anchor,
h3:hover > .heading-anchor,
.heading-anchor:focus { opacity: 1; }
.heading-anchor:hover { color: var(--blue-500); }

@media (hover: none) {
  .heading-anchor { opacity: 1; }
}

.prose a { color: var(--blue-800); }

.prose code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--paper-tint);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 0.1em 0.35em;
}

.prose pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  background: #fbfbfc;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
}
.prose pre code { background: none; border: none; padding: 0; font-size: inherit; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  display: block;
  overflow-x: auto;
}
.prose th, .prose td {
  text-align: left;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--rule);
}
.prose th { font-weight: 600; border-bottom-color: var(--ink-muted); }

.prose audio { width: 100%; margin-top: 1.5rem; }

/* --------------------------------------------------------- post footer/nav - */

.post-footer { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--rule); }

.provenance { font-size: 0.875rem; color: var(--ink-muted); margin: 1.25rem 0 0; }

.neighbours {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3rem;
}

.neighbour {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 1.125rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 90ms var(--ease), transform 150ms var(--ease);
}
.neighbour:hover { border-color: var(--blue-500); transform: translateY(-1px); }
.neighbour.next { text-align: right; }
.neighbour.next:only-child { grid-column: 2; }

.neighbour-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}
.neighbour-title { font-size: 0.9375rem; font-weight: 500; color: var(--ink); line-height: 1.35; }

/* Added by app.js on article pages only. */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--blue-500);
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 30;
  pointer-events: none;
}

/* ---------------------------------------------------------------- archive - */

.archive-year + .archive-year { margin-top: 3rem; }

.archive-heading {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
  margin: 0;
}

.archive-list { list-style: none; margin: 0; padding: 0; }

.archive-list li {
  display: flex;
  gap: 1.5rem;
  align-items: baseline;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--rule-soft);
}

.archive-list time {
  flex: 0 0 4.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.archive-list a { color: var(--ink); text-decoration: none; font-size: 1.0625rem; }
.archive-list a:hover { color: var(--blue-500); }

/* ----------------------------------------------------------------- footer - */

.site-footer { border-top: 1px solid var(--rule); background: var(--paper-tint); }

.site-footer-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2.5rem var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.copyright { margin: 0; }

.footer-nav { display: flex; gap: 1.25rem; }
.footer-nav a { color: var(--ink-muted); text-decoration: none; }
.footer-nav a:hover { color: var(--ink); }

/* ------------------------------------------------------------------ small - */

@media (max-width: 40rem) {
  .shell { padding-top: 3rem; padding-bottom: 4rem; }

  .feed-entry { flex-direction: column-reverse; gap: 1.25rem; padding: 2rem 0; }
  .feed-thumb { flex: none; width: 100%; aspect-ratio: 16 / 9; }
  .feed-title { font-size: 1.5rem; }

  .prose { font-size: 1.125rem; line-height: 1.7; }
  .prose h2 { font-size: 1.5rem; }

  .neighbours { grid-template-columns: 1fr; }
  .neighbour.next { text-align: left; }
  .neighbour.next:only-child { grid-column: 1; }

  .site-footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}

/* ------------------------------------------------------------------ print - */

@media print {
  .site-header, .site-footer, .neighbours, .tag-row { display: none; }
  .shell { max-width: none; padding: 0; }
  .prose { font-size: 11pt; }
  a { text-decoration: none; color: inherit; }
}
