/* The transparent master contains safety padding. Paint the full source image;
   compact frames match the original lettering's proportions, without cover,
   filters, alpha thresholding, or clipping the fine metal serif/ring detail. */
img[src$="apotheosize-logo-transparent.png"],
img:is([src$="apotheosize-wordmark-vector.svg"],[src*="apotheosize-wordmark-display-"]) {
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  background: transparent !important;
  padding: 0 !important;
  border: 0;
  border-radius: 0;
  image-rendering: auto;
  -webkit-user-drag: none;
  user-select: none;
}

/* The hero already supplies a frame. Footer/drawer marks use the same tiny
   brand-wordmark-frame wrapper; their existing width rules remain responsible
   for responsive sizing. The whole padded PNG remains painted and intact. */
.home .logo-heading,
.brand-wordmark-frame {
  position: relative;
  aspect-ratio: 1635 / 210;
  overflow: visible;
  line-height: 0;
  filter: none !important;
  mix-blend-mode: normal !important;
  background: transparent !important;
}

.brand-wordmark-frame {
  display: block;
  flex-shrink: 0;
}

.home .logo-heading > .hero-logo,
.brand-wordmark-frame > img[src$="apotheosize-logo-transparent.png"] {
  display: block;
  position: absolute;
  inset: 50% auto auto 0;
  width: 100%;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  transform: translateY(-50%);
  pointer-events: none;
}

/* The header owns a stable hit area. Keep the full transparent master inside
   it instead of translating a free-height image above the top frame guide. */
body > header {
  height: auto;
  min-height: 90px;
  padding-block: 14px;
  column-gap: 16px;
  flex-wrap: nowrap;
  align-items: center;
  overflow: visible;
}

body > header > #workspace-nav {
  position: relative;
  flex: 0 0 auto;
  align-self: center;
  width: 170px;
  height: 60px;
  margin: 0;
  overflow: visible;
}

#workspace-nav > .brand-word {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  transform: none;
  object-fit: contain !important;
  object-position: center !important;
  pointer-events: none;
}

/* Entering the workspace keeps its dragon in the same corner through every
   workspace view, including an empty chat, Imagine and the project gallery. */
body.workspace-entered > header > #workspace-nav {
  position: fixed;
  left: 34px;
  top: 28px;
  width: 60px;
  height: 60px;
  z-index: 12;
}
body.workspace-entered #workspace-nav .brand-word { display: none; }
body.workspace-entered #workspace-nav .brand-dragon {
  display: block;
  width: 48px;
  height: 48px;
  opacity: 1;
  animation: none;
  transition: none;
}
@media (max-width: 700px) {
  body.workspace-entered > header > #workspace-nav {
    left: 27px;
    top: 22px;
    width: 46px;
    height: 46px;
  }
  body.workspace-entered #workspace-nav .brand-dragon { width: 36px; height: 36px; }
}

/* A drawer logo needs room for the master image's transparent padding as
   well as a fixed close-button column, especially in narrow windows. */
#navigation .drawer-header {
  min-width: 0;
  min-height: 60px;
  gap: 12px;
  align-items: center;
}

#navigation .navigation-logo.brand-wordmark-frame {
  flex: 0 1 200px;
  width: 200px;
  min-width: 0;
  max-width: calc(100% - 56px);
  aspect-ratio: 2172 / 724;
}

#navigation .navigation-logo > img[src$="apotheosize-logo-transparent.png"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  transform: none;
}

#close-navigation {
  flex: 0 0 44px;
  width: 44px;
  min-height: 44px;
}

@media (max-width: 700px) {
  body > header {
    column-gap: 12px;
  }
  body > header > #workspace-nav {
    width: 135px;
    height: 46px;
  }
}

/* Preserve the existing one-time wordmark-to-dragon switch. */
body.brand-answer .brand-loop > .brand-word {
  display: none;
}

/* If a caller has not yet adopted a compact wrapper, still preserve the whole
   master; its normal intrinsic height is preferable to cropped lettering. */
img.navigation-logo[src$="apotheosize-logo-transparent.png"],
img.landing-footer-logo[src$="apotheosize-logo-transparent.png"],
img.navigation-logo:is([src$="apotheosize-wordmark-vector.svg"],[src*="apotheosize-wordmark-display-"]),
img.landing-footer-logo:is([src$="apotheosize-wordmark-vector.svg"],[src*="apotheosize-wordmark-display-"]) {
  height: auto;
  max-height: none;
}

/* The path-only wordmark and its lossless display renders have tight bounds.
   Their full artwork fits the frame without the padded master's offset. */
.home .logo-heading:has(> img:is([src$="apotheosize-wordmark-vector.svg"],[src*="apotheosize-wordmark-display-"])),
.brand-wordmark-frame:has(> img:is([src$="apotheosize-wordmark-vector.svg"],[src*="apotheosize-wordmark-display-"])),
#navigation .navigation-logo.brand-wordmark-frame:has(> img:is([src$="apotheosize-wordmark-vector.svg"],[src*="apotheosize-wordmark-display-"])) {
  aspect-ratio: 2151 / 278;
}

.home .logo-heading > .hero-logo:is([src$="apotheosize-wordmark-vector.svg"],[src*="apotheosize-wordmark-display-"]),
.brand-wordmark-frame > img:is([src$="apotheosize-wordmark-vector.svg"],[src*="apotheosize-wordmark-display-"]) {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  transform: none;
  pointer-events: none;
}

@media (forced-colors: active) {
  .home .logo-heading,
  .brand-wordmark-frame {
    forced-color-adjust: none;
  }
}
