/* TruAnon — Writing
   Tokens lifted from truanon-app.css so this reads as the same company:
   navbar #0076BA, Poppins, line-height 1.68, link blue #007bff. */

:root {
  --brand:        #0076BA;
  --brand-hover:  #2065BA;
  --link:         #007bff;
  --link-hover:   #2D7DCC;

  --bg:           #ffffff;
  --bg-soft:      #fdfdfe;
  --bg-sunken:    #f9fafb;
  --text:         #24292f;
  --text-muted:   #6a737d;
  --rule:         rgba(0, 0, 0, .1);

  --font: Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --measure: 42rem;
  --radius: .625rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:         #000000;
    --bg-soft:    #212626;
    --bg-sunken:  #222222;
    --text:       #e8e8e8;
    --text-muted: #999999;
    --rule:       rgba(255, 255, 255, .14);
    --link:       #64b0ff;
    --link-hover: #8cc6ff;
  }
}

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

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

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.68;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

/* ---------- Header ---------- */

.site-header {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
}

.site-header .bar {
  max-width: 62rem;
  min-height: 4.1rem;
  margin: 0 auto;
  padding: .5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: #fff;
  font-weight: 500;
  font-size: 1.15rem;
}
.brand:hover { color: #fff; text-decoration: none; }
.brand .mark { flex: none; }

.section-label {
  padding-left: .6rem;
  margin-left: .1rem;
  border-left: 1px solid rgba(255, 255, 255, .45);
  font-weight: 300;
  color: rgba(255, 255, 255, .85);
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .95rem;
}

.site-nav a {
  color: #fff;
  padding: .35rem .75rem;
  border-radius: 62.5rem;
  white-space: nowrap;
}
.site-nav a:hover { color: #fff; text-decoration: none; background: rgba(255, 255, 255, .12); }

.site-nav .pill {
  border: 1px solid rgba(255, 255, 255, .65);
  font-weight: 500;
}
.site-nav .pill:hover { background: #fff; color: var(--brand); }

/* ---------- Layout ---------- */

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

/* ---------- Index ---------- */

.page-intro { margin-bottom: 2.75rem; }
.page-intro h1 { margin: 0 0 .5rem; font-size: 2.2rem; font-weight: 600; letter-spacing: -.02em; }
.lede { margin: 0; color: var(--text-muted); font-size: 1.1rem; }

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

.post-card {
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
}
.post-card:last-child { border-bottom: 1px solid var(--rule); }

.post-card.has-thumb {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1.25rem;
  align-items: start;
}

.post-card .thumb {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-sunken);
  aspect-ratio: 4 / 3;
}
.post-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}
.post-card:hover .thumb img { transform: scale(1.03); }

.post-card time {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.post-card h2 { margin: .35rem 0 .4rem; font-size: 1.35rem; font-weight: 500; line-height: 1.35; }
.post-card h2 a { color: var(--text); }
.post-card h2 a:hover { color: var(--link); text-decoration: none; }
.post-card p { margin: 0; color: var(--text-muted); }

/* ---------- Post ---------- */

.post-header { margin-bottom: 2.25rem; }
.post-header h1 {
  margin: 0 0 .6rem;
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.02em;
}

.byline {
  margin: 0;
  font-size: .875rem;
  color: var(--text-muted);
}
.byline .sep { padding: 0 .35rem; }

.standfirst {
  margin: 1.1rem 0 0;
  padding-left: 1rem;
  border-left: 3px solid var(--brand);
  font-size: 1.15rem;
  color: var(--text-muted);
}

/* Hero + in-article figures. Images bleed slightly wider than the text
   measure on roomy screens, and clamp back inside it on narrow ones. */

.hero { margin: 0 0 2.5rem; }

figure {
  margin: 2rem 0;
}
figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: var(--bg-sunken);
}
figcaption {
  margin-top: .6rem;
  font-size: .85rem;
  line-height: 1.5;
  color: var(--text-muted);
}

@media (min-width: 52rem) {
  .hero,
  .prose figure.wide {
    width: calc(100% + 6rem);
    margin-left: -3rem;
  }
}

/* A bare image on its own line in Markdown becomes a block image. */
.prose p > img:only-child {
  display: block;
  width: 100%;
  height: auto;
  margin: 2rem 0;
  border-radius: var(--radius);
}

.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.35rem; }

.prose h2 {
  margin: 2.75rem 0 .85rem;
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.01em;
}
.prose h3 { margin: 2rem 0 .65rem; font-size: 1.15rem; font-weight: 600; }

.prose ul, .prose ol { margin: 0 0 1.35rem; padding-left: 1.35rem; }
.prose li { margin-bottom: .5rem; }

.prose blockquote {
  margin: 1.75rem 0;
  padding: .25rem 0 .25rem 1.25rem;
  border-left: 3px solid var(--rule);
  color: var(--text-muted);
  font-style: italic;
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose strong { font-weight: 600; }
.prose hr { margin: 2.5rem 0; border: 0; border-top: 1px solid var(--rule); }

.prose code {
  padding: .15em .4em;
  border-radius: .25rem;
  background: var(--bg-sunken);
  font-size: .9em;
}
.prose pre {
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--bg-sunken);
  overflow-x: auto;
}
.prose pre code { padding: 0; background: none; }

.prose img { max-width: 100%; height: auto; border-radius: var(--radius); }

.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.35rem; font-size: .95rem; }
.prose th, .prose td { padding: .6rem .75rem; border-bottom: 1px solid var(--rule); text-align: left; }
.prose th { font-weight: 600; }

.source-note {
  max-width: var(--measure);
  margin: 2.5rem auto 0;
  font-size: .85rem;
  color: var(--text-muted);
}

.post-foot {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 0;
  border-top: 1px solid var(--rule);
}
.post-foot .back { font-size: .95rem; font-weight: 500; }

/* ---------- Footer ---------- */

.site-footer {
  flex: none;
  border-top: 1px solid var(--rule);
  background: var(--bg-soft);
  padding: 2rem 1.25rem;
  text-align: center;
  font-size: .875rem;
  color: var(--text-muted);
}

.footer-links {
  margin: 0 0 .5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .35rem 1.25rem;
}
.footer-note { margin: 0; }

/* ---------- Small screens ---------- */

@media (max-width: 30rem) {
  .section-label { display: none; }
  main { padding-top: 2rem; }
  .page-intro h1 { font-size: 1.85rem; }
  .post-header h1 { font-size: 1.7rem; }
}
