/* #1090 SUNDERED SPHERES shared site header (owner 2026-11-30: 'Landing and Membership are one site and must share the
   same header' / 'The logo ... needs to be a lot bigger' / 'Im still not seeing the larger logo ? On the top ?').
   ONE component for index.html and spheres.html (site-header.js builds it):
     1. the masthead: the big live shard emblem + stacked two-tone wordmark at the top of the hero on first load;
     2. the pinned bar: same states on both pages (solid past 16 px, small bar logo takes over past 175 px, never two logos at once).
   Phone (<= 699 px): centred at the top of the hero.  Desktop: top-left, in line with the page's text column. */

:root {
  --ss-mast-orb: clamp(112px, 17.4vh, 168px);
  --ss-mast-word: clamp(24px, 3.5vh, 32px);
  --ss-mast-top: 10px;
  --ss-mast-left: 100px;                                   /* site-header.js sets it to the bar logo's left edge */
  --ss-mast-h: calc(var(--ss-mast-top) + var(--ss-mast-orb) + 8px + 2.2 * var(--ss-mast-word));
}

.ss-masthead {
  position: absolute;
  z-index: 4;
  top: var(--ss-mast-top);
  left: var(--ss-mast-left);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  pointer-events: none;
  opacity: 1;
  visibility: visible;
  transition: opacity .28s ease, visibility .28s ease;
}
/* soft dark seat so the crest and name read on any hero picture */
.ss-masthead::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -18px -46px -22px;
  background: radial-gradient(closest-side, rgba(12, 8, 4, .66) 0%, rgba(12, 8, 4, .40) 56%, rgba(12, 8, 4, 0) 100%);
  pointer-events: none;
}
html:root:root:root:root:root body #ss-masthead.ss-masthead .ss-mast-emblem {
  --size: var(--ss-mast-orb);
  position: relative !important;
  flex: none !important;
  width: var(--ss-mast-orb) !important;
  height: var(--ss-mast-orb) !important;
  margin: 0 !important;
  pointer-events: auto;
  filter: drop-shadow(0 8px 22px rgba(10, 6, 2, .72)) drop-shadow(0 0 26px rgba(240, 200, 110, .20));
}
html:root:root:root:root:root body #ss-masthead.ss-masthead .ss-mast-emblem > img:not(.emblem-fallback) {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  border-radius: 50%;
  transition: opacity .6s ease;
}
/* the recorded loop (no WebGPU) is a 660 px frame around the 512 px crest, so it is drawn at 129 % and centred */
html:root:root:root:root:root body #ss-masthead.ss-masthead .ss-mast-emblem > img.emblem-fallback {
  position: absolute !important;
  inset: auto !important;
  left: 50% !important;
  top: 50% !important;
  width: 129% !important;
  height: 129% !important;
  max-width: none !important;
  margin: 0 !important;
  transform: translate(-50%, -50%) !important;
  object-fit: contain !important;
  pointer-events: none;
}
html:root:root:root:root:root body #ss-masthead.ss-masthead .ss-mast-emblem.live > img:not(.emblem-fallback) { opacity: 0; }
html:root:root:root:root:root body #ss-masthead.ss-masthead .ss-mast-emblem > .emblem-fallback { opacity: 1 !important; visibility: visible !important; }
html:root:root:root:root:root body #ss-masthead.ss-masthead .ss-mast-word {
  margin: 0 !important;
  padding: 0 !important;
  font: 700 var(--ss-mast-word)/1.1 "Soul Cinzel", "Cinzel", Georgia, serif !important;
  letter-spacing: .2em !important;
  text-indent: .2em;                                      /* balances the trailing letter-space so the lines sit centred */
  text-transform: uppercase !important;
  text-align: center !important;
  white-space: nowrap !important;
  color: #f6ecd6 !important;
  background: none !important;
  text-shadow: 0 2px 14px #000, 0 0 4px #000, 0 0 2px #000 !important;
}
html:root:root:root:root:root body #ss-masthead.ss-masthead .ss-mast-word span {
  display: block !important;
  color: #ecc874 !important;
  font-size: inherit !important;
}

/* one logo at a time: masthead at the top of the page, the bar's small logo once the masthead has scrolled away */
body.ss-mast-gone .ss-masthead { opacity: 0; visibility: hidden; }
html:root:root:root:root:root body.ss-has-masthead #hero .hero-logo { display: none !important; }   /* the Landing's older hero logo slot; its emblem lives in the masthead now */
html:root:root:root:root:root body.ss-has-masthead header#bar.bar a.bar-brand { transition: opacity .28s ease, visibility .28s ease !important; }

@media (min-width: 700px) {
  /* while the masthead is on screen the bar stays clear on both pages, so the crest scrolls away whole instead of being cut by a dark strip;
     past 175 px the bar turns solid and its small logo takes over */
  html:root:root:root:root:root body.ss-has-masthead:not(.ss-mast-gone) header#bar.bar:not(.open) {
    background: linear-gradient(180deg, rgba(10, 8, 5, .72) 0%, rgba(10, 8, 5, .24) 64%, rgba(10, 8, 5, 0) 100%) no-repeat !important;
    background-clip: padding-box !important;                /* no dark hairline where the gradient would repeat under the 1 px border */
    box-shadow: none !important;
    border-bottom: 1px solid transparent !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  html:root:root:root:root:root body.ss-has-masthead:not(.ss-mast-gone) header#bar.bar:not(.open) a.bar-brand {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  /* Membership: the hero text starts under the masthead */
  body.ss-has-masthead .s-hero {
    min-height: max(820px, calc(var(--ss-mast-h) + 640px));
    padding-top: calc(var(--ss-mast-h) + 28px);
  }
}

/* tablet widths: the nav starts further left, so the masthead sits just under the bar and a little smaller */
@media (min-width: 700px) and (max-width: 1099px) {
  :root { --ss-mast-orb: 104px; --ss-mast-word: 24px; --ss-mast-top: 70px; }
}

@media (max-width: 699px) {
  :root {
    --ss-mast-orb: 96px;
    --ss-mast-word: 22px;
    --ss-mast-top: max(18px, env(safe-area-inset-top, 18px));
  }
  .ss-masthead { left: 0; right: 0; gap: 8px; }
  html:root:root:root:root:root body.ss-has-masthead:not(.ss-mast-gone) header#bar.bar:not(.open) a.bar-brand {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    display: none !important;
  }
  /* top of the page: the bar shows only the menu button, so nothing sits on the crest */
  html:root:root:root:root:root body.ss-has-masthead:not(.ss-mast-gone) header#bar.bar:not(.open) {
    background: none !important;
    box-shadow: none !important;
    border-bottom-color: transparent !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    justify-content: flex-end !important;
  }
  html:root:root:root:root:root body.ss-has-masthead:not(.ss-mast-gone) header#bar.bar:not(.open) .bar-end > :not(.menu-btn):not(.ss-theme-toggle) {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ss-masthead, html:root:root:root:root:root body.ss-has-masthead header#bar.bar a.bar-brand { transition: none !important; }
}
