/* =====================================================
   Bramble site chrome — the one header and the one footer.
   =====================================================

   Every page links this file, and every page carries the same
   header and footer markup. Change the chrome here, once, and it
   changes everywhere. `scripts/check-chrome.py` fails the deploy if
   a page's markup drifts from the canonical block.

   Tokens are namespaced (--bc-*) and defined here with literal
   values rather than borrowed from each page's :root. The pages
   don't all define the same token set, and the chrome must render
   identically on the ones that don't. Fonts are the exception —
   they read the page's stack so the header matches its body text.

   Cached for a year under /assets/ (see _headers), so bump the ?v=
   on the <link> in every page when this file changes.
   ===================================================== */

:root {
  --bc-linen: #F5EFE5;
  --bc-charcoal: #2E2A24;
  --bc-bark: #5A5248;
  --bc-amber: #906234;          /* text-safe amber — clears AA on linen */
  --bc-gold: #C49A3C;
  --bc-gold-press: #B08A32;
  --bc-stone: rgba(196, 184, 168, 0.55);
  --bc-on-gold: #2E2A24;        /* gold needs dark text, never white */
  --bc-on-dark: #F5EFE5;
  --bc-sans: var(--font-sans, "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  --bc-serif: var(--font-serif, "Lora", Georgia, serif);
  --bc-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --bc-dur: 260ms;
}

/* The header is sticky on every page now, so in-page anchors
   (#faq-next, #foundation, #capture) must clear it when targeted. */
html {
  scroll-padding-top: 88px;
}

/* =====================================================
   Header
   ===================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(245, 239, 229, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--bc-dur) var(--bc-ease);
}

.site-header.scrolled {
  border-bottom-color: var(--bc-stone);
}

/* The chrome's own measure — deliberately independent of each page's
   .container, which is 1080 on the homepage and 720 on the articles.
   One frame around every page, whatever the content column does. */
.site-chrome {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-logo {
  display: flex;
  align-items: center;
  border: none;
  text-decoration: none;
  flex: 0 0 auto;
}

.site-logo:hover {
  border: none;
}

.site-logo-full {
  height: 32px;
  width: auto;
  display: block;
}

/* Under 720px the lockup and the three nav items can't share the bar,
   so the lockup gives way to the mark. That's what keeps this header
   free of a menu button. */
.site-logo-mark {
  height: 28px;
  width: 28px;
  display: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav-link {
  position: relative;
  font-family: var(--bc-sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--bc-bark);
  text-decoration: none;
  border: none;
  padding: 9px 0;
  white-space: nowrap;
  transition: color var(--bc-dur) var(--bc-ease);
}

.site-nav-link:hover {
  color: var(--bc-charcoal);
  border: none;
}

.site-nav-link[aria-current="page"] {
  color: var(--bc-charcoal);
}

.site-nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  background: var(--bc-amber);
}

/* One gold moment per screen. The CTA stays quiet over the hero and
   earns its gold once the page scrolls — the behaviour the homepage
   already had, now on every page. */
.site-cta {
  font-family: var(--bc-sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--bc-bark);
  background: transparent;
  text-decoration: none;
  border: none;
  padding: 9px 18px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color var(--bc-dur) var(--bc-ease),
              background var(--bc-dur) var(--bc-ease);
}

.site-cta:hover {
  color: var(--bc-charcoal);
  border: none;
}

.site-header.scrolled .site-cta {
  background: var(--bc-gold);
  color: var(--bc-on-gold);
  font-weight: 500;
}

.site-header.scrolled .site-cta:hover {
  background: var(--bc-gold-press);
  color: var(--bc-on-gold);
}

@media (max-width: 719px) {
  .site-chrome {
    height: 60px;
    padding: 0 20px;
  }
  .site-logo-full {
    display: none;
  }
  .site-logo-mark {
    display: block;
  }
  .site-nav {
    gap: 18px;
  }
  .site-cta {
    padding: 8px 14px;
  }
}

/* =====================================================
   Footer
   ===================================================== */

footer.site-footer {
  background: var(--bc-charcoal);
  color: var(--bc-on-dark);
  font-family: var(--bc-sans);
  font-size: 14px;
  font-weight: 400;
  padding: 0;
  border: none;
  position: relative;
  overflow: hidden;
}

/* Soft ambient gold, top-right */
footer.site-footer::before {
  content: "";
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(196, 154, 60, 0.10), transparent 70%);
  pointer-events: none;
}

/* The Trusted Circle — three intersecting origins, linen on charcoal. */
.site-footer-pattern {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.site-footer-inner {
  position: relative;
  z-index: 2;
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 24px 40px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.3fr 1.1fr;
  gap: 36px 32px;
  text-align: left;
}

.site-footer-brand {
  display: grid;
  gap: 12px;
  align-content: start;
}

.site-footer-brand a {
  border: none;
  display: block;
}

.site-footer-logo {
  height: 32px;
  width: auto;
  display: block;
}

.site-footer-tag {
  margin: 0;
  font-family: var(--bc-serif);
  font-style: italic;
  font-size: 16px;
  font-weight: 400;
  color: rgba(245, 239, 229, 0.82);
  max-width: 28ch;
}

.site-footer-meta {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(245, 239, 229, 0.72);
  max-width: 32ch;
}

.site-footer-col {
  display: grid;
  gap: 9px;
  align-content: start;
}

.site-footer-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 239, 229, 0.65);
  margin-bottom: 4px;
}

.site-footer-col a {
  font-size: 14px;
  color: rgba(245, 239, 229, 0.86);
  text-decoration: none;
  border: none;
  transition: color var(--bc-dur) var(--bc-ease);
}

.site-footer-col a:hover {
  color: var(--bc-on-dark);
  border: none;
}

.site-footer-col svg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 8px;
}

.site-footer-bottom {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 22px;
  border-top: 1px solid rgba(245, 239, 229, 0.16);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px 32px;
  font-size: 13px;
  color: rgba(245, 239, 229, 0.72);
}

.site-footer-bottom a {
  color: inherit;
  text-decoration: none;
  border: none;
  display: inline-block;
  padding: 10px 2px;
  margin: -10px -2px;
}

.site-footer-bottom a:hover {
  color: var(--bc-on-dark);
  border: none;
}

.site-footer-bottom .sep {
  opacity: 0.5;
  padding: 0 6px;
}

/* The one slot that differs between pages: the reflection's PATHOS
   disclaimer, the circles page's local-storage promise, the blockers
   article's no-affiliate line. Everything else is identical bytes. */
.site-footer-note {
  margin: 0;
  font-family: var(--bc-serif);
  font-style: italic;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(245, 239, 229, 0.62);
  max-width: 62ch;
}

@media (max-width: 900px) {
  .site-footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .site-footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .site-footer-inner {
    grid-template-columns: 1fr;
    padding: 44px 20px 32px;
    gap: 28px;
  }
  .site-footer-bottom {
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-nav-link,
  .site-cta,
  .site-footer-col a,
  .site-footer-bottom a {
    transition: none;
  }
}
