/* Generated by scripts/build-blog.js. Edit the template there, not this file. */
:root {
  --ink: #101114;
  --ink-2: #2b2d33;
  --paper: #ffffff;
  --tint: #f1f1f3;
  --tint-2: #e6e6ea;
  --gray: #63656d;
  --gray-soft: #96989f;
  --dark: #0c0d10;
  --dark-text: rgba(255,255,255,0.62);
  --blue: #0060cc;
  --blue-tint: #e6f0ff;
  --radius-lg: 28px;
  --radius-md: 20px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Geist', Arial, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
  font-feature-settings: "liga" 1;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.container-narrow { max-width: 748px; margin: 0 auto; padding: 0 28px; }
.eyebrow {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 13px; color: var(--gray-soft); letter-spacing: 0.12em;
  text-transform: uppercase; margin-bottom: 20px;
}

/* Nav */
nav {
  position: sticky; top: 0; z-index: 60; background: rgba(255,255,255,0.88);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 19px; letter-spacing: -0.03em;
  color: var(--ink); text-decoration: none;
}
.nav-brand img { width: 24px; height: 24px; }
.nav-brand span { color: inherit; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a:not(.nav-cta) { font-size: 15px; font-weight: 500; color: var(--ink); text-decoration: none; }
.nav-links a:not(.nav-cta):hover { color: var(--gray); }
.nav-links a.nav-cta {
  background: var(--ink); color: var(--paper);
  padding: 12px 22px; border-radius: 999px;
  font-size: 15px; font-weight: 500; text-decoration: none;
}
.nav-links a.nav-cta:hover { background: #000; color: var(--paper); }
/* Phone nav: the links and the CTA move into a burger panel (see the 900px query). */
.nav-burger { display: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 17px 30px; border-radius: 999px;
  font-size: 17px; font-weight: 500; letter-spacing: -0.01em;
  cursor: pointer; border: none; text-decoration: none;
  font-family: inherit; transition: background .15s ease, color .15s ease, transform .15s ease;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #000; transform: translateY(-1px); }

/* Blog index header */
.blog-hero { padding: clamp(56px, 7vw, 96px) 0 clamp(36px, 4.5vw, 60px); }
.blog-hero h1 {
  font-size: clamp(40px, 6vw, 74px); font-weight: 600;
  line-height: 0.99; letter-spacing: -0.05em; margin-bottom: 24px;
  max-width: 900px;
}
.blog-hero .lead {
  font-size: clamp(18px, 1.55vw, 22px); line-height: 1.55;
  color: var(--gray); max-width: 720px; letter-spacing: -0.015em;
}

/* Post grid */
.blog-list { padding: 0 0 clamp(84px, 9.5vw, 152px); }
.post-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 3vw, 44px) clamp(22px, 2.2vw, 32px);
}
/* The plate: the finished picture, with the title, subtitle and wordmark
   already printed into it by blog-card.py. One picture serves every frame, so
   nothing is set over it and nothing is swapped by width — there is no type in
   this block at all, only the frame. */
.plate {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius-md); background: var(--tint); margin: 0;
}
.plate img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s cubic-bezier(.2,.7,.3,1);
}
.post-card:hover .plate img { transform: scale(1.03); }
/* A news card is white, so on the white page it has no edge of its own. It
   takes the hairline the figures and tables use, drawn over the picture, which
   would cover a border set on the frame itself. */
.plate-news::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border: 1px solid var(--tint-2); border-radius: inherit;
}

/* The headline is pixels again, so the article's real <h1> is carried
   off-screen rather than hidden: display:none would take it out of the
   accessibility tree and out of the page's outline along with it. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; border: 0; overflow: hidden; white-space: nowrap;
  clip: rect(0 0 0 0); clip-path: inset(50%);
}

.post-card { display: flex; flex-direction: column; }
/* Meta sits on one line under the image: date, reading time, then "Read". */
.post-body { display: flex; align-items: center; gap: 14px; padding-top: 14px; }
.post-meta {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gray-soft);
}
.post-meta .dot { color: var(--tint-2); margin: 0 8px; }
.post-more {
  margin-left: auto; font-size: 15px; font-weight: 500; color: var(--ink);
}
.post-more::after { content: " \2192"; }
.post-card:hover .post-more { color: var(--gray); }

/* Every post is one cell of the grid — no card spans the row, so the newest
   post sits in the first column at the same size as the rest. */

/* Article */
.article-top { padding: clamp(36px, 4vw, 56px) 0 clamp(20px, 2.2vw, 28px); }
.article-head { padding: clamp(20px, 2.4vw, 30px) 0 clamp(28px, 3vw, 40px); }
.back-link {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gray-soft); display: inline-block;
}
.back-link::before { content: "\2190  "; }
.back-link:hover { color: var(--ink); }
.byline {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 13px; color: var(--gray-soft);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.byline .dot { color: var(--tint-2); }
.byline strong { color: var(--ink-2); font-weight: 500; }
/* No blanket img rule here: it would also match the wordmark inside the plate
   and stretch it to the full frame. The plate styles its own artwork. */
.article-hero { margin: 0 auto; }
.article-hero .plate { border-radius: var(--radius-lg); }

/* Long-form prose */
.prose { padding-bottom: clamp(40px, 5vw, 64px); }
.prose p, .prose li {
  font-size: 19px; line-height: 1.72; color: var(--ink-2);
  letter-spacing: -0.011em;
}
.prose p { margin-bottom: 26px; }
.prose > p:first-child { font-size: 21px; line-height: 1.65; color: var(--ink); }
.prose h2 {
  font-size: clamp(26px, 2.9vw, 36px); font-weight: 600;
  line-height: 1.1; letter-spacing: -0.04em;
  margin: clamp(52px, 5.5vw, 76px) 0 20px;
}
.prose h3 {
  font-size: clamp(20px, 2vw, 24px); font-weight: 600;
  line-height: 1.2; letter-spacing: -0.03em;
  margin: 44px 0 16px;
}
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { font-style: italic; }
.prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--ink); }
.prose ul, .prose ol { margin: 0 0 26px; padding-left: 24px; }
.prose li { margin-bottom: 10px; }
.prose blockquote {
  margin: 34px 0; padding: 4px 0 4px 26px;
  border-left: 3px solid var(--tint-2); color: var(--gray);
}
.prose blockquote p { margin-bottom: 12px; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: none; height: 1px; background: var(--tint-2); margin: 52px 0; }
.prose code {
  font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em; background: var(--tint); padding: 3px 7px; border-radius: 7px;
}
.prose pre {
  background: var(--dark); color: #e9eaee; padding: 24px 26px;
  border-radius: var(--radius-md); overflow-x: auto; margin-bottom: 26px;
}
.prose pre code { background: none; padding: 0; font-size: 14px; line-height: 1.65; }
.prose img { border-radius: var(--radius-md); margin: 34px 0; }
/* A policy document (see /policy.css, shared with the homepage). On the page
   it drops the homepage's card, the padding and the hairline both, so only its
   bands show. The space under the last band is for the scrollbar when it
   scrolls on a phone. No radius either, or the scroll box would clip the
   corners of the bands inside it. */
.prose .policy-doc { margin: 34px 0; padding: 0 0 10px; border-radius: 0; }
/* A code block is as wide as its longest line, never narrower than the column
   and centred on it, so a long line is read rather than scrolled to. It stops
   at the wide-table width and scrolls from there. Back in the column below 900px. */
.prose pre {
  width: max-content; min-width: 100%; max-width: min(1184px, calc(100vw - 56px));
  margin-left: 50%; transform: translateX(-50%);
}
/* A policy has no card to frame it, so it keeps to the text's left edge and a
   long one runs on into the right margin only, as far as the wide-table edge. */
.prose .policy-doc {
  width: max-content; min-width: 100%;
  max-width: calc((100% + min(1184px, calc(100vw - 56px))) / 2);
}

/* Tables (see wrapTables). The box takes the figures' hairline and radius and
   scrolls sideways when the table is wider than it. The type sits a size below
   the prose. Bold in a cell marks the answer that counts, so it takes the ink
   and the rest of the cell stays gray. */
.prose .table-wrap {
  margin: 38px 0; overflow-x: auto;
  border: 1px solid var(--tint-2); border-radius: var(--radius-md);
}
.prose .table-wrap:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
/* When a table or a code block scrolls, which in practice is on a phone, a thin
   grey bar rather than the platform's own. The policy's is in /policy.css. */
.prose .table-wrap, .prose pre { scrollbar-width: thin; scrollbar-color: #c9cad0 transparent; }
.prose .table-wrap::-webkit-scrollbar, .prose pre::-webkit-scrollbar { height: 6px; }
.prose .table-wrap::-webkit-scrollbar-track, .prose pre::-webkit-scrollbar-track { background: transparent; }
.prose .table-wrap::-webkit-scrollbar-thumb, .prose pre::-webkit-scrollbar-thumb {
  background: #c9cad0; border-radius: 999px;
}
/* Out of the reading column to the article picture's width (the 1240px
   container less its padding), centred on the column. */
.prose .table-wide {
  width: min(1184px, calc(100vw - 56px));
  margin-left: calc((100% - min(1184px, calc(100vw - 56px))) / 2);
}
.prose table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 15px; line-height: 1.45; letter-spacing: -0.005em;
}
.prose th, .prose td {
  padding: 13px 16px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--tint-2);
}
.prose th {
  background: var(--tint); color: var(--ink); vertical-align: bottom;
  font-size: 13px; font-weight: 600; line-height: 1.35;
}
.prose td { color: var(--gray); }
.prose td:first-child { color: var(--ink); font-weight: 500; }
.prose tbody tr:last-child td { border-bottom: 0; }

/* Sources. Citations belong at the foot of a piece rather than inside its
   sentences, and once they are down here they are reference matter: set small
   enough to stay out of the reading line, large enough to check. The rules are
   specific enough (two classes) to hold against the phone's type bump below. */
.prose .sources {
  margin-top: clamp(48px, 5vw, 70px); padding-top: 24px;
  border-top: 1px solid var(--tint-2);
}
.prose .sources h2 {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--gray-soft); margin: 0 0 14px;
}
.prose .sources ul { margin: 0; padding-left: 17px; }
.prose .sources li {
  font-size: 12.5px; line-height: 1.6; letter-spacing: 0;
  color: var(--gray); margin-bottom: 7px;
}
/* A bare DOI or gov.uk path is longer than the column: it breaks rather than
   pushing a scrollbar onto the article. */
.prose .sources a { color: var(--gray); overflow-wrap: anywhere; }
.prose .sources a:hover { color: var(--ink); }
/* A body figure sits inside the reading column, flush with the paragraphs above
   and below it — same width, same left and right edges. figure is a block, so
   its default width is already the content box of .container-narrow (748px cap
   less 2x28px padding = 692px); it needs no width of its own, and must not set
   one, or it stops tracking the column at narrow viewports. */
.prose figure {
  margin: 42px 0;
}
.prose figure img {
  margin: 0; width: 100%; height: auto;
  background: var(--paper);
  border: 1px solid var(--tint-2);
  border-radius: var(--radius-md);
}
/* Centred under the image it labels. */
.prose figcaption {
  margin-top: 14px;
  text-align: center;
  font-size: 15px; line-height: 1.5; color: var(--gray);
  letter-spacing: -0.005em;
}

/* Click a figure and it opens against the viewport (see ZOOM_SCRIPT). The
   button is a bare wrapper: the picture keeps the frame the figure gave it, and
   only the cursor and the hover edge say it can be opened. */
.prose .zoom {
  display: block; width: 100%; padding: 0; border: 0; background: none;
  font: inherit; color: inherit; cursor: zoom-in;
}
.prose .zoom img { transition: border-color .15s ease; }
.prose .zoom:hover img { border-color: var(--gray-soft); }
.prose .zoom:focus-visible img { outline: 2px solid var(--blue); outline-offset: 3px; }

/* The viewer. Above the sticky nav, which sits at 60. */
.viewer {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: clamp(16px, 4vw, 48px);
  background: rgba(12,13,16,0.93);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
/* display:flex above beats the browser's own rule for [hidden], so the closed
   state has to be spelled out or the viewer is never closed at all. */
.viewer[hidden] { display: none; }
.viewer-img {
  max-width: 100%;
  /* Room for the caption under it. dvh second, so phones measure the viewport
     they actually show; browsers without it keep the vh line. */
  max-height: calc(100vh - 150px);
  max-height: calc(100dvh - 150px);
  width: auto; height: auto; object-fit: contain;
  border-radius: 10px; background: var(--paper); cursor: default;
}
.viewer-cap {
  margin: 0; max-width: 760px; text-align: center;
  font-size: 15px; line-height: 1.5; color: rgba(255,255,255,0.72);
}
.viewer-cap[hidden] { display: none; }
.viewer-close {
  position: absolute; top: clamp(12px, 2vw, 22px); right: clamp(12px, 2vw, 22px);
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px;
  background: rgba(255,255,255,0.14); color: #fff; cursor: pointer;
}
.viewer-close:hover { background: rgba(255,255,255,0.24); }
.viewer-close svg { display: block; width: 22px; height: 22px; }
/* The article must not scroll behind the viewer. */
body.viewer-open { overflow: hidden; }

/* Closing author note */
.article-note {
  background: var(--tint); border-radius: var(--radius-lg);
  padding: clamp(28px, 3vw, 40px); margin: clamp(16px, 2vw, 28px) auto 0;
}
.article-note p { font-size: 17px; line-height: 1.65; color: var(--ink-2); margin: 0; }
.article-note em { font-style: normal; }
.article-note a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }

/* Closing CTA band */
.article-cta { padding: clamp(64px, 7vw, 104px) 0; }
.cta-card {
  background: var(--dark); color: #fff; border-radius: var(--radius-lg);
  padding: clamp(40px, 5vw, 72px); text-align: center;
}
.cta-card h2 {
  font-size: clamp(28px, 3.4vw, 44px); font-weight: 600;
  line-height: 1.05; letter-spacing: -0.04em; margin-bottom: 18px;
}
.cta-card p {
  font-size: clamp(17px, 1.4vw, 19px); line-height: 1.55; color: var(--dark-text);
  max-width: 620px; margin: 0 auto 32px;
}
.cta-card .btn-primary { background: #fff; color: var(--ink); }
.cta-card .btn-primary:hover { background: #eceef2; color: var(--ink); }

/* More posts */
.more-posts { padding: 0 0 clamp(64px, 7vw, 104px); }
.more-posts h2 {
  font-size: clamp(24px, 2.4vw, 32px); font-weight: 600;
  letter-spacing: -0.04em; margin-bottom: clamp(28px, 3vw, 40px);
}

/* Footer */
footer { padding: 56px 0 48px; border-top: 1px solid var(--tint-2); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; letter-spacing: -0.03em; }
.footer-brand img { width: 24px; height: 24px; }
.footer-links { display: flex; gap: 26px; flex-wrap: wrap; font-size: 14px; }
.footer-links a { color: var(--gray-soft); }
.footer-links a:hover { color: var(--ink); }
.footer-meta { font-size: 14px; color: var(--gray-soft); }

@media (max-width: 1000px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .container, .container-narrow { padding: 0 20px; }
  /* Burger nav. The panel is absolute against the sticky <nav>, so it drops
     full-bleed under the bar instead of being trapped by .container. */
  .nav-burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-right: -10px;
    padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer;
  }
  .nav-burger svg { display: block; width: 24px; height: 24px; }
  .nav-burger .icon-close { display: none; }
  nav.nav-open .nav-burger .icon-open { display: none; }
  nav.nav-open .nav-burger .icon-close { display: block; }
  .nav-links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 4px 20px 22px;
    background: var(--paper); border-bottom: 1px solid var(--tint-2);
  }
  nav.nav-open .nav-links { display: flex; }
  /* Wide tables, long code and long policies go back into the column and
     scroll. A wide table keeps a minimum width so its cells are not crushed,
     and its first column stays put so a row keeps its name while the rest
     scrolls under it. */
  .prose pre, .prose .policy-doc { width: auto; max-width: none; margin-left: 0; transform: none; }
  .prose .table-wide { width: auto; margin-left: 0; }
  .prose .table-wide table { min-width: 860px; font-size: 14px; }
  .prose .table-wide th:first-child, .prose .table-wide td:first-child {
    position: sticky; left: 0; z-index: 1; width: 136px; min-width: 136px;
    background: var(--paper); box-shadow: inset -1px 0 0 var(--tint-2);
  }
  .prose .table-wide th:first-child { background: var(--tint); }
  .nav-links a:not(.nav-cta) {
    font-size: 17px; padding: 16px 2px; border-top: 1px solid var(--tint-2);
  }
  .nav-links a.nav-cta {
    margin-top: 18px; padding: 15px 22px; font-size: 16px; text-align: center;
  }
}
@media (max-width: 640px) {
  .post-grid { grid-template-columns: 1fr; }
  .prose p, .prose li { font-size: 18px; }
  .prose > p:first-child { font-size: 19px; }
  .btn { width: 100%; }
  /* The article's picture runs to both edges of the phone, squared off, with
     air above and below it. It has to beat .container's own padding, hence the
     doubled class. */
  .article-hero.container { padding: 20px 0; max-width: none; }
  .article-hero .plate { border-radius: 0; }
  /* Below 900px .container-narrow's padding replaces .article-head's, so the
     byline brings its own air. */
  .byline { font-size: 9pt; padding: 10px 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
