/* ============================================================
   Shared chrome for standalone essay artifacts.

   Each essay keeps its own typesetting and its own ground — that
   is the point of the register. This sheet only unifies the
   masthead and footer that frame them, and it does so without
   assuming a palette: every colour derives from the page's own
   text colour, so the same rules sit correctly on kinari paper
   and on a steel-dark ground alike.

   Load AFTER the essay's own <style> block.
   ============================================================ */

.site-head {
  position: relative;
  z-index: 20;
  max-width: 940px;
  margin: 0 auto;
  padding: 1.6rem 2rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid;
  border-color: color-mix(in srgb, currentColor 18%, transparent);
  font-family: var(--mono, 'JetBrains Mono', 'IBM Plex Mono', monospace);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-head a { color: inherit; text-decoration: none; opacity: 0.55; transition: opacity .2s ease; }
.site-head a:hover, .site-head a:focus-visible { opacity: 1; }

.site-head .wordmark { opacity: 1; font-weight: 500; letter-spacing: 0.18em; }

.site-head .site-nav { display: flex; flex-wrap: wrap; gap: 1.5rem; border: 0; padding: 0; margin: 0; background: none; }

/* Neutralise the old pill treatment if a page's local CSS still targets it. */
.site-head .site-nav a {
  padding: 0 0 3px;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: none;
  font-size: inherit;
  letter-spacing: inherit;
}

/* Higher specificity than the pages' own active-pill rules, which paint the
   active item in a palette colour that may vanish on that page's ground. */
.site-head .site-nav a[aria-current="page"] {
  opacity: 1;
  color: inherit;
  background: none;
  border-bottom-color: currentColor;
}

.essay-foot {
  position: relative;
  z-index: 20;
  max-width: 940px;
  margin: 4rem auto 0;
  padding: 1.6rem 2rem 4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  border-top: 1px solid;
  border-color: color-mix(in srgb, currentColor 18%, transparent);
  font-family: var(--mono, 'JetBrains Mono', 'IBM Plex Mono', monospace);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.62;
}

.essay-foot p { margin: 0; }
.essay-foot a { color: inherit; text-decoration: none; }
.essay-foot a:hover { text-decoration: underline; text-underline-offset: 4px; }
.essay-foot nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }

@supports not (color: color-mix(in srgb, red 50%, transparent)) {
  .site-head, .essay-foot { border-color: rgba(128, 128, 128, 0.32); }
}

@media (max-width: 720px) {
  .site-head { flex-wrap: wrap; gap: 1rem; padding-left: 1.25rem; padding-right: 1.25rem; }
  .site-head .site-nav { gap: 1rem; }
  .essay-foot { padding-left: 1.25rem; padding-right: 1.25rem; }
}
