/* ==========================================================================
   The 2026 redesign, for the new hosting only (_config_edge.yml loads it
   after site.css). Professional, with some grit: clean cool white and black ink, a
   faint photocopy grain, heavy condensed headlines, thick rules, and one loud
   colour used the way a highlighter pen is. Reading stays calm: a good serif
   at a comfortable measure, with the noise kept to the edges of the page.

   Most pages still carry inline styles written against site.css's tokens, so
   the tokens are redefined here rather than renamed, and those pages follow.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@62..125,400..900&family=Big+Shoulders+Stencil+Display:wght@800&family=IBM+Plex+Mono:wght@400;500&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&display=swap');

:root {
  --color-bg: #F7F8FA;          /* clean cool white, not newsprint */
  --color-bg-warm: #ECEEF2;
  --color-surface: #FFFFFF;
  --color-ink: #0E0F12;
  --color-ink-secondary: #3D434C;
  --color-ink-tertiary: #6B7280;
  --color-accent: #121212;      /* links are ink; the loud colour is --hot */
  --color-accent-dim: rgba(18, 18, 18, 0.06);
  --color-rule: #121212;
  --color-rule-light: #D8DCE2;
  --grid-dot: rgba(14, 15, 18, 0.10);
  --hot: #FF4F1A;               /* the one loud colour */

  --font-display: 'Archivo', 'Arial Narrow', sans-serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --font-ui: 'Archivo', -apple-system, 'Segoe UI', sans-serif;

  --max-width: 1080px;
  --max-width-narrow: 680px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0E1014;
    --color-bg-warm: #161920;
    --color-surface: #14171D;
    --color-ink: #E8EBF0;
    --color-ink-secondary: #B3B9C4;
    --color-ink-tertiary: #8A919C;
    --color-accent: #E8EBF0;
    --color-accent-dim: rgba(232, 235, 240, 0.08);
    --color-rule: #E8EBF0;
    --color-rule-light: #262A33;
    --grid-dot: rgba(232, 235, 240, 0.09);
    --hot: #FF6A38;
    color-scheme: dark;
  }
}

/* A faint dot grid, like engineering paper: the technical half. The grain
   and the paint are the grungy half. */
html {
  font-size: 18px;
  background-color: var(--color-bg);
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1.4px);
  background-size: 22px 22px;
}
body { background: transparent; }
body { font-family: var(--font-ui); font-stretch: 100%; font-size: 1rem; line-height: 1.55; letter-spacing: 0; color: var(--color-ink); }

/* Photocopy grain: fractal noise, very faint, fixed so it doesn't scroll. */
body::before {
  display: block;
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.07;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}
@media (prefers-color-scheme: dark) { body::before { mix-blend-mode: screen; opacity: 0.05; } }

::selection { background: var(--hot); color: #121212; }

a { color: var(--color-ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; text-decoration-color: var(--hot); }
a:hover { background: var(--hot); color: #121212; text-decoration-color: transparent; }

mark { background: linear-gradient(transparent 12%, var(--hot) 12%, var(--hot) 88%, transparent 88%); color: #121212; padding: 0 0.15em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

.container, .container--narrow { padding: 0 1rem; }
@media (min-width: 48em) { .container, .container--narrow { padding: 0 2rem; } }

/* --- Header and footer --- */
.site-header { padding: calc(1.5rem + env(safe-area-inset-top, 0px)) 0 1rem; border-bottom: 3px solid var(--color-rule); }
/* One line at every width: site.css stacks the nav under the logo on phones. */
.site-header .container { flex-direction: row !important; align-items: baseline !important; justify-content: space-between; flex-wrap: nowrap; gap: 1rem; }
.site-logo { font-family: var(--font-display); font-stretch: 75%; font-weight: 900; font-size: 1.15rem; text-transform: uppercase; letter-spacing: 0.01em; color: var(--color-ink); text-decoration: none; }
.site-logo::after { display: none; }
.site-logo:hover { background: none; color: var(--hot); opacity: 1; }
.site-nav { gap: 1.25rem; }
.site-nav a { font-family: var(--font-mono); font-size: 0.85rem; font-weight: 400; text-transform: lowercase; letter-spacing: 0; color: var(--color-ink); text-decoration: none; }
.site-nav a::after { display: none; }
.site-nav a:hover { background: var(--hot); color: #121212; }

.site-footer { border-top: 3px solid var(--color-rule); margin-top: 6rem; padding: 1.5rem 0 3rem; }
.site-footer__copy, .site-footer__back-top { font-family: var(--font-mono); font-size: 0.78rem; color: var(--color-ink-secondary); }

.topbar { background: var(--color-bg); border-bottom: 2px solid var(--color-rule); }
.topbar__title, .topbar__section { font-family: var(--font-mono); text-transform: none; letter-spacing: 0; }

/* --- Labels: mono, lower case, no letter-spaced capitals --- */
.section-label, .post-header__kicker, .post-card__date, .post-card__read, .post-card__series,
.latest-post__label, .post-index__month, .post-row__date, .post-row__series, .post-nav__label,
.writing-index__tagline {
  font-family: var(--font-mono) !important;
  text-transform: lowercase !important;
  letter-spacing: 0 !important;
  font-weight: 400 !important;
}

/* A label set like a sticker slapped on the page. */
.sticker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: lowercase;
  background: var(--color-ink);
  color: var(--color-bg);
  padding: 0.2rem 0.55rem;
  transform: rotate(-1.5deg);
  margin-bottom: 1.25rem;
}

/* --- The illustrations stay off --- */
.post-card__watermark, .writing-index__hero-watermark, .post-article__illustration, .hero__diagram { display: none !important; }

/* --- Home --- */
.home { padding: 3rem 0 0; overflow-x: clip; } /* the paint reaches past the edge */
.home .container { position: relative; }
/* A drop of the paint, landed on the header rule beside the nav. */
.home__drip {
  position: absolute;
  top: calc(-3rem - 2.1rem);
  right: 1.5rem;
  width: 6rem;
  aspect-ratio: 110 / 50;
  background: url(/images/paint-drop.svg) center / contain no-repeat;
  pointer-events: none;
}
/* The masthead, with a nod to street art: the name over a streak of orange
   paint (images/brush-streak.svg), and the job title as a stencilled strip
   slapped across the bottom of it. */
.home__mast { position: relative; isolation: isolate; display: inline-block; padding-top: 0.5rem; }
.home__paint {
  position: absolute;
  z-index: -1;
  left: -12%;
  top: 6%;
  width: 182%;
  aspect-ratio: 1400 / 420;   /* the SVG's own shape, so the drops stay round */
  background: url(/images/brush-streak.svg) left center / 100% auto no-repeat;
  transform: rotate(-10deg);
  transform-origin: left center;
  mix-blend-mode: multiply;
  pointer-events: none;
}
/* On a phone the stroke starts inside the left margin rather than off the screen. */
@media (max-width: 48em) { .home__paint { left: -0.6rem; top: 12%; width: 185%; } }
@media (prefers-color-scheme: dark) { .home__paint { mix-blend-mode: normal; opacity: 0.9; } }
.home__name {
  font-family: var(--font-display);
  font-stretch: 62%;
  font-weight: 900;
  font-size: clamp(4.5rem, 17vw, 10.5rem);
  line-height: 0.82;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--color-ink);
}
.home__tag {
  display: inline-block;
  position: relative;
  margin: -0.35rem 0 0 1.5rem;
  font-family: 'Big Shoulders Stencil Display', var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.1;
  background: #121212;
  color: #F7F8FA;
  padding: 0.3rem 0.9rem 0.2rem;
  transform: rotate(-2deg);
}
.home__where { font-family: var(--font-mono); font-size: 0.9rem; color: var(--color-ink-secondary); margin: 0.9rem 0 0 2.4rem; } /* the tag's margin plus its padding, so the two lines start together */
.home__intro { max-width: 36rem; margin-top: 2.5rem; border-top: 3px solid var(--color-rule); padding-top: 1.5rem; }
.home__intro p { font-family: var(--font-body); font-size: 1.1rem; line-height: 1.6; margin-bottom: 1rem; }
.home__intro .home__lede { font-size: 1.35rem; line-height: 1.45; }
.home__section { margin-top: 4.5rem; }

.home__recent { list-style: none; counter-reset: recent; border-top: 3px solid var(--color-rule); }
.home__recent li { counter-increment: recent; border-bottom: 1px solid var(--color-rule-light); }
.home__recent a { display: grid; grid-template-columns: 3.25rem 1fr; column-gap: 1rem; padding: 1rem 0; text-decoration: none; color: var(--color-ink); }
.home__recent a::before {
  content: counter(recent, decimal-leading-zero);
  grid-row: span 2;
  font-family: var(--font-display);
  font-stretch: 62%;
  font-weight: 900;
  font-size: 2.2rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--color-ink);
}
.home__recent a:hover { background: none; }
.home__recent a:hover::before { color: var(--hot); -webkit-text-stroke-color: var(--hot); }
.home__title { font-family: var(--font-display); font-stretch: 87%; font-weight: 700; font-size: 1.2rem; line-height: 1.25; }
.home__recent a:hover .home__title { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--hot); text-underline-offset: 0.15em; }
.home__meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--color-ink-tertiary); margin-top: 0.2rem; }
.home__more { display: inline-block; margin-top: 1.25rem; font-family: var(--font-mono); font-size: 0.9rem; }

.home__sections { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 40em) { .home__sections { grid-template-columns: 1fr 1fr; } }
.home__sections a {
  display: block;
  border: 2px solid var(--color-ink);
  padding: 1rem 1.1rem 1.1rem;
  text-decoration: none;
  color: var(--color-ink);
  box-shadow: 5px 5px 0 var(--color-ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.home__sections a:hover { background: var(--hot); color: #121212; transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--color-ink); }
.home__sections strong { display: block; font-family: var(--font-display); font-stretch: 75%; font-weight: 900; font-size: 1.45rem; text-transform: uppercase; line-height: 1; margin-bottom: 0.4rem; }
.home__sections span { font-family: var(--font-body); font-size: 0.98rem; line-height: 1.45; }

.home__coffee { margin-top: 5rem; border-top: 3px solid var(--color-rule); padding-top: 1.5rem; }
.home__coffee h2 { font-family: var(--font-display); font-stretch: 62%; font-weight: 900; font-size: clamp(3rem, 10vw, 5.5rem); line-height: 0.9; text-transform: uppercase; }
.home__coffee p { font-family: var(--font-body); font-size: 1.2rem; max-width: 34rem; margin-top: 0.75rem; }

/* --- Indexes: rows under thick rules, not boxes --- */
.writing-index { padding: 2.5rem 0 0; }
.writing-index__heading { font-family: var(--font-display); font-stretch: 62%; font-weight: 900; font-size: clamp(3rem, 9vw, 5rem); line-height: 0.9; text-transform: uppercase; letter-spacing: 0; }
.writing-index__hero { border: 0; border-top: 3px solid var(--color-rule); border-bottom: 1px solid var(--color-rule-light); background: none; padding: 1.75rem 0; box-shadow: none; }
.writing-index__hero-title { font-family: var(--font-display); font-stretch: 87%; font-weight: 800; }
.writing-index__hero-excerpt { font-family: var(--font-body); color: var(--color-ink-secondary); }
.writing-index__posts { gap: 0 !important; grid-template-columns: 1fr !important; border-top: 3px solid var(--color-rule); }
.post-card { background: none !important; border: 0 !important; border-bottom: 1px solid var(--color-rule-light) !important; border-radius: 0 !important; box-shadow: none !important; padding: 1.25rem 0 !important; transform: none !important; color: var(--color-ink); text-decoration: none; }
.post-card:hover { background: none; }
.post-card::before, .post-card::after { display: none !important; }
.post-card__title { font-family: var(--font-display); font-stretch: 87%; font-size: 1.25rem; font-weight: 700; letter-spacing: 0; margin: 0.2rem 0 0.35rem; }
.post-card:hover .post-card__title { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--hot); text-underline-offset: 0.15em; }
.post-card__excerpt { font-family: var(--font-body); color: var(--color-ink-secondary); font-size: 1rem; }
.post-card__date, .post-card__read { font-size: 0.78rem; color: var(--color-ink-tertiary); }
.post-card__read { display: none; }
.post-card__series { opacity: 1 !important; color: var(--color-ink-tertiary) !important; font-size: 0.78rem !important; }
.post-index__month { font-size: 0.85rem; color: var(--color-ink); border-bottom: 3px solid var(--color-rule); padding-bottom: 0.3rem; margin-top: 2.5rem; }
.post-row { border-bottom-color: var(--color-rule-light); text-decoration: none; }
.post-row:hover { background: none; }
.post-row:hover .post-row__title { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--hot); }
.post-row::before { display: none; }
.post-row__title { font-family: var(--font-display); font-stretch: 87%; font-weight: 600; }

/* --- Posts: the headline is loud, the reading is calm --- */
.post-header { padding: 2.5rem 0 1rem; border: 0; }
.post-header__kicker { font-size: 0.82rem; color: var(--color-ink-secondary); margin-bottom: 0.9rem; }
.post-header__kicker a { color: inherit; text-decoration: none; }
.post-header__kicker a:hover { background: var(--hot); color: #121212; }
.post-header__title { font-family: var(--font-display); font-stretch: 70%; font-weight: 900; font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 0.95; letter-spacing: 0; text-transform: uppercase; }
.post-header__meta { font-family: var(--font-mono); font-size: 0.8rem; color: var(--color-ink-tertiary); margin-top: 1rem; padding-top: 0.75rem; border-top: 3px solid var(--color-rule); }
.post-content { font-family: var(--font-body); font-size: 1.1rem; line-height: 1.7; }
.post-content h2, .post-content h3, .post-content h4 { font-family: var(--font-display); font-weight: 800; letter-spacing: 0; margin-top: 2.5em; }
.post-content h2 { font-stretch: 75%; font-size: 1.7rem; text-transform: uppercase; line-height: 1; }
.post-content h3 { font-stretch: 87%; font-size: 1.3rem; }
.post-content h4 { font-stretch: 100%; font-size: 1.05rem; }
.post-content blockquote { border-left: 4px solid var(--hot); color: var(--color-ink-secondary); }
.post-content code { font-family: var(--font-mono); font-size: 0.85em; }
.post-content pre { border: 2px solid var(--color-ink); border-radius: 0; }
.post-content table { font-family: var(--font-ui); font-size: 0.9rem; }
.post-content hr { border: 0; border-top: 3px solid var(--color-rule); margin: 3rem 0; }
.post-nav { border-top: 3px solid var(--color-rule); }
.post-nav a { font-family: var(--font-display); font-stretch: 87%; font-weight: 700; text-decoration: none; color: var(--color-ink); }
.post-nav a:hover { background: var(--hot); color: #121212; }

.author-bio { border: 0; border-top: 3px solid var(--color-rule); background: none; padding: 1.5rem 0 0; box-shadow: none; }
.author-bio__accent { display: none; }
.author-bio__heading { font-family: var(--font-display); font-stretch: 75%; font-weight: 900; text-transform: uppercase; letter-spacing: 0; }
.author-bio__text, .author-bio__cta { font-family: var(--font-body); color: var(--color-ink-secondary); }

.series-banner { background: none; border: 0; border-left: 4px solid var(--hot); border-radius: 0; font-family: var(--font-mono); text-transform: lowercase; }

/* Index rows: the title on its own line, then date · series on the next. */
.post-row { display: flex !important; flex-wrap: wrap; align-items: baseline; column-gap: 0; row-gap: 0.2rem; }
.post-row__title { order: 1; flex: 0 0 100%; }
.post-row__date { order: 2; }
.post-row__series { order: 3; grid-column: auto; }
.post-row__series:not(:empty)::before { content: "\00a0\00b7\00a0"; color: var(--color-ink-tertiary); }

/* Links in running text: deep orange, solidly underlined, filled on hover.
   site.css underlines with --color-accent-dim, which this design sets to a
   faint ink, so without this a link in a post is all but invisible. The text
   colour clears 4.5:1 against the paper in both themes; the bright --hot is
   kept for the underline, where contrast with the text is not at stake. */
:root { --link: #B3360B; }
@media (prefers-color-scheme: dark) { :root { --link: #FF8F63; } }
.post-content a, .author-bio a, .page a, .writing-index__header a, .series-banner a,
.home__intro a, .home__coffee a, .home__more, .contact-form-wrap a, .running-it-yourself a {
  color: var(--link);
  border-bottom: 0;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--hot);
  text-underline-offset: 0.18em;
  transition: none;
}
.post-content a:hover, .author-bio a:hover, .page a:hover, .writing-index__header a:hover, .series-banner a:hover,
.home__intro a:hover, .home__coffee a:hover, .home__more:hover, .contact-form-wrap a:hover, .running-it-yourself a:hover {
  background: var(--hot);
  color: #121212;
  text-decoration-color: transparent;
}
/* Links that wrap a diagram or a heading anchor stay as they are. */
.post-content a:has(svg), .post-content a:has(img) { text-decoration: none; background: none; }

/* A splash of colour: each series and group in a list takes one of eight
   colours (_plugins/series_colour.rb picks which), so a run can be picked
   out down a list. All eight clear 5.3:1 on the paper and 7.4:1 on ink. The
   date and the separators stay grey. */
:root { --sc1:#B3360B; --sc2:#1D4FB0; --sc3:#0B6E66; --sc4:#A0205F; --sc5:#3F6A12; --sc6:#6B3AA6; --sc7:#8A5300; --sc8:#B0122E; }
@media (prefers-color-scheme: dark) {
  :root { --sc1:#FF8F63; --sc2:#86A8FF; --sc3:#4FD1C1; --sc4:#FF85BF; --sc5:#A8D46A; --sc6:#C3A0FF; --sc7:#F2B95A; --sc8:#FF7A85; }
}
.sc1{color:var(--sc1)} .sc2{color:var(--sc2)} .sc3{color:var(--sc3)} .sc4{color:var(--sc4)}
.sc5{color:var(--sc5)} .sc6{color:var(--sc6)} .sc7{color:var(--sc7)} .sc8{color:var(--sc8)}
.sc-sep { color: var(--color-ink-tertiary); }
