/* ============================================================================
   BrandLogo — the ONE Lunacorn Mancho lockup.

   The master is used as a single complete image asset, never reassembled from
   text: it carries the unicorn, the LUNACORN lettering, the electric-blue A
   symbol, MANCHO and the tagline in one 1105x312 file (aspect 3.541667).

   The master's navy background is BAKED IN — every pixel is opaque #010310 —
   so any surface it sits on has to be that same navy or the logo reads as a
   dark rectangle pasted on the page. That is why the headers below set
   --brand-ground rather than inheriting the page colour, and why the light
   home theme still gets a dark header band.

   The dashboard topbar and the Guide use lunacorn-mancho-lockup.png instead
   (1641x412, transparent), which sits fine on any ground; the baked-in
   constraint above still applies wherever the opaque master remains (login,
   home), so --brand-ground stays.
   Palette values are from the supplied logo_palette.json.
   ========================================================================== */
:root {
  --lunacorn-bg:           #020412;
  --lunacorn-bg-secondary: #05091a;
  --lunacorn-silver:       #e0e3e5;
  --lunacorn-silver-mid:   #999ea8;
  --lunacorn-blue-light:   #94c1f1;
  --lunacorn-blue:         #7193e2;
  --lunacorn-blue-electric:#4962d9;
  --lunacorn-blue-shadow:  #2f3d6e;
  /* Measured off the master's own corners: every edge pixel is #010310.
     The package suggests #020412 or a gradient, but a gradient leaves a
     visible seam at the top of the header where the surround is lighter
     than the asset. A flat match makes the edge disappear. */
  --brand-edge:   #010310;
  --brand-ground: #010310;
}

.brand-logo {
  display: block;
  line-height: 0;
  flex: none;
  text-decoration: none;
}
.brand-logo img {
  display: block;
  width: clamp(330px, 42vw, 720px);
  max-width: 100%;
  height: auto;          /* never stretch: the aspect ratio is fixed at 3.5417 */
  object-fit: contain;
  user-select: none;
}
@media (max-width: 640px) {
  .brand-logo img { width: min(94vw, 540px); }
}

/* size modifiers — the whole lockup always stays visible, never cropped */
.brand-logo--sm img { width: clamp(280px, 30vw, 430px); }
.brand-logo--lg img { width: clamp(360px, 48vw, 760px); }

/* Any surface carrying the logo takes the master's own navy so the asset
   blends instead of showing its edges. */
.brand-ground { background: var(--brand-ground); }

.timezone-select {
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--line, #30466a);
  border-radius: 6px;
  background: var(--input-bg, #111a2b);
  color: var(--text, #e0e3e5);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.timezone-select:focus-visible { outline: 2px solid var(--accent, #94c1f1); outline-offset: 2px; }

/* ---- the signed-in brand bar ----------------------------------------------
   Every signed-in page's header carries the same identity block: the USER's
   Lunacorn in the emblem position (a [data-avatar-img] slot that avatar.js
   paints, linking to the picker) beside the wordmark cropped at the moon,
   tagline under it — the split the dashboard topbar and the manuals use.
   Only the lockup's LAYOUT lives here. Each page paints its own header band
   navy in its own stylesheet, because the silver wordmark needs navy under it
   in every theme (the topbar rule), and the inks here are fixed, not theme
   tokens, for the same reason. */
.bb-avlink { display: block; line-height: 0; flex: none; border-radius: 50%; }
/* House sizes — 84px mascot, 250px wordmark, 9px tagline — identical to the
   dashboard topbar (style.css) and the manuals (.gh-*), so the lockup reads
   as ONE size across every page. */
.bb-av { display: block; width: 84px; height: 84px; object-fit: contain; user-select: none; }
.bb-avlink:hover .bb-av,
.bb-avlink:focus-visible .bb-av { filter: drop-shadow(0 0 6px #24a8de); }
.bb-word {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  text-decoration: none; flex: none;
}
/* height, not width — see the note in style.css: equal height keeps the three
   theme wordmarks one size despite LUNACORN's taller-aspect art. */
.bb-word img { display: block; height: 29px; width: auto; user-select: none; }
.bb-tag {
  font-size: 9px; line-height: 1; letter-spacing: .2em; white-space: nowrap;
  text-transform: uppercase; color: var(--topbar-tagline, #a7b4d6);
}
/* the page's own name, spoken in the guide header's voice */
.bb-page {
  margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 1.8px;
  text-transform: uppercase; color: var(--topbar-label, #94c1f1);
}
.bb-div {
  width: 1px; align-self: stretch; margin: 8px 0; flex: none;
  background: linear-gradient(180deg, transparent, rgba(148, 193, 241, .4) 20%,
                              rgba(148, 193, 241, .4) 80%, transparent);
}
@media (max-width: 720px) {
  .bb-av { width: 50px; height: 50px; }
  .bb-word img { height: 20px; width: auto; }
  .bb-tag, .bb-div { display: none; }
}

/* ---- one brand per theme: LUNACORN / SNOWCORN / SUNCORN ---------------------
   The wordmark is renamed per theme, over the pale-per-theme header
   (tokens.css). THREE tints, one per ground:
     - dark navy band  -> silver LUNACORN   (wm-luna / lunacorn-wordmark-letters.png)
     - white light band -> ice-blue SNOWCORN (wm-snow  / snowcorn-wordmark.png)
     - cream Eye-Comfort -> amber SUNCORN    (wm-sun-warm / suncorn-wordmark-warm.png)
   ALL THREE are letters-only and share one geometry (aspect ~8.59), so an
   equal width renders them at one letter-size. LUNACORN used to bake its moon
   into the image (lunacorn-wordmark-short.png, aspect 6.94), which made the
   whole picture taller than the letters-only pair and no scaling could match
   them; the moon is now cut off and rides beside the word as an ::after glyph
   (below), exactly like the day themes' snowflake/compass. SUNCORN's
   U·N·C·O·R·N were sliced from the LUNACORN artwork; SNOWCORN is the same
   family rendered to match. The swap is the wordmark ONLY — the emblem beside
   it is the signed-in user's own Lunacorn and never changes with the theme.
   Three states: bare = dark, prefers-color-scheme opts in, an explicit
   data-theme always wins. */
img.wm-luna { display: block; }
img.wm-snow, img.wm-sun-warm { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) img.wm-luna { display: none; }
  :root:not([data-theme="dark"]) img.wm-snow  { display: block; }
}
:root[data-theme="light"] img.wm-luna,
:root[data-theme="sepia"] img.wm-luna,
:root[data-theme="sepia"] img.wm-snow  { display: none; }
:root[data-theme="light"] img.wm-snow,
:root[data-theme="sepia"] img.wm-sun-warm { display: block; }
:root[data-theme="dark"]  img.wm-luna { display: block; }
:root[data-theme="dark"]  img.wm-snow,
:root[data-theme="dark"]  img.wm-sun-warm { display: none; }

/* ---- the wordmark glyph — rides just right of the wordmark ----------------
   Every theme now draws its own mark beside the letters-only wordmark: a
   silver MOON on the dark band (LUNACORN — the crescent+star cut from the old
   baked-in artwork, lunacorn-moon-glyph.png), a silver SNOWFLAKE on the light
   band (SNOWCORN), a gold COMPASS on Eye-Comfort (SUNCORN). The moon is the
   DEFAULT because dark is the default theme; the day rules swap the
   background-image. Snowflake/compass are base64 SVG (no /static route); the
   moon is a whitelisted PNG (BRAND_FILES), served like the wordmark it
   completes. All ride every header system at once (topbar .brand-wordmark,
   manuals .gh-brand, chrome pages .bb-word), the same three the wordmark swap
   above targets. The emblem to the LEFT stays the signed-in user's Lunacorn. */
.brand-wordmark, .gh-brand, .bb-word { position: relative; }
.brand-wordmark::after,
.gh-brand::after,
.bb-word::after {
  content: "";
  position: absolute;
  /* anchor to the WORDMARK image's right edge, not the container's: the
     tagline under it is wider, so left:100% would land the glyph past the
     divider. The image is centred and 250px wide, so its right edge is
     centre + 125px; +11px sets the gap. top:34% is the image's own vertical
     centre (image ~29px over a 5px gap over the ~9px tagline). */
  left: 50%; top: 34%;
  transform: translate(136px, -50%);
  width: 28px; height: 28px;
  background-position: center; background-size: contain; background-repeat: no-repeat;
  pointer-events: none;
  /* dark is the default theme, so the moon is the default glyph; the day
     rules below override the background-image on light/sepia. */
  display: block;
  background-image: url("/static/brand/lunacorn-moon-glyph.png");
}
/* SUNCORN compass — Eye-Comfort (sepia) */
:root[data-theme="sepia"] .brand-wordmark::after,
:root[data-theme="sepia"] .gh-brand::after,
:root[data-theme="sepia"] .bb-word::after {
  display: block;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj4KPGRlZnM+CjxsaW5lYXJHcmFkaWVudCBpZD0iZyIgeDE9IjAiIHkxPSIwIiB4Mj0iMSIgeTI9IjEiPgo8c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiNlY2Q1OTEiLz4KPHN0b3Agb2Zmc2V0PSIuNSIgc3RvcC1jb2xvcj0iI2M5OWEzYyIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiM5YTZjMWMiLz4KPC9saW5lYXJHcmFkaWVudD4KPGxpbmVhckdyYWRpZW50IGlkPSJkIiB4MT0iMCIgeTE9IjAiIHgyPSIxIiB5Mj0iMSI+CjxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2Q5Yjc2OCIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNhOTdkMjQiLz4KPC9saW5lYXJHcmFkaWVudD4KPC9kZWZzPgo8cGF0aCB0cmFuc2Zvcm09InJvdGF0ZSg0NSA1MCA1MCkiIGQ9Ik01MCAyMCBMNTUgNDUgTDgwIDUwIEw1NSA1NSBMNTAgODAgTDQ1IDU1IEwyMCA1MCBMNDUgNDUgWiIgZmlsbD0idXJsKCNkKSIgb3BhY2l0eT0iLjkiLz4KPHBhdGggZD0iTTUwIDMgTDU2LjUgNDMuNSBMOTcgNTAgTDU2LjUgNTYuNSBMNTAgOTcgTDQzLjUgNTYuNSBMMyA1MCBMNDMuNSA0My41IFoiIGZpbGw9InVybCgjZykiLz4KPGNpcmNsZSBjeD0iNTAiIGN5PSI1MCIgcj0iNy41IiBmaWxsPSIjOGY2NDE3Ii8+CjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIHI9IjQiIGZpbGw9IiNmMmUyYWQiLz4KPC9zdmc+Cg==");
}
/* SNOWCORN snowflake — light band */
:root[data-theme="light"] .brand-wordmark::after,
:root[data-theme="light"] .gh-brand::after,
:root[data-theme="light"] .bb-word::after {
  display: block;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9ImkiIHgxPSIwIiB5MT0iMCIgeDI9IjEiIHkyPSIxIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiNlOGYwZjgiLz48c3RvcCBvZmZzZXQ9Ii41IiBzdG9wLWNvbG9yPSIjOGZhYmM4Ii8+PHN0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ybCgjaSkiLz48L3N2Zz4=");
}
/* SNOWCORN snowflake — the DEFAULT light band (system light, no explicit
   theme). Without this the dark-default moon would show under a light OS
   theme; mirrors the wordmark swap's prefers-color-scheme branch. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="sepia"]) .brand-wordmark::after,
  :root:not([data-theme="dark"]):not([data-theme="sepia"]) .gh-brand::after,
  :root:not([data-theme="dark"]):not([data-theme="sepia"]) .bb-word::after {
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9ImkiIHgxPSIwIiB5MT0iMCIgeDI9IjEiIHkyPSIxIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiNlOGYwZjgiLz48c3RvcCBvZmZzZXQ9Ii41IiBzdG9wLWNvbG9yPSIjOGZhYmM4Ii8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjNTE2ZjkyIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PGcgc3Ryb2tlPSJ1cmwoI2kpIiBzdHJva2Utd2lkdGg9IjcuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBmaWxsPSJub25lIj48bGluZSB4MT0iNTAiIHkxPSI1MCIgeDI9IjUwLjAiIHkyPSI5NS4wIi8+PGxpbmUgeDE9IjUwLjAiIHkxPSI3NC44IiB4Mj0iMzcuNyIgeTI9IjgzLjQiLz48bGluZSB4MT0iNTAuMCIgeTE9Ijc0LjgiIHgyPSI2Mi4zIiB5Mj0iODMuNCIvPjxsaW5lIHgxPSI1MC4wIiB5MT0iODYuMCIgeDI9IjQxLjgiIHkyPSI5MS43Ii8+PGxpbmUgeDE9IjUwLjAiIHkxPSI4Ni4wIiB4Mj0iNTguMiIgeTI9IjkxLjciLz48bGluZSB4MT0iNTAiIH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QiIHkxPSIzNy42IiB4Mj0iNzIuNyIgeTI9IjIyLjciLz48bGluZSB4MT0iODEuMiIgeTE9IjMyLjAiIHgyPSI5MC4yIiB5Mj0iMzYuMiIvPjxsaW5lIHgxPSI4MS4yIiB5MT0iMzIuMCIgeDI9IjgyLjAiIHkyPSIyMi4wIi8+PGxpbmUgeDE9IjUwIiB5MT0iNTAiIHgyPSI4OS4wIiB5Mj0iNzIuNSIvPjxsaW5lIHgxPSI3MS40IiB5MT0iNjIuNCIgeDI9IjcyLjciIHkyPSI3Ny4zIi8+PGxpbmUgeDE9IjcxLjQiIHkxPSI2Mi40IiB4Mj0iODUuMCIgeTI9IjU2LjAiLz48bGluZSB4MT0iODEuMiIgeTE9IjY4LjAiIHgyPSI4Mi4wIiB5Mj0iNzguMCIvPjxsaW5lIHgxPSI4MS4yIiB5MT0iNjguMCIgeDI9IjkwLjIiIHkyPSI2My44Ii8+PC9nPjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIHI9IjYiIGZpbGw9InVybCgjaSkiLz48L3N2Zz4=");
  }
}

@media (max-width: 720px) {
  /* the phone tier hides the tagline and shrinks the lockup — no room for a
     glyph either, in ANY theme (the moon is now the dark default, so hide all
     three rather than only the day glyphs). The day rules above re-assert
     display:block under :root[data-theme=…], which outranks a bare
     .bb-word::after — a media query adds no weight — so the hide is repeated
     at that same specificity. Without it the moon hides on a phone but the
     snowflake and compass leak through, stamped over the page heading. */
  .brand-wordmark::after,
  .gh-brand::after,
  .bb-word::after,
  :root[data-theme] .brand-wordmark::after,
  :root[data-theme] .gh-brand::after,
  :root[data-theme] .bb-word::after { display: none; }
}
