/* The shared top bar and footer, used by the new home page and by every other page (the build swaps them into the
   old pages). One file, so they cannot drift apart. Selectors start with header.bar / footer.site so they win over
   the old pages' own styles.css. Uses the colour tokens the pages already define (--band, --band-fg, ...). */
:root { --progress: 0; --cb-band: var(--band, #0c1424); --cb-line: var(--band-line, #2b3854); --cb-fg: var(--band-fg, #f4f0e8); --cb-muted: var(--band-muted, #aab3c5); --cb-thread: var(--band-thread, #5cc8bb); }

header.bar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--cb-band) 95%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); color: var(--cb-fg); border-bottom: 1px solid color-mix(in srgb, var(--cb-line) 70%, transparent); }
header.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; max-width: 80rem; margin: 0 auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }
header.bar .progress { position: absolute; left: 0; bottom: -1px; height: 3px; width: 100%; transform-origin: left; transform: scaleX(var(--progress)); background: linear-gradient(90deg, var(--cb-thread), #8be3d8); pointer-events: none; }
header.bar .mark { display: flex; align-items: center; gap: .55rem; font: 700 1.2rem/1 var(--display); letter-spacing: -.01em; color: var(--cb-fg); text-decoration: none; }
header.bar .mark svg { width: 1.6rem; height: 1.6rem; color: var(--cb-thread); }
header.bar nav { display: flex; align-items: center; gap: 1.1rem; font-size: .95rem; }
header.bar .links { display: flex; gap: 1.1rem; }
header.bar .links a { position: relative; color: var(--cb-muted); text-decoration: none; }
header.bar .links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--cb-thread); transform: scaleX(0); transition: transform .25s; }
header.bar .links a:hover, header.bar .links a[aria-current="page"] { color: var(--cb-fg); }
header.bar .links a:hover::after, header.bar .links a[aria-current="page"]::after { transform: scaleX(1); }
header.bar .btn { display: inline-flex; align-items: center; padding: .55rem 1rem; font: 600 .9rem/1 var(--display); border-radius: 99px; border: 1.5px solid var(--cb-line); background: transparent; color: var(--cb-fg); text-decoration: none; order: 0; transition: transform .2s, box-shadow .2s; }
header.bar .btn:hover { transform: translateY(-2px); }
header.bar .btn.primary { background: var(--cb-thread); border-color: var(--cb-thread); color: #06201d; order: 2; }
header.bar .nav-state { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
header.bar .menu { display: none; order: 3; font: 600 .9rem/1 var(--display); border: 1.5px solid var(--cb-line); background: transparent; color: var(--cb-fg); border-radius: 99px; padding: .55rem .95rem; cursor: pointer; }
header.bar .nav-state:focus-visible ~ .menu { outline: 2px solid var(--cb-thread); outline-offset: 3px; }
@media (max-width: 76rem) {
  header.bar .menu { display: inline-flex; }
  header.bar .links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--cb-band); border-bottom: 1px solid var(--cb-line); padding: .25rem clamp(1rem, 4vw, 2.5rem) .75rem; box-shadow: none; }
  header.bar .nav-state:checked ~ .links { display: flex; }
  header.bar .links a { padding: .8rem 0; border-bottom: 1px solid var(--cb-line); font-size: 1.05rem; color: var(--cb-fg); }
  header.bar .links a::after { display: none; }
}
@media (max-width: 34rem) { header.bar .btn:not(.primary) { display: none; } header.bar nav { gap: .6rem; } }

footer.site { display: grid; gap: .8rem; padding-block: 2.5rem 3rem; border-top: 1px solid var(--line, #ddd8ce); color: var(--muted, #5a6273); font-size: .92rem; position: relative; }
footer.site::before { content: ""; position: absolute; left: 0; top: -1px; width: 6rem; height: 2px; background: linear-gradient(90deg, var(--thread, #0b6e66), transparent); }
footer.site .foot-blurb { margin: 0; max-width: 60ch; color: var(--ink, #111a2e); }
footer.site .foot-blurb b { font-weight: 600; }
footer.site .foot-note { margin: 0; max-width: 60ch; font-size: .8rem; color: var(--muted, #5a6273); }
footer.site nav { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
footer.site a { color: var(--muted, #5a6273); text-decoration: none; }
footer.site a:hover { color: var(--thread, #0b6e66); text-decoration: underline; }

/* section pins: a second row of the top bar, same background, so nothing scrolls behind a floating pill. The page's
   progress line moves down to the bottom of this row. */
.pins-bar { position: sticky; top: 4rem; z-index: 19; display: flex; justify-content: center; padding: .35rem 1rem; background: color-mix(in srgb, var(--cb-band) 95%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--cb-line) 70%, transparent); color: var(--cb-fg); }
.pins-bar::after { content: ""; position: absolute; left: 0; bottom: -1px; height: 3px; width: 100%; transform-origin: left; transform: scaleX(var(--progress)); background: linear-gradient(90deg, var(--cb-thread), #8be3d8); pointer-events: none; }
header.bar:has(+ .pins-bar) { border-bottom: 0; }
header.bar:has(+ .pins-bar) .progress { display: none; }
.pins { display: flex; gap: .15rem; max-width: 100%; }
.pins a { position: relative; display: flex; align-items: center; gap: .45rem; padding: .5rem .85rem; border-radius: 99px; color: var(--band-muted); text-decoration: none; font: 600 .85rem/1 var(--display); white-space: nowrap; transition: color .2s, background .2s; }
.pins a::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; opacity: .6; transition: .25s; }
.pins a:hover { color: var(--band-fg); }
.pins .pins-parent { padding-right: .9rem; margin-right: .25rem; border-radius: 99px 0 0 99px; border-right: 1px solid var(--band-line); color: var(--band-fg); font: 500 .72rem/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.pins .pins-parent::before { display: none; } .pins .pins-parent:hover { color: var(--band-thread); }
.pins a.on { background: var(--band-thread); color: #06201d; } .pins a.on::before { opacity: 1; }
@media (max-width: 52rem) { .pins a { padding: .65rem .7rem; } .pins .pins-parent { padding-right: .7rem; } .pins a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } .pins a.on span { position: static; width: auto; height: auto; clip-path: none; } .pins a.on::before { display: none; } }
@media (max-width: 66rem) { .pins.many a { padding: .65rem .7rem; } .pins.many .pins-parent { padding-right: .7rem; } .pins.many a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } .pins.many a.on span { position: static; width: auto; height: auto; clip-path: none; } .pins.many a.on::before { display: none; } }

@media (max-width: 40rem) { .pins.many a { padding: .65rem .42rem; } .pins.many .pins-parent { padding-right: .5rem; font-size: .62rem; letter-spacing: .06em; } .pins.many a.on { padding-inline: .7rem; } }
@media (prefers-reduced-motion: reduce) { header.bar * { transition: none !important; } }
