/* =========================================================================
   Anima Labs — inner page
   Design tokens extracted from anima_inner_page.psd
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&family=JetBrains+Mono:wght@100;300;400;500;700&display=swap');

:root {
  /* Palette */
  --bg:            #0A0A0F;   /* page, void around container   */
  --bg-soft:       #15191E;   /* code blocks, raised panels    */
  --bg-sidebar-tint: rgba(8,8,12,0.72); /* dark veil over tree photo */
  --bg-topbar:     rgba(10,10,15,0.85);

  --fg:            #CDC2B5;   /* body text (warm off-white)    */
  --fg-strong:     #FFFFFF;   /* headings, emphasized UI       */
  --fg-muted:      #878B8B;   /* secondary                     */
  --fg-dim:        #494D59;   /* breadcrumbs, placeholder      */
  --fg-fade:       #3F434C;   /* caption / tertiary            */

  --link:          #91B5C5;
  --link-hover:    #C1DDE9;
  --accent-warm:   #BB9C72;   /* active nav highlight, ember   */
  --accent-lilac:  #9FA2E0;   /* code comments, wistful accent */

  --divider:       rgba(255,255,255,0.10);
  --divider-soft:  rgba(255,255,255,0.05);

  /* Typography */
  --font-ui:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-body:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --fs-base:       1rem;
  --fs-small:      .875rem;
  --fs-caption:    .75rem;
  --fs-lede:       22px;
  --fs-nav:        .875rem;
  --fs-h1:         30px;
  --fs-h2:         20px;
  --fs-h3:         16px;
  --fs-h4:         14px;

  --lh-body:       1.6;
  --lh-heading:    1.2;
  --lh-tight:      1.3;

  /* Layout — 1x display sizes (mockup is 2x retina, halved here) */
  --max-w:         1300px;
  --sidebar-w:     303px;   /* matches native BG image width */
  --topbar-h:      55px;
  --content-pad-x: 32px;
  --content-pad-y: 24px;
  --nav-pad-x:     20px;
  --nav-pad-top:   16px;
}

/* =========================================================================
   Reset / base
   ========================================================================= */

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 100%;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  overflow: hidden;   /* page manages its own scroll panes */
}

/* Subtle noise/vignette so the flat near-black doesn't bank */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(30,30,45,0.35), transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(12,12,20,0.5), transparent 70%);
  z-index: 0;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--link-hover); }

/* =========================================================================
   Page shell: 2-col grid inside a centered container
   ========================================================================= */

.page {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr;
  grid-template-areas: "side main";
  border-left:  1px solid var(--divider);
  border-right: 1px solid var(--divider);
}

/* ---------- Top bar (overlaid absolutely so nav + content scroll under it) ---------- */

.topbar-left,
.topbar-right {
  position: absolute;
  top: 0;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  z-index: 20;
  border-bottom: 1px solid var(--divider);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.topbar-left {
  left: 0;
  width: var(--sidebar-w);
  padding: 0 var(--nav-pad-x);
  border-right: 1px solid var(--divider);
  background: rgba(10, 10, 15, 0.80);   /* 80% opacity over tree image */
}

.topbar-right {
  left: var(--sidebar-w);
  right: 0;
  padding: 0 var(--content-pad-x);
  justify-content: space-between;
  gap: 24px;
  background: rgba(10, 10, 15, 0.92);   /* near-opaque over content */
}

.logo-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
.logo {
  height: 22px;
  width: auto;
  display: block;
  opacity: .92;
}

.breadcrumb {
  font-family: var(--font-ui);
  font-size: var(--fs-small);
  color: var(--fg-dim);
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.breadcrumb .sep { margin: 0 .5ch; color: var(--fg-fade); }
.breadcrumb .leaf { color: var(--fg-muted); }

.search {
  position: relative;
  min-width: 260px;
}
.search input {
  width: 100%;
  background: transparent;
  border: 1px solid var(--divider);
  color: var(--fg);
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: var(--fs-small);
  padding: 8px 12px 8px 32px;
  outline: none;
  transition: border-color .15s ease;
}
.search input::placeholder { color: var(--fg-dim); }
.search input:focus { border-color: var(--link); }
.search::before {
  content: "⌕";
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--fg-dim);
  font-family: var(--font-ui);
  font-size: 14px;
  pointer-events: none;
}

/* ---------- Sidebar ---------- */

.sidebar {
  grid-area: side;
  position: relative;
  overflow: hidden;                   /* clip the BG; .nav handles its own scroll */
  border-right: 1px solid var(--divider);
  height: 100vh;
}
.sidebar-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--sidebar-w);            /* 303px — image's natural 1x width */
  /* height auto via the img element below; image fades to bg color naturally */
  z-index: 0;
  pointer-events: none;
}
.sidebar-bg img {
  display: block;
  width: 100%;
  height: auto;
}

.nav {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  /* start list below the logo block; list scrolls up under it */
  padding: calc(var(--topbar-h) + var(--nav-pad-top)) var(--nav-pad-x) 48px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--fs-nav);
  line-height: 1.5;
  /* keeps text crisp against bright leaf areas of the photo */
  text-shadow: 0 1px 2px rgba(0,0,0,0.85), 0 0 10px rgba(0,0,0,0.5);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav > ul > li { margin-bottom: 1px; }
.nav a {
  display: block;
  color: var(--fg);
  padding: 3px 10px 3px 24px;          /* 24px indent so leaves align w/ group labels */
  position: relative;
  transition: color .12s ease, background .12s ease;
}
.nav a:hover { color: var(--fg-strong); }
.nav a.active {
  color: var(--fg-strong);
  background: var(--accent-warm);
  text-shadow: none;
}

/* Expandable groups via <details>/<summary> — zero JS */
.nav details {
  margin: 0;
}
.nav summary {
  display: block;
  cursor: pointer;
  color: var(--fg-strong);
  padding: 3px 10px 3px 10px;
  user-select: none;
  list-style: none;                       /* Firefox */
  outline: none;
}
.nav summary::-webkit-details-marker { display: none; }  /* Safari */
.nav summary::marker { content: ""; }                     /* Firefox fallback */
.nav summary:hover { color: #fff; }

.nav .caret {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid var(--fg-muted);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  margin-right: 8px;
  vertical-align: 2px;
  transition: transform .15s ease;
}
.nav details[open] > summary .caret {
  transform: rotate(90deg);
}

.nav details > ul {
  padding-left: 10px;
  margin: 2px 0 8px 14px;
  border-left: 1px solid var(--divider-soft);
  font-weight: 400;
}
.nav details > ul a {
  color: var(--fg);
  opacity: .85;
  padding-left: 14px;                    /* tighter indent for children */
}
.nav details > ul a:hover { opacity: 1; }
.nav details > ul a.active {
  opacity: 1;
  background: var(--accent-warm);
  color: var(--fg-strong);
}

/* ---------- Main column ---------- */

.main {
  grid-area: main;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.18) transparent;
}
.main::-webkit-scrollbar { width: 8px; }
.main::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 4px; }
.main::-webkit-scrollbar-track { background: transparent; }

.content {
  /* top padding reserves room under the floating topbar */
  padding:
    calc(var(--topbar-h) + var(--content-pad-y))
    var(--content-pad-x)
    64px;
  max-width: 820px;
}

/* =========================================================================
   Prose — styles for anything a markdown renderer can emit
   ========================================================================= */

.prose {
  color: var(--fg);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
}

/* Document-head block: breadcrumb line (within content), title, sublinks, lede */
.prose .doc-meta {
  font-family: var(--font-ui);
  font-size: var(--fs-small);
  color: var(--fg-dim);
  margin-bottom: 14px;
  letter-spacing: .03em;
}

.prose h1 {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: var(--fs-h1);
  line-height: var(--lh-heading);
  color: var(--fg-strong);
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}
.prose h2 {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: var(--fs-h2);
  line-height: var(--lh-heading);
  color: var(--fg-strong);
  margin: 48px 0 16px;
}
.prose h3 {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: var(--fs-h3);
  color: var(--fg-strong);
  margin: 32px 0 12px;
}
.prose h4, .prose h5, .prose h6 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-h4);
  color: var(--fg-strong);
  margin: 24px 0 8px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.prose .sublinks {
  display: flex;
  gap: 32px;
  margin: -6px 0 28px;
  font-family: var(--font-ui);
  font-size: var(--fs-small);
}
.prose .sublinks a { color: var(--link); }

.prose .lede {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--fs-lede);
  line-height: 1.45;
  color: var(--fg);
  margin: 0 0 36px;
}

.prose p {
  margin: 0 0 16px;
}
.prose strong { color: var(--fg-strong); font-weight: 600; }
.prose em { font-style: italic; color: var(--fg); }

.prose a {
  color: var(--link);
  border-bottom: 1px solid rgba(78,112,127,0.35);
}
.prose a:hover { color: var(--link-hover); border-bottom-color: var(--link-hover); }

.prose hr {
  border: 0;
  height: 1px;
  background: var(--divider);
  margin: 40px 0;
}

/* Lists */
.prose ul, .prose ol {
  margin: 0 0 18px;
  padding-left: 1.4em;
}
.prose li { margin: 4px 0; }
.prose ul li::marker { color: var(--fg-dim); }
.prose ol li::marker { color: var(--fg-muted); font-family: var(--font-ui); font-size: 0.9em; }

/* Blockquote */
.prose blockquote {
  margin: 24px 0;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--accent-warm);
  color: var(--fg-strong);
  font-style: italic;
}
.prose blockquote p { margin: 0 0 10px; }
.prose blockquote p:last-child { margin-bottom: 0; }

/* Inline code */
.prose code {
  font-family: var(--font-ui);
  font-size: 0.88em;
  color: var(--accent-lilac);
  background: rgba(159,162,224,0.08);
  padding: 1px 6px;
  border-radius: 2px;
}

/* Code blocks */
.prose pre {
  background: var(--bg-soft);
  color: var(--fg-strong);
  font-family: var(--font-ui);
  font-size: var(--fs-small);
  line-height: 1.65;
  padding: 18px 22px;
  margin: 24px 0;
  overflow-x: auto;
  border: 1px solid var(--divider-soft);
}
.prose pre code {
  color: inherit;
  background: transparent;
  padding: 0;
  font-size: inherit;
}
/* Comment-like tokens inside pre (rendered by the generator) */
.prose pre .c  { color: var(--accent-lilac); }
.prose pre .k  { color: var(--fg-strong); }
.prose pre .mu { color: var(--fg-muted); }

/* Images */
.prose img,
.prose figure img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 24px auto;
  border: 1px solid var(--divider);
}
.prose figure {
  margin: 32px 0;
}
.prose figcaption {
  font-family: var(--font-ui);
  font-size: var(--fs-caption);
  color: var(--fg-fade);
  text-align: left;
  margin-top: 10px;
  letter-spacing: .03em;
}

/* Image carousel / pager shell (for the "< 3/7 >" navigation) */
.prose .carousel {
  margin: 32px 0;
  position: relative;
}
.prose .carousel .frame {
  border: 1px solid var(--divider);
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
}
.prose .carousel .frame img { border: 0; margin: 0; }
.prose .carousel .nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px;
  font-family: var(--font-ui);
  font-size: var(--fs-small);
  color: var(--fg-fade);
}
.prose .carousel .arrow {
  font-family: 'Inter', sans-serif;
  font-weight: 200;
  font-size: 40px;
  line-height: 1;
  color: var(--link);
  cursor: pointer;
  user-select: none;
  position: absolute;
  top: calc(50% - 20px);
}
.prose .carousel .arrow.prev { left: -40px; }
.prose .carousel .arrow.next { right: -40px; }

/* Tables */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: var(--fs-small);
}
.prose th, .prose td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--divider);
  text-align: left;
  vertical-align: top;
}
.prose th {
  font-family: var(--font-ui);
  font-weight: 500;
  color: var(--fg-strong);
  letter-spacing: .03em;
}
.prose tr:hover td { background: rgba(255,255,255,0.02); }

/* Definition lists (markdown extensions) */
.prose dl { margin: 18px 0; }
.prose dt { color: var(--fg-strong); font-weight: 600; margin-top: 12px; }
.prose dd { margin: 4px 0 0 20px; color: var(--fg); }

/* Footnotes */
.prose sup a,
.prose .footnote-ref a {
  color: var(--accent-warm);
  border: none;
  font-size: .8em;
}
.prose .footnotes {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--divider);
  font-size: var(--fs-small);
  color: var(--fg-muted);
}
.prose .footnotes ol { padding-left: 1.6em; }

/* Keyboard */
.prose kbd {
  font-family: var(--font-ui);
  font-size: .85em;
  background: var(--bg-soft);
  border: 1px solid var(--divider);
  padding: 1px 6px;
  border-radius: 2px;
  color: var(--fg-strong);
}

/* "***" horizontal separator in markdown — styled as a dim centered glyph */
.prose hr.ornament {
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  height: auto;
  color: var(--fg-dim);
  letter-spacing: 1.2em;
  font-family: var(--font-ui);
}
.prose hr.ornament::before { content: "* * *"; }

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 960px) {
  :root {
    --sidebar-w: 240px;
    --content-pad-x: 32px;
    --content-pad-y: 32px;
    --fs-h1: 28px;
    --fs-lede: 19px;
  }
}

@media (max-width: 720px) {
  .page {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) auto 1fr;
    grid-template-areas:
      "topL"
      "side"
      "main";
  }
  .topbar-left { border-right: 0; }
  .topbar-right { display: none; } /* collapse secondary chrome on small screens */
  .sidebar {
    min-height: auto;
    max-height: 260px;
  }
  .content { padding: 28px 20px; }
}

/* =========================================================================
   Additions for the generated site (scripts/build.py) — 2026-09-02
   ========================================================================= */

/* ---- layout: document scrolls normally; sidebar + topbar stay put ---- */
body { overflow: auto; }
.page {
  height: auto;
  min-height: 100vh;
  grid-template-rows: auto;
  grid-template-areas: "side main";
}
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  pointer-events: none;
}
.topbar-inner {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  height: var(--topbar-h);
  pointer-events: auto;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: start;
}
.main {
  height: auto;
  min-height: 100vh;
  overflow: visible;
}
.content { position: relative; }

/* ---- nav: group label that is also a link ---- */
.nav summary a.group-link {
  display: inline;
  padding: 0;
  color: inherit;
  background: none;
}
.nav summary a.group-link.active { color: var(--accent-warm); }

/* ---- page head ---- */
.prose .page-meta {
  font-family: var(--font-ui);
  font-size: var(--fs-caption);
  color: var(--fg-muted);
  letter-spacing: .05em;
  text-transform: uppercase;
  display: flex; flex-wrap: wrap; gap: 0 18px;
  margin: 0 0 10px;
}
.prose .page-meta a { color: var(--accent-warm); border: 0; }
.prose .subtitle {
  font-family: var(--font-ui);
  font-size: var(--fs-small);
  color: var(--link);
  font-style: italic;
  margin: -10px 0 8px;
}
.prose .author {
  font-family: var(--font-ui);
  font-size: var(--fs-small);
  color: var(--fg-muted);
  margin: 0 0 20px;
}
.prose .author::before { content: "— "; color: var(--fg-dim); }
.prose .page-tags, .listing-tags {
  margin: 40px 0 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.tag {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--fg-muted);
  border: 1px solid var(--divider);
  padding: 1px 8px;
  letter-spacing: .03em;
}

/* ---- galleries ---- */
.prose .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin: 28px 0;
}
.prose .gallery figure { margin: 0; }
.prose .gallery img { margin: 0; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.prose .gallery a { border: 0; }
.prose .gallery--hero { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 0; }

/* ---- listing (Field Notes index) ---- */
.listing { margin-top: 8px; }
.listing-entry {
  padding: 22px 0;
  border-bottom: 1px solid var(--divider-soft);
}
.listing-entry:last-child { border-bottom: 0; }
.listing-meta {
  font-family: var(--font-ui);
  font-size: var(--fs-caption);
  color: var(--fg-muted);
  letter-spacing: .04em;
  display: flex; flex-wrap: wrap; gap: 0 14px;
  margin-bottom: 6px;
}
.listing-type { color: var(--accent-warm); }
.listing-id { color: var(--fg-dim); }
.listing-author { color: var(--link); }
.listing-title {
  font-family: var(--font-ui);
  font-size: var(--fs-h3);
  color: var(--fg-strong);
  border: 0;
}
.listing-title:hover { color: var(--accent-warm); }
.listing-subtitle {
  font-family: var(--font-ui);
  font-size: var(--fs-caption);
  color: var(--link);
  font-style: italic;
  margin-top: 2px;
}
.listing-excerpt {
  margin: 8px 0 0;
  color: var(--fg-muted);
  font-size: var(--fs-small);
  line-height: 1.55;
}
.listing-tags { margin-top: 10px; }

/* ---- stubs / 404 ---- */
.prose.stub h1 { color: var(--fg-muted); }
.stub-text {
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  color: var(--fg);
}
.stub-stamp {
  font-family: var(--font-ui);
  font-size: var(--fs-caption);
  color: var(--fg-dim);
}

/* ---- colophon ---- */
.colophon {
  padding: 0 var(--content-pad-x) 40px;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--fg-fade);
  letter-spacing: .04em;
}
.colophon .sep { margin: 0 .6ch; }

/* ---- content blocks used by migrated Field Notes (ported from post-styles.css) ---- */
.prose .image-container { margin: 40px 0; text-align: center; }
.prose .image-container img { display: inline-block; max-width: 72%; margin: 0; }
.prose .image-caption {
  font-family: var(--font-ui);
  font-size: var(--fs-caption);
  color: var(--link);
  opacity: .75;
  margin-top: 10px;
  font-style: italic;
}
.prose .highlight-box {
  background: rgba(151,152,83,0.06);
  border-left: 3px solid #979853;
  padding: 18px 20px;
  margin: 28px 0;
}
.prose .highlight-box p:last-child, .prose .highlight-box ul:last-child { margin-bottom: 0; }
.prose .generation-context {
  background: rgba(74,124,142,0.08);
  border: 1px solid rgba(74,124,142,0.25);
  padding: 18px 22px;
  margin: 0 0 30px;
  font-size: var(--fs-small);
}
.prose .generation-context h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .15em;
  color: var(--link-hover); margin: 0 0 12px; opacity: .85;
}
.prose .generation-context p { margin-bottom: 8px; }
.prose .generation-context code { color: var(--accent-warm); }
.prose .quote-block {
  background: rgba(139,122,166,0.06);
  border-left: 2px solid #8b7aa6;
  padding: 14px 18px;
  margin: 14px 0 24px;
}

/* twitter-thread posts */
.prose .thread-intro {
  background: rgba(74,124,142,0.06);
  border-left: 3px solid var(--link);
  padding: 18px 22px;
  margin: 0 0 36px;
  font-size: var(--fs-small);
}
.prose .thread-intro p { margin-bottom: 10px; }
.prose .thread-intro p:last-child { margin-bottom: 0; }
.prose .thread-intro strong { color: var(--accent-warm); font-weight: 500; }
.prose .section-note { color: var(--fg-muted); font-style: italic; font-size: var(--fs-small); margin: -8px 0 22px; }
.prose .tweet {
  display: flex; gap: 12px;
  padding: 14px 0 14px 2px;
  border-bottom: 1px solid var(--divider-soft);
}
.prose .tweet:last-of-type { border-bottom: 0; }
.prose .tweet-avatar {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; margin: 0;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
.prose .tweet-avatar-letter {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-ui); font-size: 16px; font-weight: 500; text-transform: uppercase;
}
.prose .tweet-content { flex: 1; min-width: 0; }
.prose .tweet-header {
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
  margin-bottom: 4px; font-size: var(--fs-small); line-height: 1.4;
}
.prose .tweet-name { color: var(--fg-strong); font-weight: 600; font-size: var(--fs-base); }
.prose .tweet-handle { color: var(--link); font-family: var(--font-ui); font-size: 12.5px; }
.prose .tweet-sep { color: var(--fg-dim); }
.prose .tweet-date { color: var(--fg-muted); font-family: var(--font-ui); font-size: 11.5px; }
.prose .tweet-permalink { color: var(--fg-dim); border: 0; margin-left: auto; font-size: 13px; padding: 0 4px; }
.prose .tweet-permalink:hover { color: var(--accent-warm); }
.prose .tweet-reply-context {
  font-size: var(--fs-caption); color: var(--accent-lilac); opacity: .75; font-style: italic;
  border-left: 1px solid rgba(159,162,224,0.3); padding: 2px 0 2px 10px; margin-bottom: 10px; line-height: 1.5;
}
.prose .tweet-body p { margin-bottom: 10px; color: var(--fg-strong); font-size: 14.5px; line-height: 1.65; }
.prose .tweet-body p:last-child { margin-bottom: 0; }
.prose .tweet-body ul { margin: 6px 0; padding-left: 18px; }
.prose .tweet-media { margin: 12px 0 4px; }
.prose .tweet-media img { margin: 6px 0; border-radius: 3px; }
.prose .tweet-media.multi { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.prose .tweet-media.multi img { margin: 0; width: 100%; height: auto; }
.prose .tweet-links {
  font-size: var(--fs-caption); margin-top: 10px; color: var(--fg-muted);
  word-break: break-all; font-family: var(--font-ui);
}
.prose .tweet-links strong { color: #979853; }

/* ---- responsive fixes ---- */
@media (max-width: 720px) {
  .page {
    grid-template-rows: var(--topbar-h) auto 1fr;
    grid-template-areas:
      "topL"
      "side"
      "main";
  }
  .topbar-left { width: 100%; }
  .sidebar {
    position: relative;   /* NOT static: .sidebar-bg is absolute and must stay inside */
    top: auto;
    height: auto;
    max-height: 300px;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--divider);
  }
  .sidebar-bg { width: 100%; height: 100%; }
  .sidebar-bg img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
  .nav { max-height: 300px; padding-top: var(--nav-pad-top); }
  .main { min-height: auto; }
  .content { padding: 28px 20px; }
  .prose .image-container img { max-width: 100%; }
  .prose .tweet-media.multi { grid-template-columns: 1fr; }
  .colophon { padding: 0 20px 32px; }
}

/* 2026-09-04: the top bar already shows the breadcrumb on wide screens */
@media (min-width: 721px) { .doc-meta { display: none; } }

/* September copy pass: readable prose within the existing inner-page design. */
.prose { line-height: 1.75; overflow-wrap: anywhere; }
.prose .tweet-body p { font-size: 1rem; }
.prose .tweet-date { font-size: .75rem; }
.skip-link { position: fixed; top: -100px; left: 12px; z-index: 100; background: var(--bg); color: white; padding: 12px; }
.skip-link:focus { top: 12px; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent-warm); outline-offset: 4px; }
.listing { margin-top: 2rem; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
