@charset "UTF-8";
/* Useful Thoughts — brokenmind.co.uk
 *
 * Typography-first reading layout. Every colour is a token, and --on-accent is
 * declared alongside --accent rather than hardcoded: the reference stylesheet
 * had its accent's contrasting colour written as a literal in 16 places, so
 * changing the accent silently broke the text sitting on it in all 16.
 */

:root {
  color-scheme: light;

  --bg:            #fbfaf8;
  --bg-raised:     #ffffff;
  --bg-sunken:     #f2efea;
  --ink:           #1b1a17;
  --ink-soft:      #55524c;
  --ink-faint:     #86817a;
  --rule:          #e3ded6;
  --rule-strong:   #cdc6bb;

  --accent:        #146b63;
  --accent-hover:  #0f544e;
  --on-accent:     #ffffff;
  --accent-wash:   #e6f2f0;

  --focus:         #146b63;
  --shadow:        0 1px 2px rgba(27,26,23,.05), 0 8px 24px rgba(27,26,23,.06);

  --measure:       38rem;
  --wrap:          72rem;
  --radius:        10px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* Dark tokens are declared twice on purpose: once for the OS preference (unless
 * the visitor has explicitly chosen light) and once for the explicit toggle, so
 * the toggle wins in both directions. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:          #14151a;
    --bg-raised:   #1c1e25;
    --bg-sunken:   #101116;
    --ink:         #e9e7e2;
    --ink-soft:    #b0aca4;
    --ink-faint:   #85817a;
    --rule:        #2a2d36;
    --rule-strong: #3c404b;
    --accent:      #5ecfc1;
    --accent-hover:#8ee0d5;
    --on-accent:   #0c1a19;
    --accent-wash: #17302d;
    --focus:       #5ecfc1;
    --shadow:      0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:          #14151a;
  --bg-raised:   #1c1e25;
  --bg-sunken:   #101116;
  --ink:         #e9e7e2;
  --ink-soft:    #b0aca4;
  --ink-faint:   #85817a;
  --rule:        #2a2d36;
  --rule-strong: #3c404b;
  --accent:      #5ecfc1;
  --accent-hover:#8ee0d5;
  --on-accent:   #0c1a19;
  --accent-wash: #17302d;
  --focus:       #5ecfc1;
  --shadow:      0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .15em; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: .6rem 1rem; border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 0; }

/* ------------------------------------------------------------------ masthead */
.masthead { border-bottom: 1px solid var(--rule); background: var(--bg); position: sticky; top: 0; z-index: 40; }
.masthead-inner { display: flex; align-items: center; gap: 1rem; min-height: 4.25rem; }
.brand { margin-right: auto; }
.brand-name {
  font-family: var(--serif); font-size: 1.35rem; font-weight: 600; letter-spacing: -.01em;
  color: var(--ink); text-decoration: none; display: block; line-height: 1.15;
}
.brand-tag { margin: 0; font-size: .8rem; color: var(--ink-faint); }

.nav-list { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: .3rem;
  font: inherit; font-size: .95rem; color: var(--ink-soft); text-decoration: none;
  background: none; border: 0; cursor: pointer; padding: .5rem .7rem; border-radius: var(--radius);
}
.nav-link:hover { color: var(--ink); background: var(--bg-sunken); }
.submenu {
  position: absolute; top: calc(100% + .35rem); left: 0; min-width: 14rem;
  background: var(--bg-raised); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow); list-style: none; margin: 0; padding: .35rem;
  max-height: 60vh; overflow-y: auto; display: none; z-index: 50;
}
.nav-item.open .submenu { display: block; }
.submenu a {
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
  padding: .4rem .6rem; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: .92rem;
}
.submenu a:hover { background: var(--accent-wash); }
.count { color: var(--ink-faint); font-size: .8rem; font-variant-numeric: tabular-nums; }

.nav-toggle, .theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.4rem; height: 2.4rem; padding: 0;
  background: none; border: 1px solid var(--rule); border-radius: var(--radius);
  color: var(--ink-soft); cursor: pointer;
}
.nav-toggle:hover, .theme-toggle:hover { color: var(--ink); border-color: var(--rule-strong); }
.nav-toggle { display: none; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: inline; }
}

/* ---------------------------------------------------------------- listings */
main { padding-block: clamp(2rem, 5vw, 3.5rem) 4rem; }

.listing-header { max-width: var(--measure); margin-bottom: 2.5rem; }
.listing-kind { margin: 0 0 .35rem; font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.listing-title { font-family: var(--serif); font-size: clamp(1.9rem, 4.5vw, 2.6rem); line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -.02em; }
.listing-page { color: var(--ink-faint); font-weight: 400; }
.listing-desc { margin: 0; color: var(--ink-soft); }

.card-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.card {
  display: grid; grid-template-columns: minmax(0,1fr); gap: 1rem;
  background: var(--bg-raised); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.25rem 1.35rem; transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: var(--rule-strong); }
@media (min-width: 40rem) {
  .card:has(.card-media) { grid-template-columns: 12rem minmax(0,1fr); align-items: start; }
}
.card-media { display: block; border-radius: 8px; overflow: hidden; background: var(--bg-sunken); }
.card-media img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.card-cats { margin: 0 0 .3rem; font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; }
.card-cats a { color: var(--accent); text-decoration: none; font-weight: 600; margin-right: .6rem; }
.card-cats a:hover { text-decoration: underline; }
.card-title { font-family: var(--serif); font-size: 1.35rem; line-height: 1.25; margin: 0 0 .4rem; letter-spacing: -.01em; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card-excerpt { margin: 0 0 .6rem; color: var(--ink-soft); font-size: .95rem; }
.card-meta, .post-meta { margin: 0; font-size: .85rem; color: var(--ink-faint); }
.sep { margin-inline: .5rem; }
.empty { color: var(--ink-faint); }

/* ------------------------------------------------------------------- post */
.post { max-width: var(--measure); margin-inline: auto; }
.post-header { margin-bottom: 2rem; }
.post-cats { margin: 0 0 .6rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.pill {
  display: inline-block; padding: .2rem .6rem; border-radius: 999px;
  background: var(--accent-wash); color: var(--accent); font-size: .78rem; font-weight: 600;
  text-decoration: none; letter-spacing: .03em;
}
.pill:hover { background: var(--accent); color: var(--on-accent); }
.post-title { font-family: var(--serif); font-size: clamp(2rem, 5.5vw, 3rem); line-height: 1.12; margin: 0 0 .75rem; letter-spacing: -.022em; }

.prose { font-size: 1.125rem; line-height: 1.75; }
.prose > * + * { margin-top: 1.4em; }
.prose p { margin: 0; }
.prose h2, .prose h3, .prose h4 {
  font-family: var(--serif); line-height: 1.25; letter-spacing: -.015em; margin-top: 2.2em; margin-bottom: -.6em;
}
.prose h2 { font-size: 1.6rem; }
.prose h3 { font-size: 1.3rem; }
.prose h4 { font-size: 1.12rem; }
.prose img { border-radius: 8px; display: block; margin-inline: auto; background: var(--bg-sunken); }
.prose figure { margin: 2em 0; }
.prose figcaption { margin-top: .6em; font-size: .85rem; color: var(--ink-faint); text-align: center; }
.prose blockquote {
  margin: 2em 0; padding: .2em 0 .2em 1.25em; border-left: 3px solid var(--accent);
  color: var(--ink-soft); font-style: italic;
}
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .4em; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--rule); padding: .5em .7em; text-align: left; }
.prose th { background: var(--bg-sunken); }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--bg-sunken); padding: .1em .35em; border-radius: 4px; }

.post-tags { margin: 2.5rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.tag {
  font-size: .8rem; color: var(--ink-soft); text-decoration: none;
  border: 1px solid var(--rule); border-radius: 999px; padding: .18rem .6rem;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }

.post-nav { display: grid; gap: .75rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--rule); }
@media (min-width: 40rem) { .post-nav { grid-template-columns: 1fr 1fr; } }
.post-nav-link {
  display: block; padding: .9rem 1.1rem; border: 1px solid var(--rule); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; font-size: .95rem; line-height: 1.35;
}
.post-nav-link:hover { border-color: var(--accent); color: var(--accent); }
.post-nav-link span { display: block; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: .25rem; }
.post-nav-link.next { text-align: right; }

.related { max-width: var(--measure); margin: 4rem auto 0; }
.related h2 { font-family: var(--serif); font-size: 1.4rem; margin: 0 0 1rem; }

/* --------------------------------------------------------------- comments */
.comments { max-width: var(--measure); margin: 4rem auto 0; padding-top: 2rem; border-top: 1px solid var(--rule); }
.comments h2 { font-family: var(--serif); font-size: 1.4rem; margin: 0 0 .35rem; }
.comments-note { margin: 0 0 1.75rem; font-size: .875rem; color: var(--ink-faint); }
.comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; }
.comment { padding-bottom: 1.5rem; border-bottom: 1px solid var(--rule); }
.comment:last-child { border-bottom: 0; padding-bottom: 0; }
.comment-head { display: grid; grid-template-columns: auto 1fr; gap: .2rem .75rem; align-items: center; margin-bottom: .6rem; }
.avatar { grid-row: span 2; border-radius: 50%; background: var(--bg-sunken); }
.comment-author { margin: 0; font-weight: 600; font-size: .95rem; align-self: end; }
.comment-date { margin: 0; font-size: .8rem; color: var(--ink-faint); align-self: start; }
.comment-body { font-size: 1rem; line-height: 1.65; }
.comment-pingback { font-size: .9rem; color: var(--ink-faint); }
.comment-ping { margin: 0; }

/* ------------------------------------------------------------- pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-top: 3rem; flex-wrap: wrap; }
.page-list { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.page-list a, .page-cur, .page-gap {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.25rem; height: 2.25rem; padding: 0 .5rem; border-radius: 8px;
  font-size: .9rem; font-variant-numeric: tabular-nums; text-decoration: none;
}
.page-list a { color: var(--ink-soft); border: 1px solid var(--rule); }
.page-list a:hover { border-color: var(--accent); color: var(--accent); }
.page-cur { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.page-gap { color: var(--ink-faint); }
.page-prev, .page-next {
  font-size: .9rem; text-decoration: none; color: var(--ink-soft);
  border: 1px solid var(--rule); border-radius: 8px; padding: .5rem .85rem;
}
.page-prev:hover, .page-next:hover { border-color: var(--accent); color: var(--accent); }

/* --------------------------------------------------------- dead links
 * Files the pre-WordPress site hosted that no longer exist anywhere -- a
 * savegame and nine Charity Commission PDFs. The link text is kept so the
 * sentence still reads; the note explains why there is nothing to click.
 * See data/link-repairs.json. */
.gone { color: var(--ink-soft); }
.gone-note {
  font-size: .85em; color: var(--ink-faint); white-space: normal;
}
.gone-note a { color: var(--ink-soft); }
.gone-note a:hover { color: var(--accent); }

/* ---------------------------------------------------------------- search */
.search-form { max-width: var(--measure); margin-bottom: 1.5rem; }
.search-form input {
  width: 100%; font: inherit; padding: .75rem 1rem;
  background: var(--bg-raised); color: var(--ink);
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
}
.search-status { color: var(--ink-faint); font-size: .9rem; margin: 0 0 1.5rem; }

/* ------------------------------------------------------------------- 404 */
.notfound { max-width: var(--measure); margin-inline: auto; text-align: center; padding-block: 3rem; }
.notfound-code { font-family: var(--serif); font-size: clamp(4rem, 15vw, 7rem); line-height: 1; margin: 0; color: var(--accent); opacity: .25; }
.notfound h1 { font-family: var(--serif); font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 1rem; }
.notfound-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .6rem 1.15rem; border-radius: var(--radius); border: 1px solid transparent;
  background: var(--accent); color: var(--on-accent); font: inherit; font-size: .95rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn-quiet:hover { background: var(--bg-sunken); color: var(--ink); border-color: var(--rule-strong); }

/* ---------------------------------------------------------------- footer */
.footer { border-top: 1px solid var(--rule); background: var(--bg-sunken); padding-block: 2.5rem; margin-top: 4rem; }
.footer-inner { display: grid; gap: 1rem; }
.footer-blurb { margin: 0; max-width: var(--measure); color: var(--ink-soft); font-size: .95rem; }
.footer-nav { list-style: none; display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 0; padding: 0; font-size: .9rem; }
.footer-nav a { color: var(--ink-soft); text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }
.footer-legal { margin: 0; font-size: .82rem; color: var(--ink-faint); }

/* --------------------------------------------------------------- responsive
 * Declared last so that every component above is in scope. In the reference
 * stylesheet this block sat mid-file and four later components had no
 * responsive rules at all. */
@media (max-width: 52rem) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; order: 3; flex-basis: 100%; }
  .nav.open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; padding-bottom: .75rem; }
  .nav-link { width: 100%; justify-content: space-between; padding: .7rem .5rem; }
  .submenu { position: static; display: none; box-shadow: none; border: 0; border-left: 2px solid var(--rule); border-radius: 0; margin-left: .5rem; max-height: 18rem; }
  .nav-item.open .submenu { display: block; }
  .masthead { position: static; }
  .masthead-inner { flex-wrap: wrap; padding-block: .75rem; }
}
@media (max-width: 40rem) {
  body { font-size: 1rem; }
  .prose { font-size: 1.05rem; }
  .post-nav-link.next { text-align: left; }
}
