:root {
    --paper: #FAFAF7;
    --card: #FFFFFF;
    --ink: #1F2429;
    --ink-2: #6B6560;
    --line: #E4E0D8;
    --accent: #B4633A;
    --accent-ink: #8F4A26;
    --chip-bg: #F1EDE6;
    --logo-bg: #F2EFE8;
    --focus: #B4633A;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --paper: #16191D;
      --card: #1E2328;
      --ink: #E8E4DF;
      --ink-2: #9A948C;
      --line: #2C3138;
      --accent: #D98A5C;
      --accent-ink: #E29B72;
      --chip-bg: #262B31;
      --logo-bg: #C9C5BD;
    }
  }
  :root[data-theme="dark"] {
    --paper: #16191D; --card: #1E2328; --ink: #E8E4DF; --ink-2: #9A948C;
    --line: #2C3138; --accent: #D98A5C; --accent-ink: #E29B72; --chip-bg: #262B31;
    --logo-bg: #C9C5BD;
  }
  :root[data-theme="light"] {
    --paper: #FAFAF7; --card: #FFFFFF; --ink: #1F2429; --ink-2: #6B6560;
    --line: #E4E0D8; --accent: #B4633A; --accent-ink: #8F4A26; --chip-bg: #F1EDE6;
    --logo-bg: #F2EFE8;
  }

  * { box-sizing: border-box; }
  body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    font-size: 16px;
  }
  .serif { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; }
  .mono  { font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; }

  a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
  a:hover { color: var(--accent); }
  :focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

  .wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }
  /* ---------- header / nav ---------- */
  header.site {
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    position: sticky; top: 0; z-index: 10;
  }
  .site-inner {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 1rem; padding: 1rem 0; flex-wrap: wrap;
  }
  .wordmark { font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; text-decoration: none; color: var(--ink); }
  .wordmark:hover { color: var(--accent-ink); }
  nav.main { display: flex; gap: 1.35rem; flex-wrap: wrap; }
  nav.main a {
    text-decoration: none; color: var(--ink-2); font-size: .92rem;
    padding-bottom: .15rem; border-bottom: 2px solid transparent;
  }
  nav.main a:hover { color: var(--ink); }
  nav.main a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
  nav.main a.stub { opacity: .55; cursor: default; }
  /* ---------- shared section bits ---------- */
  section { padding: 3.25rem 0; }
  section + section { border-top: 1px solid var(--line); }
  .eyebrow {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
    color: var(--accent-ink); margin: 0 0 .9rem;
  }
  h1, h2, h3 { text-wrap: balance; margin: 0; }
  h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -.01em; margin-bottom: .5rem; }
  .lede { color: var(--ink-2); max-width: 42rem; margin: .25rem 0 0; }
  .sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
  .sec-head .more { font-size: .88rem; white-space: nowrap; }

  /* ---------- HERO ---------- */
  .hero { padding: 4.5rem 0 3.5rem; }
  .hero h1 {
    font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    font-size: clamp(2.1rem, 5vw, 3.15rem);
    font-weight: 500; line-height: 1.15; letter-spacing: -.015em;
    max-width: 46rem;
  }
  .hero h1 em { font-style: italic; color: var(--accent-ink); }
  .hero .sub { max-width: 40rem; color: var(--ink-2); font-size: 1.08rem; margin-top: 1.1rem; }
  .hero .actions { margin-top: 1.8rem; display: flex; gap: .9rem; flex-wrap: wrap; }
  .btn {
    display: inline-block; text-decoration: none; font-size: .92rem; font-weight: 600;
    padding: .6rem 1.1rem; border-radius: 4px; border: 1px solid var(--accent);
  }
  .btn.primary { background: var(--accent); color: #FFF; }
  :root[data-theme="dark"] .btn.primary, .dark .btn.primary { color: #16191D; }
  @media (prefers-color-scheme: dark) { .btn.primary { color: #16191D; } }
  :root[data-theme="light"] .btn.primary { color: #FFF; }
  .btn.primary:hover { filter: brightness(1.07); }
  .btn.ghost { color: var(--accent-ink); background: transparent; }
  .btn.ghost:hover { background: var(--chip-bg); }

  /* ---------- proof strip ---------- */
  .proof { padding: 1.6rem 0 2.6rem; border-top: 1px solid var(--line); }
  .proof .note { font-size: .85rem; color: var(--ink-2); margin: 0 0 1rem; }
  .marks { display: flex; flex-wrap: wrap; gap: .6rem 1.9rem; align-items: center; }
  .mark {
    font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    font-size: 1.02rem; color: var(--ink-2); white-space: nowrap;
  }
  .mark.ph {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
    border: 1px dashed var(--line); border-radius: 3px; padding: .35rem .6rem;
  }

  /* ---------- cards ---------- */
  .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); gap: 1.1rem; }
  .card {
    background: var(--card); border: 1px solid var(--line); border-radius: 6px;
    padding: 1.25rem 1.25rem 1.1rem; display: flex; flex-direction: column; gap: .55rem;
  }
  .card h3 {
    font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    font-size: 1.18rem; font-weight: 500; line-height: 1.3;
  }
  .card h3 a { color: var(--ink); text-decoration: none; }
  .card h3 a:hover { color: var(--accent-ink); }
  .card p { margin: 0; font-size: .92rem; color: var(--ink-2); }
  .meta {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-variant-numeric: tabular-nums;
    font-size: .72rem; color: var(--ink-2); letter-spacing: .05em;
    display: flex; gap: .75rem; align-items: center;
  }
  .chip {
    display: inline-block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    background: var(--chip-bg); color: var(--accent-ink);
    border-radius: 3px; padding: .18rem .5rem;
  }

  /* ---------- resources ---------- */
  .res-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); gap: 1.1rem; }
  .res-group h3 {
    font-size: .78rem; letter-spacing: .13em; text-transform: uppercase;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    color: var(--ink-2); margin-bottom: .8rem; font-weight: 600;
  }
  .res-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
  .res-group li a { text-decoration: none; font-weight: 600; color: var(--ink); font-size: .97rem; }
  .res-group li a:hover { color: var(--accent-ink); }
  .res-group li span { display: block; font-size: .84rem; color: var(--ink-2); font-weight: 400; }

  /* ---------- media strip ---------- */
  .tri { display: grid; grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); gap: 1.1rem; }

  /* ---------- contact band ---------- */
  .band {
    background: var(--card); border: 1px solid var(--line); border-radius: 8px;
    padding: 2.2rem; display: flex; align-items: center; justify-content: space-between;
    gap: 1.5rem; flex-wrap: wrap;
  }
  .band h2 { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-weight: 500; }
  .band p { margin: .3rem 0 0; color: var(--ink-2); max-width: 30rem; }

  /* ---------- writing index ---------- */
  .filters { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1.6rem 0 2rem; }
  .filter {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: .74rem; letter-spacing: .07em; text-transform: uppercase;
    background: var(--chip-bg); color: var(--ink-2);
    border: 1px solid transparent; border-radius: 999px;
    padding: .38rem .85rem; cursor: pointer;
  }
  .filter:hover { color: var(--ink); }
  .filter[aria-pressed="true"] { background: var(--accent); color: #FFF; }
  @media (prefers-color-scheme: dark) { .filter[aria-pressed="true"] { color: #16191D; } }
  :root[data-theme="dark"] .filter[aria-pressed="true"] { color: #16191D; }
  :root[data-theme="light"] .filter[aria-pressed="true"] { color: #FFF; }

  .post-list { list-style: none; margin: 0; padding: 0; }
  .post-list li {
    display: grid; grid-template-columns: 6.2rem 1fr auto; gap: 1.1rem;
    padding: .95rem 0; border-bottom: 1px solid var(--line); align-items: baseline;
  }
  .post-list .d {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-variant-numeric: tabular-nums; font-size: .78rem; color: var(--ink-2);
  }
  .post-list .t a {
    font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    font-size: 1.08rem; color: var(--ink); text-decoration: none;
  }
  .post-list .t a:hover { color: var(--accent-ink); }
  .post-list li.hide { display: none; }
  @media (max-width: 560px) {
    .post-list li { grid-template-columns: 1fr; gap: .2rem; }
  }

  /* ---------- full resource guides ---------- */
  .res-sub {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
    color: var(--ink-2); margin: 1.6rem 0 .6rem; font-weight: 600;
  }
  .res-list { list-style: none; margin: .4rem 0 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: .7rem 1.6rem; }
  .res-list li a, .res-list li strong { font-weight: 600; color: var(--ink); text-decoration: none; font-size: .95rem;
    transition: color .15s ease; }
  /* Hovering ANYWHERE on an entry highlights its link (not just the exact
     link text) — the row is the perceived hover target. */
  .res-list li a:hover, .res-list li:hover a { color: var(--accent-ink); text-decoration: underline;
    text-decoration-thickness: 1px; text-underline-offset: 3px; }
  .res-list li span { display: block; font-size: .83rem; color: var(--ink-2); }
  section.guide.hide { display: none; }
  section.guide { scroll-margin-top: 5rem; } /* anchor landings clear the sticky header */

  /* ---------- resource entry anatomy ---------- */
  .res-list li { display: flex; gap: .6rem; align-items: flex-start; }
  .fav {
    flex: none; width: 1.35rem; height: 1.35rem; border-radius: 4px; margin-top: .15rem;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: .68rem; font-weight: 700;
    background: hsl(var(--h) 45% 90%); color: hsl(var(--h) 55% 32%);
  }
  @media (prefers-color-scheme: dark) { .fav { background: hsl(var(--h) 35% 24%); color: hsl(var(--h) 60% 75%); } }
  :root[data-theme="dark"] .fav { background: hsl(var(--h) 35% 24%); color: hsl(var(--h) 60% 75%); }
  :root[data-theme="light"] .fav { background: hsl(var(--h) 45% 90%); color: hsl(var(--h) 55% 32%); }
  .res-list li.subnote { padding-left: 2rem; }
  .res-list li.subnote, .res-list li.subnote div { font-size: .84rem; color: var(--ink-2); font-weight: 400; }
  .mono-sub { display:block; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: .74rem; color: var(--ink-2); }
  em.draft { font-style: normal; font-size: .72rem; color: var(--accent-ink); opacity: .75; }
  .cluster { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; margin: .5rem 0; }
  .pill { display: inline-block; font-size: .8rem; text-decoration: none; padding: .28rem .7rem;
    border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--card); }
  .pill:hover { border-color: var(--accent); color: var(--accent-ink); }
  .maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: .9rem; margin-top: .6rem; }
  .mapcard { display: flex; flex-direction: column; gap: .35rem; text-decoration: none;
    background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .7rem; }
  .mapcard:hover { border-color: var(--accent); }
  .mapcard .thumb { width: 100%; height: auto; border-radius: 5px; display: block; }
  .mapcard strong { color: var(--ink); font-size: .92rem; }
  .mapcard span { font-size: .8rem; color: var(--ink-2); }

  .favimg { background: var(--chip-bg); padding: 2px; object-fit: contain; width: 1.35rem; height: 1.35rem; }
  .pillfav { width: .9rem; height: .9rem; border-radius: 3px; vertical-align: -2px; margin-right: .4rem;
    background: var(--chip-bg); }
  .mapcard strong { display: flex; align-items: center; gap: .1rem; }

  .realthumb { aspect-ratio: 16 / 10; object-fit: cover; background: #0E1420; }

  /* ---------- portraits ---------- */
  .hero-split { display: flex; gap: 3rem; align-items: center; justify-content: space-between; }
  .portrait { width: min(17rem, 38vw); border-radius: 10px; border: 1px solid var(--line); display: block; }
  .about-portrait { float: right; width: min(13rem, 40vw); margin: 0 0 1rem 1.5rem; }
  @media (max-width: 700px) { .hero-split { flex-direction: column-reverse; align-items: flex-start; } .portrait { width: 55vw; } }

  .rowfav { width: .95rem; height: .95rem; font-size: .55rem; border-radius: 3px; margin: 0 .4rem 0 0;
    display: inline-flex; vertical-align: -2px; }
  .post-list .t .pillfav { width: 1.2rem; height: 1.2rem; vertical-align: -4px; margin-right: .45rem; }
  .rowlogo-wide { height: 1.05rem; width: auto; max-width: 5.5rem; vertical-align: -3px; margin-right: .45rem; background: #fff; border-radius: 2px; padding: 1px 3px; }
  .rowfav { width: 1.2rem; height: 1.2rem; font-size: .62rem; }

  footer.site {
    border-top: 1px solid var(--line); margin-top: 3rem;
    padding: 2rem 0 2.6rem; color: var(--ink-2); font-size: .85rem;
  }
  .foot-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
  footer.site a { color: var(--ink-2); }
  footer.site a:hover { color: var(--accent-ink); }

  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
    main { animation: fade .25s ease; }
    @keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
  }

  /* Email-auth / community-chat cluster explainers on the resources hub */
  .auth-explain { margin: 1rem 0 .35rem; font-size: .88rem; color: var(--ink-2); max-width: 46rem; }
  .auth-explain strong { color: var(--ink); }

  /* "Back to top" link closing each guide section */
  .toplink { margin: 1.6rem 0 0; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; }
  .toplink a { color: var(--ink-2); text-decoration: none; }
  .toplink a:hover { color: var(--accent-ink); }

/* ---------- site chrome additions ---------- */
.skip { position: absolute; left: -9999px; top: 0; background: var(--accent); color: #fff; padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* Appearance control: collapsing glyph dropdown (gsysd.com pattern) —
   collapsed shows only the active choice; expands on hover / focus / tap. */
.theme-control { position: relative; display: inline-block; width: 40px; height: 40px;
  margin-left: .35rem; align-self: center; }
.theme-menu { position: absolute; top: 0; right: 0; display: flex; flex-direction: column;
  border-radius: 8px; }
.theme-btn { min-width: 40px; min-height: 40px; font-size: .95rem; line-height: 1;
  color: var(--ink-2); background: transparent; border: none; border-radius: 6px;
  cursor: pointer; display: none; }
.theme-btn[aria-pressed="true"] { display: inline-flex; align-items: center;
  justify-content: center; color: var(--accent-ink); }
.theme-control:hover .theme-menu,
.theme-control:focus-within .theme-menu,
.theme-control.open .theme-menu {
  background: var(--paper); border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); z-index: 20;
}
.theme-control:hover .theme-btn,
.theme-control:focus-within .theme-btn,
.theme-control.open .theme-btn {
  display: inline-flex; align-items: center; justify-content: center;
}
.theme-btn:hover { color: var(--ink); background: var(--chip-bg); }
.hp { position: absolute; left: -9999px; }
.status-ok { color: var(--accent-ink); font-size: .9rem; }
.status-error { color: #B03A2E; font-size: .9rem; font-weight: 600; }
.cred-name { font-weight: 600; color: var(--ink); font-size: .97rem; }
.post-body img { max-width: 100%; height: auto; }
.post-body pre { overflow-x: auto; background: var(--chip-bg); padding: 1rem; border-radius: 6px; }
.post-body blockquote { border-left: 3px solid var(--accent); margin-left: 0; padding-left: 1.2rem; color: var(--ink-2); }
.page-body table, .post-body table { display: block; overflow-x: auto; }

/* ---------- share bar + post hero ---------- */
.share-bar { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center;
  margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.share-label { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin-right: .3rem; }
.share-bar .pill { cursor: pointer; font: inherit; font-size: .8rem; }
button.pill { background: var(--card); }
.post-hero { width: 100%; height: auto; border-radius: 8px; margin-top: 1.4rem; }

/* ---------- organization logo conveyor ---------- */
.logo-conveyor { display: flex; overflow: hidden; gap: 1.1rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.logo-track { display: flex; gap: 1.1rem; align-items: center; flex-shrink: 0;
  min-width: 100%; justify-content: space-around;
  animation: logo-scroll 150s linear infinite; }
.logo-conveyor:hover .logo-track { animation-play-state: paused; }
.logo-chip { display: inline-flex; align-items: center; justify-content: center;
  background: var(--logo-bg, #F2EFE8); border: 1px solid var(--line); border-radius: 8px;
  padding: .55rem .9rem; flex-shrink: 0; }
.logo-chip img { display: block; max-width: 13rem; object-fit: contain;
  filter: grayscale(1) opacity(.75); transition: filter .25s ease; }
/* .tint is the JS pointer-event fallback: :hover hit-testing is unreliable
   inside a continuously transform-animated track (Safari), so logos.js also
   toggles the class on pointerover/pointerout. */
.logo-chip:hover img, .logo-chip.tint img { filter: none; }
@keyframes logo-scroll { from { transform: translateX(0); } to { transform: translateX(calc(-100% - 1.1rem)); } }
@media (prefers-reduced-motion: reduce) {
  .logo-track { animation: none; flex-wrap: wrap; min-width: 0; }
  .logo-track[aria-hidden="true"] { display: none; }
  .logo-conveyor { -webkit-mask-image: none; mask-image: none; }
}
